com.ibm.commerce.command

Class CommandFactory

  • java.lang.Object
    • com.ibm.commerce.command.CommandFactory


  • public class CommandFactory
    extends java.lang.Object
    This class is a command factory used to instantiate commands.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CommandFactory()
      This is the default constructor for this class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static ECCommand createBusinessPolicyCommand(java.lang.Long policyId)
      This method searches the policy command registry for an entry corresponding to the specified policy id.
      static ECCommand createBusinessPolicyCommand(java.lang.Long policyId, java.lang.String interfaceName)
      This method searches the policy command registry for an entry corresponding to the specified command (interface) name and policy id.
      static ECCommand createCommand(com.ibm.commerce.registry.CommandRegistryEntry cmdEntry)
      This method instantiates an instance of a command based on the CommandRegistryEntry information.
      static ECCommand createCommand(com.ibm.commerce.registry.CommandRegistryEntry cmdEntry, java.lang.Integer storeId)
      This method instantiates an instance of a command based on the CommandRegistryEntry information.
      static ECCommand createCommand(java.lang.String cmdRefKey, java.lang.Integer storeId)
      This method searches the command registry for an entry corresponding to the specified command (interface) name and storeId.
      static ECCommand createCommand(java.lang.String cmdRefKey, java.lang.Integer storeId, boolean exceptionNeeded)
      This method searches the command registry for an entry corresponding to the specified command (interface) name and store id.
      static ECCommand createViewCommand(com.ibm.commerce.registry.ViewRegistryEntry cmdEntry)
      This method instantiates an instance of a view command based on the view registry entry information.
      static ECCommand createViewCommand(com.ibm.commerce.registry.ViewRegistryEntry cmdEntry, java.lang.Integer storeId)
      This method instantiates an instance of a view command based on the view registry entry information.
      static java.lang.String getCommandClassNameFromInterface(java.lang.String commandInterfaceName)
      This method returns the default implementation of an interface.
      static com.ibm.commerce.registry.CommandRegistryEntry locateCommandEntry(java.lang.String cmdRefKey, java.lang.Integer storeId)
      This method searches the command registry for an entry corresponding to the specified command (interface) name and store id.
      static com.ibm.commerce.registry.CommandRegistryEntry locateCommandEntry(java.lang.String cmdRefKey, java.lang.Integer storeId, boolean exceptionNeeded)
      This method searches the command registry for an entry corresponding to the specified command (interface) name and store id.
      static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey, java.lang.Integer storeId, java.lang.Integer deviceFmt)
      This method searches the view registry for an entry corresponding to the specified view name, store id and device type.
      static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey, java.lang.Integer storeId, java.lang.Integer deviceFmt, boolean exceptionNeeded)
      This method searches the view registry for an entry corresponding to the specified view name, store id and device type.
      static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey, java.lang.Integer storeId, java.lang.Integer deviceFmt, java.lang.Integer dftDeviceFmt)
      This method searches the view registry for an entry corresponding to the specified view name, store id and device type.
      static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey, java.lang.Integer storeId, java.lang.Integer deviceFmt, java.lang.Integer dftDeviceFmt, boolean exceptionNeeded)
      This method searches the view registry for an entry corresponding to the specified view name, store id, and device type.
      static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey, java.lang.Integer storeId, java.lang.Integer deviceFmt, java.lang.Integer dftDeviceFmt, boolean exceptionNeeded, javax.servlet.http.HttpServletRequest request)
      This method searches the view registry for an entry corresponding to the specified view name, store id, and device type.
      static void setCommandRegistry(com.ibm.commerce.registry.CommandRegistry newValue)
      This method sets the command registry to be used by the command factory to locate commands.
      static void setViewRegistry(com.ibm.commerce.registry.ViewRegistry newValue)
      This method sets the view registry to be used by the command factory to locate commands.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommandFactory

        public CommandFactory()
        This is the default constructor for this class.
    • Method Detail

      • createBusinessPolicyCommand

        public static ECCommand createBusinessPolicyCommand(java.lang.Long policyId)
                                                     throws ECException
        This method searches the policy command registry for an entry corresponding to the specified policy id. If one is found, this method will instantiate an object representing the command.
        Parameters:
        policyId - This is a Long object that represents a policy id.
        Returns:
        This method returns an instance of a command.
        Throws:
        ECException
      • createBusinessPolicyCommand

        public static ECCommand createBusinessPolicyCommand(java.lang.Long policyId,
                                                            java.lang.String interfaceName)
                                                     throws ECException
        This method searches the policy command registry for an entry corresponding to the specified command (interface) name and policy id. If one is found, this method will instantiate an object representing the command.
        Parameters:
        interfaceName - This is a String object that represents a command interface name.
        policyId - This is a Long object that represents a policy id.
        Returns:
        This method returns an instance of a command.
        Throws:
        ECException
      • createCommand

        public static ECCommand createCommand(com.ibm.commerce.registry.CommandRegistryEntry cmdEntry)
                                       throws ECException
        This method instantiates an instance of a command based on the CommandRegistryEntry information.
        Parameters:
        cmdEntry - This is a CommandRegistryEntry object that represents a command registry entry.
        Returns:
        This method returns an instance of a command.
        Throws:
        ECException
      • createCommand

        public static ECCommand createCommand(com.ibm.commerce.registry.CommandRegistryEntry cmdEntry,
                                              java.lang.Integer storeId)
                                       throws ECException
        This method instantiates an instance of a command based on the CommandRegistryEntry information.
        Parameters:
        comdEntry - This is a CommandRegistryEntry object that represents a command registry entry.
        storeId - Ths is an Integer object that represents the store id associated with the command.
        Returns:
        This method returns an instance of a command.
        Throws:
        ECException
      • createCommand

        public static ECCommand createCommand(java.lang.String cmdRefKey,
                                              java.lang.Integer storeId)
                                       throws ECException
        This method searches the command registry for an entry corresponding to the specified command (interface) name and storeId. If one is found, this method will instantiate an object representing the command.
        Parameters:
        cmdRefKey - This is a String object that represents a command interface name.
        storeId - This is an Integer object that represents the store id associated with the command.
        Returns:
        This method returns an instance of a command.
        Throws:
        ECException
      • createViewCommand

        public static ECCommand createViewCommand(com.ibm.commerce.registry.ViewRegistryEntry cmdEntry)
                                           throws ECException
        This method instantiates an instance of a view command based on the view registry entry information.
        Parameters:
        cmdEntry - This is a ViewRegistryEntry object.
        Returns:
        This method returns an instance of a view command.
        Throws:
        ECException
      • createViewCommand

        public static ECCommand createViewCommand(com.ibm.commerce.registry.ViewRegistryEntry cmdEntry,
                                                  java.lang.Integer storeId)
                                           throws ECException
        This method instantiates an instance of a view command based on the view registry entry information.
        Parameters:
        cmdEntry - This is a ViewRegistryEntry object.
        storeId - This is an Integer object that represents the store id associated with the command.
        Returns:
        ECCommand This method returns an instance of a view command.
        Throws:
        ECException
      • getCommandClassNameFromInterface

        public static java.lang.String getCommandClassNameFromInterface(java.lang.String commandInterfaceName)
        This method returns the default implementation of an interface. The default implementation class name is defined by the field "defaultCommandClassName".
        Parameters:
        commandInterfaceName - This is the command interface name.
        Returns:
        Thsi method returns a String representation of the default implementation class name if defined.
      • locateCommandEntry

        public static com.ibm.commerce.registry.CommandRegistryEntry locateCommandEntry(java.lang.String cmdRefKey,
                                                                                        java.lang.Integer storeId)
                                                                                 throws ECException
        This method searches the command registry for an entry corresponding to the specified command (interface) name and store id. If no entry is found for the specified store, this method will look for an entry corresponding to a store id of 0. If both fail, it will check for a default implementation of the command from the interface. It will then return an entry that represents the default implementation of the interface.
        Parameters:
        cmdRefKey - This is a String object that represents a command interface name.
        storeId - This is an Integer object that represents the store id associated with the command.
        Returns:
        This method returns a command registry entry corresponding to the key.
        Throws:
        ECException
      • setCommandRegistry

        public static void setCommandRegistry(com.ibm.commerce.registry.CommandRegistry newValue)
        This method sets the command registry to be used by the command factory to locate commands.
        Parameters:
        newValue - This is a CommandRegistry object.
      • setViewRegistry

        public static void setViewRegistry(com.ibm.commerce.registry.ViewRegistry newValue)
        This method sets the view registry to be used by the command factory to locate commands.
        Parameters:
        newValue - This is a ViewRegistry object.
      • locateViewCommandEntry

        public static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey,
                                                                                         java.lang.Integer storeId,
                                                                                         java.lang.Integer deviceFmt,
                                                                                         java.lang.Integer dftDeviceFmt,
                                                                                         boolean exceptionNeeded)
                                                                                  throws ECException
        This method searches the view registry for an entry corresponding to the specified view name, store id, and device type. If one is not found, it will look for one for the default device type. An ECException is thrown if no matching entry is found.
        Parameters:
        cmdRefKey - This is a String object that represents name of the view.
        storeId - This is an Integer object that represents the store id associated with the command.
        deviceFmt - This is an Integer object that represents the device format type id.
        dftDeviceFmt - This is an Integer object that represents the default device format type id.
        exceptionNeeded - This is a boolean value that indicates whether an exception will be thrown when the entry cannot be found.
        Returns:
        This method returns a view registry entry.
        Throws:
        ECException - This is thrown if no matching entry is found.
      • locateViewCommandEntry

        public static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey,
                                                                                         java.lang.Integer storeId,
                                                                                         java.lang.Integer deviceFmt,
                                                                                         boolean exceptionNeeded)
                                                                                  throws ECException
        This method searches the view registry for an entry corresponding to the specified view name, store id and device type. An ECException is thrown if no matching entry is found.
        Parameters:
        cmdRefKey - This is a String object that represents name of the view.
        storeId - This is an Integer object that represents the store id associated with the command.
        deviceFmt - This is an Integer object that represents the device format type id.
        exceptionNeeded - This is a boolean value that indicates whether an exception will be thrown when the entry cannot be found.
        Returns:
        This method returns a view registry entry.
        Throws:
        ECException - Thrown if no matching entry is found.
      • createCommand

        public static ECCommand createCommand(java.lang.String cmdRefKey,
                                              java.lang.Integer storeId,
                                              boolean exceptionNeeded)
                                       throws ECException
        This method searches the command registry for an entry corresponding to the specified command (interface) name and store id. If one is found, this method will instantiate an object representing the command.
        Parameters:
        cmdRefKey - This is a String object that represents a command interface name.
        storeId - This is an Integer object that represents the store id associated with the command.
        exceptionNeeded - This is a boolean value that indicates whether an exception will be thrown when the entry cannot be found.
        Returns:
        ECCommand This method returns an instance of a command.
        Throws:
        ECException
      • locateCommandEntry

        public static com.ibm.commerce.registry.CommandRegistryEntry locateCommandEntry(java.lang.String cmdRefKey,
                                                                                        java.lang.Integer storeId,
                                                                                        boolean exceptionNeeded)
                                                                                 throws ECException
        This method searches the command registry for an entry corresponding to the specified command (interface) name and store id. If no entry is found for the specified store, it will look for an entry corresponding to a store id with a value of 0. If both fail, it will check for a default implementation of the command from the interface. It will then return an entry that represents the default implementation of the interface.
        Parameters:
        cmdRefKey - This is a String object that represents a command interface name.
        storeId - This is an Integer object that represents the store id associated with the command.
        exceptionNeeded - This is a boolean value that indicates whether an exception will be thrown when the entry cannot be found.
        Returns:
        This method returns a command registry entry corresponding to the key. This method returns null if no command implementation class is found.
        Throws:
        ECException
      • locateViewCommandEntry

        public static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey,
                                                                                         java.lang.Integer storeId,
                                                                                         java.lang.Integer deviceFmt)
                                                                                  throws ECException
        This method searches the view registry for an entry corresponding to the specified view name, store id and device type. An ECException is thrown if no matching entry is found.
        Parameters:
        cmdRefKey - This is a String object that represents name of the view.
        storeId - This is an Integer object that represents the store id associated with the command.
        deviceFmt - This is an Integer object that represents the device format type id.
        Returns:
        This is a view registry entry.
        Throws:
        ECException - This is thrown if no matching entry is found.
      • locateViewCommandEntry

        public static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey,
                                                                                         java.lang.Integer storeId,
                                                                                         java.lang.Integer deviceFmt,
                                                                                         java.lang.Integer dftDeviceFmt)
                                                                                  throws ECException
        This method searches the view registry for an entry corresponding to the specified view name, store id and device type. If one is not found, it will look for one for the default device type. An ECException is thrown if no matching entry is found.
        Parameters:
        cmdRefKey - This is a String object that represents name of the view.
        storeId - This is an Integer object that represents the store id associated with the command.
        deviceFmt - This is an Integer object that represents the device format type id.
        dftDeviceFmt - This is an Integer object that represents the default device format type id.
        Returns:
        This method returns a view registry entry.
        Throws:
        ECException - This is thrown if no matching entry is found.
      • locateViewCommandEntry

        public static com.ibm.commerce.registry.ViewRegistryEntry locateViewCommandEntry(java.lang.String cmdRefKey,
                                                                                         java.lang.Integer storeId,
                                                                                         java.lang.Integer deviceFmt,
                                                                                         java.lang.Integer dftDeviceFmt,
                                                                                         boolean exceptionNeeded,
                                                                                         javax.servlet.http.HttpServletRequest request)
                                                                                  throws ECException
        This method searches the view registry for an entry corresponding to the specified view name, store id, and device type. If one is not found, it will look for one for the default device type. An ECException is thrown if no matching entry is found.
        Parameters:
        cmdRefKey - This is a String object that represents name of the view.
        storeId - This is an Integer object that represents the store id associated with the command.
        deviceFmt - This is an Integer object that represents the device format type id.
        dftDeviceFmt - This is an Integer object that represents the default device format type id.
        exceptionNeeded - This is a boolean value that indicates whether an exception will be thrown when the entry cannot be found.
        request - the HTTPServletRequest
        Returns:
        This method returns a view registry entry.
        Throws:
        ECException - This is thrown if no matching entry is found.