com.ibm.commerce.contract.commands

Class ContractSetInSessionCmdImpl

  • 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.contract.commands.ContractSetInSessionCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.AccCommand, com.ibm.commerce.command.ControllerCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, ContractSetInSessionCmd, com.ibm.commerce.security.Protectable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class ContractSetInSessionCmdImpl
    extends com.ibm.commerce.command.ControllerCommandImpl
    implements ContractSetInSessionCmd
    This is the default implementation of the ContractSetInSessionCmd controller command.

    Input parameters:

    Name Description
    ContractIdList The contracts to use in the current section. Mandatory.
    RequestProperties The request properties. Possible values include redirecturl, ContractIdList. Optional.
    Url The redirect url to be called when the command completes successfully. Mandatory.

    Behaviour:

    Sets a list of contracts to the current session (WebSphere Commerce Enterprise only). This command will check if the user entitled to use these contracts.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getUrl()
      Gets the redirection URL to be called when the command completes successfully.
      void performExecute()
      Executes the business logic of this command implementation.
      void setContractIdList(java.lang.String[] asaContractId)
      Sets the contracts to use in the current section.
      void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
      Retrieves input parameters from the request properties.
      void setUrl(java.lang.String astrUrl)
      Sets the redirect url to be called when the command completes successfully.
      void validateParameters()
      Checks if the user logon to a store.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 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, getResources, getStoreId, 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, getResources, 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 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

      • ContractSetInSessionCmdImpl

        public ContractSetInSessionCmdImpl()
    • Method Detail

      • getUrl

        public java.lang.String getUrl()
        Gets the redirection URL to be called when the command completes successfully. Reserved for IBM internal use.
        Returns:
        the 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.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_NOT_ENTITLE_TO_THIS_CONTRACT if the user does not entitle to one of the contracts in the list.
        See Also:
        AbstractECTargetableCommand.performExecute()
      • setContractIdList

        public void setContractIdList(java.lang.String[] asaContractId)
        Sets the contracts to use in the current section.
        Specified by:
        setContractIdList in interface ContractSetInSessionCmd
        Parameters:
        asaContractId - list of contract IDs
      • setRequestProperties

        public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
                                  throws com.ibm.commerce.exception.ECApplicationException
        Retrieves input parameters from the request properties.
        Specified by:
        setRequestProperties in interface com.ibm.commerce.command.ControllerCommand
        Overrides:
        setRequestProperties in class com.ibm.commerce.command.ControllerCommandImpl
        Parameters:
        aRequestProperties - An TypedProperty object contains the input parameters. For this default implementation, contractId is required parameter.
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_MISSING_CMD_PARAMETER when contractId is missed from the URL.
        See Also:
        ControllerCommandImpl.setRequestProperties(TypedProperty)
      • setUrl

        public void setUrl(java.lang.String astrUrl)
        Sets the redirect url to be called when the command completes successfully.
        Specified by:
        setUrl in interface ContractSetInSessionCmd
        Parameters:
        astrUrl - the redirect url string
      • validateParameters

        public void validateParameters()
                                throws com.ibm.commerce.exception.ECException
        Checks if the user logon to a store.
        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 message _ERR_DIDNT_LOGON if the user did not logon to a store.
        See Also:
        AbstractECTargetableCommand.validateParameters()