|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator<C,U>
C - the type of connection.U - the user to authenticate.public abstract class SSHAuthenticator<C,U extends SSHUser>
Abstraction for something that can authenticate an SSH connection.
| Constructor Summary | |
|---|---|
protected |
SSHAuthenticator(C connection,
U user)
Constructor. |
| Method Summary | ||
|---|---|---|
boolean |
authenticate()
Authenticate the bound connection using the supplied credentials. |
|
boolean |
canAuthenticate()
Returns true if the bound connection is in a state where authentication can be tried using the
supplied credentials. |
|
protected abstract boolean |
doAuthenticate()
SPI for authenticating the bound connection using the supplied credentials. |
|
static java.util.List<? extends SSHUser> |
filter(java.lang.Iterable<? extends com.cloudbees.plugins.credentials.Credentials> credentials,
java.lang.Class<?> connectionClass)
Filters Credentials returning only those which are supported with the specified type of connection. |
|
protected C |
getConnection()
Gets the bound connection. |
|
U |
getUser()
Gets the supplied credentials. |
|
boolean |
isAuthenticated()
Returns true if the bound connection has been authenticated. |
|
static
|
isSupported(java.lang.Class<C> connectionClass,
java.lang.Class<U> userClass)
Returns true if and only if the supplied connection class and user class are supported by at least one
factory. |
|
static
|
newInstance(C connection,
U user)
Creates an authenticator that may be able to authenticate the supplied connection with the supplied user. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SSHAuthenticator(@NonNull
C connection,
@NonNull
U user)
connection - the connection we will be authenticating.| Method Detail |
|---|
@NonNull
public static <C,U extends SSHUser> SSHAuthenticator<C,U> newInstance(@NonNull
C connection,
@NonNull
U user)
C - the type of connection.U - the type of user.connection - the connection to authenticate on.user - the user to authenticate with.
SSHAuthenticator that may or may not be able to successfully authenticate.
public static <C,U extends SSHUser> boolean isSupported(@NonNull
java.lang.Class<C> connectionClass,
@NonNull
java.lang.Class<U> userClass)
true if and only if the supplied connection class and user class are supported by at least one
factory.
C - the type of connection.U - the type of user.connectionClass - the connection class.userClass - the user class.
true if and only if the supplied connection class and user class are supported by at least one
factory.
public static java.util.List<? extends SSHUser> filter(java.lang.Iterable<? extends com.cloudbees.plugins.credentials.Credentials> credentials,
java.lang.Class<?> connectionClass)
Credentials returning only those which are supported with the specified type of connection.
credentials - the credentials to filter.connectionClass - the type of connection to filter for.
SSHUser credentials appropriate for use with the supplied type of connection.public boolean canAuthenticate()
true if the bound connection is in a state where authentication can be tried using the
supplied credentials.
Subclasses can override this if they can tell whether it is possible to make an authentication attempt, default
implementation is one-shot always.
true if the bound connection is in a state where authentication can be tried using the
supplied credentials.public final boolean isAuthenticated()
true if the bound connection has been authenticated.
true if the bound connection has been authenticated.@NonNull protected final C getConnection()
@NonNull public U getUser()
protected abstract boolean doAuthenticate()
true if and only if authentication was successful.public final boolean authenticate()
true if and only if authentication was successful.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||