com.ibm.commerce.giftcenter.rules.validation

Class ValidateGiftListRulesHelper

  • java.lang.Object
    • com.ibm.commerce.giftcenter.rules.validation.ValidateGiftListRulesHelper


  • public class ValidateGiftListRulesHelper
    extends java.lang.Object
    This helper class validates the business rules for creating, updating, and deleting gift lists. This class obtains the appropriate rule validators for each rule and invokes them based on the event. This class is loaded from the change mediators for the GiftList noun and its associated noun parts.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean validateARule(java.lang.Object noun, java.lang.Object nounPart, java.lang.Integer ruleName, java.lang.String event)
      Validates a rule against the noun and noun part for a particular event.
      java.lang.Integer validateOnCreate(java.lang.Object noun, java.lang.Object nounPart)
      Calls all of the create rule validators passing the gift list data.
      boolean validateOnCreate(java.lang.Object noun, java.lang.Object nounPart, java.lang.Integer rule)
      Validates a rule on creation of a noun part.
      java.lang.Integer validateOnDelete(java.lang.Object noun, java.lang.Object nounPart)
      Calls all of the delete rule validators passing the gift list data.
      boolean validateOnDelete(java.lang.Object noun, java.lang.Object nounPart, java.lang.Integer rule)
      Validates a rule on delete of a noun or noun part.
      java.lang.Integer validateOnUpdate(java.lang.Object noun, java.lang.Object nounPart)
      Calls all of the update rule validators passing the gift list data.
      boolean validateOnUpdate(java.lang.Object noun, java.lang.Object nounPart, java.lang.Integer rule)
      Validates a rule on update of a noun or noun part.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ValidateGiftListRulesHelper

        public ValidateGiftListRulesHelper()
    • Method Detail

      • validateOnCreate

        public java.lang.Integer validateOnCreate(java.lang.Object noun,
                                                  java.lang.Object nounPart)
                                           throws GiftListRuleValidationException
        Calls all of the create rule validators passing the gift list data.
        Parameters:
        noun - The GiftList noun that need to be validated.
        nounPart - The GiftList noun part to use to validate the part data against a rule, rather than using the whole GiftList noun.
        Returns:
        An integer value indicating the ruleName that failed to satisfy a business rule. If all the rules are satisfied by the business object, a null value is returned.
        Throws:
        GiftListRuleValidationException
      • validateOnCreate

        public boolean validateOnCreate(java.lang.Object noun,
                                        java.lang.Object nounPart,
                                        java.lang.Integer rule)
                                 throws GiftListRuleValidationException
        Validates a rule on creation of a noun part.
        Parameters:
        noun - The GiftList noun that need to be validated.
        nounPart - The GiftList noun part to use to validate the part data against a rule, rather than using the whole GiftList noun.
        rule - The rule name.
        Returns:
        A boolean value to indicate whether the noun or the noun part satisfies the business rule.
        Throws:
        GiftListRuleValidationException
      • validateOnDelete

        public java.lang.Integer validateOnDelete(java.lang.Object noun,
                                                  java.lang.Object nounPart)
                                           throws GiftListRuleValidationException
        Calls all of the delete rule validators passing the gift list data.
        Parameters:
        noun - The GiftList noun that need to be validated.
        nounPart - The GiftList noun part to use to validate the part data against a rule, rather than using the whole GiftList noun.
        Returns:
        An integer value indicating the ruleName that failed to satisfy a business rule. If all the rules are satisfied by the business object, a null value is returned.
        Throws:
        GiftListRuleValidationException
      • validateOnDelete

        public boolean validateOnDelete(java.lang.Object noun,
                                        java.lang.Object nounPart,
                                        java.lang.Integer rule)
                                 throws GiftListRuleValidationException
        Validates a rule on delete of a noun or noun part.
        Parameters:
        noun - The GiftList noun that need to be validated.
        nounPart - The GiftList noun part to use to validate the part data against a rule, rather than using the whole GiftList noun.
        rule - The rule to be evaluated on the noun.
        Returns:
        The boolean value which indicates whether the evaluation of the rule was successful or not.
        Throws:
        GiftListRuleValidationException
      • validateOnUpdate

        public java.lang.Integer validateOnUpdate(java.lang.Object noun,
                                                  java.lang.Object nounPart)
                                           throws GiftListRuleValidationException
        Calls all of the update rule validators passing the gift list data.
        Parameters:
        noun - The GiftList noun that need to be validated.
        nounPart - The GiftList noun part to use to validate the part data against a rule, rather than using the whole GiftList noun.
        Returns:
        An integer value indicating the ruleName that failed to satisfy a business rule. If all the rules are satisfied by the business object, a null value is returned.
        Throws:
        GiftListRuleValidationException
      • validateOnUpdate

        public boolean validateOnUpdate(java.lang.Object noun,
                                        java.lang.Object nounPart,
                                        java.lang.Integer rule)
                                 throws GiftListRuleValidationException
        Validates a rule on update of a noun or noun part.
        Parameters:
        noun - The GiftList noun that need to be validated.
        nounPart - The GiftList noun part to use to validate the part data against a rule, rather than using the whole GiftList noun.
        rule - The rule to be evaluated on the noun.
        Returns:
        The boolean value which indicates whether the evaluation of the rule was successful or not.
        Throws:
        GiftListRuleValidationException
      • validateARule

        public boolean validateARule(java.lang.Object noun,
                                     java.lang.Object nounPart,
                                     java.lang.Integer ruleName,
                                     java.lang.String event)
                              throws GiftListRuleValidationException
        Validates a rule against the noun and noun part for a particular event.
        Parameters:
        noun - The GiftList noun that need to be validated.
        nounPart - The GiftList noun part to use to validate the part data against a rule, rather than using the whole GiftList noun.
        ruleName - The rule name that need to be validated against the noun or noun part.
        event - Whether create, update or delete event for a gift list object.
        Returns:
        A boolean value to indicate whether the rule evaluated successfully or not.
        Throws:
        GiftListRuleValidationException