|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.inspirel.yami.OutgoingMessage
public final class OutgoingMessage
Outgoing message.
The handler (proxy) allowing to track the progress of outgoing message, inspect its state and to obtain the reply content.
Note: The objects of this class can be safely used from multiple threads.
Nested Class Summary | |
---|---|
static class |
OutgoingMessage.MessageState
Enumeration defining all possible message states. |
static class |
OutgoingMessage.MessageStateInfo
Helper class for reporting full message state |
Method Summary | |
---|---|
void |
close()
Cleans up internal resources related to this message. |
java.lang.String |
getExceptionMsg()
Gets the rejection reason for this message |
byte[] |
getRawReply()
Gets the raw reply body. |
Parameters |
getReply()
Gets the reply body. |
OutgoingMessage.MessageState |
getState()
Gets the current state of the message. |
OutgoingMessage.MessageStateInfo |
getStateInfo()
Gets the current state and information about the message progress. |
void |
waitForCompletion()
Waits for the completion of this message. |
boolean |
waitForCompletion(long relativeTimeout)
Waits for the completion of this message. |
boolean |
waitForCompletionAbsolute(long absoluteTimeout)
Waits for the completion of this message. |
void |
waitForTransmission()
Waits for the transmission of this message. |
boolean |
waitForTransmission(long relativeTimeout)
Waits for the transmission of this message. |
boolean |
waitForTransmissionAbsolute(long absoluteTimeout)
Waits for the transmission of this message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public OutgoingMessage.MessageState getState()
public OutgoingMessage.MessageStateInfo getStateInfo()
public Parameters getReply()
BadStateException
- if the current state is not REPLIEDpublic byte[] getRawReply()
BadStateException
- if the current state is not REPLIED or
if the agent was not configured for raw deliverypublic java.lang.String getExceptionMsg()
BadStateException
- if the current state is not REJECTEDpublic void waitForTransmission()
Note: The wait is terminated either when the transmission is successful or when the message is cancelled due to error or channel closing request.
public boolean waitForTransmission(long relativeTimeout)
Note: The wait is terminated either when the transmission is successful or when the message is cancelled due to error or channel closing request or when the timeout expires.
relativeTimeout
- relative timeout in milliseconds
public boolean waitForTransmissionAbsolute(long absoluteTimeout)
Note: The wait is terminated either when the transmission is successful or when the message is cancelled due to error or channel closing request or when the timeout expires.
absoluteTimeout
- absolute timeout in milliseconds,
counted from the beginning of the epoch (UTC)
public void waitForCompletion()
Note: The wait is terminated either when the message is completed - which means that there was a reply or rejection received for it - or when the message is cancelled due to error or channel closing request.
public boolean waitForCompletion(long relativeTimeout)
Note: The wait is terminated either when the message is completed - which means that there was a reply or rejection received for it - or when the message is cancelled due to error or channel closing request or when the timeout expires.
relativeTimeout
- relative timeout in milliseconds
public boolean waitForCompletionAbsolute(long absoluteTimeout)
Note: The wait is terminated either when the message is completed - which means that there was a reply or rejection received for it - or when the message is cancelled due to error or channel closing request or when the timeout expires.
absoluteTimeout
- absolute timeout in milliseconds,
counted from the beginning of the epoch (UTC)
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |