com.wm.app.tn.route
Class RoutingRuleList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by com.wm.app.tn.route.RoutingRuleList
All Implemented Interfaces:
com.wm.util.coder.IDataCodable, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class RoutingRuleList
extends java.util.Vector
implements com.wm.util.coder.IDataCodable

See Also:
Serialized Form

Field Summary
static int MOVE_DOWN
           
static int MOVE_FIRST
           
static int MOVE_LAST
           
static int MOVE_UP
           
 
Constructor Summary
RoutingRuleList()
           
 
Method Summary
 boolean containsRuleName(java.lang.String name)
           
 boolean containsRuleName(java.lang.String name, java.lang.String ruleID)
           
 java.lang.String[] getAllMatches(BizDocEnvelope doc, java.lang.String me, java.util.Hashtable atts)
           
 com.wm.data.IData getIData()
           
 int getMatchFrom(int idx, BizDocEnvelope doc, java.lang.String me, java.util.Hashtable atts)
           
 RoutingRule getRule(int i)
           
 RoutingRule[] list()
           
 void moveElement(int oldx, int newx)
          Moves a routing rule in the list.
 void setIData(com.wm.data.IData data)
           
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

MOVE_FIRST

public static final int MOVE_FIRST
See Also:
Constant Field Values

MOVE_LAST

public static final int MOVE_LAST
See Also:
Constant Field Values

MOVE_DOWN

public static final int MOVE_DOWN
See Also:
Constant Field Values

MOVE_UP

public static final int MOVE_UP
See Also:
Constant Field Values
Constructor Detail

RoutingRuleList

public RoutingRuleList()
Method Detail

moveElement

public void moveElement(int oldx,
                        int newx)
Moves a routing rule in the list. You can either specify an absolute index for the rule, or use one of the constants (FIRST, LAST, UP, DOWN). In this context, moving a rule "up" means it will fire sooner.

Parameters:
oldx - the index of the rule to be moved
newx - the new index to give it (or one of the constants)

getMatchFrom

public int getMatchFrom(int idx,
                        BizDocEnvelope doc,
                        java.lang.String me,
                        java.util.Hashtable atts)
Parameters:
me - the partner ID corresponding to "self"
doc - a BizDocEnvelope
idx - an index into the routing table
includeDisabled - should the match include disabled rules?
Returns:
the index of the first rule in the schedule that matches the supplied doc, starting at the supplied index (-1 if none match)

getAllMatches

public java.lang.String[] getAllMatches(BizDocEnvelope doc,
                                        java.lang.String me,
                                        java.util.Hashtable atts)
Parameters:
doc - a BizDocEnvelope
me - the partner ID corresponding to "self"
attrs - a Hashtable of attributes to match (may be null)
Returns:
a list consisting of the ID of the rules which match the supplied document (null if none match)

getRule

public RoutingRule getRule(int i)
Returns:
the rule at the supplied index

list

public RoutingRule[] list()
Returns:
a list of the rules in the system. The returned array of RoutingRules is in the same order that the rules are matched on when processing a document.

containsRuleName

public boolean containsRuleName(java.lang.String name)
Parameters:
ruleName - the name of the rule to check against
Returns:
true if a rule already has this name, false if not

containsRuleName

public boolean containsRuleName(java.lang.String name,
                                java.lang.String ruleID)
Parameters:
ruleName - the name of the rule to check against
Returns:
true if a rule already has this name, false if not for a different rule

getIData

public com.wm.data.IData getIData()
Specified by:
getIData in interface com.wm.util.coder.IDataCodable

setIData

public void setIData(com.wm.data.IData data)
Specified by:
setIData in interface com.wm.util.coder.IDataCodable