|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sag.osami.context.recorder.storage.RecordingContainer
public class RecordingContainer
This class represents a recording container file which stores the serializer used by the ContextStore at the time of the recording, and several recordings.
A recording container is basically a ZIP file which contains a file SERIALIZER
which denotes the
serializer, and folders recording-<recording number>
for each recording: therein INFO
and DATA
files are stored, the first containing some metadata (see RecordingContainer.RecordingInfo
), the latter
containing the actual recorded/serialized context event data (see ContextEventData
).
Nested Class Summary | |
---|---|
static class |
RecordingContainer.RecordingInfo
A RecordingInfo contains some metadata (number, start date, end date, events count) about a recording within a container. |
Method Summary | |
---|---|
void |
close()
Closes the recording container/ZIP file. |
static RecordingContainer |
create(java.io.File location,
java.lang.String initSerializer,
ISerializedContextReceiver ctxStore)
Creates a new recording container. |
java.io.File |
getLocation()
Gets the location of the recording container. |
RecordingContainer.RecordingInfo[] |
getRecordings()
Gets the metadata for the recordings contained in the container. |
static RecordingContainer |
open(java.io.File location,
java.lang.String actualSerializer,
ISerializedContextReceiver ctxStore)
Opens an existing recording container. |
java.io.DataInputStream |
readRecording(int recNum)
Obtains an input stream within the recording container for a specific recording. |
void |
startRecording()
Starts a new recording, i.e. initializes a SortedRecordingData and adds according metadata to the
container object. |
void |
stopRecording()
Stops the current recording, writes the current container data into a working container file, adds the (correctly reordered) temporary recording into the working container and replaces the current/old container with the working container. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static RecordingContainer create(java.io.File location, java.lang.String initSerializer, ISerializedContextReceiver ctxStore) throws java.io.IOException
location
- location of the recording container to be createdinitSerializer
- currently deployed ContextStore serializer
java.io.IOException
public static RecordingContainer open(java.io.File location, java.lang.String actualSerializer, ISerializedContextReceiver ctxStore) throws java.io.IOException, InvalidSerializerException
location
- location of the existing recording containeractualSerializer
- fully qualified class name of the currently deployed ContextStore serializer
java.io.IOException
- on I/O errors
InvalidSerializerException
- when currently deployed serializer and the serializer of the recording container don't matchpublic void startRecording() throws java.io.IOException
SortedRecordingData
and adds according metadata to the
container object. No information is written to the actual container file at this time.
java.io.IOException
- on I/O errorspublic void stopRecording() throws java.io.IOException
zipf
is pointing at the correct/new
container.
java.io.IOException
- on I/O errorspublic RecordingContainer.RecordingInfo[] getRecordings()
RecordingContainer.RecordingInfo
public java.io.DataInputStream readRecording(int recNum) throws java.io.IOException
recNum
- number of the recording
ContextEventData
)
java.io.IOException
- on I/O errorspublic java.io.File getLocation()
public void close() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |