cgl.narada.protocol
Class RtpEventRoutingProtocol

java.lang.Object
  extended by cgl.narada.protocol.RtpEventRoutingProtocol
All Implemented Interfaces:
ProtocolDebugFlags

public class RtpEventRoutingProtocol
extends Object
implements ProtocolDebugFlags

The EventRoutingProtocol is responsible for updating routing information associated with events. The routing information would vary depending on the link over which the event was received. Any given node could be connected to multiple links which have different gateway behavior. The event routing protocol needs to handle every such case.


Field Summary
 
Fields inherited from interface cgl.narada.protocol.ProtocolDebugFlags
BrokerLocatorCommunicator_Debug, ClientConnectionHandler_Debug, Connection_Debug, ConnectionPropagation_Debug, Destinations_Debug, DuplicateDetection_Debug, EventBuffer_Debug, EventRoutingProtocol_Debug, Gateway_Debug, GatewayInfo_Debug, GatewayPropagation_Debug, JmsProfilePropagation_Debug, LinkCostMatrix_Debug, NodeAdditionProtocol_Debug, NodeAddress_Debug, Path_Debug, PersistentEventRouting_Debug, ProfilePropagationProtocol_Debug, ProtocolException_Debug, ProtocolHandler_Debug, ProtocolID_Debug, ProtocolIDFactory_Debug, RoutingCache_Debug, RtpEventRoutingProtocol_Debug, RtpProfilePropagation_Debug, SecureMessageRouting_Debug, TagValueEventRoutingProtocol_Debug, TagValueProfilePropagation_Debug, XmlEventRoutingProtocol_Debug, XPathProfilePropagation_Debug
 
Constructor Summary
RtpEventRoutingProtocol(NodeAddress _nodeAddress)
          This constructor is in place for stand almone testing of the class
RtpEventRoutingProtocol(NodeAddress _nodeAddress, GatewayInfo gatewayInfo, RtpProfilePropagation rtpPropagationProtocol, ClientConnectionHandler clientConnectionHandler, ProtocolHandler protocolHandler)
          The constructor requires both the nodeAdress which it would use to update routing information associated with a certain received event, and also the gatewayInfo which would be used to compute the next most efficient hop
 
Method Summary
 void calculateDestinations(RtpEvent rtpEvent, Destinations toReach)
          This method recursively computes destinations for lower levels.
 void calculateDestinations(RtpEvent rtpEvent, Destinations toReach, int computeForLevel)
          This method recursively computes destinations for lower levels.
static void main(String[] args)
           
 void processEventReceived(byte[] receivedEventBytes)
          This method is responsible for the calculation of destination lists associated with the event.
 void processEventReceivedFromClient(byte[] rtpEventBytes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RtpEventRoutingProtocol

public RtpEventRoutingProtocol(NodeAddress _nodeAddress,
                               GatewayInfo gatewayInfo,
                               RtpProfilePropagation rtpPropagationProtocol,
                               ClientConnectionHandler clientConnectionHandler,
                               ProtocolHandler protocolHandler)
The constructor requires both the nodeAdress which it would use to update routing information associated with a certain received event, and also the gatewayInfo which would be used to compute the next most efficient hop

Parameters:
_nodeAddress - The node address of the node in question.
gatewayInfo - Reference to the connectivity graph hosted at the node
rtpPropagationProtocol - Reference to the RTP profile propagation protocol which would provide uswith destinations at different levels.
clientConnectionHandler - This is useful for routing events to clients within the destination lists that are generated.
protocolHandler - A handle to the protocol Handler

RtpEventRoutingProtocol

public RtpEventRoutingProtocol(NodeAddress _nodeAddress)
This constructor is in place for stand almone testing of the class

Parameters:
_nodeAddress - The node address of the node in question.
Method Detail

processEventReceived

public void processEventReceived(byte[] receivedEventBytes)
This method is responsible for the calculation of destination lists associated with the event. If this node can compute destinations at a certain level it should do so and if it cannot calculate destinations at a certain level, it should defer the calculation of destination lists to the appropriate gateways. The method should be able to deal with both, upward and downward dissemination of events within the system. By upward we mean that the event flows from the client to the server to the cluster gateway and so on.

Parameters:
receivedEventBytes - The event and the event routing information encapsulated within a stream of bytes

processEventReceivedFromClient

public void processEventReceivedFromClient(byte[] rtpEventBytes)

calculateDestinations

public void calculateDestinations(RtpEvent rtpEvent,
                                  Destinations toReach)
This method recursively computes destinations for lower levels. The recursion stops if the node in question is not a gateway at one of the levels (starting from highest levels to succesively lower ones)

Parameters:
rtpEvent - The event for which destinations need to be computed
toReach - The destinations that need to be reached

calculateDestinations

public void calculateDestinations(RtpEvent rtpEvent,
                                  Destinations toReach,
                                  int computeForLevel)
This method recursively computes destinations for lower levels. The recursion stops if the node in question is not a gateway at one of the levels (starting from highest levels to succesively lower ones)

Parameters:
rtpEvent - The event for which destinations need to be computed
toReach - The destinations that need to be reached

main

public static void main(String[] args)


For comments and suggestions please send e-mail to The NaradaBrokering Project