Class ProductArchivePolicy

  • All Implemented Interfaces:
    Configurable

    public class ProductArchivePolicy
    extends ArchivePolicy
    An archive policy for products, instead of events. Allows removal of superseded products, preserving latest versions. Also allows targeting unassociated products.
    • Field Detail

      • ARCHIVE_MIN_PRODUCT_AGE_PROPERTY

        public static final java.lang.String ARCHIVE_MIN_PRODUCT_AGE_PROPERTY
        Property for archive min product age
        See Also:
        Constant Field Values
      • ARCHIVE_MAX_PRODUCT_AGE_PROPERTY

        public static final java.lang.String ARCHIVE_MAX_PRODUCT_AGE_PROPERTY
        Property for archive max product age
        See Also:
        Constant Field Values
      • ARCHIVE_MIN_PRODUCT_TIME_PROPERTY

        public static final java.lang.String ARCHIVE_MIN_PRODUCT_TIME_PROPERTY
        Property for archive min product time
        See Also:
        Constant Field Values
      • ARCHIVE_MAX_PRODUCT_TIME_PROPERTY

        public static final java.lang.String ARCHIVE_MAX_PRODUCT_TIME_PROPERTY
        Property for archive max product time
        See Also:
        Constant Field Values
      • ARCHIVE_TYPE_PROPERTY

        public static final java.lang.String ARCHIVE_TYPE_PROPERTY
        Property for archive product type
        See Also:
        Constant Field Values
      • ARCHIVE_SOURCE_PROPERTY

        public static final java.lang.String ARCHIVE_SOURCE_PROPERTY
        Property for archive product source
        See Also:
        Constant Field Values
      • ARCHIVE_SUPERSEDED_PROPERTY

        public static final java.lang.String ARCHIVE_SUPERSEDED_PROPERTY
        Property for archive superseded
        See Also:
        Constant Field Values
      • ARCHIVE_UNASSOCIATED_PROPERTY

        public static final java.lang.String ARCHIVE_UNASSOCIATED_PROPERTY
        Property for archive unassociated
        See Also:
        Constant Field Values
      • ARCHIVE_STATUS_PROPERTY

        public static final java.lang.String ARCHIVE_STATUS_PROPERTY
        Property for archive product status
        See Also:
        Constant Field Values
      • DEFAULT_ARCHIVE_SUPERSEDED

        public static final java.lang.String DEFAULT_ARCHIVE_SUPERSEDED
        Default state for archive superseded
        See Also:
        Constant Field Values
      • DEFAULT_ARCHIVE_UNASSOCIATED

        public static final java.lang.String DEFAULT_ARCHIVE_UNASSOCIATED
        Default state for archive unassociated
        See Also:
        Constant Field Values
      • minProductAge

        protected java.lang.Long minProductAge
        Configured parameter for min product age
      • maxProductAge

        protected java.lang.Long maxProductAge
        Configured parameter for max product age
      • minProductTime

        protected java.lang.Long minProductTime
        Configured parameter for min product time
      • maxProductTime

        protected java.lang.Long maxProductTime
        Configured parameter for max product time
      • productType

        protected java.lang.String productType
        Configured parameter for product type
      • productSource

        protected java.lang.String productSource
        Configured parameter for product source
      • onlySuperseded

        protected boolean onlySuperseded
        Configured parameter for only superseded
      • onlyUnassociated

        protected boolean onlyUnassociated
        Configured parameter for only unassociated
      • productStatus

        protected java.lang.String productStatus
        Configured parameter for product status
    • Constructor Detail

      • ProductArchivePolicy

        public ProductArchivePolicy()
    • Method Detail

      • configure

        public void configure​(Config config)
                       throws java.lang.Exception
        Description copied from class: DefaultConfigurable
        Process configuration settings. Called before startup().
        Specified by:
        configure in interface Configurable
        Overrides:
        configure in class ArchivePolicy
        Parameters:
        config - the Config object with settings.
        Throws:
        java.lang.Exception - if configuration exceptions occur.
      • isValidPolicy

        public boolean isValidPolicy()
        Overrides:
        isValidPolicy in class ArchivePolicy
        Returns:
        boolean if the policy is valid
      • getMinProductAge

        public java.lang.Long getMinProductAge()
        Returns:
        minProductAge
      • setMinProductAge

        public void setMinProductAge​(java.lang.Long minProductAge)
        Parameters:
        minProductAge - to set
      • getMaxProductAge

        public java.lang.Long getMaxProductAge()
        Returns:
        maxProductAge
      • setMaxProductAge

        public void setMaxProductAge​(java.lang.Long maxProductAge)
        Parameters:
        maxProductAge - to set
      • getMinProductTime

        public java.lang.Long getMinProductTime()
        Returns:
        minProductTime
      • setMinProductTime

        public void setMinProductTime​(java.lang.Long minProductTime)
        Parameters:
        minProductTime - to set
      • getMaxProductTime

        public java.lang.Long getMaxProductTime()
        Returns:
        maxProductTime
      • setMaxProductTime

        public void setMaxProductTime​(java.lang.Long maxProductTime)
        Parameters:
        maxProductTime - to set
      • getProductType

        public java.lang.String getProductType()
        Returns:
        productType
      • setProductType

        public void setProductType​(java.lang.String productType)
        Parameters:
        productType - to set
      • getProductSource

        public java.lang.String getProductSource()
        Returns:
        productSource
      • setProductSource

        public void setProductSource​(java.lang.String productSource)
        Parameters:
        productSource - to set
      • isOnlySuperseded

        public boolean isOnlySuperseded()
        Returns:
        onlySuperseded
      • setOnlySuperseded

        public void setOnlySuperseded​(boolean onlySuperseded)
        Parameters:
        onlySuperseded - to set
      • isOnlyUnassociated

        public boolean isOnlyUnassociated()
        Returns:
        onlyUnassociated
      • setOnlyUnassociated

        public void setOnlyUnassociated​(boolean onlyUnassociated)
        Parameters:
        onlyUnassociated - to set
      • getProductStatus

        public java.lang.String getProductStatus()
        Returns:
        productStatus
      • setProductStatus

        public void setProductStatus​(java.lang.String productStatus)
        Parameters:
        productStatus - to set