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 AuthMethod
public void handle(Message msg, SSHPacket buf) throws UserAuthException, TransportException
SSHPacketHandler
handle
in interface SSHPacketHandler
msg
- the SSH message identifier
buf
- SSHPacket
containing rest of the requestUserAuthException
TransportException
public void init(AuthParams params)
AuthMethod
init
in interface AuthMethod
params
- parameters needed for authenticationpublic void request() throws UserAuthException, TransportException
request
in interface AuthMethod
UserAuthException
- if there is an error with the requestTransportException
- if there is a transport-related errorpublic boolean shouldRetry()
shouldRetry
in interface AuthMethod
protected SSHPacket buildReq() throws UserAuthException
SSHPacket
containing the fields common to all authentication method. Method-specific fields can
further be put into this buffer.UserAuthException
protected AccountResource makeAccountResource()