|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.latencybusters.lbm.LBMMessage
public class LBMMessage
Encapsulates all LBM messages.
Call dispose() to utilize Zero Object Delivery (ZOD), or promote() to retain message object after callback. You must call either one or the other.
When using ZOD, access message data via dataPointer() and length().
For object-based delivery (non-ZOD), access message data with data(), which creates a byte array object that contains the message data.
Constructor Summary | |
---|---|
LBMMessage()
|
Method Summary | |
---|---|
LBMApplicationHeaderChain |
applicationHeaderChain()
Get the application header chain, if any, associated with this message. |
boolean |
canSendExplicitAck()
|
LBMMessageChannelInfo |
channelInfo()
Object containing channel information included with the message. |
byte[] |
data()
Message data. |
java.nio.ByteBuffer |
dataBuffer()
Message data as a direct ByteBuffer. |
long |
dataLength()
Message data length. |
java.lang.String |
dataString()
Message string data. |
long |
deliveryLatencyNanos()
|
UMEDeregistrationCompleteInfo |
deregistrationCompleteInfo()
Get an extended registration complete info object from the message (only for LBM.MSG_UME_DEREGISTRATION_COMPLETE_EX messages). |
UMEDeregistrationSuccessInfo |
deregistrationSuccessInfo()
Get an extended deregistration success info object from the message (only for LBM.MSG_UME_DEREGISTRATION_SUCCESS_EX
messages). |
void |
dispose()
Dispose of memory associated with this message, and send UME implicit ACK for UME receivers. |
UMEMessageAck |
extractUMEAck()
Retrieves the ack structure from a UME message. |
long |
firstFragmentSequenceNumber()
LBM sequence number of the first fragment of the current message |
int |
flags()
LBM message flags. |
long |
fragmentOffset()
Byte offset of the current fragment within the associated message. |
boolean |
hasApplicationHeaderChain()
Check to see if this message contains any application header chain data. |
long |
hfSequenceNumber()
Get the hot failover sequence number as a long. |
java.math.BigInteger |
hfSequenceNumberBigInt()
Get the hot failover sequence number as a BigInteger. |
boolean |
isFragment()
Returns true if the current object is actually a message fragment. |
boolean |
isFromGateway()
Deprecated. No replacement |
long |
originalSequenceNumber()
Deprecated. No replacement |
java.lang.String |
originalSource()
Deprecated. No replacement |
char[] |
originalSourceAsCharArray()
Deprecated. No replacement |
long |
osqn()
Retrieve the message original sequence number set by the UM library. |
LBMMessage |
promote()
Promotes the current LBMMessage to a full-fledged LBMMessage object that can be referenced and used past the end of the receiver callback. |
LBMMessageProperties |
properties()
|
UMQDeregistrationCompleteInfo |
queueDeregistrationCompleteInfo()
Get an extended queue deregistration complete info object from the message (only for LBM.MSG_UMQ_DEREGISTRATION_COMPLETE_EX messages). |
UMQIndexAssignedInfo |
queueIndexAssignedInfo()
Get a queue index assigned info object from the message (only for LBM.MSG_UMQ_INDEX_ASSIGNED_EX messages). |
UMQIndexAssignmentEligibilityStartCompleteInfo |
queueIndexAssignmentEligibilityStartCompleteInfo()
Get a queue index assignment eligibility start complete info object from the message (only for LBM.MSG_UMQ_INDEX_ASSIGNMENT_ELIGIBILITY_START_COMPLETE_EX messages). |
UMQIndexAssignmentEligibilityStopCompleteInfo |
queueIndexAssignmentEligibilityStopCompleteInfo()
Get a queue index assignment eligibility stop complete info object from the message (only for LBM.MSG_UMQ_INDEX_ASSIGNMENT_ELIGIBILITY_STOP_COMPLETE_EX messages). |
UMQIndexInfo |
queueIndexInfo()
Retrieve UMQ index information for this message. |
UMQIndexReleasedInfo |
queueIndexReleasedInfo()
Get a queue index released info object from the message (only for LBM.MSG_UMQ_INDEX_RELEASED_EX messages). |
UMQMessageId |
queueMessageId()
The message ID assigned by the queue (UMQ only). |
UMQRegistrationCompleteInfo |
queueRegistrationCompleteInfo()
Get an extended queue registration complete info object from the message (only for LBM.MSG_UMQ_REGISTRATION_COMPLETE_EX messages). |
void |
reassign(int flags)
Do not acknowledge the given message and instead request that the message be reassigned. |
long |
receiverRegistrationId()
The registration ID for the receiver (UME only). |
UMERegistrationCompleteInfo |
registrationCompleteInfo()
Get an extended registration complete info object from the message (only for LBM.MSG_UME_REGISTRATION_COMPLETE_EX messages). |
UMERegistrationSuccessInfo |
registrationSuccessInfo()
Get an extended registration success info object from the message (only for LBM.MSG_UME_REGISTRATION_SUCCESS_EX
messages). |
void |
respond(byte[] data,
int dataLength,
int flags)
Send a response for this request message. |
void |
sendExplicitAck()
Send an explicit ACK for this message (UME only). |
long |
sequenceNumber()
LBM message (or message fragment) sequence number. |
java.lang.String |
source()
Message source |
char[] |
sourceAsCharArray()
Message sourceAsCharArray |
java.lang.Object |
sourceClientObject()
Get the source client object, set by an LBMSourceCreationCallback callback. |
long |
sourceRegistrationId()
The registration ID for the source (UME only). |
long |
timestampMicroseconds()
Microseconds portion of the timestamp indicating when the message was received. |
long |
timestampSeconds()
Seconds portion of the timestamp indicating when the message was received. |
java.lang.String |
topicName()
Topic on which the current message has been delivered. |
char[] |
topicNameAsCharArray()
Message topicNameAsCharArray |
long |
totalMessageLength()
Total message size. |
int |
type()
LBM message type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LBMMessage()
Method Detail |
---|
public LBMMessage promote()
CAUTION: promote() is NOT thread safe; do not call it on the same message from multiple threads at the same time. Note that there should never be any reason to do so.
public void dispose()
Note: dispose MUST be called on messages that contain application header chains. To check if a message contains an application header chain, use hasApplicationHeaderChain()
.
Note: UME receivers MUST call dispose() on each LBMMessage object when and only when the application is completely finished with the LBMMessage.
LBMContext.close()
,
LBMReceiverBase.close()
,
LBMReceiverBase.close()
public LBMApplicationHeaderChain applicationHeaderChain() throws LBMException
LBMEInvalException
- if the message contains no application header data, LBMException if another error occurs.
LBMException
public boolean hasApplicationHeaderChain()
applicationHeaderChain()
public int type()
LBM
public int flags()
LBM
public long sequenceNumber()
osqn
,
hfSequenceNumber
public LBMMessageProperties properties()
public byte[] data()
public long dataLength()
public java.nio.ByteBuffer dataBuffer()
public java.lang.String dataString()
public java.lang.String source()
public char[] sourceAsCharArray()
public java.lang.String topicName()
public char[] topicNameAsCharArray()
public LBMMessageChannelInfo channelInfo()
public long firstFragmentSequenceNumber()
public long fragmentOffset()
public long totalMessageLength()
public boolean isFragment()
public void respond(byte[] data, int dataLength, int flags) throws LBMException
Warning: It is not safe to call this method from a context thread callback.
data
- Data to send in this responsedataLength
- Number of bytes of data to send in this responseflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.
LBMException
- if any error occurs sending the response.LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
public long sourceRegistrationId()
public long receiverRegistrationId()
public UMQMessageId queueMessageId()
public long timestampSeconds()
public long timestampMicroseconds()
public long deliveryLatencyNanos() throws LBMException
LBMException
public boolean isFromGateway()
public long originalSequenceNumber()
public java.lang.String originalSource()
public char[] originalSourceAsCharArray()
public long hfSequenceNumber()
#getHfSequenceNumberBigInt
public java.math.BigInteger hfSequenceNumberBigInt()
#getHfSequenceNumber
public UMERegistrationSuccessInfo registrationSuccessInfo()
LBM.MSG_UME_REGISTRATION_SUCCESS_EX
messages).
#storeRegistrationSuccessInfo
public UMERegistrationCompleteInfo registrationCompleteInfo()
LBM.MSG_UME_REGISTRATION_COMPLETE_EX
messages).
public UMEDeregistrationSuccessInfo deregistrationSuccessInfo()
LBM.MSG_UME_DEREGISTRATION_SUCCESS_EX
messages).
#storeDeregistrationSuccessInfo
public UMEDeregistrationCompleteInfo deregistrationCompleteInfo()
LBM.MSG_UME_DEREGISTRATION_COMPLETE_EX
messages).
public UMQRegistrationCompleteInfo queueRegistrationCompleteInfo()
LBM.MSG_UMQ_REGISTRATION_COMPLETE_EX
messages).
public UMQDeregistrationCompleteInfo queueDeregistrationCompleteInfo()
LBM.MSG_UMQ_DEREGISTRATION_COMPLETE_EX
messages).
public UMQIndexAssignedInfo queueIndexAssignedInfo()
LBM.MSG_UMQ_INDEX_ASSIGNED_EX
messages).
UMQIndexAssignedInfo
object holding extended index assignment info.public UMQIndexReleasedInfo queueIndexReleasedInfo()
LBM.MSG_UMQ_INDEX_RELEASED_EX
messages).
UMQIndexReleasedInfo
object holding extended index release info.public UMQIndexAssignmentEligibilityStartCompleteInfo queueIndexAssignmentEligibilityStartCompleteInfo()
LBM.MSG_UMQ_INDEX_ASSIGNMENT_ELIGIBILITY_START_COMPLETE_EX
messages).
UMQIndexAssignmentEligibilityStartCompleteInfo
object holding extended index assignment eligibility start complete info.public UMQIndexAssignmentEligibilityStopCompleteInfo queueIndexAssignmentEligibilityStopCompleteInfo()
LBM.MSG_UMQ_INDEX_ASSIGNMENT_ELIGIBILITY_STOP_COMPLETE_EX
messages).
UMQIndexAssignmentEligibilityStopCompleteInfo
object holding extended index assignment eligibility stop complete info.public UMQIndexInfo queueIndexInfo() throws LBMException
UMQIndexInfo
object holding index information
LBMException
public boolean canSendExplicitAck()
public void sendExplicitAck() throws LBMException
LBMException
- if any error occurs or the message object is not valid, or if dispose() has already been called on this LBMMessage.public void reassign(int flags) throws LBMException
flags
- Flags indicating various conditions. ORed set of values: LBM.MSG_UMQ_REASSIGN_FLAG_DISCARD
LBMException
- if any error occurs or the message object is not valid, or if dispose() has already been called on this LBMMessage.public long osqn()
public java.lang.Object sourceClientObject()
public UMEMessageAck extractUMEAck() throws LBMException
LBMException
- if the message has already been disposed, ACK'd, or was not a UME message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |