com.ibm.commerce.command

Interface ECCommand

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      static java.lang.String defaultCommandClassName
      This is the default implementation of this command.
      • Fields inherited from interface com.ibm.websphere.command.Command

        serialVersionUID
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void checkIsAllowed(java.lang.Object resource, java.lang.String action)
      This method determines whether a user can perform a specified action on a specified resource.
      void checkResourcePermission()
      This method performs resource level access checking.
      void createCommandExecutionEvent(com.ibm.commerce.command.event.CommandExecutionTrigger trigger)
      This method creates a command execution event.
      void execute()
      This method is part of the command framework.
      boolean getAccCheck()
      This method gets the access control flag.
      CommandContext getCommandContext()
      This method gets the command context associated with this command.
      java.lang.String getCommandIfName()
      This method gets the interface name of the command.
      java.lang.String getCommandName()
      This method gets the name of the originating command.
      java.lang.Integer getCommandStoreId()
      This method gets the store id used to create this command.
      TypedProperty getDefaultProperties()
      This method gets the default properties associated with this ECCommand object .
      java.util.Map getExceptionInvokeParameters(java.lang.String event)
      This method returns the attributes for a particular event type when the command executed throws an exception.
      java.util.Map getPostInvokeParameters(java.lang.String event)
      This method returns the attributes for a particular event type after the command is executed.
      java.util.Map getPreInvokeParameters(java.lang.String event)
      This method returns the attributes for a particular event type before the command is executed.
      AccessVector getResources()
      This method gets the access vector accessed by this command.
      java.lang.Integer getStoreId()
      This method gets the store id associated with this command from the command context.
      UserAccessBean getUser()
      This method gets a user access bean for the user who invokes this command.
      java.lang.Long getUserId()
      This method gets the user id of the user who invokes this command from the command context.
      void performExecute()
      This method contains the actual business logic of this command.
      void setAccCheck(boolean newValue)
      This method sets the access control flag for this command.
      void setCommandContext(CommandContext CommandContext)
      This method sets the command context associated with this command.
      void setCommandIfName(java.lang.String name)
      This method sets the interface name of the command.
      void setCommandStoreId(java.lang.Integer storeId)
      This method sets the store id used to create this command.
      void setDefaultProperties(TypedProperty val)
      This method sets the default properties associated with this ECCommand.
      void validateParameters()
      This method performs server side parameter checking.
      • Methods inherited from interface com.ibm.websphere.command.Command

        isReadyToCallExecute, reset
    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • defaultCommandClassName

        static final java.lang.String defaultCommandClassName
        This is the default implementation of this command.
    • Method Detail

      • checkIsAllowed

        void checkIsAllowed(java.lang.Object resource,
                            java.lang.String action)
                     throws ECException
        This method determines whether a user can perform a specified action on a specified resource.
        Parameters:
        resource - This is an Object that represents the resource to be acted upon.
        action - This is a String that represents the action to be performed on the resource.
        Throws:
        ECException
      • execute

        void execute()
              throws ECException
        This method is part of the command framework. Command writers should not touch this method.
        Specified by:
        execute in interface com.ibm.websphere.command.Command
        Throws:
        ECException
      • getAccCheck

        boolean getAccCheck()
        This method gets the access control flag.
        Returns:
        This method returns true if access control checking is required for this command and false otherwise.
      • getCommandContext

        CommandContext getCommandContext()
        This method gets the command context associated with this command.
        Returns:
        This method returns the command context object.
      • getCommandIfName

        java.lang.String getCommandIfName()
        This method gets the interface name of the command.
        Returns:
        This method returns the command interface name.
      • getCommandName

        java.lang.String getCommandName()
        This method gets the name of the originating command. This would normally be the URL name.
        Returns:
        This method returns the command name.
      • getDefaultProperties

        TypedProperty getDefaultProperties()
        This method gets the default properties associated with this ECCommand object . The default properties are retrieved from the command configuration.
        Returns:
        This method returns the default properties.
      • getResources

        AccessVector getResources()
                           throws ECException
        This method 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 responsibility of the command writer to return the protectable primary resource(s) and the corresponding actions accessed by this command.
        Returns:
        This method returns an AccessVector of resource/action pairs.
        Throws:
        ECException
      • getStoreId

        java.lang.Integer getStoreId()
        This method gets the store id associated with this command from the command context.
        Returns:
        This method returns the store id.
      • setCommandStoreId

        void setCommandStoreId(java.lang.Integer storeId)
        This method sets the store id used to create this command.
        Parameters:
        storeId - This is the store id.
      • getCommandStoreId

        java.lang.Integer getCommandStoreId()
        This method gets the store id used to create this command.
        Returns:
        This method returns the store id.
      • getUser

        UserAccessBean getUser()
                        throws ECSystemException
        This method gets a user access bean for the user who invokes this command.
        Returns:
        This method returns a user access bean for the user who invokes this command.
        Throws:
        ECSystemException
      • getUserId

        java.lang.Long getUserId()
        This method gets the user id of the user who invokes this command from the command context.
        Returns:
        This method returns the user id.
      • performExecute

        void performExecute()
                     throws com.ibm.websphere.command.CommandException
        This method contains the actual business logic of this command. It should be implemented by all command writers.
        Throws:
        com.ibm.websphere.command.CommandException - This is the superclass for all ECExceptions.
      • setAccCheck

        void setAccCheck(boolean newValue)
        This method sets the access control flag for this command.
        Parameters:
        newValue - This is a boolean value; true if access checking is required and false otherwise.
      • setCommandContext

        void setCommandContext(CommandContext CommandContext)
        This method sets the command context associated with this command. This must be set before the command can be executed.
        Parameters:
        commandContext - This is a command context object.
      • setCommandIfName

        void setCommandIfName(java.lang.String name)
        This method sets the interface name of the command.
        Parameters:
        name - This is the command interface name.
      • setDefaultProperties

        void setDefaultProperties(TypedProperty val)
        This method sets the default properties associated with this ECCommand. The default properties are retrieved from the command configuration.
        Parameters:
        val - This is an object that represents the default properties.
      • validateParameters

        void validateParameters()
                         throws ECException
        This method performs server side parameter checking. This method replaces the checkParameters() method from a previous version of the code.
        Throws:
        ECException.
        ECException
      • checkResourcePermission

        void checkResourcePermission()
                              throws ECException
        This method performs resource level access checking.
        Throws:
        ECException
      • createCommandExecutionEvent

        void createCommandExecutionEvent(com.ibm.commerce.command.event.CommandExecutionTrigger trigger)
                                  throws ECException
        This method creates a command execution event.
        Parameters:
        triggerId - This is the id of the trigger point.
        Throws:
        ECException
      • getPreInvokeParameters

        java.util.Map getPreInvokeParameters(java.lang.String event)
        This method returns the attributes for a particular event type before the command is executed.
        Parameters:
        event - This is the event type.
        Returns:
        This method returns the attributes associated with the event type.
      • getPostInvokeParameters

        java.util.Map getPostInvokeParameters(java.lang.String event)
        This method returns the attributes for a particular event type after the command is executed.
        Parameters:
        event - This is the event type.
        Returns:
        This method returns the attributes associated with the event type.
      • getExceptionInvokeParameters

        java.util.Map getExceptionInvokeParameters(java.lang.String event)
        This method returns the attributes for a particular event type when the command executed throws an exception.
        Parameters:
        event - The event type.
        Returns:
        This method returns the attributes associated with the event type.