IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.recorder.core
Class RecorderCore

java.lang.Object
  extended by com.ibm.rational.test.lt.recorder.core.RecorderCore

public class RecorderCore
extends Object

The central access point for the recording framework. This class manages the creation of recording sessions and notifications about them.


Field Summary
static String AND_GROUP_TESTER_ID
          The id of the And Group Tester.
static String ANNOTATION_RECORDER_TYPE
          The type id for the annotation recorder.
static String ANNOTATION_SERVER_ENABLED
          Boolean option to enable the optional annotation server feature of the annotation recorder.
static String ANNOTATION_SERVER_PORT
          Integer property of the annotation recorder representing the port value where annotations must be sent.
static String ANNOTATION_STATE_HANDLER_PREFIX
          Prefix for the property of the annotation recorder that represents the state handler for a specific annotation type.
static String APPLICATION_CLIENT_TYPE
          The type id for the application client.
static String CONNECTION_PACKET_TESTER_ID
          The id of the Connection Packet Tester.
static String CONNECTION_PACKET_TESTER_REMOTE_PROPERTY
          This list property defines the list of ipv4:port, or [ipv6]:port where ip may be either a valid IP address, or the * character to match any address.
static String CONNECTION_PACKET_TYPE
          The type id for connection packets.
static RecorderCore INSTANCE
          The unique instance of this singleton class.
static String NOT_GROUP_TESTER_ID
          The id of the Not Group Tester.
static String OR_GROUP_TESTER_ID
          The id of the Or Group Tester.
static String PACKET_TYPE_TESTER_ID
          The id of the Packet Type Tester.
static String PACKET_TYPES_PROPERTY
          The name of the property that defines the packet types that should be filtered.
static String RECCONFIG_EXTENSION
          File extension (without dot) for recording configurations.
static String RECCONFIG_RESOURCE_TYPE
          The type of recording configurations as test resources.
static String RECDATA_EXTENSION
          File extension (without dot) for slave data recorded sessions.
static String RECORDER_ANNOTATION_PACKET_TYPE
          The type id for recorder annotation packets.
static String RECSESSION_EXTENSION
          File extension (without dot) for recorded sessions.
static String RECSESSION_RESOURCE_TYPE
          The type of recording sessions as test resources.
static String UNSUPPORTED_PACKET_TYPE
          Type of place holder packets that are returned when reading a recording session content that contains packets type defined in a missing extension.
static String UNSUPPORTED_VERSION_PACKET_TYPE
          Type of place holder packets that are returned when reading a recording session content that contains packets whose version is unsupported (i.e. a newer version than the one supported by the installed extension).
 
Method Summary
 void addListener(IRecorderCoreListener listener)
          Registers a listener for recording framework events.
 IRecordingSession createRecordingSession(RecordingSessionConfiguration config)
          Creates a new recording session, using the provided session configuration.
 IRecordingSessionProducer createRecordingSessionProducer(IFile file, long initialTimestamp, long clockFrequency)
          Instantiates a new recording session producer.
 IRecordingSessionProducer createRecordingSessionProducer(IFile file, long initialTimestamp, long clockFrequency, com.ibm.rational.test.lt.recorder.core.encrypt.IEncryptionParameter encryption)
          Instantiates a new recording session producer.
static String formatToString(byte[] value, int len)
           
static String formatToString(byte[] value, int len, boolean newLineMarkers, boolean uppercaseHexaDigits)
           
 List<IRecordingSession> getActiveSessions()
          Returns the active recording sessions (i.e. sessions that have been started and not yet terminated).
 IStatus getClientTypeStatus(String clientId)
           
 com.ibm.rational.test.lt.recorder.core.internal.extensibility.RecorderExtensionRegistry getExtensionRegistry()
          For internal use of the recording framework only.
 IPacketExtensionRegistry getPacketExtensionRegistry()
          Returns the packet extension registry, which enables to inspect properties of declared packet types.
static String getRecorderCoreLibrary32Path()
          Returns the absolute path to RecorderCore.dll (32 bits) for inclusion by external native client/recorder implementations which need to produce recorder timestamps.
static String getRecorderCoreLibrary64Path()
          Returns the absolute path to RecorderCore64.dll (64 bits) for inclusion by external native client/recorder implementations which need to produce recorder timestamps.
static String getRecorderCoreLibraryPath()
          Returns the absolute path to RecorderCore.dll for inclusion by external native client/recorder implementations which need to produce recorder timestamps.
 IStatus getRecorderTypeStatus(String recorderId)
           
 boolean isActiveSession(IFile persistedSessionFile)
          Returns whether the specified recording session file contains an active session.
 boolean isRecmodel(InputStream is)
           
 IRecordingSession loadRecordingSession(IFile persistedSessionFile)
          Loads a persisted session or returns the active session that is currently persisting its activity to the specified file.
 void removeListener(IRecorderCoreListener listener)
          Unregisters a listener for recording framework events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_PACKET_TYPE

public static final String CONNECTION_PACKET_TYPE
The type id for connection packets.

See Also:
Constant Field Values

APPLICATION_CLIENT_TYPE

