Class GlobalRequestFuture

    • Constructor Detail

      • GlobalRequestFuture

        public GlobalRequestFuture​(java.lang.String request)
        Creates a new GlobalRequestFuture for a global request. Synchronization occurs on the future itself. The future will be fulfilled once the reply has been received or an error occurred.
        Parameters:
        request - the request identifier
      • GlobalRequestFuture

        public GlobalRequestFuture​(java.lang.String request,
                                   GlobalRequestFuture.ReplyHandler handler)
        Creates a new GlobalRequestFuture for a global request. Synchronization occurs on the future itself. The future will be fulfilled once the request has been sent, or an error occurred during sending. The framework will invoke the handler once the reply has been received. For global requests with want-reply = false, the handler will be invoked with an empty buffer if the request was successfully sent.
        Parameters:
        request - the request identifier
        handler - the GlobalRequestFuture.ReplyHandler, or null
    • Method Detail

      • getSequenceNumber

        public long getSequenceNumber()
        Retrieves this future's packet sequence number.
        Returns:
        the sequence number
      • setSequenceNumber

        public void setSequenceNumber​(long number)
        Sets the packet sequence number of the global request represented by this future.
        Parameters:
        number - the packet sequence number
        Throws:
        java.lang.IllegalArgumentException - if the number given is not an unsigned 32bit value
      • getBuffer

        public Buffer getBuffer()
        Obtains the reply Buffer if the request was successful. If called after DefaultSshFuture.isDone() is true, a non-null result means the request was successful.
        Returns:
        the Buffer, or null if the request was not successful or the reply was not received yet
      • getException

        public java.lang.Throwable getException()
        Retrieves an exception if the request failed. If called after DefaultSshFuture.isDone() is true, a null result means the request did not fail.
        Returns:
        a failure reason, or null if there isn't one or if the request did not fail