Package g4ds :: Module messagehandler :: Class GlobalOutoingMessageHandler
[show private | hide private]
[frames | no frames]

Class GlobalOutoingMessageHandler


Handler for outgoing messages.

Two kinds of messages are distinguished; namely service messages and control messages. Service messages are messages traveling from the connected service (application) on this node to the same service on another node. Control message, however, are G4DS internal message for the purposes of configuring the G4DS parameters and keep data up-to-date on all sides.

Both kinds of messages service and control are finally wrapped into G4DS messages.

If you want to send a service message, use sendServiceMessage.

If you want to send a control message, use sendControlMessage.

sendG4dsMessage should normally not be used from the outside, it is used from the above two functions instead.
Method Summary
  __init__(self)
Yet empty Constructor.
String sendControlMessage(self, endpointid, subsystemid, subsystemname, message, refid)
Assembles a G4DS control message with the given content and sends it off.
String sendG4dsMessage(self, endpointid, message, refid)
Send a message using the given protocol.
String sendServiceMessage(self, endpointid, serviceid, servicename, message, refid)
Assembles a G4DS service message with the given content and sends it off.

Method Details

__init__(self)
(Constructor)

Yet empty Constructor.

sendControlMessage(self, endpointid, subsystemid, subsystemname, message, refid=None)

Assembles a G4DS control message with the given content and sends it off.

In fact, the messagewrapper.MessageWrapper is used for wrapping the given message into a valid G4DS service message. Afterwards, the message is passed on to the function sendG4dsMessage for final delivery.
Parameters:
endpointid - Id of the Endpoint for this message. Passed to sendG4dsMessage
           (type=String)
subsystemid - The id of the control sub system for this message
           (type=String)
subsystemname - The name of the control sub system used for this message
           (type=String)
message - The message itself (as passed from the control handler)
           (type=String)
refid - An id of a previous message which shall be referenced here - passed on to sendG4dsMessage
           (type=String)
Returns:
Return value of sendG4dsMessage - should be the message id of the sent message
           (type=String)

sendG4dsMessage(self, endpointid, message, refid=None)

Send a message using the given protocol.

The message is encyrpted first of all using the algorithm with the requested id. (In fact, for this matter the message is passed to the private function _handleSigningAndEncryption, which will thereupon pass the request to the SecurityController and return the result. The encrypted result is wrapped into a valid G4DS message using the messagewrapper.MessageWrapper.wrapG4dsMessage function. Finally, the result is passed to the routing engine, which will send it off using the requested protocol.
Parameters:
endpointid - Id of the endpoint for this message.
           (type=String)
message - Message to be send via G4DS. Should "actually" be a service or control message
           (type=String (XML))
refid - An id of a previous message which shall be referenced here
           (type=String)
Returns:
ID of the message
           (type=String)

sendServiceMessage(self, endpointid, serviceid, servicename, message, refid=None)

Assembles a G4DS service message with the given content and sends it off.

In fact, the messagewrapper.MessageWrapper is used for wrapping the given message into a valid G4DS control message. Afterwards, the message is passed on to the function sendG4dsMessage for final delivery.
Parameters:
endpointid - Id of the Endpoint for this message. Passed to sendG4dsMessage
           (type=String)
serviceid - The G4DS wide unique identifier of the service for this message
           (type=String)
servicename - The name of the service used for this message
           (type=String)
message - The message itself (as passed from the service). May (but does does not necessarily need to be in XML format. Other format are processed too
           (type=String)
refid - An id of a previous message which shall be referenced here - passed on to sendG4dsMessage
           (type=String)
Returns:
Return value of sendG4dsMessage - should be the message id of the sent message
           (type=String)

Generated by Epydoc 2.0 on Sat Oct 22 22:52:47 2005 http://epydoc.sf.net