cgl.narada.protocol
Class TagValueProfilePropagation

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

public class TagValueProfilePropagation
extends Object
implements ProtocolDebugFlags

This determines if a profile change needs to be propagated to a higher level node, and is responsible for doing so. In addition, a node could be gateway at multiple levels. Depending on the level for which profile changes have taken place, the propagation needs to be done accordingly.


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
TagValueProfilePropagation(GatewayInfo gatewayInfo, ProtocolHandler protocolHandler)
           
 
Method Summary
 Hashtable computeClientDestinations(MEvent mEvent)
           
 int computeDestinationsAtLevel(MEvent mEvent, int level)
          This method is called only if the isGatewayAtLevel returns true.
 EventDestinations computeStorageDestinationsAtLevel(MEvent mEvent, int level)
          This method is called only if the isGatewayAtLevel returns true.
 void connectionToClientLost(Object clientIdentifier)
           
 void forwardProfilePropagationRequest(Predicate predicate, int level)
          This method is responsble for forwarding a profile propagation request
 void handleProfilePropagationRequest(byte[] propagationRequest)
          This method handles the profile propagation requests received over the protocol Handler.
 boolean isGatewayAtLevel(int level)
          This method indicates if the node in question is a gateway at the level in the argument
static void main(String[] args)
           
 void processPropagationRequestFromClient(byte[] propagationRequest)
           
 void propagateProfileChange(Predicate predicate, int level, boolean addPredicate)
          This method is responsible for propagating profile changes to trees at the next highest level.
 void setAsGatewayAtLevel(int level)
          This designates this node as a gateway at level level.
 void setDestination(Destinations destination)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagValueProfilePropagation

public TagValueProfilePropagation(GatewayInfo gatewayInfo,
                                  ProtocolHandler protocolHandler)
Method Detail

setDestination

public void setDestination(Destinations destination)

setAsGatewayAtLevel

public void setAsGatewayAtLevel(int level)
This designates this node as a gateway at level level.


processPropagationRequestFromClient

public void processPropagationRequestFromClient(byte[] propagationRequest)

isGatewayAtLevel

public boolean isGatewayAtLevel(int level)
This method indicates if the node in question is a gateway at the level in the argument

Parameters:
level - The level for which we are testing if the node is a gateway.

computeDestinationsAtLevel

public int computeDestinationsAtLevel(MEvent mEvent,
                                      int level)
This method is called only if the isGatewayAtLevel returns true. This method computes the destinations associated with the matching of an event at a particular level

Parameters:
mEvent - The event that needs to be matched.
level - The destinations at level (level-1) that we are interested in.
Returns:
The destinations that are associated with the event.

computeClientDestinations

public Hashtable computeClientDestinations(MEvent mEvent)

computeStorageDestinationsAtLevel

public EventDestinations computeStorageDestinationsAtLevel(MEvent mEvent,
                                                           int level)
This method is called only if the isGatewayAtLevel returns true. This method computes the destinations associated with the matching of an event at a particular level. This method invokes the matching event method which returns the predicates/destination along with the destinations i.e the eventDestinations type. This is then written to stable storage.

Parameters:
mEvent - The event that needs to be matched.
level - The destinations at level (level-1) that we are interested in.
Returns:
The destinations that are associated with the event.

propagateProfileChange

public void propagateProfileChange(Predicate predicate,
                                   int level,
                                   boolean addPredicate)
This method is responsible for propagating profile changes to trees at the next highest level.

Parameters:
predicate - This is the subscription predicate that needs to be propagated.
level - The level for which this change is being propagated
addPredicate - A boolean variable indicating wether this predicate is being added to the system or is being removed.

handleProfilePropagationRequest

public void handleProfilePropagationRequest(byte[] propagationRequest)
This method handles the profile propagation requests received over the protocol Handler. In some cases based on the toReach destinations that are received we need to provide the destination address more accurately.

Parameters:
propagationRequest - The byte stream containing the profile propagation request.

connectionToClientLost

public void connectionToClientLost(Object clientIdentifier)

forwardProfilePropagationRequest

public void forwardProfilePropagationRequest(Predicate predicate,
                                             int level)
This method is responsble for forwarding a profile propagation request


main

public static void main(String[] args)


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