Package com.yahoo.messagebus
Class Result
java.lang.Object
com.yahoo.messagebus.Result
Information on the outcome of initiating a send or forward on a session.
The result will tell if the send/forward was accepted or not. If it was accepted,
an (asynchroneous) reply is guaranteed to be delivered at some later time.
If it was not accepted, a transient error has occured. In that case,
getError()
can be used to access the exact error.
This class is immutable.
- Author:
- bratseth
-
Field Summary
-
Constructor Summary
ConstructorDescriptionThis constructor is a convencience function to allow simpler instantiation of a result that contains an error.This constructor assigns a given error to the member variable such that this result becomes unaccepted with a descriptive error. -
Method Summary
Modifier and TypeMethodDescriptiongetError()
The error resulting from this send/forward if the message was not accepted.boolean
Returns whether this message was accepted.
-
Field Details
-
ACCEPTED
-
-
Constructor Details
-
Result
This constructor assigns a given error to the member variable such that this result becomes unaccepted with a descriptive error.- Parameters:
error
- The error to assign to this result.
-
Result
This constructor is a convencience function to allow simpler instantiation of a result that contains an error. It does nothing but proxy theResult(Error)
function with a new instance ofError
.- Parameters:
code
- The numerical code of the error.message
- The description of the error.
-
-
Method Details
-
isAccepted
public boolean isAccepted()Returns whether this message was accepted. If it was accepted, a Reply is guaranteed to be produced for this message at some later time. If it was not accepted, getError can be called to investigate why.- Returns:
- true if this message was accepted, false otherwise
-
getError
The error resulting from this send/forward if the message was not accepted.- Returns:
- The error is not accepcted, null if accepted.
-