public class GiftListRulesRegistry extends java.lang.Object implements Registry
GiftListRulesRegistry
class stores the gift list rule
details which are configured in the GRREGRULE table. The class also stores a
list of validator class definitions used to validate each enabled rule
against the gift list object.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
GiftListRulesRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addRuleEntry(java.lang.Integer storeId,
java.lang.String eventTypeName,
java.lang.Integer name,
java.lang.String value)
Adds a new rule entry in to the registry cache.
|
java.util.Hashtable |
getAllValidators()
Returns all the rule validators defined in registry.
|
java.util.Hashtable |
getCreateRuleValidators()
Returns the validators for create rule defined in the rule validator configuration file.
|
java.util.Hashtable |
getDeleteRuleValidators()
Returns the validators for delete rule defined in the rule validator configuration file.
|
java.lang.String |
getRuleValue(java.lang.Integer storeId,
java.lang.String eventTypeName,
java.lang.Integer name)
Returns the rule value for a storeId, event type, rule name combination.
|
java.util.Hashtable |
getUpdateRuleValidators()
Returns the validators for update rule defined in the rule validator configuration file.
|
GiftListRulesValidator |
getValidatorInstance(java.lang.String implClassName)
Returns the gift list rule validator instance class based on the
implementation class name.
|
void |
initialize()
Initializes the rule registry.
|
void |
refresh()
Refreshes the memory to reload the rule details and the validator details.
|
void |
removeRuleEntry(java.lang.Integer storeId,
java.lang.String eventTypeName,
java.lang.Integer name)
Removes a rule entry from the registry cache.
|
static GiftListRulesRegistry |
singleton()
Returns the singleton instance of
GiftListRulesRegistry class that contains a reference to the cached data. |
public static final java.lang.String COPYRIGHT
public void initialize() throws java.lang.Exception
initialize
in interface Registry
java.lang.Exception
- if an error is encountered on initialization.public void refresh() throws java.lang.Exception
public static GiftListRulesRegistry singleton()
GiftListRulesRegistry
class that contains a reference to the cached data.public void addRuleEntry(java.lang.Integer storeId, java.lang.String eventTypeName, java.lang.Integer name, java.lang.String value)
storeId
- The store ID.eventTypeName
- The event type name.name
- The rule name.value
- The rule value.public java.lang.String getRuleValue(java.lang.Integer storeId, java.lang.String eventTypeName, java.lang.Integer name)
storeId
- The store ID.eventTypeName
- The event type.name
- The rule name.public void removeRuleEntry(java.lang.Integer storeId, java.lang.String eventTypeName, java.lang.Integer name)
storeId
- The store ID.eventTypeName
- The event type.name
- The rule name.public java.util.Hashtable getCreateRuleValidators()
GiftListServerConstants.GL_RULE_VALIDATION_CONFIG_XML
public java.util.Hashtable getUpdateRuleValidators()
GiftListServerConstants.GL_RULE_VALIDATION_CONFIG_XML
public java.util.Hashtable getDeleteRuleValidators()
GiftListServerConstants.GL_RULE_VALIDATION_CONFIG_XML
public GiftListRulesValidator getValidatorInstance(java.lang.String implClassName)
implClassName
- The validator implementation class.public java.util.Hashtable getAllValidators()