com.ibm.commerce.contract.commands
Class ParticipantAddCmdImpl
java.lang.Object
CacheableCommandImpl
com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.command.ControllerCommandImpl
com.ibm.commerce.contract.commands.ParticipantAddCmdImpl
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ParticipantAddCmd, Protectable
- public class ParticipantAddCmdImpl
- extends ControllerCommandImpl
- implements ParticipantAddCmd
Add a participant to either a trading agreement (Contract/Account) or a Contract terms and conditions (WebSphere Commerce Business Edition only). The following AccessBeans are used in this default implementation: ContractAccessBean, AccountAccessBean, TradingAgreementAccessBean, ParticipantAccessBean.
- See Also:
- Serialized Form
Field Summary |
static java.lang.String |
CLASSNAME
The name of this class. |
static java.lang.String |
COPYRIGHT
IBM copyright notice field. |
Method Summary |
AccessVector |
getResources()
Gets the access vector accessed by this command. |
void |
performExecute()
Adds the participant to the specified contract/account or a contract terms and condtions. |
void |
setInfo(java.lang.String info)
Sets information of the participant |
void |
setMemberId(java.lang.Long memberId)
Sets member ID of the participant. |
void |
setRequestProperties(TypedProperty aRequestProperties)
Retrieves input parameters from the request properties. |
void |
setRole(java.lang.String role)
Sets the role type of the participant. |
void |
setTcId(java.lang.Long tcId)
Sets ID of the term and condition to which the participant will be added |
void |
setTermConditionId(java.lang.Long tcId)
Deprecated. |
void |
setTradingId(java.lang.Long tradingId)
Sets ID of the trading agreement to which the participant will be added |
void |
validateParameters()
Checks the input parameters. |
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl |
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, 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.ControllerCommand |
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- IBM copyright notice field.
- See Also:
- Constant Field Values
CLASSNAME
public static final java.lang.String CLASSNAME
- The name of this class.
- See Also:
- Constant Field Values
ParticipantAddCmdImpl
public ParticipantAddCmdImpl()
- Constructor for ParticipantAddCmdImpl.
getResources
public AccessVector getResources()
throws ECException
- Gets the access vector accessed by this command. The default implementation returns the AccountAccessBean for adding participant to an account and ContractAccessBean for contract.
-
- Specified by:
- getResources in interface ECCommand
- Overrides:
- getResources in class AbstractECTargetableCommand
-
- Returns:
- AccessVector - a vector of resource action pairs
- Throws:
- ECException
- See Also:
- AbstratECTargetableCommand#getResources()
performExecute
public void performExecute()
throws ECException
- Adds the participant to the specified contract/account or a contract terms and condtions.
-
- Specified by:
- performExecute in interface ECCommand
- Overrides:
- performExecute in class AbstractECTargetableCommand
-
- Throws:
- ECException
- See Also:
- AbstractECTargetableCommand.performExecute()
setInfo
public void setInfo(java.lang.String info)
- Sets information of the participant
-
- Specified by:
- setInfo in interface ParticipantAddCmd
-
- Parameters:
- info - a string of information for the participant
setMemberId
public void setMemberId(java.lang.Long memberId)
- Sets member ID of the participant.
-
- Specified by:
- setMemberId in interface ParticipantAddCmd
-
- Parameters:
- memberId - the member ID of the participant
setRequestProperties
public void setRequestProperties(TypedProperty aRequestProperties)
throws ECApplicationException
- Retrieves input parameters from the request properties.
-
- Specified by:
- setRequestProperties in interface ControllerCommand
- Overrides:
- setRequestProperties in class ControllerCommandImpl
-
- Parameters:
- aRequestProperties - An TypedProperty object contains the input parameters. For this default implementation, memberId and role are required parameters. optional parameters are info, id, tcId. In the case to add a participant to an account/contract, the account/contract ID has to be provided through the parameter id. In the case to add participant to a term and condition of a contract, the ID of the term and condition has to be provided through the parameter tcId.
- Throws:
- ECApplicationException - Raised with message _ERR_MISSING_CMD_PARAMETER if one of the three required parameters are missing. Raised with message _ERR_NUMBER_FORMAT_EXCEPTION if the provided id, tcId cannot be converted to Long object.
- See Also:
- ControllerCommandImpl.setRequestProperties(TypedProperty)
setRole
public void setRole(java.lang.String role)
- Sets the role type of the participant.
-
- Specified by:
- setRole in interface ParticipantAddCmd
-
- Parameters:
- role - the type of the participant role
setTcId
public void setTcId(java.lang.Long tcId)
- Sets ID of the term and condition to which the participant will be added
-
- Specified by:
- setTcId in interface ParticipantAddCmd
-
- Parameters:
- tcId - term condition ID
setTermConditionId
public void setTermConditionId(java.lang.Long tcId)
- Deprecated.
- Sets ID of the term and condition to which the participant will be added
-
- Parameters:
- tcId - term condition ID
setTradingId
public void setTradingId(java.lang.Long tradingId)
- Sets ID of the trading agreement to which the participant will be added
-
- Specified by:
- setTradingId in interface ParticipantAddCmd
-
- Parameters:
- tradingId - the trading agreement ID
validateParameters
public void validateParameters()
throws ECException
- Checks the input parameters.
-
- Specified by:
- validateParameters in interface ECCommand
- Overrides:
- validateParameters in class AbstractECTargetableCommand
-
- Throws:
- ECException - Raised with message _ERR_PARTICIPANT_ADD_TARGET_ID if both the id and tcId parameters are missing or provided at the same time for this command. Raised with message _ERR_PARTICIPANT_ROLE_TYPE_DO_NOT_EXIST if the role type provided is not a supported role type. Raised with message _ERR_ACCOUNT_TC_PARTICIPANT whenever trying to add a participant to an Business Account terms and conditions. Raised with message _ERR_WRONG_CONTRACT_STATE if the contract do not in Draft or Rejected state when adding a participant to a contract or a contract terms and conditions.
- See Also:
- AbstractECTargetableCommand.validateParameters()
Feedback
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.