com.wm.app.tn.route
Class RoutingRule

java.lang.Object
  extended by com.wm.app.tn.util.TNFixedData
      extended by com.wm.app.tn.route.RoutingRule
All Implemented Interfaces:
com.wm.data.IData, java.lang.Cloneable

public class RoutingRule
extends com.wm.app.tn.util.TNFixedData

Rules which are used to handle new documents in the system (either those coming in from outside, or new documents created internally). A rule consists of three parts; (1) criteria that "match" against a document (sender, receiver, msg type) (2) preferences for prerouting action on the document (PreRoutingFlags) (3) an action -- a B2B service and initial inputs to route the document


Nested Class Summary
 
Nested classes/interfaces inherited from class com.wm.app.tn.util.TNFixedData
com.wm.app.tn.util.TNFixedData.TreeCursor
 
Field Summary
static java.lang.String DEFAULT_RESPONSE_TYPE
           
static java.lang.String DONT_CARE
           
static int FIXED_DISPLAY_LENGTH
           
static java.lang.String MUST
           
static java.lang.String MUST_NOT
           
 
Constructor Summary
RoutingRule()
           
 
Method Summary
 java.lang.String containsErrors()
           
 void containsErrors(java.lang.String s)
           
static com.wm.data.IData create()
           
static ActivityLogEntry createActivityLog(java.lang.String operation, java.lang.String fieldname, java.lang.String oldValue, java.lang.String newValue, java.lang.String ruleID)
          Return new message entry comprising of full and brief message.
static RoutingRule get(com.wm.data.IData d)
           
 java.lang.String getAlertContactType()
           
 java.lang.String getAlertMessage()
           
 java.lang.String getAlertPartner()
           
 java.lang.String getAlertSubject()
           
 java.lang.String[][] getAttribConditions()
           
 java.lang.String getDeliveryQueue()
           
 java.lang.String getDescription()
           
 java.lang.String getID()
           
 int getIndex()
           
 java.lang.String getIntendedUserStatus()
           
 java.lang.String getLastChangeID()
          gets the last change id of this routing rule
 java.lang.String getLastChangeSession()
          gets the id of the last change session of this routing rule
 java.lang.String getLastChangeUser()
          gets the last change user of this routing rule
 java.sql.Timestamp getLastModifiedTime()
           
 java.lang.String[] getMessageType()
           
 java.lang.String[] getMessageTypeName()
           
 java.lang.String getName()
           
 PreRoutingFlags getPreRoutingFlags()
           
 java.lang.String[] getReceiver()
           
 java.lang.String[] getReceiverDisplayName()
           
 java.lang.String[] getReceiverGroups()
           
 java.lang.String[] getReceiverGroupsDisplayName()
           
 java.lang.String[] getResponseMessage()
           
 java.lang.String[] getSender()
           
 java.lang.String[] getSenderDisplayName()
           
 java.lang.String[] getSenderGroups()
           
 java.lang.String[] getSenderGroupsDisplayName()
           
 java.lang.String getSendTo()
           
 com.wm.data.IData getServiceInput()
           
 java.lang.String getServiceInvokeType()
           
 java.lang.String getServiceName()
           
 java.lang.String getToMwSString()
           
 java.lang.String[] getUserStatus()
           
 boolean isDisabled()
           
static void loadDisplayNames(RoutingRule rule)
           
 boolean matches(java.lang.String me, BizDocEnvelope d)
          Answers whether this rule matches the supplied document.
 boolean matches(java.lang.String me, BizDocEnvelope d, java.util.Hashtable atts)
          Answers whether this rule matches the supplied document.
 java.lang.String pipelineDataToString(com.wm.data.IData idata, int i)
           
 void setAlert(java.lang.String p_id, java.lang.String p_type, java.lang.String subject, java.lang.String msg)
           
 void setAttribConditions(BizDocAttribute[] attr, java.lang.String[][] cond)
          sets attribute conditions on this routing rule.
 void setAttribConditions(java.lang.String[][] cond)
          Deprecated, leave for backward compatibility
 void setDeliveryQueue(java.lang.String queue)
           
 void setDescription(java.lang.String d)
          sets the description of the RoutingRule
 void setDisabled(boolean b)
          enables or disables RoutingRule
 void setID(java.lang.String n)
          sets the unique identifier for the RoutingRule.
 void setIndex(int i)
           
 void setIntendedUserStatus(java.lang.String stat)
           
 void setLastChangeID(java.lang.String lastChangeId)
          sets the last change id of this routing rule
 void setLastChangeSession(java.lang.String lastChangeSession)
          sets the id of the last change session of this routing rule
 void setLastChangeUser(java.lang.String lastChangeUser)
          sets the last change user of this routing rule
 void setLastModifiedTime(java.sql.Timestamp t)
           
 void setMessageType(java.lang.String[] typeId)
           
 void setMessageTypeName(java.lang.String[] typeName)
           
 void setName(java.lang.String n)
          sets the name of the RoutingRule.
 void setPersist(java.lang.String s)
           
 void setPersistOption(java.lang.String s)
           
 void setPreRoutingFlags(PreRoutingFlags flags)
           
 void setReceiver(java.lang.String[] rcvId)
           
 void setReceiverDisplayName(java.lang.String[] rcvName)
           
 void setReceiverGroups(java.lang.String[] rcvGrps)
           
 void setReceiverGroupsDisplayName(java.lang.String[] rcvGrpName)
           
 void setResponseMessage(java.lang.String msg)
           
 void setResponseMessage(java.lang.String type, java.lang.String msg)
           
 void setSender(java.lang.String[] sndId)
           
 void setSenderDisplayName(java.lang.String[] sndName)
           
 void setSenderGroups(java.lang.String[] sndGrps)
           
 void setSenderGroupsDisplayName(java.lang.String[] sndGrpName)
           
 void setSendTo(java.lang.String proto)
           
 void setService(java.lang.String name, com.wm.data.IData input, java.lang.String type)
           
 void setToMwSString(java.lang.String toMwSString)
           
 void setUniqueOption(java.lang.String s)
           
 void setUserStatus(java.lang.String[] stat)
           
 void setValidate(java.lang.String s)
           
 void setVerify(java.lang.String s)
           
 java.lang.String toString()
          Default toString implementation returns class name followed by contents.
 
