public class MetadataCacheValueTranslator extends java.lang.Object implements CacheValueTranslator<java.lang.String>, CacheKeyTranslator
CacheValueTranslator
that maps values to / from metadata on the message.In the adapter configuration file this class is aliased as metadata-cache-value-translator which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
MetadataCacheValueTranslator() |
MetadataCacheValueTranslator(java.lang.String s) |
Modifier and Type | Method and Description |
---|---|
void |
addValueToMessage(AdaptrisMessage msg,
java.lang.String value)
Sets the result of calling toString() on the supplied
Object as
the value of the metadata item associated with the configured metadataKey |
java.lang.String |
getKeyFromMessage(AdaptrisMessage msg) |
java.lang.String |
getMetadataKey() |
java.lang.String |
getValueFromMessage(AdaptrisMessage msg)
Retrieves the piece of metadata associated with the configured metadataKey
|
void |
setMetadataKey(java.lang.String metadataKey)
The metadata key to access
|
public MetadataCacheValueTranslator()
public MetadataCacheValueTranslator(java.lang.String s)
public java.lang.String getValueFromMessage(AdaptrisMessage msg) throws CoreException
getValueFromMessage
in interface CacheValueTranslator<java.lang.String>
CoreException
public void addValueToMessage(AdaptrisMessage msg, java.lang.String value) throws CoreException
Object
as
the value of the metadata item associated with the configured metadataKeyaddValueToMessage
in interface CacheValueTranslator<java.lang.String>
CoreException
public void setMetadataKey(java.lang.String metadataKey)
metadataKey
- public java.lang.String getMetadataKey()
public java.lang.String getKeyFromMessage(AdaptrisMessage msg) throws CoreException
getKeyFromMessage
in interface CacheKeyTranslator
CoreException