public class MultiPayloadMessageFactory extends AdaptrisMessageFactory
MultiPayloadAdaptrisMessage
.
<message-factory class="multi-payload-message-factory">
<default-char-encoding>UTF-8</default-char-encoding>
<default-payload-id>payload-1</default-payload-id>
</message-factory>
AdaptrisMessageFactory
,
MultiPayloadAdaptrisMessage
In the adapter configuration file this class is aliased as multi-payload-message-factory which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
MultiPayloadMessageFactory() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDefaultCharEncoding()
Return the default character encoding for the message.
|
java.lang.String |
getDefaultPayloadId()
Get the default payload ID.
|
AdaptrisMessage |
newMessage()
Returns a new
AdaptrisMessage . |
AdaptrisMessage |
newMessage(AdaptrisMessage source,
java.util.Collection<java.lang.String> metadataKeysToPreserve)
Returns a new
AdaptrisMessage with an empty payload but with
selected metadata from the source. |
AdaptrisMessage |
newMessage(byte[] payload)
Returns a new
AdaptrisMessage with the specified payload and
metadata. |
AdaptrisMessage |
newMessage(byte[] payload,
java.util.Set metadata)
Returns a new
AdaptrisMessage with the specified payload and metadata. |
AdaptrisMessage |
newMessage(java.lang.String payload)
Returns a new
AdaptrisMessage with the specified payload and
metadata. |
AdaptrisMessage |
newMessage(@NotNull java.lang.String payloadId,
AdaptrisMessage source,
java.util.Collection<java.lang.String> metadataKeysToPreserve) |
AdaptrisMessage |
newMessage(@NotNull java.lang.String payloadId,
byte[] payload) |
AdaptrisMessage |
newMessage(@NotNull java.lang.String payloadId,
byte[] payload,
java.util.Set metadata)
Create a new multi-payload message, with the given ID, payload, and metadata.
|
AdaptrisMessage |
newMessage(java.lang.String payload,
java.util.Set metadata)
Returns a new
AdaptrisMessage with the specified payload and
metadata. |
AdaptrisMessage |
newMessage(java.lang.String payload,
java.lang.String charEncoding)
Returns a new
AdaptrisMessage with the specified payload and
metadata. |
AdaptrisMessage |
newMessage(java.lang.String payload,
java.lang.String charEncoding,
java.util.Set metadata)
Returns a new
AdaptrisMessage with the specified payload and
metadata. |
AdaptrisMessage |
newMessage(@NotNull java.lang.String payloadId,
java.lang.String content,
java.lang.String charEncoding)
Create a new multi-payload message, with the given ID, and payload.
|
AdaptrisMessage |
newMessage(@NotNull java.lang.String payloadId,
java.lang.String content,
java.lang.String charEncoding,
java.util.Set metadata)
Create a new multi-payload message, with the given ID, payload, and metadata.
|
void |
setDefaultCharEncoding(java.lang.String s)
Set the default character encoding to be applied to the message upon
creation.
|
void |
setDefaultPayloadId(java.lang.String defaultPayloadId)
Set the default payload ID.
|
defaultIfNull, getDefaultInstance, getUniqueIdGenerator, setUniqueIdGenerator, uniqueIdGenerator
public AdaptrisMessage newMessage(byte[] payload)
Returns a new AdaptrisMessage
with the specified payload and
metadata.
newMessage
in class AdaptrisMessageFactory
payload
- the byte[]
payloadAdaptrisMessage
public AdaptrisMessage newMessage(@NotNull @NotNull java.lang.String payloadId, byte[] payload)
public AdaptrisMessage newMessage(byte[] payload, java.util.Set metadata)
Returns a new AdaptrisMessage
with the specified payload and metadata.
newMessage
in class AdaptrisMessageFactory
payload
- the byte[]
payloadmetadata
- a Set
of MetadataElement
sAdaptrisMessage
public AdaptrisMessage newMessage(@NotNull @NotNull java.lang.String payloadId, byte[] payload, java.util.Set metadata)
payloadId
- The payload ID to use.payload
- The payload.metadata
- Any metadata.public AdaptrisMessage newMessage(java.lang.String payload)
Returns a new AdaptrisMessage
with the specified payload and
metadata. Uses default platform character encoding.
newMessage
in class AdaptrisMessageFactory
payload
- the String
payloadAdaptrisMessage
public AdaptrisMessage newMessage(java.lang.String payload, java.lang.String charEncoding)
Returns a new AdaptrisMessage
with the specified payload and
metadata. Uses default platform character encoding.
newMessage
in class AdaptrisMessageFactory
payload
- the String
payloadcharEncoding
- the String
's character encodingAdaptrisMessage
public AdaptrisMessage newMessage(java.lang.String payload, java.util.Set metadata)
Returns a new AdaptrisMessage
with the specified payload and
metadata. Uses default platform character encoding.
newMessage
in class AdaptrisMessageFactory
payload
- the String
payloadmetadata
- a Set
of MetadataElement
sAdaptrisMessage
public AdaptrisMessage newMessage(java.lang.String payload, java.lang.String charEncoding, java.util.Set metadata)
Returns a new AdaptrisMessage
with the specified payload and
metadata. Uses default platform character encoding.
newMessage
in class AdaptrisMessageFactory
payload
- the String
payloadcharEncoding
- the String
's character encodingmetadata
- a Set
of MetadataElement
sAdaptrisMessage
public AdaptrisMessage newMessage(@NotNull @NotNull java.lang.String payloadId, java.lang.String content, java.lang.String charEncoding)
payloadId
- The payload ID to use.content
- The payload content.charEncoding
- The content encoding.public AdaptrisMessage newMessage(@NotNull @NotNull java.lang.String payloadId, java.lang.String content, java.lang.String charEncoding, java.util.Set metadata)
payloadId
- The payload ID to use.content
- The payload content.charEncoding
- The content encoding.metadata
- Any metadata.public AdaptrisMessage newMessage(AdaptrisMessage source, java.util.Collection<java.lang.String> metadataKeysToPreserve) throws java.lang.CloneNotSupportedException
AdaptrisMessage
with an empty payload but with
selected metadata from the source.
The new AdaptrisMessage will have the same message id and MessageLifecycleEvent will be cloned from the original. Object metadata will also be preserved.
.newMessage
in class AdaptrisMessageFactory
source
- the original AdaptrisMessagemetadataKeysToPreserve
- a list of keys to transfer to the new Message; if null, then all keys.AdaptrisMessage
java.lang.CloneNotSupportedException
- if the MleMarkers could not be cloned.public AdaptrisMessage newMessage(@NotNull @NotNull java.lang.String payloadId, AdaptrisMessage source, java.util.Collection<java.lang.String> metadataKeysToPreserve) throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public AdaptrisMessage newMessage()
Returns a new AdaptrisMessage
. Payload and metadata are null.
newMessage
in class AdaptrisMessageFactory
AdaptrisMessage
with the specified payload and
metadatapublic java.lang.String getDefaultCharEncoding()
AdaptrisMessageFactory
getDefaultCharEncoding
in class AdaptrisMessageFactory
public void setDefaultCharEncoding(java.lang.String s)
If not explicitly configured, then the platform default character encoding will be used.
setDefaultCharEncoding
in class AdaptrisMessageFactory
s
- the defaultCharEncoding to setAdaptrisMessage.setCharEncoding(String)
public java.lang.String getDefaultPayloadId()
public void setDefaultPayloadId(java.lang.String defaultPayloadId)
defaultPayloadId
- The default payload ID.