Package com.adaptris.core
Class DefaultAdaptrisMessageImp
- java.lang.Object
-
- com.adaptris.core.AdaptrisMessageImp
-
- com.adaptris.core.DefaultAdaptrisMessageImp
-
- All Implemented Interfaces:
AdaptrisMessage,InterlokMessage,java.lang.Cloneable
public class DefaultAdaptrisMessageImp extends AdaptrisMessageImp
AdaptrisMessageimplementation created byDefaultMessageFactory
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisMessageImp
METADATA_RESOLVE_REGEXP, OBJECT_RESOLVE_REGEXP, PAYLOAD_RESOLVE_KEY, SIZE_RESOLVE_KEY, UID_RESOLVE_KEY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultAdaptrisMessageImp(IdGenerator guid, AdaptrisMessageFactory fac)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a deep clone of this object.booleanequivalentForTracking(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.StringgetContent()java.io.InputStreamgetInputStream()java.io.OutputStreamgetOutputStream()byte[]getPayload()Returns a copy of this message's payload in its raw,byte[]form.longgetSize()Return the size of the payload.voidsetContent(java.lang.String payloadString, java.lang.String charEnc)voidsetPayload(byte[] bytes)Sets the passedbyte[]as this message's payload.-
Methods inherited from class com.adaptris.core.AdaptrisMessageImp
addEvent, addMessageHeader, addMetadata, addMetadata, addObjectHeader, clearMessageHeaders, copyPayload, encode, getContentEncoding, getFactory, getMessageHeaders, getMessageLifecycleEvent, getMetadata, getMetadata, getMetadataValue, getMetadataValueIgnoreKeyCase, getNextServiceId, getObjectHeaders, getReader, getUniqueId, getWriter, getWriter, headersContainsKey, removeMessageHeader, removeMetadata, resolve, resolveObject, setContentEncoding, setMessageHeaders, setNextServiceId, setUniqueId, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisMessage
addMetadata, addObjectMetadata, clearMetadata, containsKey, getCharEncoding, getObjectMetadata, getPayloadForLogging, getStringPayload, replaceAllMetadata, setCharEncoding, setMetadata, setStringPayload, setStringPayload
-
Methods inherited from interface com.adaptris.interlok.types.InterlokMessage
addMessageHeaders, replaceAllMessageHeaders, resolve, wrap
-
-
-
-
Constructor Detail
-
DefaultAdaptrisMessageImp
protected DefaultAdaptrisMessageImp(IdGenerator guid, AdaptrisMessageFactory fac) throws java.lang.RuntimeException
- Throws:
java.lang.RuntimeException
-
-
Method Detail
-
equivalentForTracking
public boolean equivalentForTracking(AdaptrisMessage other)
Description copied from interface:AdaptrisMessageAdaptrisMessage'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.- Parameters:
other- the message to compare- Returns:
- true if the passed message is equivalent for tracking
- See Also:
(com.adaptris.core.AdaptrisMessage)
-
setPayload
public void setPayload(byte[] bytes)
Description copied from interface:AdaptrisMessageSets the passed
byte[]as this message's payload.- Parameters:
bytes- the payload- See Also:
AdaptrisMessage.setPayload(byte[])
-
getPayload
public byte[] getPayload()
Description copied from interface:AdaptrisMessageReturns a copy of this message's payload in its raw,
byte[]form.- Returns:
- payload in
byte[]form - See Also:
AdaptrisMessage.getPayload()
-
getSize
public long getSize()
Description copied from interface:AdaptrisMessageReturn the size of the payload.- Returns:
- the size of the payload.
- See Also:
AdaptrisMessage.getSize()
-
setContent
public void setContent(java.lang.String payloadString, java.lang.String charEnc)
-
getContent
public java.lang.String getContent()
- See Also:
InterlokMessage.getContent()
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionDescription copied from interface:AdaptrisMessageReturns a deep clone of this object.
- Specified by:
clonein interfaceAdaptrisMessage- Overrides:
clonein classAdaptrisMessageImp- Returns:
- a deep clone of this object
- Throws:
java.lang.CloneNotSupportedException- if the implementation does not support cloning- See Also:
Object.clone()
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Throws:
java.io.IOException- See Also:
InterlokMessage.getInputStream()
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException- Throws:
java.io.IOException- See Also:
InterlokMessage.getOutputStream()
-
-