IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.kernel.util
Class AnnotatedEventProperty

java.lang.Object
  extended by org.eclipse.hyades.test.common.event.EventProperty
      extended by com.ibm.rational.test.lt.kernel.util.AnnotatedEventProperty
All Implemented Interfaces:
com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyReader, com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyWriter

public class AnnotatedEventProperty
extends org.eclipse.hyades.test.common.event.EventProperty
implements com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyWriter, com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyReader


Field Summary
static String ENCODING
           
static String SEPERATOR
           
static String TYPE
           
 
Constructor Summary
AnnotatedEventProperty()
          This constructor can be used by either the execution side or the workbench side, however it is better to use one of the other constructors.
AnnotatedEventProperty(IAnnotation annotation)
          This constructor should only be used on the execution side in order to create a new AnnotatedEventProperty.
AnnotatedEventProperty(String name, String type, String value)
          This constructor should only be used on the workbench side in order to convert a TPTP EventProperty into an AnnotatedEventProperty.
 
Method Summary
 void annotate(byte[] data)
          write data to the annotation file and set the offset and length attributes.
 void annotate(String value)
          write a string value to the annotation file and set the offset and length attributes Before writing the string the file any values resulting from encrypted datapool access will be filtered from the string.
 void annotate(String value, String encoding)
          write a string value to the annotation file and set the offset and length attributes Before writing the string the file any values resulting from encrypted datapool access will be filtered from the string.
 void doPending(com.ibm.rational.test.lt.kernel.util.EncryptedValueFilter filter)
          internal use only
 int getFileNumber()
          get the number of the annotation file where this value can be found
 int getLength()
          get the length of the value in the annotation file
 int getOffset()
          get the offset into the annotation file where this value can be found
 void parseValue(String value)
          This parses the value and extracts the fileNumber, offset and length.
 void setAnnotation(IAnnotation annotation)
          provides the annotation infrastructure required for creating and writing AnnotatedEventPropery's
 void setType(String type)
          DO NOT change the type of an annotated event property unless you have code in the workbench to handle the specified type.
 void setValue(String value)
          DO NOT set the value of an AnnotatedEventProperty directly.
 
Methods inherited from class org.eclipse.hyades.test.common.event.EventProperty
getName, getType, getValue, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyWriter
setName
 

Field Detail

ENCODING

public static String ENCODING

TYPE

public static String TYPE

SEPERATOR

public static String SEPERATOR
Constructor Detail

AnnotatedEventProperty

public AnnotatedEventProperty()
This constructor can be used by either the execution side or the workbench side, however it is better to use one of the other constructors. If used by the execution side, setAnnotation() must be used to provide the execution side infrastructure, and the type must be set explicitly. If used by the workbench side, the property name and type must be set explicitly and parseValue must be used to extract the location of the data.


AnnotatedEventProperty

public AnnotatedEventProperty(IAnnotation annotation)
This constructor should only be used on the execution side in order to create a new AnnotatedEventProperty. The data which is to be added to the annotation file is added via annotate(). Then this object can be added to the ExecutionEvent just like any other EventProperty. DO NOT override the property type with setType() on this object unless you have code in the workbench to handle your property type.


AnnotatedEventProperty

public AnnotatedEventProperty(String name,
                              String type,
                              String value)
                       throws NoSuchElementException
This constructor should only be used on the workbench side in order to convert a TPTP EventProperty into an AnnotatedEventProperty. This is valid ONLY when the EventProperty is known to be (via it's type attribute) one that has been created via this class.

This parses the value attribute and extracts the fileNumber, offset and length.

Parameters:
name - String
type - String
value - String
Throws:
NoSuchElementException
Method Detail

setAnnotation

public void setAnnotation(IAnnotation annotation)
provides the annotation infrastructure required for creating and writing AnnotatedEventPropery's

Parameters:
annotation -

parseValue

public void parseValue(String value)
                throws NoSuchElementException
This parses the value and extracts the fileNumber, offset and length.

Specified by:
parseValue in interface com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyReader
Parameters:
value -
Throws:
NoSuchElementException

setValue

public void setValue(String value)
DO NOT set the value of an AnnotatedEventProperty directly. Use annotate(). this function is a NO-OP. It will do nothing for you.

Overrides:
setValue in class org.eclipse.hyades.test.common.event.EventProperty

setType

public void setType(String type)
DO NOT change the type of an annotated event property unless you have code in the workbench to handle the specified type.

Specified by:
setType in interface com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyWriter
Overrides:
setType in class org.eclipse.hyades.test.common.event.EventProperty

getFileNumber

public int getFileNumber()
get the number of the annotation file where this value can be found

Specified by:
getFileNumber in interface com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyReader
Returns:
int

getOffset

public int getOffset()
get the offset into the annotation file where this value can be found

Specified by:
getOffset in interface com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyReader
Returns:
int

getLength

public int getLength()
get the length of the value in the annotation file

Specified by:
getLength in interface com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyReader
Returns:
int

doPending

public void doPending(com.ibm.rational.test.lt.kernel.util.EncryptedValueFilter filter)
internal use only


annotate

public void annotate(byte[] data)
write data to the annotation file and set the offset and length attributes.

Specified by:
annotate in interface com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyWriter
Parameters:
data -

annotate

public void annotate(String value,
                     String encoding)
              throws UnsupportedEncodingException
write a string value to the annotation file and set the offset and length attributes Before writing the string the file any values resulting from encrypted datapool access will be filtered from the string.

Specified by:
annotate in interface com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyWriter
Parameters:
value - The string value for the event property
encoding - The encoding to use before writing to the file
Throws:
UnsupportedEncodingException - if the encoding is unsupported.

annotate

public void annotate(String value)
write a string value to the annotation file and set the offset and length attributes Before writing the string the file any values resulting from encrypted datapool access will be filtered from the string. The string will be encoded using UTF-8

Specified by:
annotate in interface com.ibm.rational.test.lt.kernel.util.IAnnotatedEventPropertyWriter
Parameters:
value - The string value for the event property

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.