Class Result


  • public class Result
    extends Object

    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 Detail

      • ACCEPTED

        public static final Result ACCEPTED
    • Constructor Detail

      • Result

        public Result​(Error error)
        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

        public Result​(int code,
                      String message)
        This constructor is a convencience function to allow simpler instantiation of a result that contains an error. It does nothing but proxy the Result(Error) function with a new instance of Error.
        Parameters:
        code - The numerical code of the error.
        message - The description of the error.
    • Method Detail

      • 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

        public Error getError()
        The error resulting from this send/forward if the message was not accepted.
        Returns:
        The error is not accepcted, null if accepted.