com.apama.iaf.plugin
Interface ConfigurableCodec


public interface ConfigurableCodec

This interface defines functions that Codecs which have upstream events passed to them via their associated transport must perform. Codecs which are used with the FileAdapter, which receives events via the Null codec upstream are such codecs.


Field Summary
static java.lang.String DATA_FIELD
           
static java.lang.String SESSION_ID_FIELD
           
 
Method Summary
 void addConfiguration(int sessionId, NormalisedEvent configuration)
          A codec may wish to support multiple configurations depending on data being read.
 boolean performsEscapingDownstream()
          Whether or not the codec performs escaping downstream.
 void removeConfiguration(int sessionId)
          Remove configuration associated with the given id
 

Field Detail

DATA_FIELD

static final java.lang.String DATA_FIELD
See Also:
Constant Field Values

SESSION_ID_FIELD

static final java.lang.String SESSION_ID_FIELD
See Also:
Constant Field Values
Method Detail

addConfiguration

void addConfiguration(int sessionId,
                      NormalisedEvent configuration)
                      throws java.io.IOException
A codec may wish to support multiple configurations depending on data being read. The codec does not have to do anything in this function if it has no need for specific information relating to a particular data sink being used. The motivation for this functionality was the Apama File adapter. Multiple configurations may be needed if there are multiple files being read using (for instance) different separators delimiting fields.

Parameters:
sessionId - the sessionID this data relates to. Important as the codec may have configuration information based on the sessionID
configuration - The normalised event containing the additional information required
Throws:
java.io.IOException - if the configuration could not be added to the codec

removeConfiguration

void removeConfiguration(int sessionId)
                         throws java.io.IOException
Remove configuration associated with the given id

Parameters:
sessionId - the sessionId to remove the configuration for
Throws:
java.io.IOException

performsEscapingDownstream

boolean performsEscapingDownstream()
Whether or not the codec performs escaping downstream. Dependant on what encoding the codec needs to perform, it may prefer to do add escape characters where necessary to strings itself. If this returns true, the transport won't escape the line before it sends it to the codec.

Returns:
whether or not the codec performs it's own escaping when sending downstream messages


Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG