Developing Apama Applications > Developing Adapters > Standard Plug-ins > The Fixed Width codec 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 normalised 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.
Copyright © 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.