wt.rule
Class RuleServiceFwd

java.lang.Object
  extended bywt.rule.RuleServiceFwd
All Implemented Interfaces:
RemoteAccess, RuleService, Serializable

public class RuleServiceFwd
extends Object
implements RemoteAccess, RuleService, Serializable

The rule service supports the following functions:

Rule selection and rule application are actually carried out by delegates. The rule service provides a framework for managing these delegates.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static String FC_RESOURCE
           
(package private) static boolean SERVER
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
RuleServiceFwd()
           
 
Method Summary
 Object applyRule(Object object, Rule rule)
          Apply rule to the object.
 Object applyRule(Object object, Rule rule, WTContainerRef container)
          Apply rule to the object.
 Rule disableRule(Rule rule)
          Disable the specified Rule.
 Rule enableRule(Rule rule)
          Enable the specified Rule.
 QueryResult findRules(Class objType, RuleType ruleType, boolean enabled)
          Find all TypeBasedRules in the Classic container that are of type ruleType and whose object type attribute equals objType.
 QueryResult findRules(Class objType, RuleType ruleType, WTContainerRef container, boolean enabled)
          Find all TypeBasedRules in the specified container that are of type ruleType and whose object type attribute equals objType.
private static Manager getManager()
           
 Rule getRule(Object object, RuleType ruleType)
          Select an appropriate rule from the Classic container based on the object and ruleType supplied as arguments.
 Rule getRule(Object object, RuleType ruleType, WTContainerRef container)
          Select an appropriate rule from the specified container based on the object and ruleType supplied as arguments.
 Rule mergeRules(Rule[] rules, RuleType ruleType)
          Merge the provided rules into a composite rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVER

static final boolean SERVER

FC_RESOURCE

private static final String FC_RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME
Constructor Detail

RuleServiceFwd

public RuleServiceFwd()
Method Detail

getManager

private static Manager getManager()
                           throws WTException
Returns:
Manager
Throws:
WTException

getRule

public Rule getRule(Object object,
                    RuleType ruleType)
             throws WTException
Select an appropriate rule from the Classic container based on the object and ruleType supplied as arguments.

The object argument may be a type identifier or a normal object. A type identifier is one of the following:

Specified by:
getRule in interface RuleService
Parameters:
object - the object that the rule should be applicable to (cannot be null)
ruleType - the type of rule to select (cannot be null)
Returns:
Rule
Throws:
WTException

getRule

public Rule getRule(Object object,
                    RuleType ruleType,
                    WTContainerRef container)
             throws WTException
Select an appropriate rule from the specified container based on the object and ruleType supplied as arguments.

The object argument may be a type identifier or a normal object. A type identifier is one of the following:

Specified by:
getRule in interface RuleService
Parameters:
object - the object that the rule should be applicable to (cannot be null)
ruleType - the type of rule to select (cannot be null)
container -
Returns:
Rule
Throws:
WTException

applyRule

public Object applyRule(Object object,
                        Rule rule,
                        WTContainerRef container)
                 throws WTException,
                        WTPropertyVetoException
Apply rule to the object. Return the resulting object. The result object might be the same object or a different one depending on the semantics of the rule. The specified container is used to lookup resource objects that are required while applying the rule.

If the rule is null then nothing is done and the original object is returned.

NOTE: This interface does not support operations that require returning multiple objects.

Supported API: false

Specified by:
applyRule in interface RuleService
Parameters:
object - the object that the rule should be applied to (cannot be null)
rule - the rule to be applied
container - the container to use for resource object lookups
Returns:
Object
Throws:
WTException
WTPropertyVetoException

applyRule

public Object applyRule(Object object,
                        Rule rule)
                 throws WTException,
                        WTPropertyVetoException
Apply rule to the object. Return the resulting object. The result object might be the same object or a different one depending on the semantics of the rule. The Classic container is used to lookup resource objects that are required while applying the rule.

If the rule is null then nothing is done and the original object is returned.

NOTE: This interface does not support operations that require returning multiple objects.

Supported API: false

Specified by:
applyRule in interface RuleService
Parameters:
object - the object that the rule should be applied to (cannot be null)
rule - the rule to be applied
Returns:
Object
Throws:
WTException
WTPropertyVetoException

findRules

public QueryResult findRules(Class objType,
                             RuleType ruleType,
                             boolean enabled)
                      throws WTException
Find all TypeBasedRules in the Classic container that are of type ruleType and whose object type attribute equals objType.

If enabled is true then only return those rules that are enabled. If enabled is false then all matching rules are returned.

Supported API: false

Specified by:
findRules in interface RuleService
Parameters:
objType - the object type that the returned rules should reference
ruleType - the type of rule that should be returned
enabled - whether only enabled rules should be returned
Returns:
QueryResult
Throws:
WTException

findRules

public QueryResult findRules(Class objType,
                             RuleType ruleType,
                             WTContainerRef container,
                             boolean enabled)
                      throws WTException
Find all TypeBasedRules in the specified container that are of type ruleType and whose object type attribute equals objType.

If enabled is true then only return those rules that are enabled. If enabled is false then all matching rules are returned.

Supported API: false

Specified by:
findRules in interface RuleService
Parameters:
objType - the object type that the returned rules should reference
ruleType - the type of rule that should be returned
container - the container to start searching in
enabled - whether only enabled rules should be returned
Returns:
QueryResult
Throws:
WTException

disableRule

public Rule disableRule(Rule rule)
                 throws WTException
Disable the specified Rule.

Supported API: false

Specified by:
disableRule in interface RuleService
Parameters:
rule - the rule to disable
Returns:
Rule
Throws:
WTException

enableRule

public Rule enableRule(Rule rule)
                throws WTException
Enable the specified Rule.

Supported API: false

Specified by:
enableRule in interface RuleService
Parameters:
rule - the rule to enable
Returns:
Rule
Throws:
WTException

mergeRules

public Rule mergeRules(Rule[] rules,
                       RuleType ruleType)
                throws WTException,
                       WTPropertyVetoException
Merge the provided rules into a composite rule.

Supported API: false

Specified by:
mergeRules in interface RuleService
Parameters:
rules - the rules to be merged
ruleType - the ruleType of the rules to be merged
Returns:
Rule
Throws:
WTException
WTPropertyVetoException