|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 |
public void registerMessage(java.lang.Integer messageId, java.lang.Class implementor, SshMessageStore store) throws MessageAlreadyRegisteredException
messageId
- The id of the message being
registeredimplementor
- The class of the message
implementation.store
- The message store to route
the object to
MessageAlreadyRegisteredException
- Thrown if the message id is
already registeredpublic void unregisterMessage(java.lang.Integer messageId, SshMessageStore store) throws MessageNotRegisteredException
messageId
- The id of the message to
unregisterstore
- The message store currently
receiving notification
MessageNotRegisteredException
- Thrown if the message is not
registeredpublic void sendMessage(SshMessage ms, java.lang.Object sender) throws TransportProtocolException
ms
- The message to sendsender
- The sender of the message
TransportProtocolException
- Thrown if an error occurspublic void disconnect(java.lang.String description)
description
- A description of why the disconnect is occuringpublic void setServiceThread(Service service)
service
- The new serviceThread valuepublic void removeServiceThread(Service service)
service
- Description of the Parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |