com.ibm.commerce.rules
Class RulesSystemDataModelMemoryImpl

java.lang.Object
  |
  +--com.ibm.commerce.rules.RulesSystemDataModel
        |
        +--com.ibm.commerce.rules.RulesSystemDataModelMemoryImpl

public class RulesSystemDataModelMemoryImpl
extends RulesSystemDataModel

Provides a memory-based implementation of the data model.


Inner Class Summary
static class RulesSystemDataModelMemoryImpl.RuleServiceConfigurationKey
          The key for the rule service configurations map.
 
Fields inherited from class com.ibm.commerce.rules.RulesSystemDataModel
COPYRIGHT
 
Constructor Summary
RulesSystemDataModelMemoryImpl()
           
 
Method Summary
 void addRuleServerConfiguration(RuleServerConfiguration aRuleServerConfiguration)
          Adds a rule server configuration, replacing one if it exists.
 void addRuleServerConfiguration(java.lang.String aServerName)
          Adds a rule server configuration, replacing any with the same name.
 void addRuleServiceConfiguration(RuleServiceConfiguration aRuleServiceConfiguration)
          Adds a rule service configuration, replacing any with the same rule server and rule service key, if any.
 void addRuleServiceStatus(java.lang.String aServerName, RuleServiceKey aServiceKey, java.lang.String aCloneName, RuleServiceStatusCode aStatusCode)
          Adds a rule service status clone report.
 void clear()
          Clears the contents of this data model.
 boolean commitRuleServerConfiguration(RuleServerConfiguration aRuleServerConfiguration)
          Commits the specified rule server configuration to this data model's persistent store.
 boolean commitRuleServiceConfiguration(RuleServiceConfiguration aRuleServiceConfiguration)
          Commits the specified rule service configuration to this data model's persistent store.
 void commitRuleServiceStatus(java.lang.String aServerName, RuleServiceKey aServiceKey, java.lang.String aCloneName, RuleServiceStatusCode aStatusCode)
          commitRuleServiceStatus method comment.
 int countRuleServiceConfigurations()
          Counts the number of rule service configurations in all rule servers
 int countRuleServiceConfigurationsInServer(java.lang.String aServerName)
          Counts the number of rule service configurations in the specified rule server.
 void eachRuleServiceConfiguration(RuleServiceConfigurationBlock command)
          Executes the specified block of code for each rule service configuration in all rule servers.
 void eachRuleServiceConfigurationInServer(java.lang.String aServerName, RuleServiceConfigurationBlock command)
          Executes the specified block of code for each rule service configuration in the specified server.
 RuleServerConfiguration lookupRuleServerConfiguration(java.lang.String aServerName)
          Retrieves the rule server configuration with the specified name.
 RuleServiceConfiguration lookupRuleServiceConfiguration(java.lang.String aServerName, RuleServiceKey aRuleServiceKey)
          Retrieves the rule service configuration in the specified rule server with the specified identifying key.
 RuleServiceStatus lookupRuleServiceStatus(java.lang.String aServerName, RuleServiceKey aServiceKey)
          lookupRuleServiceStatus method comment.
 void removeAllServiceConfigurations()
           
 void removeRuleServerConfiguration(java.lang.String aServerName)
          Removes a rule server configuration specified by name, along with all its configured rule services.
 void removeRuleServiceConfiguration(java.lang.String aServerName, RuleServiceKey aRuleServiceKey)
          Removes a rule service configuration from the rule server specified by name.
 void removeRuleServiceConfigurations(RuleServiceConfigurationFilter filter)
          Removes the rule service configurations accepted by the specified filter.
 boolean ruleServerConfigurationExists(java.lang.String aServerName)
          Answers the question, "Does a rule server configuration exist in the persistent store with this name?"
 boolean ruleServiceConfigurationExists(java.lang.String aServerName, RuleServiceKey aServiceKey)
          Answers the question, "Does a rule service configuration exist in the persistent store with this key and in this rule server?"
 boolean ruleServiceStatusExists(java.lang.String aServerName, RuleServiceKey aServiceKey)
          Answers the question, "Is there a rule service status report in the persistent store for this rule service key in this rule server?"
 
Methods inherited from class com.ibm.commerce.rules.RulesSystemDataModel
createBlazeRuleServiceConfiguration, getInstance, reset, ruleServerConfigurationExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RulesSystemDataModelMemoryImpl

public RulesSystemDataModelMemoryImpl()
Method Detail

addRuleServerConfiguration

public void addRuleServerConfiguration(RuleServerConfiguration aRuleServerConfiguration)
Adds a rule server configuration, replacing one if it exists. Used for testing.

addRuleServerConfiguration

public void addRuleServerConfiguration(java.lang.String aServerName)
Adds a rule server configuration, replacing any with the same name. Used for testing.

addRuleServiceConfiguration

public void addRuleServiceConfiguration(RuleServiceConfiguration aRuleServiceConfiguration)
Adds a rule service configuration, replacing any with the same rule server and rule service key, if any. Used for testing.

addRuleServiceStatus

public void addRuleServiceStatus(java.lang.String aServerName,
                                 RuleServiceKey aServiceKey,
                                 java.lang.String aCloneName,
                                 RuleServiceStatusCode aStatusCode)
Adds a rule service status clone report. Used for testing.

clear

public void clear()
Clears the contents of this data model.

commitRuleServerConfiguration

public boolean commitRuleServerConfiguration(RuleServerConfiguration aRuleServerConfiguration)
                                      throws RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Commits the specified rule server configuration to this data model's persistent store.
Overrides:
commitRuleServerConfiguration in class RulesSystemDataModel
See Also:
RulesSystemDataModel

commitRuleServiceConfiguration

public boolean commitRuleServiceConfiguration(RuleServiceConfiguration aRuleServiceConfiguration)
                                       throws RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Commits the specified rule service configuration to this data model's persistent store.
Overrides:
commitRuleServiceConfiguration in class RulesSystemDataModel
See Also:
RulesSystemDataModel

commitRuleServiceStatus

public void commitRuleServiceStatus(java.lang.String aServerName,
                                    RuleServiceKey aServiceKey,
                                    java.lang.String aCloneName,
                                    RuleServiceStatusCode aStatusCode)
commitRuleServiceStatus method comment.
Overrides:
commitRuleServiceStatus in class RulesSystemDataModel
Following copied from class: com.ibm.commerce.rules.RulesSystemDataModel
Parameters:
aServerName - The name of the rule server to which the rule service belongs.
aServiceKey - The identifying key of the rule service.
aCloneName - The name of the clone for which the rule service status is to be reported.
aStatusCode - The status to report for the rule service.
Throws:
RuleServerConfigurationNotFoundException - Indicates that the rule server configuration for the rule server to which the specified rule service belongs does not exist.

countRuleServiceConfigurations

public int countRuleServiceConfigurations()
Description copied from class: RulesSystemDataModel
Counts the number of rule service configurations in all rule servers
Overrides:
countRuleServiceConfigurations in class RulesSystemDataModel
See Also:
RulesSystemDataModel

countRuleServiceConfigurationsInServer

public int countRuleServiceConfigurationsInServer(java.lang.String aServerName)
                                           throws RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Counts the number of rule service configurations in the specified rule server. Note that if the specified server is not found, this method does not throw an exception; instead, it returns 0. Use ruleServerConfigurationExists(aServerName) if you are unsure whether the rule server configuration exists for your specified server.
Overrides:
countRuleServiceConfigurationsInServer in class RulesSystemDataModel
See Also:
RulesSystemDataModel

eachRuleServiceConfiguration

public void eachRuleServiceConfiguration(RuleServiceConfigurationBlock command)
                                  throws RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Executes the specified block of code for each rule service configuration in all rule servers.
Overrides:
eachRuleServiceConfiguration in class RulesSystemDataModel
See Also:
RulesSystemDataModel

eachRuleServiceConfigurationInServer

public void eachRuleServiceConfigurationInServer(java.lang.String aServerName,
                                                 RuleServiceConfigurationBlock command)
                                          throws RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Executes the specified block of code for each rule service configuration in the specified server. Note that if the specified server is not found, this method does not throw an exception; instead, it does nothing. Use ruleServerConfigurationExists(aServerName) if you are unsure whether the rule server configuration exists for your specified server.
Overrides:
eachRuleServiceConfigurationInServer in class RulesSystemDataModel
See Also:
RulesSystemDataModel

