com.sag.osami.context.recorder
Class ContextStoreRecorder

java.lang.Object
  extended by com.sag.osami.context.recorder.ContextStoreRecorder
All Implemented Interfaces:
IContextStoreRecorder, ISerializedContextProducer

public class ContextStoreRecorder
extends java.lang.Object
implements ISerializedContextProducer, IContextStoreRecorder


Field Summary
 java.lang.String actualSerializer
           
 RecordingContainer curContainer
           
 ContextStoreReplay replay
           
 
Constructor Summary
ContextStoreRecorder(java.lang.String actualSerializer)
          Default constructor.
 
Method Summary
 java.lang.String[] listrecordings(java.net.URI uristring)
          Returns a list of recordings which are contained in a recording container.
 void openContainer(java.net.URI uristring)
          Convenience method for opening a recording container if none or another recording is currently open.
 void setContextStore(ISerializedContextReceiver contextStore)
           
 void startrecord(java.net.URI uristring)
          Starts recording contexts into the (existent or newly created) recording container represented by the URI.
 void startreplay(java.net.URI uristring)
          Starts replaying contexts from the recording represented by the URI.
 void stoprecord()
          Stops recording contexts.
 void stopreplay()
          Stops replaying contexts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

replay

public ContextStoreReplay replay

curContainer

public RecordingContainer curContainer

actualSerializer

public java.lang.String actualSerializer
Constructor Detail

ContextStoreRecorder

public ContextStoreRecorder(java.lang.String actualSerializer)
Default constructor.

Parameters:
actualSerializer - fully qualified class name of the currently deployed ContextStore serializer
Method Detail

openContainer

public void openContainer(java.net.URI uristring)
                   throws java.io.IOException,
                          InvalidSerializerException
Convenience method for opening a recording container if none or another recording is currently open. Does nothing if the same recording container is already open. Used internally and in the ContextStoreRecorder UI.

Throws:
java.io.IOException
InvalidSerializerException

startrecord

public void startrecord(java.net.URI uristring)
Description copied from interface: IContextStoreRecorder
Starts recording contexts into the (existent or newly created) recording container represented by the URI.

Please note that the recording is written to a temporary location beforehand and is added to the recording container as soon as the recording is stopped!

Specified by:
startrecord in interface IContextStoreRecorder
Parameters:
uristring - file:/-URI of the recording container

stoprecord

public void stoprecord()
Description copied from interface: IContextStoreRecorder
Stops recording contexts.

Specified by:
stoprecord in interface IContextStoreRecorder

startreplay

public void startreplay(java.net.URI uristring)
Description copied from interface: IContextStoreRecorder
Starts replaying contexts from the recording represented by the URI.

Specified by:
startreplay in interface IContextStoreRecorder
Parameters:
uristring - The required format of the URI is: file:/<path>#<recNum>, where path denotes the recording container and recNum the number of the recording within the container which is to be replayed. Recording numbers are 1-based.

stopreplay

public void stopreplay()
Description copied from interface: IContextStoreRecorder
Stops replaying contexts.

Specified by:
stopreplay in interface IContextStoreRecorder

listrecordings

public java.lang.String[] listrecordings(java.net.URI uristring)
Description copied from interface: IContextStoreRecorder
Returns a list of recordings which are contained in a recording container.

Specified by:
listrecordings in interface IContextStoreRecorder
Parameters:
uristring - file:/-URI of the recording container
Returns:
list of the recordings, each formatted as follows:
#<recording number> <timestamp of the recording start> -- <timestamp of the recording end> (<recorded events count>)

setContextStore

public void setContextStore(ISerializedContextReceiver contextStore)
Specified by:
setContextStore in interface ISerializedContextProducer