Methods inherited from class com.wm.app.tn.util.TNFixedData
clone, dataSize, get, get, getCursor, getHashCursor, getIndexCursor, getKey, getSharedCursor, getTreeCursor, indexOf, merge, set, set
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MUST

public static final java.lang.String MUST
See Also:
Constant Field Values

MUST_NOT

public static final java.lang.String MUST_NOT
See Also:
Constant Field Values

DONT_CARE

public static final java.lang.String DONT_CARE
See Also:
Constant Field Values

DEFAULT_RESPONSE_TYPE

public static final java.lang.String DEFAULT_RESPONSE_TYPE
See Also:
Constant Field Values

FIXED_DISPLAY_LENGTH

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

RoutingRule

public RoutingRule()
Method Detail

setID

public void setID(java.lang.String n)
sets the unique identifier for the RoutingRule.


getID

public java.lang.String getID()
Returns:
the unique identifier of the RoutingRule.

setName

public void setName(java.lang.String n)
sets the name of the RoutingRule. This is the name that appears on the Trading Networks Console.


getName

public java.lang.String getName()
Returns:
the name of the RoutingRule. This is the name that appears on the Trading Networks Console.

setDescription

public void setDescription(java.lang.String d)
sets the description of the RoutingRule


getDescription

public java.lang.String getDescription()
Returns:
the description of the RoutingRule

setDisabled

public void setDisabled(boolean b)
enables or disables RoutingRule


isDisabled

public boolean isDisabled()
Returns:
true if the RoutingRule is disabled, otherwise false.

setLastModifiedTime

public void setLastModifiedTime(java.sql.Timestamp t)

getLastModifiedTime

public java.sql.Timestamp getLastModifiedTime()

setIndex

public void setIndex(int i)

getIndex

public int getIndex()
Returns:
the index of this RoutingRule in the routing rule list

setSender

public void setSender(java.lang.String[] sndId)

setReceiver

public void setReceiver(java.lang.String[] rcvId)

setSenderGroups

public void setSenderGroups(java.lang.String[] sndGrps)

setReceiverGroups

public void setReceiverGroups(java.lang.String[] rcvGrps)

setMessageType

public void setMessageType(java.lang.String[] typeId)

setUserStatus

public void setUserStatus(java.lang.String[] stat)

containsErrors

public void containsErrors(java.lang.String s)

setSenderDisplayName

public void setSenderDisplayName(java.lang.String[] sndName)

setReceiverDisplayName

public void setReceiverDisplayName(java.lang.String[] rcvName)

setMessageTypeName

public void setMessageTypeName(java.lang.String[] typeName)

setSenderGroupsDisplayName

public void setSenderGroupsDisplayName(java.lang.String[] sndGrpName)

setReceiverGroupsDisplayName

public void setReceiverGroupsDisplayName(java.lang.String[] rcvGrpName)

setToMwSString

public void setToMwSString(java.lang.String toMwSString)

getSender

public java.lang.String[] getSender()

getReceiver

public java.lang.String[] getReceiver()

getSenderGroups

public java.lang.String[] getSenderGroups()

getReceiverGroups

public java.lang.String[] getReceiverGroups()

getMessageType

public java.lang.String[] getMessageType()

getUserStatus

public java.lang.String[] getUserStatus()

containsErrors

public java.lang.String containsErrors()

getSenderDisplayName

public java.lang.String[] getSenderDisplayName()

getReceiverDisplayName

public java.lang.String[] getReceiverDisplayName()

getMessageTypeName

public java.lang.String[] getMessageTypeName()

getSenderGroupsDisplayName

public java.lang.String[] getSenderGroupsDisplayName()

getReceiverGroupsDisplayName

public java.lang.String[] getReceiverGroupsDisplayName()

getToMwSString

public java.lang.String getToMwSString()

