com.ibm.commerce.contract.commands

Class CopyContractCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.CacheableCommandImpl
      • com.ibm.commerce.command.MeasuredCacheableCommandImpl
        • com.ibm.commerce.command.AbstractECTargetableCommand
          • com.ibm.commerce.command.TaskCommandImpl
            • com.ibm.commerce.contract.commands.CopyContractCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.command.TaskCommand, CopyContractCmd, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class CopyContractCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements CopyContractCmd
    This is the default implementation of the CopyContractCmd task command.

    Behaviour:

      Copy a specified contract to a new contract (WebSphere Commerce Enterprise only).

    Task commands called:

    AccessBeans called:

    • ContractAccessBean
    • TradingAgreementAccessBean
    • TradingDescriptionAccessBean
    • ParticipantAccessBean
    • AttachmentAccessBean
    • TradingAttachmentRelationAccessBean
    • ContractDisplayAccessBean
    • PolicyTCRelationAccessBean
    • TermConditionDescriptionAccessBean
    • TermConditionAccessBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void createNewContract()
      Creates a new contract based on an existing contract.
      void createNewVersionInContractChildTable()
      Copys other contract related data for the new contract based on the existing contract.
      void createNewVersionInTCChildTable(java.lang.Long newTCId, java.lang.Long originalTCId)
      Copys terms and conditions related data for the new contract based on the existing contract.
      java.lang.Long getNewContractId()
      Returns ID of the new contract.
      void performExecute()
      Executes the business logic of this command implementation.
      void setAccountId(java.lang.Long anAccountId)
      Sets the ID of the account to which the contract will be copied.
      void setContractId(java.lang.Long anContractId)
      Sets ID of the contract which will be copied from.
      void setContractMajorVersion(java.lang.Integer majorVersion)
      Sets the major version of the new contract.
      void setContractMinorVersion(java.lang.Integer minorVersion)
      Sets the minor version of the new contract.
      void setContractName(java.lang.String contractName)
      Sets the name of the new contract.
      void validateParameters()
      Validates if the id of the original contract was provided.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand

        accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
      • Methods inherited from interface com.ibm.commerce.command.CacheableECCommand

        execute
      • Methods inherited from interface com.ibm.commerce.command.ECCommand

        checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
    • Field Detail

      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The name of this class.
        See Also:
        Constant Field Values
      • COPYRIGHT

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

      • CopyContractCmdImpl

        public CopyContractCmdImpl()
    • Method Detail

      • createNewContract

        public void createNewContract()
                               throws java.sql.SQLException
        Creates a new contract based on an existing contract.
        Throws:
        java.sql.SQLException
      • createNewVersionInContractChildTable

        public void createNewVersionInContractChildTable()
        Copys other contract related data for the new contract based on the existing contract.
      • createNewVersionInTCChildTable

        public void createNewVersionInTCChildTable(java.lang.Long newTCId,
                                                   java.lang.Long originalTCId)
        Copys terms and conditions related data for the new contract based on the existing contract.
        Parameters:
        newTCId - the ID of the new term
        originalTCId - the ID of the original term
      • getNewContractId

        public java.lang.Long getNewContractId()
        Returns ID of the new contract.
        Specified by:
        getNewContractId in interface CopyContractCmd
        Returns:
        The ID of the new contract.
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        Executes the business logic of this command implementation.
        Specified by:
        performExecute in interface com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_CONTRACT_COPY whenever an IOException or SAXException occurred during terms and conditions copying process.
        See Also:
        createNewContract(), createNewVersionInContractChildTable(), createNewVersionInTCChildTable(Long, Long), AbstractECTargetableCommand.performExecute()
      • setAccountId

        public void setAccountId(java.lang.Long anAccountId)
        Sets the ID of the account to which the contract will be copied.
        Specified by:
        setAccountId in interface CopyContractCmd
        Parameters:
        anAccountId - the ID of the account
      • setContractId

        public void setContractId(java.lang.Long anContractId)
        Sets ID of the contract which will be copied from.
        Specified by:
        setContractId in interface CopyContractCmd
        Parameters:
        anContractId - the ID of the original contract
      • setContractMajorVersion

        public void setContractMajorVersion(java.lang.Integer majorVersion)
        Sets the major version of the new contract.
        Specified by:
        setContractMajorVersion in interface CopyContractCmd
        Parameters:
        majorVersion - the major version of the new contract
      • setContractMinorVersion

        public void setContractMinorVersion(java.lang.Integer minorVersion)
        Sets the minor version of the new contract.
        Specified by:
        setContractMinorVersion in interface CopyContractCmd
        Parameters:
        minorVersion - the minor version of the new contract
      • setContractName

        public void setContractName(java.lang.String contractName)
        Sets the name of the new contract.
        Specified by:
        setContractName in interface CopyContractCmd
        Parameters:
        contractName - the name of the new contract
      • validateParameters

        public void validateParameters()
                                throws com.ibm.commerce.exception.ECException
        Validates if the id of the original contract was provided.
        Specified by:
        validateParameters in interface com.ibm.commerce.command.ECCommand
        Overrides:
        validateParameters in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException - Raised with the message _ERR_MISSING_CONTRACT_ID if the id of the original contract was missing.
        See Also:
        AbstractECTargetableCommand.validateParameters()