com.ibm.commerce.marketing.promotion

Class PromotionKey

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.PromotionKey
  • All Implemented Interfaces:
    Key, NumericKey, XMLizable, com.ibm.websphere.cache.Sizeable, java.io.Serializable


    public class PromotionKey
    extends java.lang.Object
    implements XMLizable, NumericKey, com.ibm.websphere.cache.Sizeable
    This object represents a unique key of each promotion within commerce domain. From database schema perspective, it represents a unique index of promotion table. Promotion object is in store scope.
    XML Snippet of the PromotionKey is as follows:
            <!-- this identifies the promotion.  -->
      <PromotionKey>
            <!-- Name of the promotion -->
            <PromotionName>DollarsOffPromotionOne</PromotionName>
      
            <!-- The store which owns this promotion. Store key is defined as the 
            combination of the DN of the organization that owns  this store and a 
            store name -->
            <StoreKey>
                    <DN>o=Root Organization</DN>
                    <Identifier>BlueStore 201</Identifier>
            </StoreKey>
      
            <!-- Versions of a promotion. Statistics are associated with the
            version number,promotions with the same promotion key and version 
            number but different revision are considered different revisions of
            the same promotion.  Promotions with the same key but different 
            version numbers are considered distinct promotions. -->
            <Version>0</Version>
            <Revision>0</Revision>
      </PromotionKey>
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright
      static java.lang.String TAG_PROMOTION_KEY
      Promotion key tag.
      static java.lang.String TAG_PROMOTION_NAME
      Promotion name tag.
      static java.lang.String TAG_REVISION
      Revision tag name
      static java.lang.String TAG_VERSION
      Version tag name
    • Constructor Summary

      Constructors 
      Constructor and Description
      PromotionKey()
      Default constructor
      PromotionKey(org.w3c.dom.Node promotionKeyNode)
      Constructor based on one XML node, which represents a promotion key.
      PromotionKey(StoreKey aKey, java.lang.String newPromotionName, java.lang.Integer aVersion, java.lang.Integer aRevision)
      Constructor of PromotionKey
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object aObject)
      This method checks for equality.
      void fromXML(org.w3c.dom.Node node)
      Transforms the XML node into its corresponding real Object.
      java.lang.Number getNumericKey()
      Returns the numeric value of the promotion key.
      long getObjectSize()
      Returns the estimated footprint size in bytes of this object and the objects it contains.
      java.lang.String getPromotionName()
      Returns the promotion name.
      java.lang.Integer getRevision()
      Returns the revision.
      StoreKey getStoreKey()
      Returns the store key associated with the promotion by its key.
      java.lang.Integer getVersion()
      Returns the version number.
      int hashCode()
      This method returns the hash code.
      boolean isNumericKeySet()
      Returns true if the numeric key of this promotion key is set
      void setNumericKey(java.lang.Number aNumericKey)
      Sets the numeric value of the promotion key.
      void setRevision(java.lang.Integer aRevision)
      Sets the revision.
      void setStoreKey(StoreKey aStoreKey)
      Sets the store key associated with the promotion by its key.
      void setVersion(java.lang.Integer aVersion)
      Sets the version.
      java.lang.String toString()
      Returns the String representation of this key.
      java.lang.String toXML()
      Converts the object into its corresponding XML format representation.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String TAG_PROMOTION_KEY
        Promotion key tag.
        See Also:
        Constant Field Values
      • TAG_PROMOTION_NAME

        public static final java.lang.String TAG_PROMOTION_NAME
        Promotion name tag.
        See Also:
        Constant Field Values
      • TAG_VERSION

        public static final java.lang.String TAG_VERSION
        Version tag name
        See Also:
        Constant Field Values
      • TAG_REVISION

        public static final java.lang.String TAG_REVISION
        Revision tag name
        See Also:
        Constant Field Values
    • Constructor Detail

      • PromotionKey

        public PromotionKey()
        Default constructor
      • PromotionKey

        public PromotionKey(StoreKey aKey,
                            java.lang.String newPromotionName,
                            java.lang.Integer aVersion,
                            java.lang.Integer aRevision)
        Constructor of PromotionKey
        Parameters:
        aKey - store key identifies the store to which this promotion belongs to.
        newPromotionName - the name of the promotion
        aVersion - the version number of the promotion
        aRevision - the revision number of the promotion
      • PromotionKey

        public PromotionKey(org.w3c.dom.Node promotionKeyNode)
        Constructor based on one XML node, which represents a promotion key.
        Parameters:
        promotionKeyNode - promotionKeyNode XML node
    • Method Detail

      • getObjectSize

        public long getObjectSize()
        Returns the estimated footprint size in bytes of this object and the objects it contains.
        Specified by:
        getObjectSize in interface com.ibm.websphere.cache.Sizeable
        Returns:
        the estimated footprint size in bytes or -1 if a size cannot be determined.
      • getPromotionName

        public java.lang.String getPromotionName()
        Returns the promotion name.
        Returns:
        String of the promotion name.
      • equals

        public boolean equals(java.lang.Object aObject)
        This method checks for equality.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if the specified object is equal to this object, false otherwise.
        See Also:
        Object.equals(Object)
      • hashCode

        public int hashCode()
        This method returns the hash code.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code.
        See Also:
        Object.hashCode()
      • toString

        public java.lang.String toString()
        Returns the String representation of this key.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of this key.
      • getNumericKey

        public java.lang.Number getNumericKey()
        Returns the numeric value of the promotion key.
        Specified by:
        getNumericKey in interface NumericKey
        Returns:
        Long the numeric value of the promotion key.
      • setNumericKey

        public void setNumericKey(java.lang.Number aNumericKey)
        Sets the numeric value of the promotion key.
        Parameters:
        aNumericKey - sets the numeric value of the promotion key.
      • isNumericKeySet

        public boolean isNumericKeySet()
        Returns true if the numeric key of this promotion key is set
        Specified by:
        isNumericKeySet in interface NumericKey
        Returns:
        true if the numeric key of this Key object is set, false otherwise
      • getStoreKey

        public StoreKey getStoreKey()
        Returns the store key associated with the promotion by its key.
        Returns:
        StoreKey the store key associated with the promotion by its key.
      • setStoreKey

        public void setStoreKey(StoreKey aStoreKey)
        Sets the store key associated with the promotion by its key.
        Parameters:
        aStoreKey - The store key associated with the promotion by its key to set.
      • getRevision

        public java.lang.Integer getRevision()
        Returns the revision.
        Returns:
        Integer representing the revision.
      • getVersion

        public java.lang.Integer getVersion()
        Returns the version number.
        Returns:
        Integer representing the version number.
      • setRevision

        public void setRevision(java.lang.Integer aRevision)
        Sets the revision.
        Parameters:
        aRevision - The revision to set.
      • setVersion

        public void setVersion(java.lang.Integer aVersion)
        Sets the version.
        Parameters:
        aVersion - The version to set.