public class DefaultAdaptrisMessageImp extends AdaptrisMessageImp
AdaptrisMessage
implementation created by DefaultMessageFactory
Modifier | Constructor and Description |
---|---|
protected |
DefaultAdaptrisMessageImp(IdGenerator guid,
AdaptrisMessageFactory fac) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a deep clone of this object.
|
boolean |
equivalentForTracking(AdaptrisMessage other)
AdaptrisMessage 's are equivalent for tracking if they
have the same unique Id, their payloads are equal, their char encodings are
equal and their metadata is equal. |
java.lang.String |
getContent() |
java.io.InputStream |
getInputStream() |
java.io.OutputStream |
getOutputStream() |
byte[] |
getPayload()
Returns a copy of this message's payload in its raw,
byte[] form. |
long |
getSize()
Return the size of the payload.
|
java.lang.String |
getStringPayload()
Returns a
String representation of the payload. |
void |
setContent(java.lang.String payloadString,
java.lang.String charEnc) |
void |
setPayload(byte[] bytes)
Sets the passed
byte[] as this message's payload. |
void |
setStringPayload(java.lang.String s)
Sets the passed
String as the payload. |
void |
setStringPayload(java.lang.String payloadString,
java.lang.String charEnc)
Sets the passed
String with the passed character encoding as
the payload. |
addEvent, addMessageHeader, addMetadata, addMetadata, addObjectHeader, addObjectMetadata, areEqual, clearMetadata, containsKey, copyPayload, encode, getCharEncoding, getContentEncoding, getFactory, getMessageHeaders, getMessageLifecycleEvent, getMetadata, getMetadata, getMetadataValue, getMetadataValueIgnoreKeyCase, getNextServiceId, getObjectHeaders, getObjectMetadata, getReader, getUniqueId, getWriter, getWriter, headersContainsKey, removeMessageHeader, removeMetadata, resolve, setCharEncoding, setContentEncoding, setMessageHeaders, setMetadata, setNextServiceId, setUniqueId, toString, toString, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPayloadForLogging
resolve
protected DefaultAdaptrisMessageImp(IdGenerator guid, AdaptrisMessageFactory fac) throws java.lang.RuntimeException
java.lang.RuntimeException
public boolean equivalentForTracking(AdaptrisMessage other)
AdaptrisMessage
AdaptrisMessage
's are equivalent for tracking if they
have the same unique Id, their payloads are equal, their char encodings are
equal and their metadata is equal. NB equality of metadata is based on key
only.
other
- the message to compare(com.adaptris.core.AdaptrisMessage)
public void setPayload(byte[] bytes)
AdaptrisMessage
Sets the passed byte[]
as this message's payload.
bytes
- the payloadAdaptrisMessage.setPayload(byte[])
public byte[] getPayload()
AdaptrisMessage
Returns a copy of this message's payload in its raw,
byte[]
form.
byte[]
formAdaptrisMessage.getPayload()
public long getSize()
AdaptrisMessage
AdaptrisMessage.getSize()
public void setStringPayload(java.lang.String s)
AdaptrisMessage
Sets the passed String
as the payload. The passed String
is assumed to have the default platform
encoding and any previously set character encoding will be set to null. If a specific character encoding is required use
setStringPayload(String, String)
.
s
- the payload to setAdaptrisMessage.setStringPayload(String)
public void setStringPayload(java.lang.String payloadString, java.lang.String charEnc)
AdaptrisMessage
Sets the passed String
with the passed character encoding as
the payload. Passing null for charEncoding
is the same as
using setPayload(String)
.
payloadString
- the payloadcharEnc
- the character encoding used by the payloadAdaptrisMessage.setStringPayload(String, String)
public void setContent(java.lang.String payloadString, java.lang.String charEnc)
public java.lang.String getStringPayload()
AdaptrisMessage
Returns a String
representation of the payload. This
String
will be created using the provided character encoding
if one has been set, otherwise the default platform character encoding will
be used. If you wish to apply a different character encoding use
getPayload
to obtain a raw byte[]
.
String
representation of the payloadAdaptrisMessage.getStringPayload()
public java.lang.String getContent()
InterlokMessage.getContent()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
AdaptrisMessage
Returns a deep clone of this object.
clone
in interface AdaptrisMessage
clone
in class AdaptrisMessageImp
java.lang.CloneNotSupportedException
- if the implementation does not support
cloningObject.clone()
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
InterlokMessage.getInputStream()
public java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
InterlokMessage.getOutputStream()