Class NetarkivetMessage

    • Field Detail

      • replyOfId

        protected String replyOfId
    • Constructor Detail

      • NetarkivetMessage

        protected NetarkivetMessage​(ChannelID to,
                                    ChannelID replyTo)
        Creates a new NetarkivetMessage.
        Parameters:
        to - the initial receiver of the message
        replyTo - the initial sender of the message
        Throws:
        ArgumentNotValid - if to==replyTo, the replyTo parameter is a topic instead of a queue, or there is a null parameter.
    • Method Detail

      • isOk

        public boolean isOk()
        Did an error occur when processing the message.
        Returns:
        true if no error occurred, otherwise false
      • setNotOk

        public void setNotOk​(String err)
        Set or append error message. Sets isOk field to false.
        Parameters:
        err - error message
      • setNotOk

        public void setNotOk​(Throwable e)
        Set error message based on an exception.
        Parameters:
        e - An exception thrown during processing.
      • getID

        public String getID()
        Retrieve message id. Note that message ID is not set until message is sent, and this method must not be called before then.
        Returns:
        message id
        Throws:
        PermissionDenied - If the message has not yet been sent.
      • getReplyOfId

        public String getReplyOfId()
        Retrieve replyOfId. This is set by subclasses of NetarkivetMessage, to indicate that this is a reply of some other message. If the subclass doesn't set replyOfId, this method behaves like getId.
        Returns:
        replyOfId
      • getTo

        public ChannelID getTo()
        Retrieve initial destination.
        Returns:
        initial destination
      • getReplyTo

        public ChannelID getReplyTo()
        Retrieve specified reply channel.
        Returns:
        initial origin
      • toString

        public String toString()
        Returns a string containing: : To ReplyTo [:error message].
        Overrides:
        toString in class Object
        Returns:
        String representation of Message.
      • hasBeenSent

        public boolean hasBeenSent()
        Check, if a given message has been sent yet. If the message has a null id, it hasn't been sent yet.
        Returns:
        true, if message has been sent yet, false otherwise.