lookupRuleServerConfiguration

public RuleServerConfiguration lookupRuleServerConfiguration(java.lang.String aServerName)
                                                      throws RulesSystemDataModelException,
                                                             RuleServerConfigurationNotFoundException
Description copied from class: RulesSystemDataModel
Retrieves the rule server configuration with the specified name.
Overrides:
lookupRuleServerConfiguration in class RulesSystemDataModel
See Also:
RulesSystemDataModel

lookupRuleServiceConfiguration

public RuleServiceConfiguration lookupRuleServiceConfiguration(java.lang.String aServerName,
                                                               RuleServiceKey aRuleServiceKey)
                                                        throws RuleServiceConfigurationNotFoundException,
                                                               RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Retrieves the rule service configuration in the specified rule server with the specified identifying key.
Overrides:
lookupRuleServiceConfiguration in class RulesSystemDataModel
See Also:
RulesSystemDataModel

lookupRuleServiceStatus

public RuleServiceStatus lookupRuleServiceStatus(java.lang.String aServerName,
                                                 RuleServiceKey aServiceKey)
                                          throws RuleServerConfigurationNotFoundException,
                                                 RuleServiceConfigurationNotFoundException,
                                                 RulesSystemDataModelException
lookupRuleServiceStatus method comment.
Overrides:
lookupRuleServiceStatus in class RulesSystemDataModel
Following copied from class: com.ibm.commerce.rules.RulesSystemDataModel
Throws:
RuleServerConfigurationNotFoundException - Indicates that the rule server configuration does not exist.
RuleServiceConfigurationNotFoundException - Indicates that the rule service configuration does not exist in the specified rule server.

removeAllServiceConfigurations

public void removeAllServiceConfigurations()

removeRuleServerConfiguration

public void removeRuleServerConfiguration(java.lang.String aServerName)
Description copied from class: RulesSystemDataModel
Removes a rule server configuration specified by name, along with all its configured rule services. Clients should call ruleServerConfigurationExists(aServerName) first to determine whether the rule server configuration already exists.
Overrides:
removeRuleServerConfiguration in class RulesSystemDataModel

removeRuleServiceConfiguration

public void removeRuleServiceConfiguration(java.lang.String aServerName,
                                           RuleServiceKey aRuleServiceKey)
                                    throws RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Removes a rule service configuration from the rule server specified by name.
Overrides:
removeRuleServiceConfiguration in class RulesSystemDataModel
See Also:
RulesSystemDataModel

removeRuleServiceConfigurations

public void removeRuleServiceConfigurations(RuleServiceConfigurationFilter filter)
                                     throws RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Removes the rule service configurations accepted by the specified filter.

For example, to remove all disabled rule service configurations, clients can write the following.

 aRulesSystemDataModel.removeRuleServiceConfigurations(new RuleServiceConfigurationFilter() {
     // Return true to indicate that the rules system data model
     // should remove this rule service configuration.
     public boolean accept(RuleServiceConfiguration each) {
         return !each.isEnabled();
     }
 });
 
Overrides:
removeRuleServiceConfigurations in class RulesSystemDataModel
See Also:
RulesSystemDataModel

ruleServerConfigurationExists

public boolean ruleServerConfigurationExists(java.lang.String aServerName)
                                      throws RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Answers the question, "Does a rule server configuration exist in the persistent store with this name?"
Overrides:
ruleServerConfigurationExists in class RulesSystemDataModel
See Also:
RulesSystemDataModel

ruleServiceConfigurationExists

public boolean ruleServiceConfigurationExists(java.lang.String aServerName,
                                              RuleServiceKey aServiceKey)
                                       throws RulesSystemDataModelException
Description copied from class: RulesSystemDataModel
Answers the question, "Does a rule service configuration exist in the persistent store with this key and in this rule server?"
Overrides:
ruleServiceConfigurationExists in class RulesSystemDataModel
See Also:
RulesSystemDataModel

ruleServiceStatusExists

public boolean ruleServiceStatusExists(java.lang.String aServerName,
                                       RuleServiceKey aServiceKey)
Description copied from class: RulesSystemDataModel
Answers the question, "Is there a rule service status report in the persistent store for this rule service key in this rule server?"
Overrides:
ruleServiceStatusExists in class RulesSystemDataModel