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

Class ChangeSubscriptionMediator

    • Field Detail

      • COPYRIGHT

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

      • ChangeSubscriptionMediator

        public ChangeSubscriptionMediator()
    • Method Detail

      • create

        public void create(java.lang.Object aNoun)
                    throws AbstractApplicationException
        This method populates the physical data container with the physical SDO object to create. It sets all the Subscription data, including any provided user data, from the logical Subscription noun.
        Parameters:
        aNoun - The logical SubscriptionType SDO business object to create.
        Throws:
        AbstractApplicationException
      • createSchedulerJob

        public java.lang.Long createSchedulerJob(java.lang.Object noun,
                                                 java.lang.String scheduledActionName,
                                                 java.util.Date actionDate,
                                                 java.lang.Integer jobStatus,
                                                 TypedProperty parameters)
                                          throws AbstractApplicationException
        This method creates a scheduled action on the SUBSCRSCHJOBS table using the parameters specified. The subscription ID of the subscription for which the job is created is expected to be set in the subscription noun. If the job status is null, the job is marked active by default.
        Parameters:
        noun - The subscription type noun.
        scheduledActionName - The name of the scheduled action.
        actionDate - The action date on which the scheduled action is to be run.
        jobStatus - The status of the job.
        parameters - The request parameters for the scheduled job.
        Returns:
        The created scheduled action ID.
        Throws:
        AbstractApplicationException
      • validateCreate

        public java.util.List validateCreate(java.lang.Object aNoun)
                                      throws AbstractApplicationException
        This method checks if the logical Subscription noun can be created. By default, this method checks if the subscription type code is valid.
        Parameters:
        aNoun - The logical SubscriptionType SDO business object to validate.
        Returns:
        This method returns a list of ApplicationError if there are any errors, otherwise the list will be empty.
        Throws:
        AbstractApplicationException
      • change

        public void change(java.lang.Object aNoun)
                    throws AbstractApplicationException
        This method is called when a Process service with a custom action is called on the subscription. The method choose an appropriate action to perform on the noun based on the state of the logical Subscription noun. The custom actions supported by this method are:
        • Activate - The state of the subscription noun is set to Active and the activate method is called.
        • Cancel - The state of the subscription noun is set to Canceled and the cancel method is called.
        Specified by:
        change in interface ChangeBusinessObjectMediator
        Overrides:
        change in class AbstractChangeBusinessObjectMediatorImpl
        Parameters:
        aNoun - The logical SubscriptionType SDO business object.
        Throws:
        AbstractApplicationException
      • validateChange

        public java.util.List validateChange(java.lang.Object aNoun)
                                      throws AbstractApplicationException
        This method checks if the logical Subscription noun can be updated. If the noun cannot be updated, the appropriate error exception is added to the list of exceptions to be returned to the caller. Additional validation can be added in validateChange method of SubscriptionDetailsValidator
        Parameters:
        aNoun - The logical SubscriptionType SDO business object to validate.
        Returns:
        This method returns a list of ApplicationError if there are any errors, otherwise the list will be empty.
        Throws:
        AbstractApplicationException
        See Also:
        SubscriptionDetailsValidator#validateChange()}
      • delete

        public void delete(java.lang.Object aNoun)
                    throws AbstractApplicationException
        This method updates the physical data container with the physical SDO object to delete.
        Parameters:
        aNoun - The logical SubscriptionType SDO business object to delete.
        Throws:
        AbstractApplicationException
      • validateDelete

        public java.util.List validateDelete(java.lang.Object aNoun)
                                      throws AbstractApplicationException
        This method checks if the logical Subscription noun can be deleted. If the noun cannot be deleted, the appropriate error exception is added to the list of exceptions to be returned to the caller. Additional validation can be added in validateChange method of SubscriptionDetailsValidator
        Parameters:
        aNoun - The logical SubscriptionType SDO business object to validate.
        Returns:
        This method returns a list of ApplicationError if there are any errors, otherwise the list will be empty.
        Throws:
        AbstractApplicationException
        See Also:
        SubscriptionDetailsValidator#validateDelete()}
      • findPhysicalEntity

        public java.lang.Object findPhysicalEntity(java.lang.Object aNoun)
                                            throws AbstractApplicationException
        This method returns the physical SDO from the PhysicalDataContainer that was created in the initializePhysicalDataContainer method that matches the provided noun.
        Parameters:
        aNoun - The logical SubscriptionType SDO.
        Returns:
        This method returns the physical SDO object if it is found, otherwise it returns null.
        Throws:
        AbstractApplicationException