Top Description Fields Constructors Methods
org.apache.sshd.client.future

public Class DefaultAuthFuture

extends DefaultCancellableSshFuture<AuthFuture>
implements AuthFuture
Class Inheritance
All Implemented Interfaces
org.apache.sshd.client.future.AuthFuture, org.apache.sshd.common.future.Cancellable, org.apache.sshd.common.future.WithException, org.apache.sshd.common.future.HasException, org.apache.sshd.common.future.VerifiableFuture, org.apache.sshd.common.future.SshFuture, org.apache.sshd.common.future.WaitableFuture
Imports
java.io.IOException, java.util.concurrent.CancellationException, java.util.concurrent.atomic.AtomicBoolean, org.apache.sshd.common.SshException, org.apache.sshd.common.future.CancelFuture, .CancelOption, .DefaultCancellableSshFuture

A default implementation of AuthFuture.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private AtomicBoolean
private final CancelFuture

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CancelFuture

Returns:

A CancelFuture that can be used to wait until the cancellation has been effected or the AuthFuture has been fulfilled; never null.
cancel
()

Overrides org.apache.sshd.common.future.DefaultCancellableSshFuture.cancel.

Implements org.apache.sshd.common.future.Cancellable.cancel.

Attempts to cancel the operation.

public CancelFuture
public boolean
public boolean
public void
setAuthed(boolean
Authentication success state
authed
)

Implements org.apache.sshd.client.future.AuthFuture.setAuthed.

Notifies that the session has been authenticated.

public void
setCancellable(boolean
whether this future is currently cancellable
cancellable
)

Implements org.apache.sshd.client.future.AuthFuture.setCancellable.

Enables or disables cancellation of this AuthFuture.

public AuthFuture
verify(long
Wait timeout in milliseconds
timeoutMillis
,
CancelOption...
Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
options
)

Implements org.apache.sshd.common.future.VerifiableFuture.verify.

Wait and verify that the operation was successful

public boolean
Inherited from org.apache.sshd.common.future.DefaultCancellableSshFuture:
createCancellationgetExceptionisCanceledsetException

Field Detail

cancellableback to summary
private AtomicBoolean cancellable
cancellationback to summary
private final CancelFuture cancellation

Constructor Detail

DefaultAuthFutureback to summary
public DefaultAuthFuture(Object id, Object lock)

Method Detail

cancelback to summary
public CancelFuture cancel()

Overrides org.apache.sshd.common.future.DefaultCancellableSshFuture.cancel.

Implements org.apache.sshd.common.future.Cancellable.cancel.

Doc from org.apache.sshd.common.future.Cancellable.cancel.

Attempts to cancel the operation. Note that returned CancelFuture may also be fulfilled unsuccessfully (i.e., (isDone() && !isCanceled()) == true.

Returns:CancelFuture

A CancelFuture that can be used to wait until the cancellation has been effected or the AuthFuture has been fulfilled; never null.

Annotations
@Override
getCancellationback to summary
public CancelFuture getCancellation()

Overrides org.apache.sshd.common.future.DefaultCancellableSshFuture.getCancellation.

Implements org.apache.sshd.common.future.Cancellable.getCancellation.

Doc from org.apache.sshd.common.future.Cancellable.getCancellation.

Retrieves the CancelFuture, if cancel() had been called.

Returns:CancelFuture

The CancelFuture if the Cancellable has already been canceled, or null otherwise

Annotations
@Override
isFailureback to summary
public boolean isFailure()

Implements org.apache.sshd.client.future.AuthFuture.isFailure.

Returns:boolean

Doc from org.apache.sshd.client.future.AuthFuture.isFailure.

false if the authentication operation failed

Note

the operation is considered failed if an exception is received instead of a success/fail response code or the operation is in progress. Should check isDone() in order to ensure that the result is valid.

Annotations
@Override
isSuccessback to summary
public boolean isSuccess()

Implements org.apache.sshd.client.future.AuthFuture.isSuccess.

Returns:boolean

Doc from org.apache.sshd.client.future.AuthFuture.isSuccess.

true if the authentication operation is finished successfully

Note

calling this method while the operation is in progress returns false. Should check isDone() in order to ensure that the result is valid.

Annotations
@Override
setAuthedback to summary
public void setAuthed(boolean authed)

Implements org.apache.sshd.client.future.AuthFuture.setAuthed.

Doc from org.apache.sshd.client.future.AuthFuture.setAuthed.

Notifies that the session has been authenticated. This method is invoked by SSHD internally. Please do not call this method directly.

Parameters
authed:boolean

Authentication success state

Annotations
@Override
setCancellableback to summary
public void setCancellable(boolean cancellable)

Implements org.apache.sshd.client.future.AuthFuture.setCancellable.

Doc from org.apache.sshd.client.future.AuthFuture.setCancellable.

Enables or disables cancellation of this AuthFuture.

This is a framework method; do not call directly.

Parameters
cancellable:boolean

whether this future is currently cancellable

Annotations
@Override
verifyback to summary
public AuthFuture verify(long timeoutMillis, CancelOption... options) throws IOException

Implements org.apache.sshd.common.future.VerifiableFuture.verify.

Doc from org.apache.sshd.common.future.VerifiableFuture.verify.

Wait and verify that the operation was successful

Parameters
timeoutMillis:long

Wait timeout in milliseconds

options:CancelOption[]

Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.

Returns:AuthFuture

The (same) future instance

Annotations
@Override
Exceptions
IOException:
If failed to verify successfully on time
wasCanceledback to summary
public boolean wasCanceled()

Implements org.apache.sshd.client.future.AuthFuture.wasCanceled.

Doc from org.apache.sshd.client.future.AuthFuture.wasCanceled.

Tells whether cancel() was called on this AuthFuture.

This is different from isCanceled(). Canceling an on-going authentication may not be possible; cancel() is only a request to cancel the authentication. That request may not be honored and the CancelFuture may actually be isCanceled() == false. AuthFuture.isCanceled() is then false, too.

Returns:boolean

true if cancel() was called, false otherwise

Annotations
@Override