public class EReplyMessage extends EMessage implements 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 Form| Modifier and Type | Class and Description |
|---|---|
static class |
EReplyMessage.Builder<M extends EReplyMessage,B extends EReplyMessage.Builder<M,?>>
Base class for all
EReplyMessage builders. |
static class |
EReplyMessage.ConcreteBuilder
Since
EReplyMessage is not abstract and may be
instantiated as a concrete message, this builder is used
to create an EReplyMessage instance. |
static class |
EReplyMessage.ReplyStatus
An eBus reply is limited to either OK (success) or
ERROR (failure).
|
EMessage.MessageType| Modifier and Type | Field and Description |
|---|---|
String |
replyReason
The reason for a
EReplyMessage.ReplyStatus.ERROR reply status. |
EReplyMessage.ReplyStatus |
replyStatus
The current request handling status.
|
MAX_FIELDS| Modifier | Constructor and Description |
|---|---|
protected |
EReplyMessage(EReplyMessage.Builder<?,?> builder)
Creates a new eBus reply message based on the given reply
message builder.
|
|
EReplyMessage(String subject,
EReplyMessage.ReplyStatus replyStatus,
String replyReason)
Creates a new reply message instance for the given
subject, status, reason, and final reply flag.
|
|
EReplyMessage(String subject,
long timestamp,
EReplyMessage.ReplyStatus replyStatus,
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 |
|---|---|
static EReplyMessage.Builder |
builder()
Returns the
EReplyMessage builder. |
boolean |
equals(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. |
String |
toString()
Returns the message subject, timestamp, and sequence
number as a string.
|
isApplicationMessage, isSystemMessage, key, messageTypepublic final EReplyMessage.ReplyStatus replyStatus
EReplyMessage.ReplyStatus.ERROR, then replyReason will
contain text explaining why the request was rejected.@Optional public final String replyReason
EReplyMessage.ReplyStatus.ERROR reply status.
May be null or empty.public EReplyMessage(String subject, EReplyMessage.ReplyStatus replyStatus, String replyReason) throws 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.IllegalArgumentException - if:
subject is either of null or empty;
replyStatus is null;
public EReplyMessage(String subject, long timestamp, EReplyMessage.ReplyStatus replyStatus, String replyReason) throws IllegalArgumentException
This constructor is not deprecated since it is
needed by local messages designated by
@ELocalOnly annotation.
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.IllegalArgumentException - if:
subject is either of null or empty;
replyStatus is null;
protected EReplyMessage(EReplyMessage.Builder<?,?> builder)
builder is guaranteed to contain
a valid message configuration at this point.builder - contains the reply message configuration.public boolean equals(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 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.public static EReplyMessage.Builder builder()
EReplyMessage builder.EReplyMessage.Builder instance.Copyright © 2019. All rights reserved.