com.ibm.commerce.utf.commands

Class DeleteOrderItemPAttributeTCCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, DeleteOrderItemPAttributeTCCmd, 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 DeleteOrderItemPAttributeTCCmdImpl
    extends TaskCommandImpl
    implements DeleteOrderItemPAttributeTCCmd
    Deletes terms and conditions of type "OrderItemPAttribute".

    Behaviour

    1. Verifies that a trading ID has been provided.
    2. Finds a list of all the TCs of type "OrderItemPAttribute" for the given trading ID.
    3. Deletes every TC from the above list, which is found in the incoming tcVector.
    4. If the incoming tcVector is empty, deletes all the "OrderItemPAttribute" TCs found for the trading ID.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public java.lang.Long tradingId
        Trading Id.
      • tcVector

        public java.util.Vector tcVector
        Vector.
    • Constructor Detail

      • DeleteOrderItemPAttributeTCCmdImpl

        public DeleteOrderItemPAttributeTCCmdImpl()
        Default Constructor.
    • Method Detail

      • reset

        public void reset()
        Reset the command.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • deleteAllOrderItemPAttributeTCs

        public void deleteAllOrderItemPAttributeTCs()
                                             throws ECException
        Finds all the terms and conditions of type "OrderPAttribute" for the given trading agreement ID and deletes them.
        Throws:
        ECApplicationException - If an application error occurs while deleting TCs.
        ECSystemException - If a system error occurs while deleting TCs.
        ECException
      • deleteIncomingTCs

        public void deleteIncomingTCs()
                               throws ECException
        Finds all the terms and conditions of type "OrderItemPAttribute" for the given trading agreement ID. Out of these, deletes all the TCs with IDs that are in the incoming tcVector.
        Throws:
        ECApplicationException - If an application error occurs while deleting TCs.
        ECSystemException - If a system error occurs while deleting TCs.
        ECException
      • getTcVector

        public java.util.Vector getTcVector()
        Retrieves the list of IDs of terms and conditions to be deleted.
        Returns:
        The list of TC IDs.
      • getTradingId

        public java.lang.Long getTradingId()
        Retrieves the trading agreement ID.
        Returns:
        The trading agreement ID.
      • performExecute

        public void performExecute()
                            throws ECException
        Calls the deleteAllOrderItemPAttributeTCs method if the incoming tcVector is null. Otherwise, calls the deleteIncomingTCs method.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
        See Also:
        ECCommand#performExecute()
      • setTcVector

        public void setTcVector(java.util.Vector newTcVector)
        Stores the list of IDs corresponding to the term and conditions to be deleted.
        Specified by:
        setTcVector in interface DeleteOrderItemPAttributeTCCmd
        Parameters:
        newTcVector - The list of term and condition IDs.
      • setTradingId

        public void setTradingId(java.lang.Long newTradingId)
        Stores the trading ID.
        Specified by:
        setTradingId in interface DeleteOrderItemPAttributeTCCmd
        Parameters:
        newTradingid - The trading ID.