com.ibm.commerce.component.giftregistry.commands

Class ValidateGiftRegistryValuesCmdImpl

  • All Implemented Interfaces:
    BusinessObjectDocumentCmd, com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, ValidateGiftRegistryValuesCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class ValidateGiftRegistryValuesCmdImpl
    extends BusinessObjectDocumentCmdImpl
    implements ValidateGiftRegistryValuesCmd
    Validates the gift registry value object based on the business rules.
    The class will validate each of the gift registries in the incoming UpdateGiftRegistryBOD and then validate the gift items. Validation is based on the defined business rules stored in the GRREGRULES table.

    Called from Operation: UpdateGiftRegistryCmd
    In Parameter: UpdateGiftRegistryBOD
    Result: Returns ECApplicationException if an error occurs.

    If an error occurs when validating a gift registry value object, the GiftRegistryVO along with a GiftRegistryMessage will be added to the error hashtable. If an error occurs when validating a gift item, the GiftRegistryItemVO along with a GiftRegistryMessage will be added to a hashtable. The hashtable will be returned to as part of the ECApplicationException.

    On error, a ECApplicationException is thrown with possible messages:
    • GiftRegistryMessage._ERR_GIFT_REGISTRY_QUANTITY_INVALID
    • GiftRegistryMessage._ERR_GIFT_REGISTRY_FAILED_DURING_VALIDATION
    • GiftRegistryMessage._ERR_GIFT_REGISTRY_RULE_VIOLATED
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String CLASSNAME
        The class name of this class
    • Constructor Detail

      • ValidateGiftRegistryValuesCmdImpl

        public ValidateGiftRegistryValuesCmdImpl()
    • Method Detail

      • performExecute

        public void performExecute()
                            throws ECException
        Executes this task command. The following business rules are validated in this command:
        • check to see if the maximum number of registries allowed is exceeded - EC_RULE_MAXIMUM_NUM_OF_REGISTRIES
        • validate the registry event date to ensure date is not before the minimum advance days - EC_RULE_DAYS_EVENT_DATE_VALID_IN_PAST
        • validate the registry event date to ensure date is not after the maximum advance days - EC_RULE_DAYS_EVENT_DATE_VALID_IN_FUTURE
        • validate the registry event date to ensure date can be updated to the past - EC_RULE_EVENT_DATE_IN_PAST

        It also calls CheckGiftRegistryItemEligibilityCmd to validate each item based on the defined business rules.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException