Thread-Safety Note
the contents of this message can be modified after construction. When using asynchronous loggers and appenders it is not recommended to modify this message after the message is logged, because it is undefined whether the logged message string will contain the old values or the modified values.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | StructuredDataMessage.
Supported formats. |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private StructuredDataId | |
| private static final int | |
| private final int | |
| private String | |
| private static final long | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | StructuredDataMessage(final String
The String id. id, final String The message. msg, final String The message type. type)Creates a StructuredDataMessage using an ID (max 32 characters), message, and type (max 32 characters). |
| public | StructuredDataMessage(final String
The String id. id, final String The message. msg, final String The message type. type, final int The maximum length of keys; maxLength)Creates a StructuredDataMessage using an ID (user specified max characters), message, and type (user specified maximum number of characters). |
| public | StructuredDataMessage(final String
The String id. id, final String The message. msg, final String The message type. type, final Map<String, String> The StructuredData map. data)Creates a StructuredDataMessage using an ID (max 32 characters), message, type (max 32 characters), and an initial map of structured data to include. |
| public | StructuredDataMessage(final String
The String id. id, final String The message. msg, final String The message type. type, final Map<String, String> The StructuredData map. data, final int The maximum length of keys; maxLength)Creates a StructuredDataMessage using an (user specified max characters), message, and type (user specified maximum number of characters, and an initial map of structured data to include. |
| public | StructuredDataMessage(final StructuredDataId
The StructuredDataId. id, final String The message. msg, final String The message type. type)Creates a StructuredDataMessage using a StructuredDataId, message, and type (max 32 characters). |
| public | StructuredDataMessage(final StructuredDataId
The StructuredDataId. id, final String The message. msg, final String The message type. type, final int The maximum length of keys; maxLength)Creates a StructuredDataMessage using a StructuredDataId, message, and type (max 32 characters). |
| public | StructuredDataMessage(final StructuredDataId
The StructuredDataId. id, final String The message. msg, final String The message type. type, final Map<String, String> The StructuredData map. data)Creates a StructuredDataMessage using a StructuredDataId, message, type (max 32 characters), and an initial map of structured data to include. |
| public | StructuredDataMessage(final StructuredDataId
The StructuredDataId. id, final String The message. msg, final String The message type. type, final Map<String, String> The StructuredData map. data, final int The maximum length of keys; maxLength)Creates a StructuredDataMessage using a StructuredDataId, message, type (max 32 characters), and an initial map of structured data to include. |
| private | StructuredDataMessage(final StructuredDataMessage
The StructuredDataMessage. msg, final Map<String, String> The StructuredData map. map)Constructor based on a StructuredDataMessage. |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: The formatted String.Overrides org. Formats the structured data as described in RFC 5424. |
| public String | Returns: The formatted String.The format identifier. Ignored in this implementation. format)Overrides org. Formats the structured data as described in RFC 5424. |
| public final String | Returns: The formatted String."full" will include the type and message. null will return only the STRUCTURED-DATA as
described in RFC 5424 format,The SD-ID as described in RFC 5424. If null the value in the StructuredData
will be used. structuredDataId)Formats the structured data as described in RFC 5424. |
| public final void | asString(final StructuredDataMessage.
"full" will include the type and message. null will return only the STRUCTURED-DATA as
described in RFC 5424 format,The SD-ID as described in RFC 5424. If null the value in the StructuredData
will be used. structuredDataId, final StringBuilder The StringBuilder to append the formatted message to. sb)Formats the structured data as described in RFC 5424. |
| private void | |
| public boolean | equals(final Object
the reference object with which to compare. o)Overrides org. Indicates whether some other object is "equal to" this one. |
| public void | formatTo(final StringBuilder
the StringBuilder to write into buffer)Overrides org. Implements org. Writes a text representation of this object into the specified |
| public void | formatTo(final String[]
An array of Strings that provide extra information about how to format the message.
Each MultiFormatStringBuilderFormattable implementation is free to use the provided formats however they choose. formats, final StringBuilder the StringBuilder to write into buffer)Overrides org. Implements org. Writes a text representation of this object into the specified |
| public String | Returns: the message.Overrides org. Implements org. Returns the message. |
| private StructuredDataMessage. | |
| public String[] | Returns: An array of the supported format names.Overrides org. Implements org. Returns the supported formats. |
| public String | Returns: the formatted message.Overrides org. Implements org. Formats the message and return it. |
| public String | Returns: the formatted message.An array of Strings that provide extra information about how to format the message.
StructuredDataMessage accepts only a format of "FULL" which will cause the event type to be
prepended and the event message to be appended. Specifying any other value will cause only the
StructuredData to be included. The default is "FULL". formats)Overrides org. Implements org. Formats the message according to the specified format. |
| public StructuredDataId | |
| public String | |
| public int | hashCode()
Overrides org. Returns a hash code value for this object. |
| public StructuredDataMessage | newInstance(final Map<String, String>
The Map. map)Overrides org. Constructs a new instance based on an existing Map. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| protected void | validate(final String key, final boolean value)
Overrides org. Default implementation does nothing. |
| protected void | validate(final String key, final byte value)
Overrides org. Default implementation does nothing. |
| protected void | validate(final String key, final char value)
Overrides org. Default implementation does nothing. |
| protected void | validate(final String key, final double value)
Overrides org. Default implementation does nothing. |
| protected void | validate(final String key, final float value)
Overrides org. Default implementation does nothing. |
| protected void | validate(final String key, final int value)
Overrides org. Default implementation does nothing. |
| protected void | validate(final String key, final long value)
Overrides org. Default implementation does nothing. |
| protected void | validate(final String key, final Object value)
Overrides org. Default implementation does nothing. |
| protected void | validate(final String key, final short value)
Overrides org. Default implementation does nothing. |
| protected void | validate(final String key, final String value)
Overrides org. Default implementation does nothing. |
| protected void |
| HASHVAL | back to summary |
|---|---|
| private static final int HASHVAL | |
| id | back to summary |
|---|---|
| private StructuredDataId id | |
| MAX_LENGTH | back to summary |
|---|---|
| private static final int MAX_LENGTH | |
| maxLength | back to summary |
|---|---|
| private final int maxLength | |
| message | back to summary |
|---|---|
| private String message | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. | |
| type | back to summary |
|---|---|
| private String type | |
| StructuredDataMessage | back to summary |
|---|---|
| public StructuredDataMessage(final String id, final String msg, final String type) Creates a StructuredDataMessage using an ID (max 32 characters), message, and type (max 32 characters). | |
| StructuredDataMessage | back to summary |
|---|---|
| public StructuredDataMessage(final String id, final String msg, final String type, final int maxLength) Creates a StructuredDataMessage using an ID (user specified max characters), message, and type (user specified maximum number of characters). | |
| StructuredDataMessage | back to summary |
|---|---|
| public StructuredDataMessage(final String id, final String msg, final String type, final Map<String, String> data) Creates a StructuredDataMessage using an ID (max 32 characters), message, type (max 32 characters), and an initial map of structured data to include. | |
| StructuredDataMessage | back to summary |
|---|---|
| public StructuredDataMessage(final String id, final String msg, final String type, final Map<String, String> data, final int maxLength) Creates a StructuredDataMessage using an (user specified max characters), message, and type (user specified maximum number of characters, and an initial map of structured data to include. | |
| StructuredDataMessage | back to summary |
|---|---|
| public StructuredDataMessage(final StructuredDataId id, final String msg, final String type) Creates a StructuredDataMessage using a StructuredDataId, message, and type (max 32 characters).
| |
| StructuredDataMessage | back to summary |
|---|---|
| public StructuredDataMessage(final StructuredDataId id, final String msg, final String type, final int maxLength) Creates a StructuredDataMessage using a StructuredDataId, message, and type (max 32 characters).
| |
| StructuredDataMessage | back to summary |
|---|---|
| public StructuredDataMessage(final StructuredDataId id, final String msg, final String type, final Map<String, String> data) Creates a StructuredDataMessage using a StructuredDataId, message, type (max 32 characters), and an initial map of structured data to include. | |
| StructuredDataMessage | back to summary |
|---|---|
| public StructuredDataMessage(final StructuredDataId id, final String msg, final String type, final Map<String, String> data, final int maxLength) Creates a StructuredDataMessage using a StructuredDataId, message, type (max 32 characters), and an initial map of structured data to include. | |
| StructuredDataMessage | back to summary |
|---|---|
| private StructuredDataMessage(final StructuredDataMessage msg, final Map<String, String> map) Constructor based on a StructuredDataMessage.
| |
| StructuredDataMessage | back to summary |
|---|---|
| protected StructuredDataMessage() Basic constructor. | |
| asString | back to summary |
|---|---|
| public String asString() Overrides org. Formats the structured data as described in RFC 5424. | |
| asString | back to summary |
|---|---|
| public String asString(final String format) Overrides org. Formats the structured data as described in RFC 5424. | |
| asString | back to summary |
|---|---|
| public final String asString(final StructuredDataMessage. Formats the structured data as described in RFC 5424.
| |
| asString | back to summary |
|---|---|
| public final void asString(final StructuredDataMessage. Formats the structured data as described in RFC 5424.
| |
| asXml | back to summary |
|---|---|
| private void asXml(final StructuredDataId structuredDataId, final StringBuilder sb) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides org. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| formatTo | back to summary |
|---|---|
| public void formatTo(final StringBuilder buffer) Overrides org. Implements org. Doc from org. Writes a text representation of this object into the specified
| |
| formatTo | back to summary |
|---|---|
| public void formatTo(final String[] formats, final StringBuilder buffer) Overrides org. Implements org. Doc from org. Writes a text representation of this object into the specified
| |
| getFormat | back to summary |
|---|---|
| public String getFormat() Overrides org. Implements org. Returns the message. | |
| getFormat | back to summary |
|---|---|
| private StructuredDataMessage. Hides org. | |
| getFormats | back to summary |
|---|---|
| public String[] getFormats() Overrides org. Implements org. Returns the supported formats. | |
| getFormattedMessage | back to summary |
|---|---|
| public String getFormattedMessage() Overrides org. Implements org. Formats the message and return it. | |
| getFormattedMessage | back to summary |
|---|---|
| public String getFormattedMessage(final String[] formats) Overrides org. Implements org. Formats the message according to the specified format.
| |
| getId | back to summary |
|---|---|
| public StructuredDataId getId() Returns this message id.
| |
| getType | back to summary |
|---|---|
| public String getType() Returns this message type.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides org. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| newInstance | back to summary |
|---|---|
| public StructuredDataMessage newInstance(final Map<String, String> map) Overrides org. Doc from org. Constructs a new instance based on an existing Map.
| |
| setId | back to summary |
|---|---|
| protected void setId(final String id) Sets the id from a String. This ID can be at most 32 characters long.
| |
| setId | back to summary |
|---|---|
| protected void setId(final StructuredDataId id) Sets the id.
| |
| setMessageFormat | back to summary |
|---|---|
| protected void setMessageFormat(final String msg) | |
| setType | back to summary |
|---|---|
| protected void setType(final String type) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final boolean value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final byte value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final char value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final double value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final float value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final int value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final long value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final Object value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final short value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validate | back to summary |
|---|---|
| protected void validate(final String key, final String value) Overrides org. Doc from org. Default implementation does nothing.
| |
| validateKey | back to summary |
|---|---|
| protected void validateKey(final String key) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final StructuredDataMessage. | FULL
Full message format includes the type and message. |
| public static final StructuredDataMessage. | XML
The map should be formatted as XML. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static StructuredDataMessage. | |
| public static StructuredDataMessage. |
| FULL | back to summary |
|---|---|
| public static final StructuredDataMessage. Full message format includes the type and message. | |
| XML | back to summary |
|---|---|
| public static final StructuredDataMessage. The map should be formatted as XML. | |
| Format | back to summary |
|---|---|
| private Format() | |
| valueOf | back to summary |
|---|---|
| public static StructuredDataMessage. | |
| values | back to summary |
|---|---|
| public static StructuredDataMessage. | |