Class AuthenticationProtocolClient
- java.lang.Object
-
- com.sshtools.j2ssh.transport.Service
-
- com.sshtools.j2ssh.authentication.AuthenticationProtocolClient
-
public class AuthenticationProtocolClient extends Service
- Version:
- $Revision: 1.27 $
- Author:
- $author$
-
-
Field Summary
-
Fields inherited from class com.sshtools.j2ssh.transport.Service
ACCEPTING_SERVICE, messageStore, REQUESTING_SERVICE, startMode, state, transport
-
-
Constructor Summary
Constructors Constructor Description AuthenticationProtocolClient()Creates a new AuthenticationProtocolClient object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventListener(AuthenticationProtocolListener listener)intauthenticate(SshAuthenticationClient auth, Service serviceToStart)java.util.ListgetAvailableAuths(java.lang.String username, java.lang.String serviceName)java.lang.StringgetBannerMessage(int timeout)byte[]getSessionIdentifier()protected voidonServiceAccept()Called when the service is accepted by the remote server.protected voidonServiceInit(int startMode)Called when the service is intialized.protected voidonServiceRequest()protected voidonStart()Called when the service is started.voidreadAuthenticationState()SshMessagereadMessage(int messageId)SshMessagereadMessage(int[] messageId)voidregisterMessage(java.lang.Class cls, int messageId)voidsendMessage(SshMessage msg)-
Methods inherited from class com.sshtools.j2ssh.transport.Service
getServiceName, getState, init, sendServiceAccept, start, stop
-
-
-
-
Method Detail
-
onServiceAccept
protected void onServiceAccept() throws java.io.IOExceptionDescription copied from class:ServiceCalled when the service is accepted by the remote server.
- Specified by:
onServiceAcceptin classService- Throws:
java.io.IOException
-
onStart
protected void onStart()
Description copied from class:ServiceCalled when the service is started.
-
onServiceInit
protected void onServiceInit(int startMode) throws java.io.IOExceptionDescription copied from class:ServiceCalled when the service is intialized.
- Specified by:
onServiceInitin classService- Parameters:
startMode-- Throws:
java.io.IOExceptionjava.io.IOException
-
onServiceRequest
protected void onServiceRequest() throws java.io.IOException- Specified by:
onServiceRequestin classService- Throws:
java.io.IOExceptionjava.io.IOException
-
addEventListener
public void addEventListener(AuthenticationProtocolListener listener)
- Parameters:
listener-
-
getAvailableAuths
public java.util.List getAvailableAuths(java.lang.String username, java.lang.String serviceName) throws java.io.IOException- Parameters:
username-serviceName-- Returns:
- Throws:
java.io.IOExceptionSshException
-
authenticate
public int authenticate(SshAuthenticationClient auth, Service serviceToStart) throws java.io.IOException
- Parameters:
auth-serviceToStart-- Returns:
- Throws:
java.io.IOExceptionSshException
-
sendMessage
public void sendMessage(SshMessage msg) throws java.io.IOException
- Parameters:
msg-- Throws:
java.io.IOException
-
getSessionIdentifier
public byte[] getSessionIdentifier()
- Returns:
-
registerMessage
public void registerMessage(java.lang.Class cls, int messageId)- Parameters:
cls-messageId-
-
readMessage
public SshMessage readMessage(int messageId) throws TerminatedStateException, java.io.IOException
- Parameters:
messageId-- Returns:
- Throws:
TerminatedStateExceptionjava.io.IOException
-
readMessage
public SshMessage readMessage(int[] messageId) throws TerminatedStateException, java.io.IOException
- Parameters:
messageId-- Returns:
- Throws:
TerminatedStateExceptionjava.io.IOException
-
readAuthenticationState
public void readAuthenticationState() throws java.io.IOException, TerminatedStateException- Throws:
java.io.IOExceptionTerminatedStateException
-
getBannerMessage
public java.lang.String getBannerMessage(int timeout) throws java.io.IOException- Parameters:
timeout-- Returns:
- Throws:
java.io.IOExceptionSshException
-
-