Class ArchivePolicy

  • All Implemented Interfaces:
    Configurable
    Direct Known Subclasses:
    ProductArchivePolicy

    public class ArchivePolicy
    extends DefaultConfigurable
    A policy for the Indexer to clean up Events in its ProductIndex. The policy is created by configuration parameters and generates a ProductIndexQuery. Any product/event matching the product index query is archived. Generally, archiving means the data for that product/event is removed from the index as well as the storage. Upon archiving, an EVENT_ARCHIVED type of IndexerEvent is sent to interested listeners. All archive policies run in their own thread (one thread separate from indexing for all archive policies, not one each) and execute at configured intervals.
    • Field Detail

      • ARCHIVE_MIN_AGE_PROPERTY

        public static final java.lang.String ARCHIVE_MIN_AGE_PROPERTY
        Deprecated.
        See Also:
        Constant Field Values
      • ARCHIVE_MAX_AGE_PROPERTY

        public static final java.lang.String ARCHIVE_MAX_AGE_PROPERTY
        Deprecated.
        See Also:
        Constant Field Values
      • ARCHIVE_MIN_EVENT_AGE_PROPERTY

        public static final java.lang.String ARCHIVE_MIN_EVENT_AGE_PROPERTY
        Property for archive minimum event age
        See Also:
        Constant Field Values
      • ARCHIVE_MAX_EVENT_AGE_PROPERTY

        public static final java.lang.String ARCHIVE_MAX_EVENT_AGE_PROPERTY
        Property for archive maximum event age
        See Also:
        Constant Field Values
      • ARCHIVE_MIN_EVENT_TIME_PROPERTY

        public static final java.lang.String ARCHIVE_MIN_EVENT_TIME_PROPERTY
        Property for archive minimum event time
        See Also:
        Constant Field Values
      • ARCHIVE_MAX_EVENT_TIME_PROPERTY

        public static final java.lang.String ARCHIVE_MAX_EVENT_TIME_PROPERTY
        Property for archive maximum event time
        See Also:
        Constant Field Values
      • ARCHIVE_MIN_MAG_PROPERTY

        public static final java.lang.String ARCHIVE_MIN_MAG_PROPERTY
        Property for archive minimum mag
        See Also:
        Constant Field Values
      • ARCHIVE_MAX_MAG_PROPERTY

        public static final java.lang.String ARCHIVE_MAX_MAG_PROPERTY
        Property for archive maximum mag
        See Also:
        Constant Field Values
      • ARCHIVE_MIN_LAT_PROPERTY

        public static final java.lang.String ARCHIVE_MIN_LAT_PROPERTY
        Property for archive minimum latitude
        See Also:
        Constant Field Values
      • ARCHIVE_MAX_LAT_PROPERTY

        public static final java.lang.String ARCHIVE_MAX_LAT_PROPERTY
        Property for archive maximum latitude
        See Also:
        Constant Field Values
      • ARCHIVE_MIN_LNG_PROPERTY

        public static final java.lang.String ARCHIVE_MIN_LNG_PROPERTY
        Property for archive minimum longitude
        See Also:
        Constant Field Values
      • ARCHIVE_MAX_LNG_PROPERTY

        public static final java.lang.String ARCHIVE_MAX_LNG_PROPERTY
        Property for archive maximum longitude
        See Also:
        Constant Field Values
      • ARCHIVE_MIN_DEPTH_PROPERTY

        public static final java.lang.String ARCHIVE_MIN_DEPTH_PROPERTY
        Property for archive minimum depth
        See Also:
        Constant Field Values
      • ARCHIVE_MAX_DEPTH_PROPERTY

        public static final java.lang.String ARCHIVE_MAX_DEPTH_PROPERTY
        Property for archive maximum depth
        See Also:
        Constant Field Values
      • ARCHIVE_EVENT_SOURCE_PROPERTY

        public static final java.lang.String ARCHIVE_EVENT_SOURCE_PROPERTY
        Property for archive event source
        See Also:
        Constant Field Values
      • minAge

        protected java.lang.Long minAge
        Deprecated.
      • maxAge

        protected java.lang.Long maxAge
        Deprecated.
      • minEventAge

        protected java.lang.Long minEventAge
        Configured parameter var for minEventAge
      • maxEventAge

        protected java.lang.Long maxEventAge
        Configured parameter var for maxEventAge
      • minEventTime

        protected java.lang.Long minEventTime
        Configured parameter var for minEventTime
      • maxEventTime

        protected java.lang.Long maxEventTime
        Configured parameter var for maxEventTime
      • minMag

        protected java.math.BigDecimal minMag
        Configured parameter var for minMag
      • maxMag

        protected java.math.BigDecimal maxMag
        Configured parameter var for maxMag
      • minLat

        protected java.math.BigDecimal minLat
        Configured parameter var for minLat
      • maxLat

        protected java.math.BigDecimal maxLat
        Configured parameter var for maxLat
      • minLng

        protected java.math.BigDecimal minLng
        Configured parameter var for minLng
      • maxLng

        protected java.math.BigDecimal maxLng
        Configured parameter var for maxLng
      • minDepth

        protected java.math.BigDecimal minDepth
        Configured parameter var for minDepth
      • maxDepth

        protected java.math.BigDecimal maxDepth
        Configured parameter var for maxDepth
      • eventSource

        protected java.lang.String eventSource
        Configured parameter var for eventSource
    • Constructor Detail

      • ArchivePolicy

        public ArchivePolicy()
        Default Constructor
    • 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 DefaultConfigurable
        Parameters:
        config - the Config object with settings.
        Throws:
        java.lang.Exception - if configuration exceptions occur.
      • getIndexQuery

        public ProductIndexQuery getIndexQuery()
        Returns:
        a ProductIndexQuery
      • isValidPolicy

        public boolean isValidPolicy()
        Returns:
        boolean if the policy is valid
      • parseBigDecimal

        protected java.math.BigDecimal parseBigDecimal​(Config config,
                                                       java.lang.String name)
        Gets the property 'name' from config and returns a BigDecimal of it
        Parameters:
        config - Config file
        name - name of property from config
        Returns:
        BigDecimal of property
      • parseDateOrLong

        protected java.lang.Long parseDateOrLong​(Config config,
                                                 java.lang.String name)
        Gets the property 'name' from config and returns a Date/Long of it
        Parameters:
        config - Config file
        name - name of property from config
        Returns:
        Date/Long of property
      • parseLong

        protected java.lang.Long parseLong​(Config config,
                                           java.lang.String name)
        Gets the property 'name' from config and returns a Long of it
        Parameters:
        config - Config file
        name - name of property from config
        Returns:
        Long of property
      • getMinAge

        public java.lang.Long getMinAge()
        Deprecated.
        Returns:
        minAge
      • setMinAge

        public void setMinAge​(java.lang.Long minAge)
        Deprecated.
        Parameters:
        minAge - to set
      • getMaxAge

        public java.lang.Long getMaxAge()
        Deprecated.
        Returns:
        maxAge
      • setMaxAge

        public void setMaxAge​(java.lang.Long maxAge)
        Deprecated.
        Parameters:
        maxAge - to set
      • getMinEventAge

        public java.lang.Long getMinEventAge()
        Returns:
        minEventAge
      • setMinEventAge

        public void setMinEventAge​(java.lang.Long minEventAge)
        Parameters:
        minEventAge - to set
      • getMaxEventAge

        public java.lang.Long getMaxEventAge()
        Returns:
        maxEventAge
      • setMaxEventAge

        public void setMaxEventAge​(java.lang.Long maxEventAge)
        Parameters:
        maxEventAge - to set
      • getMinEventTime

        public java.lang.Long getMinEventTime()
        Returns:
        minEventTime
      • setMinEventTime

        public void setMinEventTime​(java.lang.Long minEventTime)
        Parameters:
        minEventTime - to set
      • getMaxEventTime

        public java.lang.Long getMaxEventTime()
        Returns:
        maxEventTime
      • setMaxEventTime

        public void setMaxEventTime​(java.lang.Long maxEventTime)
        Parameters:
        maxEventTime - to set
      • getMinMag

        public java.math.BigDecimal getMinMag()
        Returns:
        minMag
      • setMinMag

        public void setMinMag​(java.math.BigDecimal minMag)
        Parameters:
        minMag - to set
      • getMaxMag

        public java.math.BigDecimal getMaxMag()
        Returns:
        maxMag
      • setMaxMag

        public void setMaxMag​(java.math.BigDecimal maxMag)
        Parameters:
        maxMag - to set
      • getMinLat

        public java.math.BigDecimal getMinLat()
        Returns:
        minLat
      • setMinLat

        public void setMinLat​(java.math.BigDecimal minLat)
        Parameters:
        minLat - to set
      • getMaxLat

        public java.math.BigDecimal getMaxLat()
        Returns:
        maxLat
      • setMaxLat

        public void setMaxLat​(java.math.BigDecimal maxLat)
        Parameters:
        maxLat - to set
      • getMinLng

        public java.math.BigDecimal getMinLng()
        Returns:
        minLng
      • setMinLng

        public void setMinLng​(java.math.BigDecimal minLng)
        Parameters:
        minLng - to set
      • getMaxLng

        public java.math.BigDecimal getMaxLng()
        Returns:
        maxLng
      • setMaxLng

        public void setMaxLng​(java.math.BigDecimal maxLng)
        Parameters:
        maxLng - to set
      • getMinDepth

        public java.math.BigDecimal getMinDepth()
        Returns:
        minDepth
      • setMinDepth

        public void setMinDepth​(java.math.BigDecimal minDepth)
        Parameters:
        minDepth - to set
      • getMaxDepth

        public java.math.BigDecimal getMaxDepth()
        Returns:
        maxDepth
      • setMaxDepth

        public void setMaxDepth​(java.math.BigDecimal maxDepth)
        Parameters:
        maxDepth - to set
      • getEventSource

        public java.lang.String getEventSource()
        Returns:
        eventSource
      • setEventSource

        public void setEventSource​(java.lang.String eventSource)
        Parameters:
        eventSource - to set