cgl.narada.protocol
Class JmsProfilePropagation

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

public class JmsProfilePropagation
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
JmsProfilePropagation(GatewayInfo gatewayInfo, ProtocolHandler protocolHandler)
           
 
Method Summary
 Hashtable computeClientDestinations(JmsEvent jmsEvent)
           
 int computeDestinationsAtLevel(JmsEvent jmsEvent, int level)
          This method is called only if the isGatewayAtLevel returns true.
 EventDestinations computeStorageDestinationsAtLevel(JmsEvent jmsEvent, int level)
          This method is called only if the isGatewayAtLevel returns true.
 void connectionToClientLost(Object clientIdentifier, String linkId)
           
 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(JmsProfile jmsProfile, int level, boolean addProfile)
          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

JmsProfilePropagation

public JmsProfilePropagation(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(JmsEvent jmsEvent,
                                      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:
jmsEvent - 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(JmsEvent jmsEvent)

computeStorageDestinationsAtLevel

public EventDestinations computeStorageDestinationsAtLevel(JmsEvent jmsEvent,
                                                           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 profiles/destination along with the destinations i.e the eventDestinations type. This is then written to stable storage.

Parameters:
jmsEvent - 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(JmsProfile jmsProfile,
                                   int level,
                                   boolean addProfile)
This method is responsible for propagating profile changes to trees at the next highest level.

Parameters:
jmsProfile - This is the subscription profile that needs to be propagated.
level - The level for which this change is being propagated
addProfile - A boolean variable indicating wether this profile 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,
                                   String linkId)

main

public static void main(String[] args)


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