Package com.adaptris.core.util
Class TruncateMetadata
- java.lang.Object
-
- com.adaptris.core.MessageLoggerImpl
-
- com.adaptris.core.util.TruncateMetadata
-
- All Implemented Interfaces:
MessageLogger
,MetadataLogger
@ComponentProfile(summary="Log unique-id & metadata (values are truncated) only", since="3.8.4") public class TruncateMetadata extends MessageLoggerImpl implements MetadataLogger
MessageLogger & MetadataLogger implementation that that logs unique-id and metadata but truncates metadata at the configured length.- See Also:
MessageLogger
,MetadataLogger
In the adapter configuration file this class is aliased as message-logging-with-truncated-metadata which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.MessageLoggerImpl
FIELD_MESSAGE_EVENTS, FIELD_METADATA, FIELD_PAYLOAD, FIELD_UNIQUE_ID, LAST_RESORT_LOGGER
-
-
Constructor Summary
Constructors Constructor Description TruncateMetadata()
TruncateMetadata(java.lang.Integer i)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integer
getMaxLength()
void
setMaxLength(java.lang.Integer bytes)
Set the max length for a metadata value before it gets discarded.java.lang.String
toString(AdaptrisMessage m)
java.lang.String
toString(java.util.Collection<MetadataElement> elements)
protected MetadataElement
wrap(java.lang.String key, java.lang.String value)
-
Methods inherited from class com.adaptris.core.MessageLoggerImpl
builder, format
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.MetadataLogger
toString
-
-
-
-
Method Detail
-
toString
public java.lang.String toString(AdaptrisMessage m)
- Specified by:
toString
in interfaceMessageLogger
-
getMaxLength
public java.lang.Integer getMaxLength()
-
setMaxLength
public void setMaxLength(java.lang.Integer bytes)
Set the max length for a metadata value before it gets discarded.- Parameters:
bytes
- the length; default is 256 if not specified.
-
toString
public java.lang.String toString(java.util.Collection<MetadataElement> elements)
- Specified by:
toString
in interfaceMetadataLogger
-
wrap
protected MetadataElement wrap(java.lang.String key, java.lang.String value)
- Overrides:
wrap
in classMessageLoggerImpl
-
-