public abstract class JCSMPXMLMessage extends Object implements XMLMessage, BufferCloningUser
JCSMPXMLMessage is the base class for all XMLMessage implementation.| Modifier and Type | Field and Description |
|---|---|
static int |
FLAG_COMPAT_PERSISTENT_UNSET |
static int |
FLAG_COMPAT_SETPERSISTENT |
static long |
NULL_FLOWID |
static long |
NULL_MSGID |
static int |
PRORITY_DEFAULT |
static int |
PRORITY_MAX |
static int |
PRORITY_UNDEFINED |
MSGDUMP_BRIEF, MSGDUMP_FULL, SDK_BINARY_METADATA_PORTION, STRUCTURED_MAP_MESSAGE, STRUCTURED_STREAM_MESSAGE, STRUCTURED_TEXT_MESSAGE, UNSTRUCTURED_JMS_BYTES_MESSAGE, UNSTRUCTURED_JMS_OBJECT_MESSAGE, UNSTRUCTURED_JMS_PROPERTIES_MESSAGE, UNSTRUCTURED_MESSAGE, UNSTRUCTURED_XML_MESSAGE| Modifier and Type | Method and Description |
|---|---|
void |
ackMessage()
Acknowledges the message.
|
void |
callout_ad_release_opportunity() |
void |
checkHdrStoreInBinMeta() |
void |
clearAttachment()
Deletes the attachment to the message.
|
void |
clearBinaryMetadataBytes(int type)
Clears any existing binary metadata.
|
void |
clearContent()
Clears the message content.
|
void |
clearMetadata() |
void |
clearQueueNameLocation() |
void |
clearReadOnly() |
void |
clearTopicNameLocation() |
boolean |
equals(Object obj) |
long |
getAckMessageId() |
int |
getAdSessionUid() |
String |
getApplicationMessageId()
Gets the application message ID, a string for an application-specific
message identifier.
|
String |
getApplicationMessageType()
Gets the application message type.
|
String |
getAppMessageID() |
String |
getAppMessageType() |
ByteBuffer |
getAttachmentByteBuffer()
Gets a
ByteBuffer containing the message's binary
attachment. |
byte[] |
getAttachmentContent() |
ContentBuffer |
getAttachmentContentBuffer() |
int |
getAttachmentContentLength()
Gets the length of the attachment.
|
ContentBuffer |
getBinaryMetadataCB() |
int |
getBinaryMetadataContentLength(int type) |
int |
getBinaryMetadataType() |
Collection<Integer> |
getBinaryMetadataTypes() |
Long |
getCacheRequestId()
Return the request ID set in the cache request.
|
CSMPSubscriberChannel |
getChannel() |
int |
getCompatFlags() |
List<Long> |
getConsumerIdList()
Gets a read-only list of consumer IDs set on this message.
|
byte[] |
getContent() |
ContentBuffer |
getContentBuffer() |
int |
getContentLength()
The length of the message content.
|
String |
getCorrelationId()
Gets the correlation ID.
|
Object |
getCorrelationKey()
Gets the correlation key for the message.
|
User_Cos |
getCos()
Gets the Class of Service (CoS) value for this message.
|
boolean |
getDeliverToOne()
Gets whether this message is configured for delivering to one client only.
|
int |
getDeliveryCount()
Get message delivery count.
|
DeliveryMode |
getDeliveryMode()
Gets the delivery mode of the message.
|
Destination |
getDestination()
Gets the destination this message was published to.
|
byte[] |
getDestinationReceivedBytes() |
Destination |
getDestinationSent() |
String |
getDestinationTopicSuffix()
Returns the string, without a leading delimiter, that is found after the
session's default ReplyTo base topic in an incoming message.
|
boolean |
getDiscardIndication()
Returns
true if one or more messages have been discarded
prior to the current message, else false. |
SMFPubMsgHeaderBean |
getEncPubMsgHeader() |
long |
getExpiration()
The UTC time (in milliseconds, from midnight, January 1, 1970 UTC) when the message is supposed to expire.
|
Long |
getExpirationBinaryMeta() |
long |
getFlowId() |
String |
getHTTPContentEncoding()
Gets the HTTP content encoding header value from interaction with an HTTP client.
|
String |
getHTTPContentType()
Gets the HTTP content type header value from interaction with an HTTP client.
|
long |
getInternalProducerId() |
ConsumerLargeMessageNotification |
getLargeMsgInfo() |
Consumer |
getMessageConsumer() |
String |
getMessageId()
Returns the message ID set by JCSMP during send or reception.
|
long |
getMessageIdLong()
Returns the message ID set by JCSMP during send or reception.
|
MessageType |
getMessageType() |
byte[] |
getMetadataContent() |
ContentBuffer |
getMetadataContentBuffer() |
int |
getMetadataContentLength() |
JCSMPXMLMessagePool |
getMsgPool() |
long |
getPrevMessageId() |
int |
getPriority()
Returns priority value in the range of 0–255, or -1 if it is not set.
|
SDTMap |
getProperties()
Gets the user properties map.
|
int |
getQueueNameLength() |
int |
getQueueNameOffset() |
long |
getReceiveTimestamp()
Gets the receive timestamp (in milliseconds, from midnight, January 1, 1970 UTC).
|
boolean |
getRedelivered()
Indicates if the message has been delivered by the appliance to the API before.
|
Destination |
getReplyTo()
Gets the replyTo destination
|
String |
getReplyToSuffix()
Returns the appended suffix to the session's default ReplyTo base topic
set as part of this message's ReplyTo topic destination.
|
long |
getSafeToRetransmitTstamp() |
int |
getSendCount() |
String |
getSenderId()
Returns the Sender's ID.
|
String |
getSenderID() |
Long |
getSenderTimestamp()
Gets the send timestamp (in milliseconds, from midnight, January 1, 1970
UTC).
|
Long |
getSendTimestamp() |
int |
getSeqNum() |
Long |
getSequenceNumber()
Gets the sequence number.
|
JCSMPSession |
getSession() |
byte |
getStructuredMsgType()
Gets the structured message type.
|
long |
getTimeToLive()
The number of milliseconds before the message is discarded or moved to
Dead Message Queue.
|
int |
getTopicNameLength() |
int |
getTopicNameOffset() |
Long |
getTopicSequenceNumber()
Gets the topic sequence number generated by the appliance.
|
boolean |
getTQDiscardIndication() |
byte[] |
getUserData()
When an application sends a message, it can optionally attach
application-specific data along with the message, such as user data.
|
boolean |
hasAttachment()
Checks whether the message has an attachment.
|
boolean |
hasBinaryMetadata(int type) |
boolean |
hasBinaryMetadataAny() |
boolean |
hasContent()
Checks whether the message has content.
|
int |
hashCode() |
boolean |
hasMetadata() |
boolean |
hasUserData()
Checks whether a received message includes user data.
|
void |
incrementSendCount() |
boolean |
isAckImmediately()
Test if the ACK Immediately message property is set or not.
|
boolean |
isCacheMessage()
Returns
true if this message was part of a cache reply. |
boolean |
isDeliveryCountSupported()
Returns
true if Delivery Count is supported. |
boolean |
isDMQEligible()
The method returns whether the message is eligible to be moved to a Dead Message Queue (DMQ)
upon expiration.
|
boolean |
isElidingEligible()
Checks whether the message is eligible for eliding.
|
boolean |
isFlagReturnedToPool() |
boolean |
isForceRedeliveredFlag() |
boolean |
isNewMsgIdRequired() |
boolean |
isReadOnly()
Tests if the message is read only.
|
boolean |
isReplyMessage()
Returns whether the message's reply field is set, indicating that this
message is a reply.
|
boolean |
isRetransmitting() |
boolean |
isSafeToRelease() |
boolean |
isSafeToRetransmit() |
boolean |
isSendAttemptedOnce()
Prevents a message on the output queue from being retransmitted before
it's been attempted once.
|
boolean |
isSenderIDSetByUser() |
boolean |
isSendTimestampSetByUser() |
boolean |
isSequenceNumberSetByUser() |
boolean |
isStructuredMsg()
Returns whether the message is a structured message.
|
boolean |
isSuspect()
Return
true if this message was part of a cache reply that had the suspect flag set. |
int |
readAttachmentBytes(byte[] byteOutputBuffer)
Reads bytes from an attachment, copying the data to the supplied byte
array.
|
int |
readAttachmentBytes(byte[] byteOutputBuffer,
int length)
Reads
length bytes from an attachment, copying the data to
the supplied byte array. |
int |
readAttachmentBytes(int srcPos,
byte[] byteOutputBuffer,
int destPos,
int length)
Reads
length bytes from an attachment, copying the data to
the supplied byte array. |
int |
readBinaryMetadataBytes(int type,
byte[] byteOutputBuffer) |
int |
readMetadataBytes(byte[] byteOutputBuffer) |
int |
readMetadataBytes(byte[] byteOutputBuffer,
int length) |
int |
readMetadataBytes(int srcPos,
byte[] byteOutputBuffer,
int destPos,
int length) |
void |
rejectMessage()
Deprecated.
|
void |
releaseContentBuffer(BufferCloningPool bufCloningPool) |
void |
reset()
Resets the message, clearing all fields, preparing it for publishing
again.
|
void |
reset(boolean resetMsgType) |
void |
resetExpirationBinaryMeta() |
void |
resetSendCount() |
void |
returnMessageToPool() |
void |
rewindAttachment()
Deprecated.
|
void |
rewindMetadata()
Deprecated.
|
void |
set_ad_release_expect(int count) |
void |
setAckImmediately(boolean ackImmediately)
Set the ACK Immediately message property.
|
void |
setAckMessageId(long ackMsgId) |
void |
setAdSessionUid(int uid) |
void |
setApplicationMessageId(String msgId)
Sets the message ID (a string for an application-specific message
identifier).
|
void |
setApplicationMessageType(String appMsgType)
Sets the application message type.
|
void |
setAppMessageID(String msgId) |
void |
setAppMessageType(String appMsgType) |
void |
setAsReplyMessage(boolean isResponse)
Sets the reply field of the message.
|
void |
setBinaryMetadataCB(ContentBuffer cb,
int type) |
void |
setCacheMessage() |
void |
setCacheRequestId(Long id) |
void |
setChannel(CSMPSubscriberChannel channel) |
void |
setCorrelationId(String id)
Sets the correlation ID.
|
void |
setCorrelationKey(Object key)
Sets the correlation key for the message.
|
void |
setCos(User_Cos cosValue)
Sets the Class of Service (CoS) value for this message.
|
void |
setDeliverToOne(boolean deliverToOne)
Configures this message to be delivered to one client only.
|
void |
setDeliveryCount(Long count) |
void |
setDeliveryMode(DeliveryMode mode)
Sets the delivery mode of the message.
|
void |
setDestinationReceived(Destination destrx) |
void |
setDestinationReceivedBytes(byte[] destrxBytes) |
void |
setDestinationSent(Destination desttx) |
void |
setDiscardIndication(boolean di) |
void |
setDMQEligible(boolean dmqEligible)
Set the message to be eligible to be moved to a Dead Message Queue.
|
void |
setElidingEligible(boolean eliding)
Sets whether the message is eligible for eliding.
|
void |
setExpiration(long expiration)
The UTC time (in milliseconds, from midnight, January 1, 1970 UTC) when the message is supposed to expire.
|
void |
setExpirationBinaryMeta(long expiration) |
void |
setFlagReturnedToPool(boolean flagReturnedToPool) |
void |
setFlowId(long flowId) |
void |
setForceRedeliveredFlag(boolean forceRedeliveredFlag) |
void |
setHTTPContentEncoding(String contentEncoding)
Sets the HTTP content type encoding value for interaction with an HTTP client.
|
void |
setHTTPContentType(String contentType)
Sets the HTTP content type header value for interaction with an HTTP client.
|
void |
setInternalP2pTopicDescriptionBase(String t) |
void |
setInternalProducerId(long value) |
void |
setLargeMsgInfo(ConsumerLargeMessageNotification largeMsgInfo) |
void |
setMessageConsumer(Consumer consumer) |
void |
setMessageIdLong(long msgId) |
void |
setMessageType(MessageType msgType) |
void |
setMsgPool(JCSMPXMLMessagePool msgPool) |
void |
setNewMsgIdRequired(boolean generateMsgId) |
void |
setPrevMessageId(long id) |
void |
setPriority(int priority)
A message can optionally have priority set.
|
void |
setProperties(SDTMap props)
This method allows users to specify their own user properties to be
carried in the message separate from the payload.
|
void |
setQueueNameLocation(int offset,
int length) |
void |
setReadOnly()
The message can be set as read only.
|
void |
setReceiveTimestamp(long t) |
void |
setRedelivered(boolean redelivered) |
void |
setReplyTo(Destination destination)
Sets the replyTo destination for the message.
|
void |
setReplyToSuffix(String suffix)
Appends a String to the session's default ReplyTo base topic and creates
a ReplyTo Topic Destination.
|
void |
setRetransmitting(boolean retransmitting) |
void |
setSafeToRelease(boolean safeToRelease) |
void |
setSafeToRetransmit(boolean safeToRetransmit) |
void |
setSafeToRetransmitTstamp(long safeToRetransmitTstamp) |
void |
setSendAttemptedOnce(boolean sendAttemptedOnce) |
void |
setSenderId_internal(String senderId) |
void |
setSenderId(String senderId)
Sets the Sender ID for the message.
|
void |
setSenderID(String senderID) |
void |
setSenderTimestamp(long ts)
Allows the application to set the send timestamp overriding the API's
generated value.
|
void |
setSendTimestamp_internal(long ts) |
void |
setSendTimestamp(long ts) |
void |
setSeqNum(int seqNum) |
void |
setSequenceNumber_internal(long seqNum) |
void |
setSequenceNumber(long seqNum)
Sets the sequence number.
|
void |
setSession(JCSMPSession session) |
void |
setStructuredMsg(boolean value)
Sets the message as a structured message.
|
void |
setStructuredMsgType(byte value)
Sets the structured message type.
|
void |
setSuspect() |
void |
setTimeToLive(long ttl)
The number of milliseconds before the message is discarded or moved to a
Dead Message Queue.
|
void |
setTopicNameLocation(int offset,
int length) |
void |
setTopicSequenceNumber(Long sequenceNumber) |
void |
setTQDiscardIndication(boolean tqd) |
void |
setUserData(byte[] userData)
When an application sends a message, it can optionally attach
application-specific data along with the message as user data.
|
String |
toString() |
int |
writeAttachment(byte[] byteInputBuffer)
Writes a new attachment to the message.
|
int |
writeAttachment(byte[] byteInputBuffer,
int offset,
int length)
Writes a new attachment to the message.
|
int |
writeAttachment(InputStream stream)
Writes a new attachment to the message.
|
int |
writeBinaryMetadataBytes(int type,
byte[] byteInputBuffer) |
int |
writeBinaryMetadataBytes(int type,
byte[] byteInputBuffer,
int offset,
int length) |
int |
writeCidListData(byte[] input,
int offset,
int length)
INTERNAL METHOD Write the data for a CID list to the message, replacing
any existing data if present.
|
int |
writeMetadata(byte[] byteInputBuffer) |
int |
writeMetadata(byte[] byteInputBuffer,
int offset,
int length) |
int |
writeMetadata(InputStream stream) |
int |
writeNewAttachment(byte[] byteInputBuffer)
Deprecated.
Use
writeAttachment(byte[]) instead |
int |
writeNewAttachment(byte[] byteInputBuffer,
int offset,
int length)
Deprecated.
Use
writeAttachment(byte[],int,int) instead |
int |
writeNewAttachment(InputStream stream)
Deprecated.
Use
writeAttachment(InputStream) instead |
int |
writeNewAttachment(InputStream stream,
int offset,
int length)
Deprecated.
|
dump, dump, readContentBytes, readContentBytes, readContentBytespublic static final int PRORITY_UNDEFINED
public static final int PRORITY_DEFAULT
public static final int PRORITY_MAX
public static final long NULL_MSGID
public static final long NULL_FLOWID
public static final int FLAG_COMPAT_SETPERSISTENT
public static final int FLAG_COMPAT_PERSISTENT_UNSET
public String getMessageId()
XMLMessageOn the receiving side, if messages received do not have message ID set by the appliance, JCSMP automatically assigns one and guarantees its uniqueness for a particular <subscriber; message type>.
Guaranteed messages delivered from the appliance have a appliance-assigned
message ID. Messages sent or received over the Direct
delivery mode are assigned a message ID by the API, but its value is not
meaningful.
getMessageId in interface XMLMessageXMLMessage.getMessageId()public final long getMessageIdLong()
XMLMessageXMLMessage.getMessageId().getMessageIdLong in interface XMLMessagepublic final void setMessageIdLong(long msgId)
public final long getAckMessageId()
getAckMessageId in interface XMLMessagepublic final void setAckMessageId(long ackMsgId)
public int getDeliveryCount()
throws UnsupportedOperationException
XMLMessagegetDeliveryCount in interface XMLMessageUnsupportedOperationExceptionpublic boolean isDeliveryCountSupported()
XMLMessagetrue if Delivery Count is supported.isDeliveryCountSupported in interface XMLMessagetrue if the Delivery Count is supported, otherwise false.public void setDeliveryCount(Long count)
public boolean hasUserData()
XMLMessagehasUserData in interface XMLMessagetrue if user data is present, false
otherwise.public byte[] getUserData()
XMLMessagehasUserData() method to check
whether user data is present on a received message.
NOTE: The maximum length of the user data is 36 bytes.
getUserData in interface XMLMessagenull
if none is present.XMLMessage.getUserData()public void setUserData(byte[] userData)
XMLMessageNOTE: The maximum length of user data is 36 bytes.
setUserData in interface XMLMessageuserData - The user data - copied into the message object.com.solacesystems.jcsmp.XMLMessage#setUserData(java.lang.String)public MessageType getMessageType()
getMessageType in interface XMLMessageMessageType representing one of the four message types.XMLMessage.getMessageType()public void setMessageType(MessageType msgType)
setMessageType in interface XMLMessagemsgType - An enumerated type (MessageType) representing one of
the CSMP message types.com.solacesystems.jcsmp.XMLMessage#setMessageType(int)public DeliveryMode getDeliveryMode()
XMLMessagegetDeliveryMode in interface XMLMessageDeliveryMode) representing one of the
CSMP delivery modes.public void setDeliveryMode(DeliveryMode mode)
XMLMessagesetDeliveryMode in interface XMLMessagemode - An enumerated type (DeliveryMode) representing one of
the CSMP delivery modes.public int getPriority()
XMLMessagegetPriority in interface XMLMessageXMLMessage.getPriority()public void setPriority(int priority)
XMLMessageThe valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest. Value -1 indicates the priority is not set and a default priority value is used instead.
setPriority in interface XMLMessagepriority - parameterXMLMessage.setPriority(int)public User_Cos getCos()
XMLMessagegetCos in interface XMLMessagepublic void setCos(User_Cos cosValue)
XMLMessagesetCos in interface XMLMessagecosValue - Class of Service (CoS).public boolean getRedelivered()
XMLMessagegetRedelivered in interface XMLMessageboolean indicating if the message has been delivered before.XMLMessage.getRedelivered()public void setRedelivered(boolean redelivered)
public void setForceRedeliveredFlag(boolean forceRedeliveredFlag)
public boolean isForceRedeliveredFlag()
public long getTimeToLive()
XMLMessagegetTimeToLive in interface XMLMessageXMLMessage.getTimeToLive()public void setTimeToLive(long ttl)
XMLMessageA value of 0 means the message never expires. The default value is 0.
Note: Calling this method with a value of 0 explicitly resets previously set message expiration to 0.
This property is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used in conjunction with other message types unless the message is promoted by the appliance to a Guaranteed message.
setTimeToLive in interface XMLMessagettl - The number of milliseconds the Guaranteed message is allowed to
live before delivery to a subscriber.com.solacesystems.jcsmp.XMLMessage#setTimeToLive(int)public boolean isDMQEligible()
XMLMessagefalse, the message is discarded upon expiration. The default value is
false.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message unless the message is promoted by the appliance to a Guaranteed message.
isDMQEligible in interface XMLMessageboolean indicating whether the message is eligible to be moved to
a Dead Message Queue.public void setDMQEligible(boolean dmqEligible)
XMLMessagefalse.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message unless the message is promoted by the appliance to a Guaranteed message.
setDMQEligible in interface XMLMessagedmqEligible - Whether the message is eligible to be moved to a DMQ upon expiration.public void setAdSessionUid(int uid)
public int getAdSessionUid()
public void ackMessage()
XMLMessage
If a JCSMPSession is configured to use
SUPPORTED_MESSAGE_ACK_CLIENT, when a message is successfully received by
an application, the application must call this method to explicitly
acknowledge reception of the message in order to free system resources
associated with an unacknowledged message.
Note: If a JCSMPSession is configured to use
JCSMPProperties.SUPPORTED_MESSAGE_ACK_AUTO (the default behaviour),
the call to this method is ignored and a warning log is generated.
Acknowledged messages are removed from the appliance's message spool.
ackMessage in interface XMLMessageXMLMessage.ackMessage()@Deprecated public void rejectMessage()
rejectMessage in interface XMLMessagepublic boolean getDiscardIndication()
XMLMessagetrue if one or more messages have been discarded
prior to the current message, else false. This indicates
congestion discards only and is not affected by message eliding.getDiscardIndication in interface XMLMessageTrue if prior messages have been discarded, else
false.XMLMessage.getDiscardIndication()public void setDiscardIndication(boolean di)
public boolean getTQDiscardIndication()
getTQDiscardIndication in interface XMLMessageTrue if prior messages have been discarded, else false.XMLMessage.getTQDiscardIndication()public void setTQDiscardIndication(boolean tqd)
public void setElidingEligible(boolean eliding)
XMLMessagesetElidingEligible in interface XMLMessageeliding - Whether the message is eligible for eliding.isElidingEligible() for more information about
this feature.public boolean isElidingEligible()
XMLMessage
Message eliding enables filtering of data to avoid transmitting every
single update to a subscribing client. It can be used to overcome slow
consumers or any situation where a slower message rate is desired.
Eliding can be applied to messages delivered to subscribers in
DIRECT delivery mode.
Time-based eliding ensures that subscriber applications always receive only the most current update of a published topic at a rate that they can manage. By limiting the incoming message rate, a subscriber application is able to avoid a message backlog filled with outdated messages. This property does not indicate whether messages were elided or provide information about the subscriber profile eliding configuration.
isElidingEligible in interface XMLMessagepublic int getContentLength()
XMLMessagegetContentLength in interface XMLMessageXMLMessage.getContentLength()public void clearContent()
XMLMessageclearContent in interface XMLMessageXMLMessage.clearContent()public void setReadOnly()
XMLMessageIllegalAccessError to be raised.setReadOnly in interface XMLMessageXMLMessage.setReadOnly()public boolean isReadOnly()
XMLMessageisReadOnly in interface XMLMessagepublic void clearAttachment()
XMLMessageclearAttachment in interface XMLMessageXMLMessage.clearAttachment()public boolean hasAttachment()
XMLMessagehasAttachment in interface XMLMessageTrue if the message has an attachment, false otherwise.XMLMessage.hasAttachment()public int getAttachmentContentLength()
XMLMessagegetAttachmentContentLength in interface XMLMessageXMLMessage.getAttachmentContentLength()public int readAttachmentBytes(int srcPos,
byte[] byteOutputBuffer,
int destPos,
int length)
XMLMessagelength bytes from an attachment, copying the data to
the supplied byte array.
If the number of bytes to be read in the attachment is less than
length, all attachment bytes are read into the array.
Parameter ordering mimics the semantics of System#arraycopy.
readAttachmentBytes in interface XMLMessagesrcPos - The starting position in the source array.byteOutputBuffer - A destination byte array to fill.destPos - The starting position in the destination array.length - The number of bytes to read.public int readAttachmentBytes(byte[] byteOutputBuffer)
XMLMessageIf the length of the array is less than the number of bytes remaining to be read, the array is filled.
If the number of bytes to be read in the attachment is less than the length of the array, all attachment bytes are read into the array. Use XMLMessage.getAttachmentContentLength() to find the size of the attachment in order to provide a correctly-sized array.
readAttachmentBytes in interface XMLMessagebyteOutputBuffer - A byte array to fill with bytes from the attachment.XMLMessage.readAttachmentBytes(byte[])public int readAttachmentBytes(byte[] byteOutputBuffer,
int length)
XMLMessagelength bytes from an attachment, copying the data to
the supplied byte array.
If the number of bytes to be read in the attachment is less than length,
all attachment bytes are read into the array.
readAttachmentBytes in interface XMLMessagebyteOutputBuffer - A byte array to fill with bytes from the attachment.length - The number of bytes to read.XMLMessage.readAttachmentBytes(byte[], int)public void rewindAttachment()
XMLMessageXMLMessage.readAttachmentBytes(byte[]) or
XMLMessage.readAttachmentBytes(byte[], int) reads from the beginning of the attachment.rewindAttachment in interface XMLMessageXMLMessage.rewindAttachment()public int writeNewAttachment(byte[] byteInputBuffer)
writeAttachment(byte[]) insteadXMLMessagewriteNewAttachment in interface XMLMessagebyteInputBuffer - A byte array to copy as attachment content.XMLMessage.writeNewAttachment(byte[])public int writeAttachment(byte[] byteInputBuffer)
XMLMessageThis method copies the input bytes into the message.
writeAttachment in interface XMLMessagebyteInputBuffer - A byte array to copy as attachment content.XMLMessage.writeAttachment(byte[])public int writeNewAttachment(byte[] byteInputBuffer,
int offset,
int length)
throws BufferUnderflowException
writeAttachment(byte[],int,int) insteadXMLMessageoffset or length are negative, an
IllegalArgumentException is thrown.
If length or offset result in an attempt to
read past the end of the array, a BufferUnderflowException is
thrown.writeNewAttachment in interface XMLMessagebyteInputBuffer - A byte array to copy as attachment content.offset - The offset from which to read bytes from the input buffer.length - The number of bytes to copy.BufferUnderflowExceptionXMLMessage.writeNewAttachment(byte[], int, int)public int writeAttachment(byte[] byteInputBuffer,
int offset,
int length)
throws BufferUnderflowException
XMLMessageoffset or length are negative, an
IllegalArgumentException is thrown.
If length or offset result in an attempt to
read past the end of the array, a BufferUnderflowException is
thrown.
This method copies the input bytes into the message.
writeAttachment in interface XMLMessagebyteInputBuffer - A byte array to copy as attachment content.offset - The offset from which to read bytes from the input buffer.length - The number of bytes to copy.BufferUnderflowException - on errorXMLMessage.writeAttachment(byte[], int, int)public int writeNewAttachment(InputStream stream, int offset, int length) throws IOException
XMLMessageoffset or length are negative, an
IllegalArgumentException is thrown.writeNewAttachment in interface XMLMessagestream - A stream from which to read attachment content.offset - The offset from which to read bytes from the input stream.length - The number of bytes to read from the stream.IOExceptionXMLMessage.writeNewAttachment(InputStream, int, int)public int writeAttachment(InputStream stream) throws IOException
XMLMessageThis method copies the input bytes into the message.
writeAttachment in interface XMLMessagestream - A stream from which to read attachment content.IOExceptionpublic int writeNewAttachment(InputStream stream) throws IOException
writeAttachment(InputStream) insteadXMLMessagewriteNewAttachment in interface XMLMessagestream - A stream from which to read attachment content.IOExceptionXMLMessage.writeNewAttachment(InputStream)public void clearMetadata()
com.solacesystems.jcsmp.XMLMessage#clearMetadata()public int getMetadataContentLength()
com.solacesystems.jcsmp.XMLMessage#getMetadataContentLength()public boolean hasMetadata()
com.solacesystems.jcsmp.XMLMessage#hasMetadata()public boolean hasContent()
XMLMessagehasContent in interface XMLMessageTrue if the message has content, false otherwise.XMLMessage.hasContent()public int readMetadataBytes(int srcPos,
byte[] byteOutputBuffer,
int destPos,
int length)
public int readMetadataBytes(byte[] byteOutputBuffer,
int length)
com.solacesystems.jcsmp.XMLMessage#readMetadataBytes(byte[], int)public int readMetadataBytes(byte[] byteOutputBuffer)
com.solacesystems.jcsmp.XMLMessage#readMetadataBytes(byte[])public void rewindMetadata()
com.solacesystems.jcsmp.XMLMessage#rewindMetadata()public int writeMetadata(byte[] byteInputBuffer,
int offset,
int length)
throws BufferUnderflowException
BufferUnderflowExceptioncom.solacesystems.jcsmp.XMLMessage#writeMetadata(byte[], int, int)public int writeMetadata(byte[] byteInputBuffer)
com.solacesystems.jcsmp.XMLMessage#writeMetadata(byte[])public int writeMetadata(InputStream stream) throws IOException
IOExceptioncom.solacesystems.jcsmp.XMLMessage#writeMetadata(InputStream)public final void clearBinaryMetadataBytes(int type)
XMLMessageclearBinaryMetadataBytes in interface XMLMessagetype - Type of binary metadata to clear.public final int getBinaryMetadataContentLength(int type)
getBinaryMetadataContentLength in interface XMLMessagetype - The type of binary metadata to check length for.public final Collection<Integer> getBinaryMetadataTypes()
getBinaryMetadataTypes in interface XMLMessagepublic final boolean hasBinaryMetadata(int type)
hasBinaryMetadata in interface XMLMessagetype - The type of binary metadata to check for.public final int readBinaryMetadataBytes(int type,
byte[] byteOutputBuffer)
readBinaryMetadataBytes in interface XMLMessagetype - The type of binary metadata to read.byteOutputBuffer - The byte array to copy the data to.public final int writeBinaryMetadataBytes(int type,
byte[] byteInputBuffer)
writeBinaryMetadataBytes in interface XMLMessagetype - The type of binary metadata to write.byteInputBuffer - The byte array to copy the data to.public final int writeBinaryMetadataBytes(int type,
byte[] byteInputBuffer,
int offset,
int length)
throws BufferUnderflowException
writeBinaryMetadataBytes in interface XMLMessagetype - The type of binary metadata to write.byteInputBuffer - Byte array to copy the data to.offset - The offset from which to read bytes from the input buffer.length - The number of bytes to copy.BufferUnderflowException - on errorpublic final boolean hasBinaryMetadataAny()
public final ContentBuffer getBinaryMetadataCB()
public final int getBinaryMetadataType()
public final void setBinaryMetadataCB(ContentBuffer cb, int type)
public int writeCidListData(byte[] input,
int offset,
int length)
input - parameteroffset - parameterlength - parameterpublic List<Long> getConsumerIdList()
XMLMessage0x00000000 - 0xFFFFFFFE, and each
one indicates that the received message matched at least one subscription
with that consumer ID on the appliance.
Consumer IDs are only present once, even if multiple subscriptions with that consumer ID each have caused a match.
The return value is null if no consumer IDs are set on the
message.
getConsumerIdList in interface XMLMessagepublic void setTopicNameLocation(int offset,
int length)
setTopicNameLocation in interface XMLMessageoffset - Indicates the number of bytes from the start of the metadata where the first byte of the Topic name is located.length - parameterXMLMessage.setTopicNameLocation(int, int)public int getTopicNameOffset()
getTopicNameOffset in interface XMLMessageXMLMessage.getTopicNameOffset()public int getTopicNameLength()
getTopicNameLength in interface XMLMessageXMLMessage.getTopicNameLength()public void clearTopicNameLocation()
clearTopicNameLocation in interface XMLMessageXMLMessage.clearTopicNameLocation()public void setQueueNameLocation(int offset,
int length)
setQueueNameLocation in interface XMLMessageoffset - Indicates the number of bytes from the start of the metadata where the first byte of the queue name is located.length - parameterXMLMessage.setQueueNameLocation(int, int)public int getQueueNameOffset()
getQueueNameOffset in interface XMLMessageXMLMessage.getQueueNameOffset()public int getQueueNameLength()
getQueueNameLength in interface XMLMessageXMLMessage.getQueueNameLength()public void clearQueueNameLocation()
clearQueueNameLocation in interface XMLMessageXMLMessage.clearQueueNameLocation()public boolean isAckImmediately()
XMLMessagefalse.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message.
This property, when set by a publisher, may or may not be removed by the appliance prior to delivery to a consumer, so message consumers must not rely on this property being present.
isAckImmediately in interface XMLMessageboolean indicating whether the message should be ACKed by the appliance immediately upon receipt.XMLMessage.isAckImmediately()public void setAckImmediately(boolean ackImmediately)
XMLMessagefalse.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message.
This property, when set by a publisher, may or may not be removed by the appliance prior to delivery to a consumer, so message consumers must not rely on this property being present.
setAckImmediately in interface XMLMessageackImmediately - Whether the message should be ACKed by the appliance immediately upon receipt.XMLMessage.setAckImmediately(boolean)public void reset()
XMLMessageJCSMPFactory.reset in interface XMLMessagepublic void reset(boolean resetMsgType)
public void callout_ad_release_opportunity()
public void set_ad_release_expect(int count)
public long getInternalProducerId()
public void setInternalProducerId(long value)
public void setInternalP2pTopicDescriptionBase(String t)
public int getCompatFlags()
public void setPrevMessageId(long id)
public long getPrevMessageId()
public CSMPSubscriberChannel getChannel()
public void setChannel(CSMPSubscriberChannel channel)
public Consumer getMessageConsumer()
public void setMessageConsumer(Consumer consumer)
public JCSMPSession getSession()
public void setSession(JCSMPSession session)
public byte[] getMetadataContent()
public ContentBuffer getMetadataContentBuffer()
public byte[] getContent()
public ContentBuffer getContentBuffer()
public byte[] getAttachmentContent()
public ContentBuffer getAttachmentContentBuffer()
public ByteBuffer getAttachmentByteBuffer()
XMLMessageByteBuffer containing the message's binary
attachment. The buffer's position is set to the beginning of
the attachment, its limit set to the length of the
attachment, and its mark is undefined.getAttachmentByteBuffer in interface XMLMessageByteBuffer view wrapping a byte
array owned by this message. If no attachment is present in this
message, returns null.public int getSeqNum()
public void setSeqNum(int seqNum)
public boolean isNewMsgIdRequired()
public void setNewMsgIdRequired(boolean generateMsgId)
public int getSendCount()
public void incrementSendCount()
public void resetSendCount()
public boolean isSendAttemptedOnce()
public void setSendAttemptedOnce(boolean sendAttemptedOnce)
public boolean isFlagReturnedToPool()
public void setFlagReturnedToPool(boolean flagReturnedToPool)
public JCSMPXMLMessagePool getMsgPool()
public void setMsgPool(JCSMPXMLMessagePool msgPool)
public void returnMessageToPool()
public void releaseContentBuffer(BufferCloningPool bufCloningPool)
releaseContentBuffer in interface BufferCloningUserpublic boolean isSafeToRetransmit()
public void setSafeToRetransmit(boolean safeToRetransmit)
public long getSafeToRetransmitTstamp()
public void setSafeToRetransmitTstamp(long safeToRetransmitTstamp)
public boolean isSafeToRelease()
public void setSafeToRelease(boolean safeToRelease)
public boolean isRetransmitting()
public void setRetransmitting(boolean retransmitting)
public void clearReadOnly()
public Destination getDestination()
XMLMessageQueue or Topic instance.getDestination in interface XMLMessagenull if unavailable.public void setDestinationReceived(Destination destrx)
public void setDestinationReceivedBytes(byte[] destrxBytes)
public byte[] getDestinationReceivedBytes()
public void setDestinationSent(Destination desttx)
public Destination getDestinationSent()
public Object getCorrelationKey()
XMLMessageJCSMPStreamingPublishCorrelatingEventHandler.getCorrelationKey in interface XMLMessagepublic void setCorrelationKey(Object key)
XMLMessageJCSMPStreamingPublishCorrelatingEventHandler. Only effective for
PERSISTENT and NON-PERSISTENT messages
(that is, Guaranteed Delivery).setCorrelationKey in interface XMLMessagekey - The correlation key to associate with this message.public long getFlowId()
public void setFlowId(long flowId)
public String getAppMessageID()
getAppMessageID in interface XMLMessagepublic String getApplicationMessageId()
XMLMessagegetApplicationMessageId in interface XMLMessagenull if it was not set on send.public String getAppMessageType()
getAppMessageType in interface XMLMessagepublic String getApplicationMessageType()
XMLMessagegetApplicationMessageType in interface XMLMessagepublic String getCorrelationId()
XMLMessagegetCorrelationId in interface XMLMessagenull, if
unset.public boolean getDeliverToOne()
XMLMessageFalse by default.
getDeliverToOne in interface XMLMessagetrue if this message was configured to deliver to one client only.public SDTMap getProperties()
XMLMessagegetProperties in interface XMLMessagenull if no user
properties map has been set on this message.public Destination getReplyTo()
XMLMessagegetReplyTo in interface XMLMessagepublic long getReceiveTimestamp()
XMLMessagegetReceiveTimestamp in interface XMLMessagepublic void setReceiveTimestamp(long t)
public String getSenderID()
getSenderID in interface XMLMessagepublic String getSenderId()
XMLMessagegetSenderId in interface XMLMessagepublic Long getSequenceNumber()
XMLMessagegetSequenceNumber in interface XMLMessageNull if it was not set on send.public long getExpiration()
XMLMessageA value of 0 means the message never expires. The default value is 0.
If TimeToLive is set to a value greater than 0 before sending, getExpiration() will have one of the following values:
JCSMPProperties.CALCULATE_MESSAGE_EXPIRATION is set to true, getExpiration() returns
the sum of the message's TimeToLive and UTC value after the message is sent at the first send attempt. Otherwise,
getExpiration() returns 0.
JCSMPProperties.CALCULATE_MESSAGE_EXPIRATION
is set to true, getExpiration() returns the sum of TimeToLive and the UTC value when the message is received.
Otherwise, getExpiration returns 0.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message unless the message is promoted by the appliance to a Guaranteed message.
getExpiration in interface XMLMessagepublic Long getExpirationBinaryMeta()
public Long getSendTimestamp()
getSendTimestamp in interface XMLMessagepublic Long getSenderTimestamp()
XMLMessagegetSenderTimestamp in interface XMLMessagepublic byte getStructuredMsgType()
XMLMessageisStructuredMsg()
One of the structured messages:
getStructuredMsgType in interface XMLMessagepublic boolean isStructuredMsg()
XMLMessageisStructuredMsg in interface XMLMessageTrue if the message is a structured message.public void setAppMessageID(String msgId)
setAppMessageID in interface XMLMessagepublic void setApplicationMessageId(String msgId)
XMLMessagesetApplicationMessageId in interface XMLMessagemsgId - The message ID.public void setAppMessageType(String appMsgType)
setAppMessageType in interface XMLMessagepublic void setApplicationMessageType(String appMsgType)
XMLMessagesetApplicationMessageType in interface XMLMessageappMsgType - The application message type.public void setCorrelationId(String id)
XMLMessagesetCorrelationId in interface XMLMessageid - The correlation ID to associate with this message.public void setDeliverToOne(boolean deliverToOne)
XMLMessageFalse by default.
When a direct message has the DeliverToOne property set to true , it can be delivered only to one client. For a Guaranteed Delivery message, this behavior only applies to the "demoted" direct copy of this message.
setDeliverToOne in interface XMLMessagedeliverToOne - True to enable delivering to one client only.public void setProperties(SDTMap props)
XMLMessageProducersetProperties in interface XMLMessageprops - The user properties map.public boolean isReplyMessage()
XMLMessageisReplyMessage in interface XMLMessageboolean indicating the state of the reply field.public void setAsReplyMessage(boolean isResponse)
XMLMessagesetAsReplyMessage in interface XMLMessageisResponse - Whether to set or clear the reply attribute.public void setReplyTo(Destination destination)
XMLMessagesetReplyTo in interface XMLMessagedestination - The replyTo destination.public void setReplyToSuffix(String suffix)
XMLMessagesetReplyToSuffix in interface XMLMessagesuffix - The suffix to append when setting a new ReplyTo destination on
this message.public String getReplyToSuffix()
XMLMessagegetReplyToSuffix in interface XMLMessagenull if unset or ReplyTo is not a
Topic.public String getDestinationTopicSuffix()
XMLMessagegetDestination()) does not
begin with the session's default ReplyTo base topic, then
null is returned.getDestinationTopicSuffix in interface XMLMessagepublic void setSenderID(String senderID)
setSenderID in interface XMLMessagepublic void setSenderId(String senderId)
XMLMessagesetSenderId in interface XMLMessagesenderId - The Sender ID for the message.public void setSenderId_internal(String senderId)
public void setSendTimestamp(long ts)
setSendTimestamp in interface XMLMessagepublic void setSenderTimestamp(long ts)
XMLMessagesetSenderTimestamp in interface XMLMessagets - The value to set as the send timestamp.public void setSendTimestamp_internal(long ts)
public void setSequenceNumber(long seqNum)
XMLMessagesetSequenceNumber in interface XMLMessageseqNum - The sequence number.public void setSequenceNumber_internal(long seqNum)
public boolean isSequenceNumberSetByUser()
public boolean isSendTimestampSetByUser()
public boolean isSenderIDSetByUser()
public void setExpiration(long expiration)
XMLMessageThis field only serves as a reference as to when the message may expire. A value of 0 means the message never expires. The default value is 0.
Note: If TimeToLive is set to zero explicitly by application, any previously set Expiration is reset to 0.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message unless the message is promoted by the appliance to a Guaranteed message.
setExpiration in interface XMLMessageexpiration - parameterpublic void setExpirationBinaryMeta(long expiration)
public void resetExpirationBinaryMeta()
public void setStructuredMsgType(byte value)
XMLMessagesetStructuredMsg()
One of the structured messages:
setStructuredMsgType in interface XMLMessagevalue - structured/Unstructured message type.public void setStructuredMsg(boolean value)
XMLMessagesetStructuredMsgType().setStructuredMsg in interface XMLMessagevalue - True if it is a structured message.public Long getCacheRequestId()
XMLMessagenull if isCacheMessage() is false.getCacheRequestId in interface XMLMessagepublic void setCacheRequestId(Long id)
public boolean isCacheMessage()
XMLMessagetrue if this message was part of a cache reply.isCacheMessage in interface XMLMessagetrue if this message was part of a cache reply.public void setCacheMessage()
public boolean isSuspect()
XMLMessagetrue if this message was part of a cache reply that had the suspect flag set.isSuspect in interface XMLMessagetrue if this message was part of a cache reply that had the suspect flag set.public void setSuspect()
public void checkHdrStoreInBinMeta()
public SMFPubMsgHeaderBean getEncPubMsgHeader()
public Long getTopicSequenceNumber()
XMLMessagegetTopicSequenceNumber in interface XMLMessageNull if it was not generated by the appliance.public void setTopicSequenceNumber(Long sequenceNumber)
public ConsumerLargeMessageNotification getLargeMsgInfo()
public void setLargeMsgInfo(ConsumerLargeMessageNotification largeMsgInfo)
public String getHTTPContentType()
XMLMessagegetHTTPContentType in interface XMLMessagenull if it is not set.public void setHTTPContentType(String contentType)
XMLMessagesetHTTPContentType in interface XMLMessagecontentType - The HTTP content type header value.public String getHTTPContentEncoding()
XMLMessagegetHTTPContentEncoding in interface XMLMessagenull if it is not set.public void setHTTPContentEncoding(String contentEncoding)
XMLMessagesetHTTPContentEncoding in interface XMLMessagecontentEncoding - The HTTP content encoding header value.Copyright 2004-2020 Solace Corporation. All rights reserved.