com.ibm.commerce.contract.commands
Class CopyContractCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.contract.commands.CopyContractCmdImpl
All Implemented Interfaces:
CopyContractCmd, ECCommand, TaskCommand

public class CopyContractCmdImpl
extends TaskCommandImpl
implements CopyContractCmd

Copy a specified contract to a new contract (WebSphere Commerce Business Edition only). Calling commands: ContractCopy, ContractNewVersion


Field Summary
static java.lang.String CLASSNAME
           
static java.lang.String COPYRIGHT
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.contract.commands.CopyContractCmd
defaultCommandClassName, NAME
 
Constructor Summary
CopyContractCmdImpl()
           
 
Method Summary
 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()
          Return id of the new contract
 void performExecute()
          Contains the actual business logic of the command It should be implemented by all the command writer.
 void setContractId(java.lang.Long anContractId)
          Set id of the contract which will be copied from
 void setContractMajorVersion(java.lang.Integer majorVersion)
          set the majorVersion of the new contract.
 void setContractMinorVersion(java.lang.Integer minorVersion)
          set the minorVersion of the new contract.
 void setContractName(java.lang.String contractName)
          set the name of the new contract.
 void validateParameters()
          Performs server side parameter checking.
 
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

CLASSNAME

public static final java.lang.String CLASSNAME

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

CopyContractCmdImpl

public CopyContractCmdImpl()
Method Detail

createNewContract

public void createNewContract()
                       throws javax.ejb.CreateException,
                              javax.ejb.FinderException,
                              java.rmi.RemoteException,
                              javax.naming.NamingException
Creates a new contract based on an existing contract. this method

createNewVersionInContractChildTable

public void createNewVersionInContractChildTable()
                                          throws javax.ejb.CreateException,
                                                 javax.ejb.FinderException,
                                                 java.rmi.RemoteException,
                                                 javax.naming.NamingException
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)
                                    throws javax.ejb.CreateException,
                                           javax.ejb.FinderException,
                                           java.rmi.RemoteException,
                                           javax.naming.NamingException
Copys terms and conditions related data for the new contract based on the existing contract.

getNewContractId

public java.lang.Long getNewContractId()
Return id of the new contract
Specified by:
getNewContractId in interface CopyContractCmd
Returns:
java.lang.Long

performExecute

public void performExecute()
                    throws ECException
Description copied from interface: ECCommand
Contains the actual business logic of the command It should be implemented by all the command writer.
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.

setContractId

public void setContractId(java.lang.Long anContractId)
Set id of the contract which will be copied from
Specified by:
setContractId in interface CopyContractCmd
Parameters:
contractId - java.lang.Long

setContractMajorVersion

public void setContractMajorVersion(java.lang.Integer majorVersion)
set the majorVersion of the new contract.
Specified by:
setContractMajorVersion in interface CopyContractCmd
Parameters:
majorVersion - java.lang.Integer

setContractMinorVersion

public void setContractMinorVersion(java.lang.Integer minorVersion)
set the minorVersion of the new contract.
Specified by:
setContractMinorVersion in interface CopyContractCmd
Parameters:
minorVersion - java.lang.Integer

setContractName

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

validateParameters

public void validateParameters()
                        throws ECException
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -