|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.apama.iaf.plugin.AbstractEventCodec
public abstract class AbstractEventCodec
AbstractEventCodec is the abstract base class which all Java IAF event codecs should extend. It includes the EventCodec interface the IAF uses to tell the codec to send an upstream event, and also contains abstract definitions of the other methods the IAF will need to call (via a JNI interface to libraries written in C)
In addition to implementing the abstract methods here and in the EventCodec interface, valid subclasses must provide a constructor with the same signature as the one provided here. Note that the IAF provides NO guarantees about what threads that will be used to call these functions, so to ensure correct operation care must be taken to use locking where required.
Field Summary |
---|
Fields inherited from interface com.apama.iaf.plugin.EventCodec |
---|
API_VERSION |
Constructor Summary | |
---|---|
AbstractEventCodec(java.lang.String name,
EventCodecProperty[] properties,
TimestampConfig timestampConfig)
Construct a new instance of AbstractEventCodec. |
Method Summary | |
---|---|
abstract void |
addEventTransport(java.lang.String name,
EventTransport transport)
Add a named event transport to the set of transports known to the codec. |
abstract void |
cleanup()
Frees any resources allocated by the codec (useful for resources external to the JVM that were allocated in the constructor). |
void |
flushDownstream()
Flush any pending codec events into the semantic mapper. |
void |
flushUpstream()
Flush any pending codec events onto the transport. |
abstract int |
getAPIVersion()
Return the codec API version that the codec was built against. |
int |
getCapabilities()
Return the capabilities of the codec. |
abstract CodecStatus |
getStatus()
Return a CodecStatus or ExtendedCodecStatus
object containing up-to-date status information for the codec. |
abstract void |
removeEventTransport(java.lang.String name)
Remove a named event transport from the set of transports known to the codec. |
abstract void |
sendNormalisedEvent(NormalisedEvent event,
TimestampSet timestamps)
Called by the Semantic Mapper to encode a normalised event and send it through to the transport. |
abstract void |
sendTransportEvent(java.lang.Object event,
TimestampSet timestamps)
Called by the event transport to decode a downstream event using a Java Codec, which will then send it on to the Semantic Mapper. |
abstract void |
setSemanticMapper(SemanticMapper mapper)
Set the Semantic Mapper object to be used by the decoder. |
java.lang.String |
toString()
|
void |
updateProperties(EventCodecProperty[] properties,
TimestampConfig timestampConfig)
Update the configuration of the codec. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractEventCodec(java.lang.String name, EventCodecProperty[] properties, TimestampConfig timestampConfig) throws CodecException
The AbstractEventCodec implementation does nothing, but subclasses should make use of the arguments to initialize the codec.
name
- The codec name, as specified in the IAF config fileproperties
- The codec property set specified in the IAF
configuration filetimestampConfig
- Timestamp recording/logging settings from the
IAF configuration file
CodecException
Method Detail |
---|
public void updateProperties(EventCodecProperty[] properties, TimestampConfig timestampConfig) throws CodecException
properties
- The new codec property set specified in the IAF
configuration filetimestampConfig
- Timestamp recording/logging settings
CodecException
public abstract void addEventTransport(java.lang.String name, EventTransport transport) throws CodecException
name
- The name of the transport to be addedtransport
- The transport object instance
CodecException
public abstract void removeEventTransport(java.lang.String name) throws CodecException
name
- The transport to be removed
CodecException
public abstract void setSemanticMapper(SemanticMapper mapper) throws CodecException
mapper
- The Semantic mapper object instance
CodecException
public void flushUpstream() throws CodecException
CodecException
public void flushDownstream() throws CodecException
CodecException
public abstract void cleanup() throws CodecException
CodecException
public abstract CodecStatus getStatus()
CodecStatus
or ExtendedCodecStatus
object containing up-to-date status information for the codec.
public abstract int getAPIVersion()
EventCodec.API_VERSION
.public int getCapabilities()
0
.public java.lang.String toString()
toString
in class java.lang.Object
public abstract void sendTransportEvent(java.lang.Object event, TimestampSet timestamps) throws CodecException, SemanticMapperException
EventDecoder
sendTransportEvent
in interface EventDecoder
event
- An object representing the event to be decoded, in a format
shared by the decoder and transport.timestamps
- A TimestampSet representing the timestamps attached
to the event.
CodecException
- Thrown by the decoder if the event provided
has an invalid format.
SemanticMapperException
- Thrown if an error occurred during
processing of the message by the Semantic Mapper.public abstract void sendNormalisedEvent(NormalisedEvent event, TimestampSet timestamps) throws CodecException, TransportException
EventCodec
sendNormalisedEvent
in interface EventCodec
event
- A NormalisedEvent representing the event to be encoded.timestamps
- A TimestampSet representing the timestamps attached
to the event.
CodecException
- Thrown by the codec if the event provided
has an invalid format.
TransportException
- Thrown if an error occurred in the Transport
when sending the message.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |