com.ptc.netmarkets.rule
Class StandardNmRuleService

java.lang.Object
  extended bywt.services.StandardManager
      extended bycom.ptc.netmarkets.rule.StandardNmRuleService
All Implemented Interfaces:
Manager, NetFactor, NmRuleService, Serializable

public class StandardNmRuleService
extends StandardManager
implements NmRuleService, Serializable

Use the newStandardNmRuleService static factory method(s), not the StandardNmRuleService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static String RESOURCE
           
private static String RULE_ROW_ACTION_MODEL
           
private static String WT_RESOURCE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardNmRuleService()
           
 
Method Summary
 NmChangeModel[] create(NmCommandBean cb, Hashtable params)
          Create a rule using the data in the request.
 NmChangeModel[] disable(NmCommandBean cb)
          

Supported API: false
 NmChangeModel[] enable(NmCommandBean cb)
          

Supported API: false
 Enumeration findTypes(Class objType, WTContainerRef container, boolean enabled)
          Find TypeBasedRules that are of type RuleType.TYPE and whose object type attribute equals objType.
private  NmChangeModel getChangeModel(NmRule nmRule, int changeType)
          Get a change model that represents the modification of or addition of the specified rule.
 String getConceptualClassname()
          Deprecated.  
private  String getContents(File xmlFile, String encoding)
           
 NmRule getNmRule(NmCommandBean cb, Hashtable params)
          Get the rule from the specified container for the specified rule type and object type.
 NmRule getNmRule(Rule rule)
          Gets a NmRule for the specified rule.
 NmRule getNmRule(Rule rule, boolean includeSpec)
          

Supported API: false
private  PersistentRule getRule(NmCommandBean cb)
          Return the PersistentRule that is referenced by the command bean.
 Rule getRule(String name, RuleType ruleType, WTContainerRef container)
          Get the Rule that has the specified name and ruleType in the specified container.
 String getRuleObjectTypeFromPersistId(String ObjType)
          

Supported API: false
 NmRule getRuleProperties(NmCommandBean cb, boolean includeSpec)
          

Supported API: false
private  ArrayList getRuleRowData(NmRule nmRule)
           
 ArrayList list(NmCommandBean cb)
          

Supported API: false
 ArrayList listRulesForType(String className, NmOid projectOid)
          

Supported API: false
static StandardNmRuleService newStandardNmRuleService()
          Default factory for the class.
 NmChangeModel[] update(NmCommandBean cb, Hashtable params)
          Update a rule using the data in the request.
private  void updateRule(Rule rule, Hashtable params)
          Update the specified rule using the parameter values contained in the spcified Hashtable.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, performStartupProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

WT_RESOURCE

private static final String WT_RESOURCE
See Also:
Constant Field Values

RULE_ROW_ACTION_MODEL

private static final String RULE_ROW_ACTION_MODEL
See Also:
Constant Field Values
Constructor Detail

StandardNmRuleService

public StandardNmRuleService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

newStandardNmRuleService

public static StandardNmRuleService newStandardNmRuleService()
                                                      throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardNmRuleService
Throws:
WTException

list

public ArrayList list(NmCommandBean cb)
               throws WTException


Supported API: false

Specified by:
list in interface NmRuleService
Parameters:
cb -
Returns:
ArrayList
Throws:
WTException

listRulesForType

public ArrayList listRulesForType(String className,
                                  NmOid projectOid)
                           throws WTException


Supported API: false

Specified by:
listRulesForType in interface NmRuleService
Parameters:
className -
projectOid -
Returns:
ArrayList
Throws:
WTException

getRule

public Rule getRule(String name,
                    RuleType ruleType,
                    WTContainerRef container)
             throws WTException
Get the Rule that has the specified name and ruleType in the specified container. If no rule is found in the specified container, then its parent container is searched. This repeats until a rule is found or the top of the hierarchy is reached. If no such rule exists, return null.