setAttribConditions

public void setAttribConditions(BizDocAttribute[] attr,
                                java.lang.String[][] cond)
                         throws java.lang.NumberFormatException,
                                java.lang.IllegalArgumentException
sets attribute conditions on this routing rule. If both attr and cond null, it deletes all extended conditions.

Parameters:
attr - BizDocAttribute[]
cond - String[][] they should be in the form { ID, op, val }
Throws:
java.lang.NumberFormatException
java.lang.IllegalArgumentException

setAttribConditions

public void setAttribConditions(java.lang.String[][] cond)
Deprecated, leave for backward compatibility


getAttribConditions

public java.lang.String[][] getAttribConditions()

matches

public boolean matches(java.lang.String me,
                       BizDocEnvelope d)
Answers whether this rule matches the supplied document. This method will do logging and consult the BizDocAttribute store, so it should only be called when those facilities are initialized.

Parameters:
me - internal partner ID for the "self partner" (null if none)
d - the document in question

matches

public boolean matches(java.lang.String me,
                       BizDocEnvelope d,
                       java.util.Hashtable atts)
Answers whether this rule matches the supplied document.

Parameters:
me - internal partner ID for the "self partner" (null if none)
d - the document in question
atts - a hashtable of BizDocAttributes (keyed by ID) -- if null, this method will do logging and consult the BizDocAttribute store.

setVerify

public void setVerify(java.lang.String s)

setValidate

public void setValidate(java.lang.String s)

setPersist

public void setPersist(java.lang.String s)

setUniqueOption

public void setUniqueOption(java.lang.String s)

setPersistOption

public void setPersistOption(java.lang.String s)

getPreRoutingFlags

public PreRoutingFlags getPreRoutingFlags()

setPreRoutingFlags

public void setPreRoutingFlags(PreRoutingFlags flags)

setAlert

public void setAlert(java.lang.String p_id,
                     java.lang.String p_type,
                     java.lang.String subject,
                     java.lang.String msg)

setResponseMessage

public void setResponseMessage(java.lang.String msg)

setResponseMessage

public void setResponseMessage(java.lang.String type,
                               java.lang.String msg)

setIntendedUserStatus

public void setIntendedUserStatus(java.lang.String stat)

setService

public void setService(java.lang.String name,
                       com.wm.data.IData input,
                       java.lang.String type)

setSendTo

public void setSendTo(java.lang.String proto)

setDeliveryQueue

public void setDeliveryQueue(java.lang.String queue)

getAlertPartner

public java.lang.String getAlertPartner()

getAlertContactType

public java.lang.String getAlertContactType()

getAlertSubject

public java.lang.String getAlertSubject()

getAlertMessage

public java.lang.String getAlertMessage()

getResponseMessage

public java.lang.String[] getResponseMessage()

getIntendedUserStatus

public java.lang.String getIntendedUserStatus()

getServiceName

public java.lang.String getServiceName()
Returns:
the fully qualified interface and service name of the B2B service that this RoutingRule executes. If the RoutingRule does not execute a B2B service, null is returned.

getServiceInput

public com.wm.data.IData getServiceInput()

getSendTo

public java.lang.String getSendTo()

getDeliveryQueue

public java.lang.String getDeliveryQueue()

getServiceInvokeType

public java.lang.String getServiceInvokeType()

setLastChangeID

public void setLastChangeID(java.lang.String lastChangeId)
sets the last change id of this routing rule


getLastChangeID

public java.lang.String getLastChangeID()
gets the last change id of this routing rule


setLastChangeUser

public void setLastChangeUser(java.lang.String lastChangeUser)
sets the last change user of this routing rule


getLastChangeUser

public java.lang.String getLastChangeUser()
gets the last change user of this routing rule


setLastChangeSession

public void setLastChangeSession(java.lang.String lastChangeSession)
sets the id of the last change session of this routing rule


getLastChangeSession

public java.lang.String getLastChangeSession()
gets the id of the last change session of this routing rule


create

public static com.wm.data.IData create()

get

public static RoutingRule get(com.wm.data.IData d)

toString

public java.lang.String toString()
Description copied from class: com.wm.app.tn.util.TNFixedData
Default toString implementation returns class name followed by contents.

Overrides:
toString in class com.wm.app.tn.util.TNFixedData
Returns:
string rep for this object

loadDisplayNames

public static void loadDisplayNames(RoutingRule rule)

createActivityLog

public static ActivityLogEntry createActivityLog(java.lang.String operation,
                                                 java.lang.String fieldname,
                                                 java.lang.String oldValue,
                                                 java.lang.String newValue,
                                                 java.lang.String ruleID)
Return new message entry comprising of full and brief message.

Parameters:
operation - the type of operation performed i.e, insert or update
fieldname - the name that needs to be displayed in message
oldValue - the previous value before update operation takes place (It will be null in case of insert operation)
newValue - the new value against which previous value will be compared.
Returns:
a new message entry

pipelineDataToString

public java.lang.String pipelineDataToString(com.wm.data.IData idata,
                                             int i)