com.ibm.commerce.rules.commands
Class PersonalizationRuleServiceCommandBase

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.rules.commands.PersonalizationRuleServiceCommandBase
All Implemented Interfaces:
ECCommand, PersonalizationRuleServiceCommand, TaskCommand
Direct Known Subclasses:
ChangePersonalizationRuleServiceEnabledStateCommandBase, MarkPersonalizationRuleServiceChangedCommandJitImpl, PersonalizationRuleServiceDetailsCommandBase, PersonalizationRuleServiceInteractorCommandBase, RemovePersonalizationRuleServiceCommandJitImpl

public abstract class PersonalizationRuleServiceCommandBase
extends TaskCommandImpl
implements PersonalizationRuleServiceCommand

Common features of the personalization rule service commands are found here.

All personalization rule service commands require at least one input parameter: serviceName, a string representing the name of the service on which to operate. By default, commands assume the rule service exists within the current store and within the personalization rule server. There are no common output values.

Clients may use any constructor to create instances of this command that collaborate with objects other than the usual ones managed by the WCS command framework. These are primarily used for testing, but may be used for any purpose. The WCS command framework uses the no-argument constructor to create instances of this command for normal use.


Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.rules.commands.PersonalizationRuleServiceCommand
COPYRIGHT
 
Fields inherited from interface com.ibm.commerce.command.ECCommand
defaultCommandClassName
 
Constructor Summary
PersonalizationRuleServiceCommandBase()
           
PersonalizationRuleServiceCommandBase(RulesSystemDataModel aRulesSystemDataModel)
           
PersonalizationRuleServiceCommandBase(java.lang.String aPersonalizationRuleServerName, RulesSystemDataModel aRulesSystemDataModel)
          This constructor accepts instances of all collaborating classes.
 
Method Summary
protected  void doCheckParameter(java.lang.String parameterName, java.lang.Object parameterValue)
          Convenience method that checks parameterValue for null and throws an exception in that case.
protected abstract  void doPerformExecute()
          A primitive method that does the "real work" of the command.
protected static java.lang.String getDefaultPersonalizationRuleServerName()
           
protected static RulesSystemDataModel getDefaultRulesSystemDataModel()
           
protected  java.lang.String getPersonalizationRuleServerName()
           
protected  RuleServiceKey getRuleServiceKey()
           
protected  RulesSystemDataModel getRulesSystemDataModel()
           
protected  java.lang.String getServiceName()
           
 void performExecute()
          A template method that ensures consistent handling of invalid parameters and exceptions.
 void reset()
          This method is called after a command has been executed to reset its states variables.
 void setServiceName(java.lang.String aServiceName)
           
protected  void unsetParameters()
           
 void validateParameters()
          Performs server side parameter checking.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Constructor Detail

PersonalizationRuleServiceCommandBase

public PersonalizationRuleServiceCommandBase()

PersonalizationRuleServiceCommandBase

public PersonalizationRuleServiceCommandBase(RulesSystemDataModel aRulesSystemDataModel)

PersonalizationRuleServiceCommandBase

public PersonalizationRuleServiceCommandBase(java.lang.String aPersonalizationRuleServerName,
                                             RulesSystemDataModel aRulesSystemDataModel)
This constructor accepts instances of all collaborating classes. Clients can use this for maximum flexibility in testing or diagnostics.
Parameters:
aPersonalizationRuleServerName - The name of the personalization rule server to use.
aRulesSystemDataModel - The rules system data model to use.
Method Detail

doCheckParameter

protected void doCheckParameter(java.lang.String parameterName,
                                java.lang.Object parameterValue)
                         throws ParameterNotFoundException
Convenience method that checks parameterValue for null and throws an exception in that case.

Clients can use this method to simplify validateParameters in subclasses as follows.

 public void validateParameters() throws ECException {
     doCheckParameter("commandContext", commandContext);
     doCheckParameter("parameter1", parameter1);
     doCheckParameter("parameter2", parameter2);
 }
 
Parameters:
parameterName - The name of the parameter.
parameterValue - The value of the parameter.
Throws:
ParameterNotFoundException - Thrown if parameterValue is null.

doPerformExecute

protected abstract void doPerformExecute()
                                  throws ECException
A primitive method that does the "real work" of the command. Called by performExecute.

getDefaultPersonalizationRuleServerName

protected static java.lang.String getDefaultPersonalizationRuleServerName()

getDefaultRulesSystemDataModel

protected static RulesSystemDataModel getDefaultRulesSystemDataModel()

getPersonalizationRuleServerName

protected java.lang.String getPersonalizationRuleServerName()

getRuleServiceKey

protected RuleServiceKey getRuleServiceKey()

getRulesSystemDataModel

protected RulesSystemDataModel getRulesSystemDataModel()

getServiceName

protected java.lang.String getServiceName()

performExecute

public void performExecute()
                    throws ECException
A template method that ensures consistent handling of invalid parameters and exceptions. Does the following.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
See Also:
ECCommand

reset

public void reset()
Description copied from class: AbstractECCommand
This method is called after a command has been executed to reset its states variables. After the call to reset, we should be able to execute the command again.
Overrides:
reset in class AbstractECCommand
See Also:
ECCommand

setServiceName

public void setServiceName(java.lang.String aServiceName)
Specified by:
setServiceName in interface PersonalizationRuleServiceCommand

unsetParameters

protected void unsetParameters()

validateParameters

public void validateParameters()
                        throws ECException
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -