Apama 10.15.0 | Connecting Apama Applications to External Components | Standard IAF Plug-ins | Codec IAF Plug-ins | The Fixed Width codec IAF plug-in | Multiple configurations and the Fixed Width codec
 
Multiple configurations and the Fixed Width codec
The Fixed Width codec supports multiple configurations for interpreting fixed width data from different sources. A transport that is using the Fixed Width codec can use the com.apama.iaf.plugin.ConfigurableCodec interface to set the configuration that you want the adapter to use.
The transport can set a configuration by calling the following method on the codec:
public void addConfiguration(int sessionId,
                             NormalisedEvent configuration)
   throws java.io.IOException
The sessionId represents the ID value for this configuration.
The normalized event should contain key/value pairs that are stored as strings the Fixed Width codec can parse.
Key
Value
fieldLengths
A string sequence that contains the number of characters each field value is stored in. For example, "[5,6,5,9"] where the first value is stored in the first 5 characters, the second value is stored in the next 6 characters, and so on.
isLeftAligned
true or false, depending on whether data is left or right aligned in a field.
padCharacter
"_" where '_' is the pad character used when the data requires padding to fill the field.
The transport can remove a configuration by calling the following method:
void removeConfiguration(int sessionId) throws java.io.IOException
The sessionId represents the ID value initially used to add the configuration using the addConfiguration() method.