com.ibm.commerce.marketing.promotion.runtime

Class PromotionEngineHome

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.runtime.PromotionEngineHome


  • public class PromotionEngineHome
    extends java.lang.Object
    This class is where it all starts. Assume the promotion system is properly configured at the time it is installed. PromotionEngineHome is the starting point for any interactions with the promotion feature. the interaction usually follows the following sequence:
    1. PromotionEngineHome.createPromotionEngine() is invoked. There are three variations to this method. The first one takes a path to an XML configuration file. And also takes a flag value to indicate whether or not this engine will be used as the default within the JVM. The second variation replaces the file path with an already parsed XML Node (could be a Document). The third takes an already constructed PromotionEngineConfiguration object.
    2. At runtime, all operations are performed through an engine instance. This instance is obtained by calling either PromotionEngineHome.getEngineInstance(String engineName) or PromotionEngine.getDefaultEngine(). And it starts the process from there.
    Currently, only one promotion engine is supported.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright
        See Also:
        Constant Field Values
    • Method Detail

      • createPromotionEngine

        public static PromotionEngine createPromotionEngine(java.lang.String configFile,
                                                            boolean useAsDefault)
        Creates an engine instance from a configuration XML, marks it as the default promotion engine if useAsDefault is set to true.
        Parameters:
        configFile - configFile the fully qualified path name of the configuration XML file
        useAsDefault - boolean useAsDefault whether this engine should be used as the default engine or not
        Returns:
        the newly created promotion engine instance if everything went fine without problem, null otherwise
      • createPromotionEngine

        public static final PromotionEngine createPromotionEngine(org.w3c.dom.Node node,
                                                                  boolean useAsDefault)
        Creates an engine instance from a configuration XML, marks it as the default promotion engine if useAsDefault is set to true.
        Parameters:
        node - node the Already parsed configuration XML file
        useAsDefault - boolean useAsDefault whether this engine should be used as the default engine or not
        Returns:
        the newly created promotion engine instance if everything went ok, null otherwise
      • getEngineInstance

        public static final PromotionEngine getEngineInstance(java.lang.String engineName)
        Returns the PromotionEngine instance with the name as specified in engineName parameter
        Parameters:
        engineName - the name of the engine
        Returns:
        the promotion engine specified by the name entered, null if system couldn't find one.
      • getDefaultEngine

        public static final PromotionEngine getDefaultEngine()
        Returns the default promotion engine
        Returns:
        the default promotion engine, if it is set, null otherwise
      • setDefaultEngine

        public static void setDefaultEngine(PromotionEngine aDefaultEngine)
        Sets default engine
        Parameters:
        aDefaultEngine - The default engine to set.