org.opengts.db
Interface RuleFactory

All Known Implementing Classes:
RuleFactoryAdapter, RuleFactoryExample, RuleFactoryLite

public interface RuleFactory


Nested Class Summary
static class RuleFactory.NotifyAction
           
 
Field Summary
static int ACTION_DEFAULT
           
static int ACTION_EMAIL_ACCOUNT
           
static int ACTION_EMAIL_ALL
           
static int ACTION_EMAIL_DEVICE
           
static int ACTION_EMAIL_RULE
           
static int ACTION_NONE
           
static int ACTION_NOTIFY_ACCOUNT
           
static int ACTION_NOTIFY_ALL
           
static int ACTION_NOTIFY_DEVICE
           
static int ACTION_NOTIFY_MASK
           
static int ACTION_NOTIFY_RULE
           
static int ACTION_SAVE_LAST
           
static int ACTION_VIA_EMAIL
           
static int ACTION_VIA_LISTENER
           
static int ACTION_VIA_MASK
           
static int ACTION_VIA_QUEUE
           
static int PRIORITY_HIGH
           
static int PRIORITY_LOW
           
static int PRIORITY_MEDIUM
           
static int PRIORITY_UNDEFINED
           
static java.lang.String PROP_rule_workHours_
           
 
Method Summary
 boolean checkRuntime()
          Initializes and returns true if successful
 boolean checkSelectorSyntax(java.lang.String selector)
          Return true if the specified selector is syntactically correct
 java.lang.Object evaluateSelector(java.lang.String selector, Account account)
          Evaluates a selector against the specified Account and returns the result
 java.lang.Object evaluateSelector(java.lang.String selector, EventData event)
          Evaluates a selector against the specified event and returns the result
 int executeRule(java.lang.String ruleID, EventData event)
          Executes the specified ruleID against the specified EventData record, and return a mask containing the actions performed.
 int executeRules(EventData event)
          Executes all rules which apply to the specified EventData record, and return a mask containing the actions performed.
 int executeSelector(java.lang.String selector, EventData event)
          Executes the specified selector against the criteria contained win the event record, and return a mask containing the actions performed.
 java.lang.String getFunctionDescription(java.lang.String ftnName)
          Returns the description for the specified function name
 java.util.List<java.lang.String> getFunctionNames()
          Returns a list of all available selector function names
 java.lang.String getFunctionUsage(java.lang.String ftnName)
          Returns the function "usage" description for the specified function name
 java.lang.String getGeoCorridorDescription(Account account, java.lang.String corrID)
          Gets the description for the specified GeoCorridor ID.
 java.lang.String getIdentifierDescription(java.lang.String idName)
          Returns the description for the specified identifier
 java.util.List<java.lang.String> getIdentifierNames()
          Returns a list of all available selector identifiers
 java.lang.String getName()
          Returns this RuleFactory name
 PredefinedRuleAction[] getPredefinedRuleActions(BasicPrivateLabel bpl)
          Returns a list of predefined rule actions
 java.lang.String[] getRuleIDs(Account account)
          Returns a list of defined rule-ids for the specified Account.
 java.lang.String getRuleNotifyEmail(Account account, java.lang.String ruleID)
          Returns the rule notification email addresses for the specified rule-id, in the specified Account.
 java.lang.String getRuleSelector(Account account, java.lang.String ruleID)
          Returns the rule selector for the specified rule-id, in the specified Account
 java.lang.String getVersion()
          Returns this RuleFactory version String
 boolean isSelectorMatch(java.lang.String selector, EventData event)
          Return true if the specified 'event' matches the specified 'selector'
 

Field Detail

PROP_rule_workHours_

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

ACTION_NONE

static final int ACTION_NONE
See Also:
Constant Field Values

ACTION_NOTIFY_MASK

static final int ACTION_NOTIFY_MASK
See Also:
Constant Field Values

ACTION_NOTIFY_ACCOUNT

static final int ACTION_NOTIFY_ACCOUNT
See Also:
Constant Field Values

ACTION_NOTIFY_DEVICE

static final int ACTION_NOTIFY_DEVICE
See Also:
Constant Field Values

ACTION_NOTIFY_RULE

static final int ACTION_NOTIFY_RULE
See Also:
Constant Field Values

ACTION_VIA_MASK

static final int ACTION_VIA_MASK
See Also:
Constant Field Values

ACTION_VIA_EMAIL

static final int ACTION_VIA_EMAIL
See Also:
Constant Field Values

ACTION_VIA_QUEUE

static final int ACTION_VIA_QUEUE
See Also:
Constant Field Values

ACTION_VIA_LISTENER

static final int ACTION_VIA_LISTENER
See Also:
Constant Field Values

ACTION_SAVE_LAST

static final int ACTION_SAVE_LAST
See Also:
Constant Field Values

ACTION_NOTIFY_ALL

static final int ACTION_NOTIFY_ALL
See Also:
Constant Field Values

ACTION_EMAIL_ALL

static final int ACTION_EMAIL_ALL
See Also:
Constant Field Values

ACTION_EMAIL_ACCOUNT

static final int ACTION_EMAIL_ACCOUNT
See Also:
Constant Field Values

ACTION_EMAIL_DEVICE

static final int ACTION_EMAIL_DEVICE
See Also:
Constant Field Values

ACTION_EMAIL_RULE

static final int ACTION_EMAIL_RULE
See Also:
Constant Field Values

ACTION_DEFAULT

static final int ACTION_DEFAULT
See Also:
Constant Field Values

PRIORITY_UNDEFINED

static final int PRIORITY_UNDEFINED
See Also:
Constant Field Values

PRIORITY_HIGH

static final int PRIORITY_HIGH
See Also:
Constant Field Values

PRIORITY_MEDIUM

static final int PRIORITY_MEDIUM
See Also:
Constant Field Values

PRIORITY_LOW

static final int PRIORITY_LOW
See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Returns this RuleFactory name

Returns:
This RuleFactory name

getVersion

java.lang.String getVersion()
Returns this RuleFactory version String

Returns:
This RuleFactory version String

checkRuntime

boolean checkRuntime()
Initializes and returns true if successful

Returns:
True if initialization was succesful, false otherwise

getIdentifierNames

java.util.List<java.lang.String> getIdentifierNames()
Returns a list of all available selector identifiers

Returns:
A list of all available selector identifiers

getIdentifierDescription

java.lang.String getIdentifierDescription(java.lang.String idName)
Returns the description for the specified identifier

Parameters:
idName - The name of the identifier for which the description is returned.
Returns:
The description for the specified identifier

getFunctionNames

java.util.List<java.lang.String> getFunctionNames()
Returns a list of all available selector function names

Returns:
A list of all available selector function names

getFunctionUsage

java.lang.String getFunctionUsage(java.lang.String ftnName)
Returns the function "usage" description for the specified function name

Parameters:
ftnName - The name of the function for which the "usage" description is returned.
Returns:
The "usage" description for the specified function name

getFunctionDescription

java.lang.String getFunctionDescription(java.lang.String ftnName)
Returns the description for the specified function name

Parameters:
ftnName - The name of the function for which the description is returned.
Returns:
The description for the specified function name

getPredefinedRuleActions

PredefinedRuleAction[] getPredefinedRuleActions(BasicPrivateLabel bpl)
Returns a list of predefined rule actions

Parameters:
bpl - The context BasicPrivateLabel instance
Returns:
The list of predefined rule actions (or null, if no predefined rule actions have been defined

getRuleIDs

java.lang.String[] getRuleIDs(Account account)
Returns a list of defined rule-ids for the specified Account.

Parameters:
account - The account from which the rule-id list is returned
Returns:
The list of rule-ids

getRuleSelector

java.lang.String getRuleSelector(Account account,
                                 java.lang.String ruleID)
Returns the rule selector for the specified rule-id, in the specified Account

Parameters:
account - The account which owns the rule-id from which the selector is returned
ruleID - The Rule-ID which contains the selector to return
Returns:
The rule selector for the specified account and rule-id

getRuleNotifyEmail

java.lang.String getRuleNotifyEmail(Account account,
                                    java.lang.String ruleID)
Returns the rule notification email addresses for the specified rule-id, in the specified Account. Email addresses are returned as a comma-separated String value.

Parameters:
account - The account which owns the rule-id from which the notify email addresses are returned
ruleID - The Rule-ID which contains the notify email addresses to return
Returns:
The rule notification email addresses for the specified account and rule-id

checkSelectorSyntax

boolean checkSelectorSyntax(java.lang.String selector)
Return true if the specified selector is syntactically correct

Parameters:
selector - The rule selector to syntax check
Returns:
True if the selector is syntactically correct, false otherwise

isSelectorMatch

boolean isSelectorMatch(java.lang.String selector,
                        EventData event)
Return true if the specified 'event' matches the specified 'selector'

Parameters:
selector - The rule selector to check against the specified event
event - The event that contains the criteria used by the selector
Returns:
True if the events matches the specified selector, false otherwise

executeSelector

int executeSelector(java.lang.String selector,
                    EventData event)
Executes the specified selector against the criteria contained win the event record, and return a mask containing the actions performed.

Parameters:
selector - The selector to execute.
event - The event that contains the criteria used by the selector
Returns:
The mask containing the 'actions' performed.

executeRules

int executeRules(EventData event)
Executes all rules which apply to the specified EventData record, and return a mask containing the actions performed.

Parameters:
event - The event that contains the criteria used by the rules
Returns:
The mask containing the 'actions' performed.

executeRule

int executeRule(java.lang.String ruleID,
                EventData event)
Executes the specified ruleID against the specified EventData record, and return a mask containing the actions performed.

Parameters:
ruleID - The ruleID to execute against the specified event
event - The event that contains the criteria used by the rules
Returns:
The mask containing the 'actions' performed.

evaluateSelector

java.lang.Object evaluateSelector(java.lang.String selector,
                                  EventData event)
                                  throws RuleParseException
Evaluates a selector against the specified event and returns the result

Parameters:
selector - The selector to execute.
event - The event that contains the criteria used by the selector
Returns:
An object containing the result of the executed selector.
Throws:
RuleParseException

evaluateSelector

java.lang.Object evaluateSelector(java.lang.String selector,
                                  Account account)
                                  throws RuleParseException
Evaluates a selector against the specified Account and returns the result

Parameters:
selector - The selector to execute.
account - The Account that contains the criteria used by the selector
Returns:
An object containing the result of the executed selector.
Throws:
RuleParseException

getGeoCorridorDescription

java.lang.String getGeoCorridorDescription(Account account,
                                           java.lang.String corrID)
Gets the description for the specified GeoCorridor ID. Will return null if GeoCorridor is not supported. Will return blank if the specified GeoCorridor ID was not found.

Parameters:
account - The Account that owns the specified GeoCorridor ID
corrID - The GeoCorridor ID