com.sshtools.j2ssh.transport
Interface TransportProtocol

All Known Implementing Classes:
TransportProtocolCommon

public interface TransportProtocol

This interface provides external access to messaging services supplied by the SSH API.

When a party wants to receive an incoming message it simply registers its interest with the transport protocol through registerMessage(). Messages are then routed to the synchronized message store object supplied during registration where any waiting threads are notified. This framework for message routing is implemented by the abstract Service class.

Messages should be unregistered by services especially if the service is temporary, such as Authenticaiton services. Messages are sent through the transport layer by using sendMessage(). This requires an additional identification object (typically passed as 'this') so that the transport layer can filter messages whilst in key exchange. (only transport protocol messages are valid during the key exchange process.

Version:
1.0
Author:
Lee David Painter ( lee@sshtools.com )

Method Summary
 void disconnect(java.lang.String description)
          Closes the connection
 void registerMessage(java.lang.Integer messageId, java.lang.Class implementor, SshMessageStore store)
          Registers a message id with the transport layer
 void removeServiceThread(Service service)
          Description of the Method
 void sendMessage(SshMessage ms, java.lang.Object sender)
          Sends an Message
 void setServiceThread(Service service)
          Sets the serviceThread attribute of the TransportProtocol object
 void unregisterMessage(java.lang.Integer messageId, SshMessageStore store)
          Unregisters a message from the transport layer
 

Method Detail

registerMessage

public void registerMessage(java.lang.Integer messageId,
                            java.lang.Class implementor,
                            SshMessageStore store)
                     throws MessageAlreadyRegisteredException
Registers a message id with the transport layer

Parameters:
messageId - The id of the message being registered
implementor - The class of the message implementation.
store - The message store to route the object to
Throws:
MessageAlreadyRegisteredException - Thrown if the message id is already registered

unregisterMessage

public void unregisterMessage(java.lang.Integer messageId,
                              SshMessageStore store)
                       throws MessageNotRegisteredException
Unregisters a message from the transport layer

Parameters:
messageId - The id of the message to unregister
store - The message store currently receiving notification
Throws:
MessageNotRegisteredException - Thrown if the message is not registered

sendMessage

public void sendMessage(SshMessage ms,
                        java.lang.Object sender)
                 throws TransportProtocolException
Sends an Message

Parameters:
ms - The message to send
sender - The sender of the message
Throws:
TransportProtocolException - Thrown if an error occurs

disconnect

public void disconnect(java.lang.String description)
Closes the connection

Parameters:
description - A description of why the disconnect is occuring

setServiceThread

public void setServiceThread(Service service)
Sets the serviceThread attribute of the TransportProtocol object

Parameters:
service - The new serviceThread value

removeServiceThread

public void removeServiceThread(Service service)
Description of the Method

Parameters:
service - Description of the Parameter


Copyright © 2002 Sshtools.com. All Rights Reserved.