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

Class 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 Detail

      • CONNECTION_PACKET_TYPE

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

        public static final String APPLICATION_CLIENT_TYPE
        The type id for the application client.
      • 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
      • 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.
      • RECORDER_ANNOTATION_PACKET_TYPE

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

        public static final String ANNOTATION_RECORDER_TYPE
        The type id for the annotation recorder.
      • 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.
      • 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.
      • 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).
      • RECSESSION_EXTENSION

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

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

        public static final String RECCONFIG_EXTENSION
        File extension (without dot) for recording configurations.
      • 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:
      • 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.
      • 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.
      • 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.
      • 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.
      • 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:
      • 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.
      • RECSESSION_RESOURCE_TYPE

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

        public static final String RECCONFIG_RESOURCE_TYPE
        The type of recording configurations as test resources.
      • 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 -
      • 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)
      • 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. 2013. All rights reserved.