public class UserAuthImpl extends AbstractService implements UserAuth
UserAuth implementation.ErrorNotifiable.Utillog, 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, requestpublic UserAuthImpl(Transport trans)
public boolean authenticate(java.lang.String username,
Service nextService,
AuthMethod method,
int timeoutMs)
throws UserAuthException,
TransportException
UserAuthusername 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 UserAuthusername - 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()
UserAuthpublic boolean hadPartialSuccess()
hadPartialSuccess in interface UserAuthtrue if at least one of the method supplied succeeded.public java.lang.Iterable<java.lang.String> getAllowedMethods()
UserAuthgetAllowedMethods in interface UserAuthpublic void handle(Message msg, SSHPacket buf) throws SSHException
SSHPacketHandlerhandle in interface SSHPacketHandlerhandle in class AbstractServicemsg - the SSH message identifierbuf - SSHPacket containing rest of the requestSSHException - if there is a non-recoverable errorpublic void notifyError(SSHException error)
ErrorNotifiableerror.notifyError in interface ErrorNotifiablenotifyError in class AbstractService