Class AsciiProtocolHandler.AsciiReply

  • All Implemented Interfaces:
    Reply
    Enclosing class:
    AsciiProtocolHandler

    protected class AsciiProtocolHandler.AsciiReply
    extends java.lang.Object
    implements Reply
    This class represents a Broker reply to a client request.
    • Constructor Summary

      Constructors 
      Constructor Description
      AsciiReply​(byte[] reply, int off, int len)
      Constructs a Broker reply from the bytes read from the Broker.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getError()
      Returns the reply's error number if this reply is an error.
      int getEventDeliveryCount()
      Returns the delivery count if the reply is an event.
      long getEventSequenceNumber()
      Returns the sequence number if the reply is an event.
      WmMessageImpl getMessage()
      Get the reply's message.
      int getMessageCount()
      Get the reply count, typically in reply to a multi-get event request.
      int[] getMessageSubscriptionIDs()
      Returns the reply's message subscription IDs if this reply is a message.
      java.lang.String getReplyString()
      Returns the reply's text.
      int getRequestID()
      Get the request ID to which this reply belongs.
      int getSessionID()
      Get the session ID to which this reply belongs.
      int getSize()
      Get the size of any additional data, typically the size of the event.
      int getType()
      Get the reply type.
      void setData​(byte[] data, int off, int len)
      Sets additional data belonging to a Broker reply.
      java.lang.String toString()
      Returns a string representation of this object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AsciiReply

        public AsciiReply​(byte[] reply,
                          int off,
                          int len)
                   throws javax.jms.JMSException
        Constructs a Broker reply from the bytes read from the Broker.
        Parameters:
        reply - the Broker reply bytes
        off - the start of the Broker reply
        len - the length of the Broker reply
        Throws:
        javax.jms.JMSException - if the reply could not be parsed
    • Method Detail

      • getType

        public int getType()
        Get the reply type.
        Specified by:
        getType in interface Reply
        Returns:
        the reply type
      • setData

        public void setData​(byte[] data,
                            int off,
                            int len)
        Sets additional data belonging to a Broker reply. This is typically event data.
        Parameters:
        data - additional data belonging to a Broker reply
        off - the start of the additional data
        len - the length of the additional data
      • getSize

        public int getSize()
        Get the size of any additional data, typically the size of the event.
        Returns:
        the size of any additional data
      • getMessage

        public WmMessageImpl getMessage()
        Get the reply's message.
        Specified by:
        getMessage in interface Reply
        Returns:
        the reply's message
      • getMessageCount

        public int getMessageCount()
        Get the reply count, typically in reply to a multi-get event request.
        Specified by:
        getMessageCount in interface Reply
        Returns:
        the reply count
      • getMessageSubscriptionIDs

        public int[] getMessageSubscriptionIDs()
        Returns the reply's message subscription IDs if this reply is a message.
        Returns:
        the reply's message subscription IDs
      • getSessionID

        public int getSessionID()
        Get the session ID to which this reply belongs.
        Specified by:
        getSessionID in interface Reply
        Returns:
        the session ID to which this reply belongs
      • getRequestID

        public int getRequestID()
        Get the request ID to which this reply belongs.
        Specified by:
        getRequestID in interface Reply
        Returns:
        the request ID to which this reply belongs
      • getError

        public int getError()
        Returns the reply's error number if this reply is an error.
        Specified by:
        getError in interface Reply
        Returns:
        the reply's error number
      • getReplyString

        public java.lang.String getReplyString()
        Returns the reply's text.
        Returns:
        the reply's text
      • getEventSequenceNumber

        public long getEventSequenceNumber()
        Returns the sequence number if the reply is an event.
        Returns:
        the sequence number if the reply is an event
      • getEventDeliveryCount

        public int getEventDeliveryCount()
        Returns the delivery count if the reply is an event.
        Returns:
        the delivery count if the reply is an event
      • toString

        public java.lang.String toString()
        Returns a string representation of this object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representatio of this object