com.ibm.commerce.utf.commands
Class DeleteOrderCommentsTCCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.utf.commands.DeleteOrderCommentsTCCmdImpl
All Implemented Interfaces:
DeleteOrderCommentsTCCmd, ECCommand, TaskCommand

public class DeleteOrderCommentsTCCmdImpl
extends TaskCommandImpl
implements DeleteOrderCommentsTCCmd

Deletes Terms and Conditions of type "OrderComments".

Behaviour

  1. Verifies that a trading ID has been provided
  2. Finds a list of all the TCs of type "OrderComments" for the given trading ID.
  3. Deletes every TC froom the above list, which is found in the incoming tcVector.
  4. If the incoming tcVector is empty, deletes all the "OrderComments" TCs found for the trading ID.


Field Summary
 java.util.Vector tcVector
           
 java.lang.Long tradingId
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.utf.commands.DeleteOrderCommentsTCCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
DeleteOrderCommentsTCCmdImpl()
           
 
Method Summary
 void deleteAllOrderCommentsTCs()
          Finds all the terms and conditions of type "OrderComments" for the given trading agreement ID and deletes them.
 void deleteIncomingTCs()
          Finds all the terms and conditions of type "OrderComments" for the given trading agreement ID.
 java.util.Vector getTcVector()
          Retrieves the list of IDs of terms and conditions to be deleted.
 java.lang.Long getTradingId()
          Retrieves the trading agreement ID.
 void performExecute()
          Calls the deleteAllOrderCommentsTCs method if the incoming tcVector is null.
 void setTcVector(java.util.Vector newTcVector)
          Stores the list of IDs corresponding to the term and conditions to be deleted.
 void setTradingId(java.lang.Long newTradingId)
          Stores the trading ID.
 void validateParameters()
          Checks for an incoming trading agreement ID.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Field Detail

tcVector

public java.util.Vector tcVector

tradingId

public java.lang.Long tradingId
Constructor Detail

DeleteOrderCommentsTCCmdImpl

public DeleteOrderCommentsTCCmdImpl()
Method Detail

deleteAllOrderCommentsTCs

public void deleteAllOrderCommentsTCs()
                               throws ECException
Finds all the terms and conditions of type "OrderComments" 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.

deleteIncomingTCs

public void deleteIncomingTCs()
                       throws ECException
Finds all the terms and conditions of type "OrderComments" 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.

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 deleteAllOrderCommentsTCs method if the incoming tcVector is null. Otherwise, calls the deleteIncomingTCs method.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

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 DeleteOrderCommentsTCCmd
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 DeleteOrderCommentsTCCmd
Parameters:
newTradingid - The trading ID.

validateParameters

public void validateParameters()
                        throws ECException
Checks for an incoming trading agreement ID.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Throws:
ECApplicationException - If the trading agreement ID has not been provided.