Package net.schmizz.sshj.userauth.method
Class AbstractAuthMethod
java.lang.Object
net.schmizz.sshj.userauth.method.AbstractAuthMethod
- All Implemented Interfaces:
SSHPacketHandler,AuthMethod
- Direct Known Subclasses:
AuthGssApiWithMic,AuthKeyboardInteractive,AuthNone,AuthPassword,KeyedAuthMethod
This abstract class for
AuthMethod implements common or default functionality.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.slf4j.LoggerLoggerprivate final Stringprotected AuthParamsAuthParamsuseful for building request. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SSHPacketbuildReq()Builds aSSHPacketcontaining the fields common to all authentication method.getName()voidDelegate handling of some SSH packet to this object.voidinit(AuthParams params) This method must be called before requesting authentication with this method.protected AccountResourcevoidrequest()voidsetLoggerFactory(LoggerFactory loggerFactory) boolean
-
Field Details
-
log
protected org.slf4j.Logger logLogger -
name
-
params
AuthParamsuseful for building request.
-
-
Constructor Details
-
AbstractAuthMethod
- Parameters:
name- thenameof this authentication method.
-
-
Method Details
-
setLoggerFactory
- Specified by:
setLoggerFactoryin interfaceAuthMethod
-
getName
- Specified by:
getNamein interfaceAuthMethod- Returns:
- assigned name of this authentication method
-
handle
Description copied from interface:SSHPacketHandlerDelegate handling of some SSH packet to this object.- Specified by:
handlein interfaceSSHPacketHandler- Parameters:
msg- the SSHmessage identifierbuf-SSHPacketcontaining rest of the request- Throws:
UserAuthExceptionTransportException
-
init
Description copied from interface:AuthMethodThis method must be called before requesting authentication with this method.- Specified by:
initin interfaceAuthMethod- Parameters:
params- parameters needed for authentication
-
request
- Specified by:
requestin interfaceAuthMethod- Throws:
UserAuthException- if there is an error with the requestTransportException- if there is a transport-related error
-
shouldRetry
public boolean shouldRetry()- Specified by:
shouldRetryin interfaceAuthMethod- Returns:
- whether authentication should be reattempted if it failed.
-
buildReq
Builds aSSHPacketcontaining the fields common to all authentication method. Method-specific fields can further be put into this buffer.- Throws:
UserAuthException
-
makeAccountResource
-