public class UserAuthImpl extends AbstractService implements UserAuth
UserAuth
implementation.ErrorNotifiable.Util
log, name, trans
Constructor and Description |
---|
UserAuthImpl(Transport trans) |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(java.lang.String username,
Service nextService,
AuthMethod method,
int timeoutMs)
Attempt to authenticate
username using each of methods in order. |
java.lang.Iterable<java.lang.String> |
getAllowedMethods()
The available authentication methods.
|
java.lang.String |
getBanner()
Returns the authentication banner (if any).
|
boolean |
hadPartialSuccess() |
void |
handle(Message msg,
SSHPacket buf)
Delegate handling of some SSH packet to this object.
|
void |
notifyError(SSHException error)
Notifies this object of an
error . |
getName, notifyUnimplemented, request
public UserAuthImpl(Transport trans)
public boolean authenticate(java.lang.String username, Service nextService, AuthMethod method, int timeoutMs) throws UserAuthException, TransportException
UserAuth
username
using each of methods
in order. nextService
is the
Service
that will be enabled on successful authentication.
Authentication fails if there are no method available, i.e. if all the method failed or there were method
available but could not be attempted because the server did not allow them.
Further attempts may also be made by catching UserAuthException
and retrying with this method.authenticate
in interface UserAuth
username
- the user to authenticatenextService
- the service to set on successful authenticationmethod
- the AuthMethod
's to tryUserAuthException
- in case of authentication failureTransportException
- if there was a transport-layer errorpublic java.lang.String getBanner()
UserAuth
public boolean hadPartialSuccess()
hadPartialSuccess
in interface UserAuth
true
if at least one of the method supplied succeeded.public java.lang.Iterable<java.lang.String> getAllowedMethods()
UserAuth
getAllowedMethods
in interface UserAuth
public void handle(Message msg, SSHPacket buf) throws SSHException
SSHPacketHandler
handle
in interface SSHPacketHandler
handle
in class AbstractService
msg
- the SSH message identifier
buf
- SSHPacket
containing rest of the requestSSHException
- if there is a non-recoverable errorpublic void notifyError(SSHException error)
ErrorNotifiable
error
.notifyError
in interface ErrorNotifiable
notifyError
in class AbstractService