Class AuthenticationProtocolServer
- java.lang.Object
-
- com.sshtools.j2ssh.transport.Service
-
- com.sshtools.j2ssh.transport.AsyncService
-
- com.sshtools.daemon.authentication.AuthenticationProtocolServer
-
- All Implemented Interfaces:
java.lang.Runnable
public class AuthenticationProtocolServer extends AsyncService
- Version:
- $Revision: 1.11 $
- Author:
- $author$
-
-
Field Summary
-
Fields inherited from class com.sshtools.j2ssh.transport.AsyncService
thread
-
Fields inherited from class com.sshtools.j2ssh.transport.Service
ACCEPTING_SERVICE, messageStore, REQUESTING_SERVICE, startMode, state, transport
-
-
Constructor Summary
Constructors Constructor Description AuthenticationProtocolServer()Creates a new AuthenticationProtocolServer object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptService(Service service)protected int[]getAsyncMessageFilter()Implement this method by returning the message ids of the asyncrounous messages your implementation wants to receive.TransportProtocolStategetConnectionState()byte[]getSessionIdentifier()protected voidonMessageReceived(SshMessage msg)Called by the service thread when an asyncronous message is received.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 voidonStop()The service thread calls this method when the thread is exiting.SshMessagereadMessage()voidregisterMessage(int messageId, java.lang.Class cls)voidsendMessage(SshMessage msg)-
Methods inherited from class com.sshtools.j2ssh.transport.AsyncService
onStart, run
-
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
-
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.IOException
-
getSessionIdentifier
public byte[] getSessionIdentifier()
- Returns:
-
getConnectionState
public TransportProtocolState getConnectionState()
- Returns:
-
sendMessage
public void sendMessage(SshMessage msg) throws java.io.IOException
- Parameters:
msg-- Throws:
java.io.IOException
-
readMessage
public SshMessage readMessage() throws java.io.IOException
- Returns:
- Throws:
java.io.IOExceptionSshException
-
registerMessage
public void registerMessage(int messageId, java.lang.Class cls)- Parameters:
messageId-cls-
-
onServiceRequest
protected void onServiceRequest() throws java.io.IOException- Specified by:
onServiceRequestin classService- Throws:
java.io.IOExceptionAuthenticationProtocolException
-
onMessageReceived
protected void onMessageReceived(SshMessage msg) throws java.io.IOException
Description copied from class:AsyncServiceCalled by the service thread when an asyncronous message is received.
- Specified by:
onMessageReceivedin classAsyncService- Parameters:
msg-- Throws:
java.io.IOExceptionAuthenticationProtocolException
-
getAsyncMessageFilter
protected int[] getAsyncMessageFilter()
Description copied from class:AsyncServiceImplement this method by returning the message ids of the asyncrounous messages your implementation wants to receive.
- Specified by:
getAsyncMessageFilterin classAsyncService- Returns:
-
acceptService
public void acceptService(Service service)
- Parameters:
service-
-
onStop
protected void onStop()
Description copied from class:AsyncServiceThe service thread calls this method when the thread is exiting.
- Specified by:
onStopin classAsyncService
-
-