public class GlobalRequestFuture extends DefaultSshFuture<GlobalRequestFuture> implements HasException, SshFutureListener<IoWriteFuture>
DefaultSshFuture that can be used to wait for the reply of an SSH_MSG_GLOBAL_REQUEST sent with
want-reply = true.org.apache.sshd.common.session.Session#request(Buffer, String, ReplyHandler)| Modifier and Type | Class and Description |
|---|---|
static interface |
GlobalRequestFuture.ReplyHandler
A
ReplyHandler is invoked asynchronously when the reply for a request with want-reply = true is
received. |
log| Constructor and Description |
|---|
GlobalRequestFuture(String request)
Creates a new
GlobalRequestFuture for a global request. |
GlobalRequestFuture(String request,
GlobalRequestFuture.ReplyHandler handler)
Creates a new
GlobalRequestFuture for a global request. |
| Modifier and Type | Method and Description |
|---|---|
Buffer |
getBuffer()
Obtains the reply
Buffer if the request was successful. |
Throwable |
getException()
Retrieves an exception if the request failed.
|
GlobalRequestFuture.ReplyHandler |
getHandler()
Retrieves the
GlobalRequestFuture.ReplyHandler of this future, if any. |
String |
getId() |
long |
getSequenceNumber()
Retrieves this future's packet sequence number.
|
void |
operationComplete(IoWriteFuture future) |
void |
setSequenceNumber(long number)
Sets the packet sequence number of the global request represented by this future.
|
String |
toString() |
addListener, await0, createCancellation, getNumRegisteredListeners, getValue, isDone, notifyListeners, onValueSet, removeListener, setValueasListener, asT, await, awaitUninterruptibly, formatExceptionMessage, notifyListener, verifyResultdebug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitvalidateListenerawait, await, await, await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptiblypublic GlobalRequestFuture(String request)
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.request - the request identifierpublic GlobalRequestFuture(String request, GlobalRequestFuture.ReplyHandler handler)
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.request - the request identifierhandler - the GlobalRequestFuture.ReplyHandler, or nullpublic String getId()
getId in interface WaitableFuturegetId in class AbstractSshFuture<GlobalRequestFuture>public long getSequenceNumber()
public void setSequenceNumber(long number)
number - the packet sequence numberIllegalArgumentException - if the number given is not an unsigned 32bit valuepublic GlobalRequestFuture.ReplyHandler getHandler()
GlobalRequestFuture.ReplyHandler of this future, if any.null if none was setpublic Buffer getBuffer()
Buffer if the request was successful. If called after DefaultSshFuture.isDone() is
true, a non-null result means the request was successful.Buffer, or null if the request was not successful or the reply was not received yetpublic Throwable getException()
DefaultSshFuture.isDone() is true, a
null result means the request did not fail.getException in interface HasExceptionnull if there isn't one or if the request did not failpublic void operationComplete(IoWriteFuture future)
operationComplete in interface SshFutureListener<IoWriteFuture>public String toString()
toString in class DefaultSshFuture<GlobalRequestFuture>Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.