public static final String APPLICATION_CLIENT_TYPE
The type id for the application client.

See Also:
Constant Field Values

ANNOTATION_SERVER_PORT

public static final String ANNOTATION_SERVER_PORT
Integer property of the annotation recorder representing the port value where annotations must be sent. Returns -1 if the annotation server is not started

See Also:
Constant Field Values

ANNOTATION_STATE_HANDLER_PREFIX

public static final String ANNOTATION_STATE_HANDLER_PREFIX
Prefix for the property of the annotation recorder that represents the state handler for a specific annotation type. The property name must be the concatenation of this prefix and a qualified annotation type. If the annotation type is not registered, an UnsupportedPropertyException will be thrown. This runtime property is supported only while the annotation recorder is active. The type of this property is an instance of IAnnotationStateHandler. Some state handlers may provide a more specific interface. In this case, the returned value of DelegaterComponent.getProperty(String) must be cast to this interface.

See Also:
Constant Field Values

RECORDER_ANNOTATION_PACKET_TYPE

public static final String RECORDER_ANNOTATION_PACKET_TYPE
The type id for recorder annotation packets.

See Also:
Constant Field Values

ANNOTATION_RECORDER_TYPE

public static final String ANNOTATION_RECORDER_TYPE
The type id for the annotation recorder.

See Also:
Constant Field Values

ANNOTATION_SERVER_ENABLED

public static final String ANNOTATION_SERVER_ENABLED
Boolean option to enable the optional annotation server feature of the annotation recorder. Once started, the annotation server port can be retrieved by getting the runtime property RecorderCore.ANNOTATION_SERVER_PORT.

See Also:
Constant Field Values

UNSUPPORTED_PACKET_TYPE

public static final String UNSUPPORTED_PACKET_TYPE
Type of place holder packets that are returned when reading a recording session content that contains packets type defined in a missing extension.

See Also:
Constant Field Values

UNSUPPORTED_VERSION_PACKET_TYPE

public static final String UNSUPPORTED_VERSION_PACKET_TYPE
Type of place holder packets that are returned when reading a recording session content that contains packets whose version is unsupported (i.e. a newer version than the one supported by the installed extension).

See Also:
Constant Field Values

RECSESSION_EXTENSION

public static final String RECSESSION_EXTENSION
File extension (without dot) for recorded sessions.

See Also:
Constant Field Values

RECDATA_EXTENSION

public static final String RECDATA_EXTENSION
File extension (without dot) for slave data recorded sessions.

See Also:
Constant Field Values

RECCONFIG_EXTENSION

public static final String RECCONFIG_EXTENSION
File extension (without dot) for recording configurations.

See Also:
Constant Field Values

CONNECTION_PACKET_TESTER_ID

public static final String CONNECTION_PACKET_TESTER_ID
The id of the Connection Packet Tester. This tester evaluates if a packet is a connection packet and if its source or destination properties match some criteria, such as a host name, an ip range, or a port.
This tester understands the following properties:

See Also:
Constant Field Values

CONNECTION_PACKET_TESTER_REMOTE_PROPERTY

public static final String CONNECTION_PACKET_TESTER_REMOTE_PROPERTY
This list property defines the list of ipv4:port, or [ipv6]:port where ip may be either a valid IP address, or the * character to match any address.

See Also:
Constant Field Values

AND_GROUP_TESTER_ID

public static final String AND_GROUP_TESTER_ID
The id of the And Group Tester. This tester groups a set of testers and synthesizes an evaluation result by applying the "and" operator between each tester evaluation result. In other words, it evaluates true if and only if all testers evaluate true.
This tester requires its configuration to be of type LogicalTesterGroupConfiguration.

See Also:
Constant Field Values

OR_GROUP_TESTER_ID

public static final String OR_GROUP_TESTER_ID
The id of the Or Group Tester. This tester groups a set of testers and synthesizes an evaluation result by applying the "or" operator between each tester evaluation result. In other words, it evaluates false if and only if all testers evaluate false.
This tester requires its configuration to be of type LogicalTesterGroupConfiguration.

See Also:
Constant Field Values

NOT_GROUP_TESTER_ID

public static final String NOT_GROUP_TESTER_ID
The id of the Not Group Tester. This tester negates the evaluation of the a tester by applying the "not" operator to its result.
This tester requires its configuration to be of type LogicalTesterGroupConfiguration. The count of child configurations of this configuration must be exactly one.

See Also:
Constant Field Values

PACKET_TYPE_TESTER_ID

public static final String PACKET_TYPE_TESTER_ID
The id of the Packet Type Tester. This tester evaluates whether a packet has a type that belongs to a specified set of packet types. It understands the following properties:

See Also:
Constant Field Values

PACKET_TYPES_PROPERTY

public static final String PACKET_TYPES_PROPERTY
The name of the property that defines the packet types that should be filtered. This property is used by the packet type filter. Its type is a list of strings, and its default value the empty list.

See Also:
Constant Field Values

RECSESSION_RESOURCE_TYPE

public static final String RECSESSION_RESOURCE_TYPE
The type of recording sessions as test resources.

See Also:
Constant Field Values

