public class MetadataValueTranslator extends ValueTranslatorImp
This implementation of ValueTranslator
will pull a metadata value from the
AdaptrisMessage
to be used as a Jmx operation parameter. Conversely we can also take a
string result from a Jmx operation call and create a new/overwrite an existing metadata item with
the new value.
If your Jmx operation requires a different type of data other than String, simply set the type to
the fully qualified name of the required type. A conversion will then take place which will
require your your desired class to have a string constructor, or be a Date
,
where the value is the milliseconds.
In the adapter configuration file this class is aliased as jmx-metadata-value-translator which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log |
DEFAULT_PARAMETER_TYPE
Constructor and Description |
---|
MetadataValueTranslator() |
MetadataValueTranslator(java.lang.String key,
java.lang.String type) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMetadataKey() |
java.lang.Object |
getValue(AdaptrisMessage message)
Returns the object instance used as a parameter for a JMX operation call.
|
void |
setMetadataKey(java.lang.String metadataKey) |
void |
setValue(AdaptrisMessage message,
java.lang.Object value)
Will set the given object value back into the AdaptrisMessage.
|
getType, setType
public MetadataValueTranslator()
public MetadataValueTranslator(java.lang.String key, java.lang.String type)
public java.lang.Object getValue(AdaptrisMessage message) throws CoreException
ValueTranslator
CoreException
public void setValue(AdaptrisMessage message, java.lang.Object value)
ValueTranslator
public java.lang.String getMetadataKey()
public void setMetadataKey(java.lang.String metadataKey)