Save This Page
Home » j2ssh-0.2.9-src » com.sshtools.j2ssh.transport » [javadoc | source]
com.sshtools.j2ssh.transport
abstract public class: Service [javadoc | source]
java.lang.Object
   com.sshtools.j2ssh.transport.Service

Direct Known Subclasses:
    ConnectionProtocol, AsyncService, AuthenticationProtocolServer, AuthenticationProtocolClient

This class implements the transport protocol service.

After the transport protocol negotiates the protocol version and performs server authentication via key exchange, the client requests a service. The service is identified by a name and currently there are 2 services defined.

ssh-userauth
ssh-connection

These 2 services are implemented by the SSH authentication protocol and SSH connection protocol respectivley. Further services can be defined and a similar local naming policy is applied to the service names, as is applied to the algorithm names; a local service should use the "servicename(at)domain" syntax.

Field Summary
public static final  int REQUESTING_SERVICE    Service start mode passed into init method when the service is operating in client mode. i.e its requesting a service to be started on the remote server and requires a SSH_MSG_SERVICE_ACCEPT message. 
public static final  int ACCEPTING_SERVICE    Serivce start mode passed into init method when the service is operating in server mode. i.e a client is requesting a service to be started on the local computer and requires the SSH_MSG_SERVICE_ACCEPT message to be sent. 
protected  SshMessageStore messageStore    The message store registered with the transport protocol to receive the service's message. 
protected  TransportProtocol transport    The underlying transport protocol 
protected  Integer startMode    This instances start mode 
protected  ServiceState state    The current state of the service 
Constructor:
 public Service(String serviceName) 

    Constructs the service.

    Parameters:
    serviceName - the name of the service
    since: 0.2.0 -
Method from com.sshtools.j2ssh.transport.Service Summary:
getServiceName,   getState,   init,   onServiceAccept,   onServiceInit,   onServiceRequest,   onStart,   sendServiceAccept,   start,   stop
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sshtools.j2ssh.transport.Service Detail:
 public final String getServiceName() 

    Returns the service name.

 public ServiceState getState() 

    Returns the state of the service.

 public  void init(int startMode,
    TransportProtocol transport) throws IOException 

    Initialize the service.

 abstract protected  void onServiceAccept() throws IOException

    Called when the service is accepted by the remote server.

 abstract protected  void onServiceInit(int startMode) throws IOException

    Called when the service is intialized.

 abstract protected  void onServiceRequest() throws IOException
 abstract protected  void onStart() throws IOException

    Called when the service is started.

 protected  void sendServiceAccept() throws IOException 

    Sends the SSH_MSG_SERVICE_ACCEPT message to the client to indicate that the local computer is accepting the remote computers service request.

 public final  void start() throws IOException 

    Starts the service.

 public final  void stop() 

    Stops the service.