public class EReplyMessage extends EMessage implements java.io.Serializable
This message is not abstract because it is a complete message in its own right and may be used to send a generic reply to any request.
Note: messages are limited to 31 fields. This
is due to eBus binary serialization format. This number is
decreased to 27 fields for sub-classes because
EMessage
has two fields: subject
and
timestamp
and EReplyMessage
has two fields:
replyStatus
and replyReason
.
ENotificationMessage
,
ERequestMessage
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
EReplyMessage.ReplyStatus
An eBus reply is limited to either OK (success) or
ERROR (failure).
|
EMessage.MessageType
Modifier and Type | Field and Description |
---|---|
java.lang.String |
replyReason
The reason for a
EReplyMessage.ReplyStatus.ERROR reply status. |
EReplyMessage.ReplyStatus |
replyStatus
The current request handling status.
|
MAX_FIELDS
Constructor and Description |
---|
EReplyMessage(java.lang.String subject,
EReplyMessage.ReplyStatus replyStatus,
java.lang.String replyReason)
Creates a new reply message instance for the given
subject, status, reason, and final reply flag.
|
EReplyMessage(java.lang.String subject,
long timestamp,
EReplyMessage.ReplyStatus replyStatus,
java.lang.String replyReason)
Creates a new reply message instance for the given
subject, timestamp, status, reason, and final reply flag.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Returns
true if o is a
non-null EReplyMessage instance with a reply
status and reply reason equal to
this EReplyMessage instance and false
otherwise. |
int |
hashCode()
Returns the reply message hash code.
|
boolean |
isFinal()
Returns
true if this is the final reply and
false if another reply is to be expected. |
java.lang.String |
toString()
Returns the message subject, timestamp, and sequence
number as a string.
|
isApplicationMessage, isSystemMessage, key, messageType
public final EReplyMessage.ReplyStatus replyStatus
public final java.lang.String replyReason
EReplyMessage.ReplyStatus.ERROR
reply status.
May be null
or empty.public EReplyMessage(java.lang.String subject, EReplyMessage.ReplyStatus replyStatus, java.lang.String replyReason) throws java.lang.IllegalArgumentException
This constructor is public so that this class may be used as a generic reply to any request.
subject
- the message subject.replyStatus
- the reply status.replyReason
- the reason explaining an error reply
status. May be null
or empty.java.lang.IllegalArgumentException
- if:
subject
is either of null
or empty;
replyStatus
is null
;
public EReplyMessage(java.lang.String subject, long timestamp, EReplyMessage.ReplyStatus replyStatus, java.lang.String replyReason) throws java.lang.IllegalArgumentException
subject
- the message subject.timestamp
- the message timestamp (Java millisecond
epoch time).replyStatus
- the OK or error reply status.replyReason
- the reason explaining an error reply
status. May be null
or empty.java.lang.IllegalArgumentException
- if:
subject
is either of null
or empty;
replyStatus
is null
;
public boolean equals(java.lang.Object o)
true
if o
is a
non-null EReplyMessage
instance with a reply
status and reply reason equal to
this EReplyMessage
instance and false
otherwise.public int hashCode()
public java.lang.String toString()
public boolean isFinal()
true
if this is the final reply and
false
if another reply is to be expected.true
if this is the final reply.