RECCONFIG_RESOURCE_TYPE

public static final String RECCONFIG_RESOURCE_TYPE
The type of recording configurations as test resources.

See Also:
Constant Field Values

INSTANCE

public static RecorderCore INSTANCE
The unique instance of this singleton class.

Method Detail

createRecordingSession

public IRecordingSession createRecordingSession(RecordingSessionConfiguration config)
                                         throws CoreException
Creates a new recording session, using the provided session configuration.

Parameters:
config - A session configuration, completed with all options and containing all the required recorder and client configurations.
Returns:
A new recording session. The returned session must be started by the caller.
Throws:
CoreException

loadRecordingSession

public IRecordingSession loadRecordingSession(IFile persistedSessionFile)
                                       throws CoreException
Loads a persisted session or returns the active session that is currently persisting its activity to the specified file. Note that unpersisted sessions (i.e. sessions that do not specify an output file in their configuration) can be retrieved using this method.

Parameters:
persistedSessionFile - A recording session (.recsession) file.
Returns:
The recording session that is stored (even if it is not terminated) in the specified file.
Throws:
CoreException - If the session could be retrieved from the file.

isActiveSession

public boolean isActiveSession(IFile persistedSessionFile)
Returns whether the specified recording session file contains an active session.

Parameters:
persistedSessionFile - A recording session file.
Returns:
whether the specified recording session file contains an active session.

getActiveSessions

public List<IRecordingSession> getActiveSessions()
Returns the active recording sessions (i.e. sessions that have been started and not yet terminated).

Returns:
the active recording sessions

createRecordingSessionProducer

public IRecordingSessionProducer createRecordingSessionProducer(IFile file,
                                                                long initialTimestamp,
                                                                long clockFrequency)
                                                         throws CoreException
Instantiates a new recording session producer.

Parameters:
file - The file to produce. Must have a .recsession extension. Any file with same name, or with same name but .recdata extension will be overwritten.
initialTimestamp - The initial timestamp of the recording session. This timestamp must be expressed in the same unit as the recorder packet timestamps.
clockFrequency - The clock frequency, i.e. the number of unique timestamps within one second.
Returns:
A new recording session producer. Note that the output stream of the returned producer must be explicitly closed by the caller.
Throws:
CoreException

createRecordingSessionProducer

public IRecordingSessionProducer createRecordingSessionProducer(IFile file,
                                                                long initialTimestamp,
                                                                long clockFrequency,
                                                                com.ibm.rational.test.lt.recorder.core.encrypt.IEncryptionParameter encryption)
                                                         throws CoreException
Instantiates a new recording session producer.

Parameters:
file - The file to produce. Must have a .recsession extension. Any file with same name, or with same name but .recdata extension will be overwritten.
initialTimestamp - The initial timestamp of the recording session. This timestamp must be expressed in the same unit as the recorder packet timestamps.
clockFrequency - The clock frequency, i.e. the number of unique timestamps within one second.
encryption - Specifies the details of the encryption used to persist the recording session.
Returns:
A new recording session producer. Note that the output stream of the returned producer must be explicitly closed by the caller.
Throws:
CoreException

addListener

public void addListener(IRecorderCoreListener listener)
Registers a listener for recording framework events.

Parameters:
listener -

removeListener

public void removeListener(IRecorderCoreListener listener)
Unregisters a listener for recording framework events. Has no effect if the listener was not registered.

Parameters:
listener -

isRecmodel

public boolean isRecmodel(InputStream is)
                   throws IOException
Throws:
IOException

getExtensionRegistry

public com.ibm.rational.test.lt.recorder.core.internal.extensibility.RecorderExtensionRegistry getExtensionRegistry()
For internal use of the recording framework only.

Returns:

getPacketExtensionRegistry

public IPacketExtensionRegistry getPacketExtensionRegistry()
Returns the packet extension registry, which enables to inspect properties of declared packet types.

Returns:
the packet extension registry.

getRecorderTypeStatus

public IStatus getRecorderTypeStatus(String recorderId)

getClientTypeStatus

public IStatus getClientTypeStatus(String clientId)

getRecorderCoreLibraryPath

public static String getRecorderCoreLibraryPath()
Returns the absolute path to RecorderCore.dll for inclusion by external native client/recorder implementations which need to produce recorder timestamps. Depending on the architecture of the calling JVM, it will return the 32 bits version of the dll or the 64 bits version of the dll.

Returns:

getRecorderCoreLibrary32Path

public static String getRecorderCoreLibrary32Path()
Returns the absolute path to RecorderCore.dll (32 bits) for inclusion by external native client/recorder implementations which need to produce recorder timestamps.

Returns:

getRecorderCoreLibrary64Path

public static String getRecorderCoreLibrary64Path()
Returns the absolute path to RecorderCore64.dll (64 bits) for inclusion by external native client/recorder implementations which need to produce recorder timestamps.

Returns:

formatToString

public static String formatToString(byte[] value,
                                    int len)

formatToString

public static String formatToString(byte[] value,
                                    int len,
                                    boolean newLineMarkers,
                                    boolean uppercaseHexaDigits)

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.