IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.testgen.core.conversion
Class BasePacketConverter

java.lang.Object
  extended by com.ibm.rational.test.lt.testgen.core.conversion.BasePacketConverter
All Implemented Interfaces:
IPacketConverter, IPacketReferenceOutputStream

public abstract class BasePacketConverter
extends Object
implements IPacketConverter

A base implementation of IPacketConverter that stores the context passed to the BasePacketConverter.initialize(IPacketConverterContext).


Constructor Summary
BasePacketConverter()
           
 
Method Summary
 void complete()
          This implementation does nothing.
 void dispose()
          This implementation does nothing.
protected  IPacketConverterContext getContext()
          Returns the context of this packet converter.
 Set<String> getOutputPacketTypes(Set<String> inputPacketTypes)
          This implementation returns the set that was passed as an argument.
 void initialize(IPacketConverterContext context)
          Stores the context so it can be later accessed using BasePacketConverter.getContext().
 void writePacket(IRecorderPacketReference ref, long minPendingPacketTime)
          This implementation sends the packet to this converter output, with no additional transformation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePacketConverter

public BasePacketConverter()
Method Detail

getOutputPacketTypes

public Set<String> getOutputPacketTypes(Set<String> inputPacketTypes)
This implementation returns the set that was passed as an argument. Implementations may either extend this method and add more packet types, or override and return a different set.

Specified by:
getOutputPacketTypes in interface IPacketConverter
Parameters:
inputPacketTypes - A set of packet types.
Returns:
The set of all the packet types that this converter can output, for each specified input packet type.

initialize

public void initialize(IPacketConverterContext context)
                throws CoreException
Stores the context so it can be later accessed using BasePacketConverter.getContext(). This method can be overridden, but the implementation should invoke its super implementation.

Specified by:
initialize in interface IPacketConverter
Parameters:
context - The context that can be used by the packet converter to read its configuration, retrieve its output stream or create attachments. At this time the converter may not emit packet (IPacketConverterContext.getOutputStream() will return null).
Throws:
CoreException

getContext

protected final IPacketConverterContext getContext()
Returns the context of this packet converter.

Returns:
the context of this packet converter.

complete

public void complete()
              throws IOException
This implementation does nothing. Override if needed.

Specified by:
complete in interface IPacketConverter
Throws:
IOException

writePacket

public void writePacket(IRecorderPacketReference ref,
                        long minPendingPacketTime)
                 throws IOException
This implementation sends the packet to this converter output, with no additional transformation. It should usually be overridden. Implementation may invoke the super implementation if the packet needs to be passed along to the output with no conversion.

Specified by:
writePacket in interface IPacketReferenceOutputStream
minPendingPacketTime - The lowest start time of all packets that may be sent to this output after the current one. If all packets are expected to be written sorted by their start timestamp, then this value should be greater or equal than the start timestamp of the current packet.
Throws:
IOException

dispose

public void dispose()
This implementation does nothing. Override if needed.

Specified by:
dispose in interface IPacketConverter

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.