public abstract class Reply extends Routable
A reply is a response to a message that has been sent throught the messagebus. No reply will ever exist without a
corresponding message. There are no error-replies defined, as errors can instead piggyback any reply by the errors
member variable.
Constructor and Description |
---|
Reply() |
Modifier and Type | Method and Description |
---|---|
void |
addError(Error error)
Add an error to this reply.
|
Error |
getError(int i)
Returns the error at the given position.
|
Set<Integer> |
getErrorCodes()
Retrieves a set of integer error codes
|
Stream<Error> |
getErrors()
Retrieves a (read only) stream of the errors in this reply
|
Message |
getMessage()
Returns the message to which this is a reply.
|
int |
getNumErrors()
Returns the number of errors that this reply contains.
|
double |
getRetryDelay()
Returns the retry request of this reply.
|
boolean |
hasErrors()
Returns whether or not this reply contains any errors.
|
boolean |
hasFatalErrors()
Returns whether or not this reply contains any fatal errors.
|
void |
setMessage(Message msg)
Sets the message to which this is a reply.
|
void |
setRetryDelay(double retryDelay)
Sets the retry delay request of this reply.
|
void |
swapState(Routable rhs)
Swaps the state that makes this routable unique to another routable.
|
discard, getCallStack, getContext, getProtocol, getTrace, getType, popHandler, pushHandler, setContext
public void swapState(Routable rhs)
Routable
public Message getMessage()
Returns the message to which this is a reply.
public void setMessage(Message msg)
Sets the message to which this is a reply. Although it might seem very bogus to allow such an accessor, it is necessary since we allow an empty constructor.
msg
- The message to which this is a reply.public boolean hasErrors()
Returns whether or not this reply contains any errors.
public boolean hasFatalErrors()
Returns whether or not this reply contains any fatal errors.
public Error getError(int i)
Returns the error at the given position.
i
- The index of the error to return.public int getNumErrors()
Returns the number of errors that this reply contains.
public void addError(Error error)
Add an error to this reply. This method will also trace the error as long as there is any tracing enabled.
error
- The error object to add.public double getRetryDelay()
Returns the retry request of this reply. This can be set using setRetryDelay(double)
and is an instruction to
the resender logic of message bus on how to perform the retry. If this value is anything other than a negative
number, it instructs the resender to disregard all configured resending attributes and instead act according to
this value.
public void setRetryDelay(double retryDelay)
Sets the retry delay request of this reply. If this is a negative number, it will use the defaults configured in the source session.
retryDelay
- The retry request.public Stream<Error> getErrors()
Copyright © 2018. All rights reserved.