Specified by:
getRule in interface NmRuleService
Parameters:
name - the rule name (cannot be null)
ruleType - the rule type (cannot be null)
container -
Returns:
Rule
Throws:
WTException

create

public NmChangeModel[] create(NmCommandBean cb,
                              Hashtable params)
                       throws WTException
Create a rule using the data in the request.

Supported API: false

Specified by:
create in interface NmRuleService
Parameters:
cb -
params - the request parameters
Returns:
NmChangeModel[]
Throws:
WTException

update

public NmChangeModel[] update(NmCommandBean cb,
                              Hashtable params)
                       throws WTException
Update a rule using the data in the request.

Supported API: false

Specified by:
update in interface NmRuleService
Parameters:
cb -
params -
Returns:
NmChangeModel[]
Throws:
WTException

enable

public NmChangeModel[] enable(NmCommandBean cb)
                       throws WTException


Supported API: false

Specified by:
enable in interface NmRuleService
Parameters:
cb -
Returns:
NmChangeModel[]
Throws:
WTException

disable

public NmChangeModel[] disable(NmCommandBean cb)
                        throws WTException


Supported API: false

Specified by:
disable in interface NmRuleService
Parameters:
cb -
Returns:
NmChangeModel[]
Throws:
WTException

getNmRule

public NmRule getNmRule(NmCommandBean cb,
                        Hashtable params)
                 throws WTException
Get the rule from the specified container for the specified rule type and object type.

Supported API: false

Specified by:
getNmRule in interface NmRuleService
Parameters:
cb -
params - the request parameters
Returns:
NmRule
Throws:
WTException

findTypes

public Enumeration findTypes(Class objType,
                             WTContainerRef container,
                             boolean enabled)
                      throws WTException
Find TypeBasedRules that are of type RuleType.TYPE 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:
findTypes in interface NmRuleService
Parameters:
objType - find rules that reference this object type
container - The container in which to search for types
enabled -
Returns:
Enumeration
Throws:
WTException

getNmRule

public NmRule getNmRule(Rule rule)
                 throws WTException
Gets a NmRule for the specified rule. Do not include the XML contents in the returned NmRule.

Supported API: false

Specified by:
getNmRule in interface NmRuleService
Parameters:
rule -
Returns:
NmRule
Throws:
WTException

getNmRule

public NmRule getNmRule(Rule rule,
                        boolean includeSpec)
                 throws WTException


Supported API: false

Specified by:
getNmRule in interface NmRuleService
Parameters:
rule -
includeSpec - if true include the XML specification in the returned
Returns:
NmRule
Throws:
WTException

getRuleProperties

public NmRule getRuleProperties(NmCommandBean cb,
                                boolean includeSpec)
                         throws WTException


Supported API: false

Specified by:
getRuleProperties in interface NmRuleService
Parameters:
cb -
includeSpec - if true, include the XML specification in the returned NmRule
Returns:
NmRule
Throws:
WTException

getRuleObjectTypeFromPersistId

public String getRuleObjectTypeFromPersistId(String ObjType)
                                      throws WTException


Supported API: false

Specified by:
getRuleObjectTypeFromPersistId in interface NmRuleService
Parameters:
ObjType -
Returns:
String
Throws:
WTException

getRule

private PersistentRule getRule(NmCommandBean cb)
                        throws WTException
Return the PersistentRule that is referenced by the command bean.

Throws:
WTException

getRuleRowData

private ArrayList getRuleRowData(NmRule nmRule)
                          throws WTException
Throws:
WTException

updateRule

private void updateRule(Rule rule,
                        Hashtable params)
                 throws NmException
Update the specified rule using the parameter values contained in the spcified Hashtable. The changes are NOT persisted.

Throws:
NmException

getContents

private String getContents(File xmlFile,
                           String encoding)
                    throws IOException,
                           WTException
Throws:
IOException
WTException

getChangeModel

private NmChangeModel getChangeModel(NmRule nmRule,
                                     int changeType)
                              throws WTException
Get a change model that represents the modification of or addition of the specified rule.

Throws:
WTException