com.ibm.commerce.utf.commands
Class CreateContractBasicInfoCmdImpl

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

public class CreateContractBasicInfoCmdImpl
extends TaskCommandImpl
implements CreateContractBasicInfoCmd

Creates a contract object that shares an existing trading agreement. This command can be used to create a contract that is a result of a negotiation mechanism, such as an RFQ or a Reverse Auction.

Exception conditions


Field Summary
 java.lang.String contractName
           
 java.lang.Long contractOwner
           
 java.lang.Long tradingId
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.utf.commands.CreateContractBasicInfoCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
CreateContractBasicInfoCmdImpl()
           
 
Method Summary
 java.lang.String getContractName()
          Retrieves the name of the contract.
 java.lang.Long getContractOwner()
          Retrieves the ID of the contract owner.
 java.lang.Long getTradingId()
          Retrieves the trading agreement ID.
 void performExecute()
          Creates a contract using an existing trading agreement object.
 void setContractName(java.lang.String newContractName)
          Stores the incoming value for the contract name.
 void setContractOwner(java.lang.Long newContractOwner)
          Stores the incoming value for the contract owner ID.
 void setTradingId(java.lang.Long newTradingId)
          Stores the incoming value for the Trading Agreement ID.
 void validateParameters()
          This method does the following:
Checks if a name has been provided for the contract. Checks if a trading agreement ID has been provided. Checks if incoming trading agreement ID is valid. Checks if the supplied name is already being used by another contract in the system.
 
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

contractName

public java.lang.String contractName

contractOwner

public java.lang.Long contractOwner

tradingId

public java.lang.Long tradingId
Constructor Detail

CreateContractBasicInfoCmdImpl

public CreateContractBasicInfoCmdImpl()
Method Detail

getContractName

public java.lang.String getContractName()
Retrieves the name of the contract.
Returns:
The name of the contract.

getContractOwner

public java.lang.Long getContractOwner()
Retrieves the ID of the contract owner.
Returns:
The ID of the contract owner.

getTradingId

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

performExecute

public void performExecute()
                    throws ECException
Creates a contract using an existing trading agreement object.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Throws:
ECApplicationException - If an error occurs while creating the contract object.
ECSystemException - If a system error occurs prior to creating the contract.

setContractName

public void setContractName(java.lang.String newContractName)
Stores the incoming value for the contract name.
Specified by:
setContractName in interface CreateContractBasicInfoCmd
Parameters:
newContractName - The name of the contract.

setContractOwner

public void setContractOwner(java.lang.Long newContractOwner)
Stores the incoming value for the contract owner ID.
Specified by:
setContractOwner in interface CreateContractBasicInfoCmd
Parameters:
newContractOwner - The ID of the contract owner.

setTradingId

public void setTradingId(java.lang.Long newTradingId)
Stores the incoming value for the Trading Agreement ID.
Specified by:
setTradingId in interface CreateContractBasicInfoCmd
Parameters:
newTradingId - The ID of the trading agreement.

validateParameters

public void validateParameters()
                        throws ECException
This method does the following:
  1. Checks if a name has been provided for the contract.
  2. Checks if a trading agreement ID has been provided.
  3. Checks if incoming trading agreement ID is valid.
  4. Checks if the supplied name is already being used by another contract in the system.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Throws:
ECApplicationException -
  • If the contract name has not been provided.
  • If the trading agreement ID has not been provided.
  • If the trading agreement is invalid.
  • If another contract with the supplied name exists.
  • ECSystemException -
    • If any error occurs while accessing the trading agreement object.
    • If any error occurs while determining if another contract with the same name exists.