TPTP 4.6.0 Platform Project
Public API Specification

org.eclipse.hyades.collection.correlation
Interface ICorrelatorData

All Known Implementing Classes:
BaseCorrelatorDataImpl, TraceCorrelator

public interface ICorrelatorData

This interface defines the concept of a correlator, a type of object capable of holding customized context information. The key property of a correlator is that it can be transformed into differet formats, such as binary and XML.


Method Summary
 IApplication getApplication()
          Returns the application associated with this correlator where application-instance-specific data can be retrieved.
 int readBinary(byte[] data, int offset, int length)
          Converts an array of bytes into a correlator.
 int readXML(java.lang.StringBuffer data, int offset, int length)
          Converts an XML fragment into a correlator.
 int writeBinary(byte[] data, int offset, int length)
          Converts this correlator into an array of bytes, and saves them in the buffer.
 java.lang.StringBuffer writeXML(java.lang.StringBuffer data)
          Converts this correlator into an XML fragment, and saves them in the string buffer.
 

Method Detail

getApplication

IApplication getApplication()
Returns the application associated with this correlator where application-instance-specific data can be retrieved.

Returns:
the application associated with this correlator.

readBinary

int readBinary(byte[] data,
               int offset,
               int length)
               throws InsufficientBufferLengthException
Converts an array of bytes into a correlator.

Parameters:
data - the data buffer from which the correlation information is to be read
offset - the starting position to read the correltion data
length - the length (in bytes) of the entire buffer for the correlation data
Returns:
the index of the byte right after the last byte of the correlation data read.
Throws:
InsufficientBufferLengthException - If the buffer is not long enough for holding the correlation data

writeBinary

int writeBinary(byte[] data,
                int offset,
                int length)
                throws InsufficientBufferLengthException
Converts this correlator into an array of bytes, and saves them in the buffer.

Parameters:
data - the data buffer to which the correlator bytes are to be written
offset - the starting position to write the correltion data
length - the length (in bytes) of the buffer for the correlation data
Returns:
the index of the byte right after the last byte of the correlator data written.
Throws:
InsufficientBufferLengthException - If the buffer is not long enough for holding the correlation data

readXML

int readXML(java.lang.StringBuffer data,
            int offset,
            int length)
Converts an XML fragment into a correlator.

Parameters:
data - the data buffer from which the correlation information is to be read
offset - the starting position to read the correltion data
length - the length (in characters) of the entire buffer for the correlation data
Returns:
the index of the character right after the last character of the correlation data read.

writeXML

java.lang.StringBuffer writeXML(java.lang.StringBuffer data)
Converts this correlator into an XML fragment, and saves them in the string buffer.

Parameters:
data - the data buffer to which the correlator information is to be written
Returns:
the string buffer with the information about this correlator attached at the end.

TPTP 4.6.0 Platform Project
Public API Specification