cgl.narada.matching.tagvalue
Class Matching

java.lang.Object
  extended by cgl.narada.matching.tagvalue.Matching
All Implemented Interfaces:
MatchingDebugFlags, MatchingTree

public class Matching
extends Object
implements MatchingTree, MatchingDebugFlags

This class implements the matching algorithm. This provides methods to add a subscription and also to remove interest in a subscription predicate. The matching algorithm should also be able to compute destinations based on the general matching algorithm.


Field Summary
 
Fields inherited from interface cgl.narada.matching.tagvalue.MatchingDebugFlags
EdgeAttributes_Debug, EventID_Debug, Matching_Debug, MatchingTreeEdge_Debug, MatchingTreeNode_Debug, MEvent_Debug, Predicate_Debug
 
Constructor Summary
Matching(int unitLevel, int systemLevel, TagValueProfilePropagation tvProtocol)
          The Matching constructor
 
Method Summary
 void addSubscriptionPredicate(Predicate predicate)
          This method adds a subscription predicate to the matching tree
 int getMatchingLevel()
          This method returns the level assocaited with this matching tree.
static void main(String[] args)
           
 int matchEvent(MEvent e)
          This method return the destinations assocaited with an event that needs to be matched to the matching tree
 void matchEventForStorage(MEvent e, EventDestinations eDest)
          This method return the destinations assocaited with an event that needs to be matched to the matching tree.
 void propagateChangesToHigherLevels(Predicate predicate, boolean addPredicate)
           
 void removeSubscriptionPredicate(Predicate predicate)
          This method removes a subscription predicate to the matching tree
 void setNodeDestination(Destinations destination)
          This method sets the destination address for this node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matching

public Matching(int unitLevel,
                int systemLevel,
                TagValueProfilePropagation tvProtocol)
The Matching constructor

Method Detail

getMatchingLevel

public int getMatchingLevel()
This method returns the level assocaited with this matching tree. A node could be a gateway at multiple levels. How it handles destinations at different levels, and propagates destinations at different levels is dicatated by the level of the matching tree which computes the destinations and initiates profile propagation changes.

Returns:
The level of the matching tree.

setNodeDestination

public void setNodeDestination(Destinations destination)
This method sets the destination address for this node

Specified by:
setNodeDestination in interface MatchingTree

addSubscriptionPredicate

public void addSubscriptionPredicate(Predicate predicate)
This method adds a subscription predicate to the matching tree

Specified by:
addSubscriptionPredicate in interface MatchingTree
Parameters:
predicate - The predicate comprising the subscription and the destination assocaited with the subscription.

removeSubscriptionPredicate

public void removeSubscriptionPredicate(Predicate predicate)
This method removes a subscription predicate to the matching tree

Specified by:
removeSubscriptionPredicate in interface MatchingTree
Parameters:
predicate - The predicate comprising the subscription and the destination assocaited with the subscription.

propagateChangesToHigherLevels

public void propagateChangesToHigherLevels(Predicate predicate,
                                           boolean addPredicate)
Specified by:
propagateChangesToHigherLevels in interface MatchingTree

matchEvent

public int matchEvent(MEvent e)
This method return the destinations assocaited with an event that needs to be matched to the matching tree

Returns:
The destination as an INT

matchEventForStorage

public void matchEventForStorage(MEvent e,
                                 EventDestinations eDest)
This method return the destinations assocaited with an event that needs to be matched to the matching tree. The return value provides us with updates that can be used for writing the event to stable storage.


main

public static void main(String[] args)


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