com.ibm.commerce.giftcenter.facade.server.services.dataaccess.bom.mediator

Class ChangeGiftListItemPartMediator

    • Field Detail

      • COPYRIGHT

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

        public static java.lang.String[] xpaths
        The XPath supported by the mediator.
      • MAX_PERSONALIZATION_ATTRIBUTE_KEY_LENGTH

        public static final java.lang.Integer MAX_PERSONALIZATION_ATTRIBUTE_KEY_LENGTH
        Integer constant defined for the maximum length of a personalization attribute key.
      • MAX_PERSONALIZATION_ATTRIBUTE_VALUE_LENGTH

        public static final java.lang.Integer MAX_PERSONALIZATION_ATTRIBUTE_VALUE_LENGTH
        Integer constant defined for the maximum length of a personalization attribute key.
    • Constructor Detail

      • ChangeGiftListItemPartMediator

        public ChangeGiftListItemPartMediator()
    • Method Detail

      • create

        public void create(java.lang.Object noun,
                           java.lang.Object nounPart)
                    throws AbstractApplicationException
        Creates the physical gift list item to be persisted. If the gift list item already exists, the item will be updated. It also creates or updates the personalization attributes passed, if any.
        Parameters:
        noun - - The gift list for which the item is created.
        nounPart - - The gift list item to be created.
        Throws:
        AbstractApplicationException - - when the create fails.
      • delete

        public void delete(java.lang.Object noun,
                           java.lang.Object nounPart)
                    throws AbstractApplicationException
        Deletes a gift list item from a gift list.
        Parameters:
        noun - - The gift list from which the item is to be deleted.
        nounPart - - The gift list item to delete.
        Throws:
        AbstractApplicationException - - when the delete fails.
      • findPhysicalEntity

        public java.lang.Object findPhysicalEntity(java.lang.Object noun,
                                                   java.lang.Object nounPart)
                                            throws AbstractApplicationException
        Finds a physical gift list item entity from the initialized physical data container. It matches by gift list item ID and part number if available. If there is a match, the corresponding physical gift list item is returned.
        Parameters:
        noun - - The gift list noun object.
        nounPart - - The gift list item to be resolved.
        Returns:
        Object - The physical gift list item if found, else null.
        Throws:
        AbstractApplicationException - - when an exception occurs
      • getNounPartXPaths

        public java.lang.String[] getNounPartXPaths()
        Returns the noun part XPaths supported by the mediator.
        Returns:
        An array of XPath strings
      • update

        public void update(java.lang.Object noun,
                           java.lang.Object nounPart)
                    throws AbstractApplicationException
        Updates the gift list item. If the quantity requested is set to zero, the item will be deleted.
        Parameters:
        noun - - The gift list noun object.
        nounPart - - The gift list item to be updated.
        Throws:
        AbstractApplicationException - - when the new quantity becomes negative.
      • validateChange

        public java.util.List validateChange(java.lang.Object noun,
                                             java.lang.Object nounPart)
                                      throws AbstractApplicationException
        Validates if the change request for the gift list item can be performed or not. If the item to be updated does not exist, an error is returned. In addition to this, the following fields are validated.
      • /GiftList/GiftListIdentifier
      • /GiftList/Item/Attributes
Specified by:
validateChange in interface ChangeBusinessObjectPartMediator
Overrides:
validateChange in class AbstractChangeGiftListPartMediator
Parameters:
noun - - The gift list object.
nounPart - - The gift list item object.
Returns:
List - A list of application errors.
Throws:
AbstractApplicationException - - not thrown.
  • validateCreate

    public java.util.List validateCreate(java.lang.Object noun,
                                         java.lang.Object nounPart)
                                  throws AbstractApplicationException
    Validates if the item can be created successfully in the table. To add an item to the GiftList or WishList, the following fields are required to be passed.
  • /GiftList/GiftListIdentifier/UniqueID
  • /GiftList/Item/QuantityRequested/Quantity
Specified by:
validateCreate in interface ChangeBusinessObjectPartMediator
Overrides:
validateCreate in class AbstractChangeGiftListPartMediator
Parameters:
noun - - The noun of type GiftListType
nounPart - - The nounpart of type GiftListItemType
Returns:
List - A list of ApplicationError objects encountered during validation. The list will be empty if no errors are encountered.
Throws:
AbstractApplicationException - - when an exception occurs.