com.ibm.commerce.contract.commands

Class ContractDeployCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.CacheableCommandImpl
      • com.ibm.commerce.command.MeasuredCacheableCommandImpl
        • com.ibm.commerce.command.AbstractECTargetableCommand
          • com.ibm.commerce.command.ControllerCommandImpl
            • com.ibm.commerce.scheduler.commands.AddJobCmdImpl
              • com.ibm.commerce.contract.commands.ContractDeployCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.AccCommand, com.ibm.commerce.command.ControllerCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, ContractDeployCmd, com.ibm.commerce.scheduler.commands.AddJobCmd, com.ibm.commerce.security.Protectable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class ContractDeployCmdImpl
    extends com.ibm.commerce.scheduler.commands.AddJobCmdImpl
    implements ContractDeployCmd
    This is the default implementation of the ContractDeployCmd controller command.

    Input parameters:

    Name Description
    contractId The contract ID. It is mandatory.
    targetStoreId The target store ID for deploying contract. It is mandatory.
    URL the redirect URL after the command be executed successfully.It is mandatory.

    Output parameters:

    None.

    Behaviour:

    Deploys the specified contract to the specified store (WebSphere Commerce Enterprise only). If the contract is expired, an exception will be thrown. If a referenced policy is not available, an exception will be thrown. If a referenced policy is expired, an exception will be thrown.

    Task command called:

    ValidateBusinessPolicyInContractForStoreCmd

    Access Beans used:

    • BusinessPolicyAccessBean
    • ContractAccessBean
    • TradingAgreementAccessBean
    • com.ibm.commerce.contract.objects.ContractJDBCHelperAccessBean
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASSNAME
      The full name of this class.
      static java.lang.String COPYRIGHT
      The IBM copyright notice field.
      • Fields inherited from interface com.ibm.commerce.scheduler.commands.AddJobCmd

        defaultCommandClassName, NAME
    • Constructor Summary

      Constructors 
      Constructor and Description
      ContractDeployCmdImpl()
      The constructor of this class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      com.ibm.commerce.accesscontrol.AccessVector getResources()
      Gets the access vector accessed by this command.
      java.lang.String getScheduledCommandName()
      Gets the scheduled command name
      java.lang.String getUrlName()
      Gets the redirect URL
      void performExecute()
      Executes the business logic of this command implementation.
      void setContractId(java.lang.Long contractId)
      Sets the contract ID parameter
      void setPropertiesForScheduler()
      Sets the properties for scheduler
      void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
      Sets the request properties of this command implementation.
      void validateParameters()
      Extracts and validates the input parameters of this command implementation.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from class com.ibm.commerce.scheduler.commands.AddJobCmdImpl

        getApplicationType, getAttempts, getCheckCommandId, getDelay, getHost, getInterfaceName, getJobId, getJobInstanceId, getStoreId, getUserRefNum, setApplicationType, setAttempts, setCheckCommandId, setDelay, setDescription, setEndTime, setErrorUrl, setHost, setInterfaceName, setInterval, setJobId, setJobInfo, setName, setPathInfo, setPriority, setQueryString, setSequence, setStartTime, setStoreId, setStringEndTime, setStringStartTime, setUrl, setUserRefNum
      • 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, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
      • 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.AccCommand

        accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
      • Methods inherited from interface com.ibm.commerce.command.ECCommand

        checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
      • Methods inherited from interface com.ibm.commerce.security.Protectable

        fulfills, getOwner
    • Field Detail

      • CLASSNAME

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

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

      • ContractDeployCmdImpl

        public ContractDeployCmdImpl()
        The constructor of this class
    • Method Detail

      • getResources

        public com.ibm.commerce.accesscontrol.AccessVector getResources()
                                                                 throws com.ibm.commerce.exception.ECException
        Gets the access vector accessed by this command. The default implementation returns null indicating that no protectable resource is accessed by this command. It is the responsibilities of the command writer to return the protectable primary resource(s) and the corresponding actions accessed by this command.

        Specified by:
        getResources in interface com.ibm.commerce.command.ECCommand
        Overrides:
        getResources in class com.ibm.commerce.scheduler.commands.AddJobCmdImpl
        Returns:
        a vector of resource action pairs
        Throws:
        com.ibm.commerce.exception.ECException
        See Also:
        AccessVector
      • getScheduledCommandName

        public java.lang.String getScheduledCommandName()
        Gets the scheduled command name
        Returns:
        scheduled command name
      • getUrlName

        public java.lang.String getUrlName()
        Gets the redirect URL
        Returns:
        redirect URL
      • 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.scheduler.commands.AddJobCmdImpl
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_CONTRACT_SYS_GENERIC whenever an error was occured
        See Also:
        AddJobCmdImpl.performExecute()
      • setContractId

        public void setContractId(java.lang.Long contractId)
        Sets the contract ID parameter
        Specified by:
        setContractId in interface ContractDeployCmd
        Parameters:
        contractId - Contract ID
      • setPropertiesForScheduler

        public void setPropertiesForScheduler()
        Sets the properties for scheduler
      • setRequestProperties

        public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
                                  throws com.ibm.commerce.exception.ECApplicationException
        Sets the request properties of this command implementation.
        Specified by:
        setRequestProperties in interface com.ibm.commerce.command.ControllerCommand
        Overrides:
        setRequestProperties in class com.ibm.commerce.scheduler.commands.AddJobCmdImpl
        Parameters:
        aRequestProperties - Request Properties name-value pairs are: redirect URL, contract Id and target store Id. They are all required.
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_MISSING_CMD_PARAMETER if contract Id or store Id was not found. Raised with message _ERR_NUMBER_FORMAT_EXCEPTION if contract Id or store Id is not in the correct format (number).
        See Also:
        AddJobCmdImpl.setRequestProperties(TypedProperty)
      • validateParameters

        public void validateParameters()
                                throws com.ibm.commerce.exception.ECException
        Extracts and validates the input parameters of this command implementation.
        Specified by:
        validateParameters in interface com.ibm.commerce.command.ECCommand
        Overrides:
        validateParameters in class com.ibm.commerce.scheduler.commands.AddJobCmdImpl
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_CONTRACT_ALREADY_DEPLOY_TO_THE_STORE if the contract has been deployed to the store. Raised with message _ERR_WRONG_CONTRACT_STATE if the contract is not in the desired state (normally, a Draft and Deploy Failed contract can be deployed). Raised with message _ERR_CONTRACT_EXPIRED if the contract is expired. Raised with message _ERR_INVALID_CONTRACT_EXPIRED_DATE if the expiration date of the contract is invalid. Raised with message _ERR_CONTRACT_SYS_GENERIC when other unknown error occurs.
        com.ibm.commerce.exception.ECException
        See Also:
        AddJobCmdImpl.validateParameters()