Package org.apache.sshd.client.auth
Class AbstractUserAuth
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.client.auth.AbstractUserAuth
- All Implemented Interfaces:
UserAuth
,ClientSessionHolder
,UserAuthInstance<ClientSession>
,NamedResource
- Direct Known Subclasses:
UserAuthHostBased
,UserAuthKeyboardInteractive
,UserAuthPassword
,UserAuthPublicKey
- Author:
- Apache MINA SSHD Project
-
Field Summary
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Called to release any allocated resourcesfinal String
getName()
void
init
(ClientSession session, String service) boolean
Tells whether the authentication protocol is cancellable currently.boolean
protected abstract boolean
processAuthDataRequest
(ClientSession session, String service, Buffer buffer) protected abstract boolean
sendAuthDataRequest
(ClientSession session, String service) protected void
setCancellable
(boolean cancellable) Sets whether the authentication protocol is currently cancellable.toString()
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.sshd.client.auth.UserAuth
signalAuthMethodFailure, signalAuthMethodSuccess
-
Constructor Details
-
AbstractUserAuth
-
-
Method Details
-
getClientSession
- Specified by:
getClientSession
in interfaceClientSessionHolder
- Returns:
- The underlying
ClientSession
used
-
getSession
- Specified by:
getSession
in interfaceUserAuthInstance<ClientSession>
-
getName
- Specified by:
getName
in interfaceNamedResource
-
getService
-
isCancellable
public boolean isCancellable()Description copied from interface:UserAuth
Tells whether the authentication protocol is cancellable currently.- Specified by:
isCancellable
in interfaceUserAuth
- Returns:
true
if the protocol can be canceled at its current state;false
if not.
-
setCancellable
protected void setCancellable(boolean cancellable) Sets whether the authentication protocol is currently cancellable.- Parameters:
cancellable
-true
if the protocol may be canceled in its current state;false
if not
-
init
- Specified by:
init
in interfaceUserAuth
- Parameters:
session
- TheClientSession
service
- The requesting service name- Throws:
Exception
- If failed to initialize the mechanism
-
process
- Specified by:
process
in interfaceUserAuth
- Parameters:
buffer
- TheBuffer
to process -null
if not a response buffer, i.e., the underlying authentication mechanism should initiate whatever challenge/response mechanism is required- Returns:
true
if request handled -false
if the next authentication mechanism should be used- Throws:
Exception
- If failed to process the request
-
sendAuthDataRequest
protected abstract boolean sendAuthDataRequest(ClientSession session, String service) throws Exception - Throws:
Exception
-
processAuthDataRequest
protected abstract boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception - Throws:
Exception
-
destroy
public void destroy()Description copied from interface:UserAuth
Called to release any allocated resources -
toString
-