public abstract class AbstractAuthMethod extends java.lang.Object implements AuthMethod
AuthMethod implements common or default functionality.| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log
Logger
|
protected AuthParams |
params
AuthParams useful for building request. |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAuthMethod(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected SSHPacket |
buildReq()
Builds a
SSHPacket containing the fields common to all authentication method. |
java.lang.String |
getName() |
void |
handle(Message msg,
SSHPacket buf)
Delegate handling of some SSH packet to this object.
|
void |
init(AuthParams params)
This method must be called before requesting authentication with this method.
|
protected AccountResource |
makeAccountResource() |
void |
request() |
boolean |
shouldRetry() |
protected final org.slf4j.Logger log
protected AuthParams params
AuthParams useful for building request.protected AbstractAuthMethod(java.lang.String name)
name - the name of this authentication method.public java.lang.String getName()
getName in interface AuthMethodpublic void handle(Message msg, SSHPacket buf) throws UserAuthException, TransportException
SSHPacketHandlerhandle in interface SSHPacketHandlermsg - the SSH message identifierbuf - SSHPacket containing rest of the requestUserAuthExceptionTransportExceptionpublic void init(AuthParams params)
AuthMethodinit in interface AuthMethodparams - parameters needed for authenticationpublic void request()
throws UserAuthException,
TransportException
request in interface AuthMethodUserAuthException - if there is an error with the requestTransportException - if there is a transport-related errorpublic boolean shouldRetry()
shouldRetry in interface AuthMethodprotected SSHPacket buildReq() throws UserAuthException
SSHPacket containing the fields common to all authentication method. Method-specific fields can
further be put into this buffer.UserAuthExceptionprotected AccountResource makeAccountResource()