Package gov.usgs.earthquake.indexer
Class ProductArchivePolicy
- java.lang.Object
-
- gov.usgs.util.DefaultConfigurable
-
- gov.usgs.earthquake.indexer.ArchivePolicy
-
- gov.usgs.earthquake.indexer.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 Summary
Fields Modifier and Type Field Description static java.lang.String
ARCHIVE_MAX_PRODUCT_AGE_PROPERTY
Property for archive max product agestatic java.lang.String
ARCHIVE_MAX_PRODUCT_TIME_PROPERTY
Property for archive max product timestatic java.lang.String
ARCHIVE_MIN_PRODUCT_AGE_PROPERTY
Property for archive min product agestatic java.lang.String
ARCHIVE_MIN_PRODUCT_TIME_PROPERTY
Property for archive min product timestatic java.lang.String
ARCHIVE_SOURCE_PROPERTY
Property for archive product sourcestatic java.lang.String
ARCHIVE_STATUS_PROPERTY
Property for archive product statusstatic java.lang.String
ARCHIVE_SUPERSEDED_PROPERTY
Property for archive supersededstatic java.lang.String
ARCHIVE_TYPE_PROPERTY
Property for archive product typestatic java.lang.String
ARCHIVE_UNASSOCIATED_PROPERTY
Property for archive unassociatedstatic java.lang.String
DEFAULT_ARCHIVE_SUPERSEDED
Default state for archive supersededstatic java.lang.String
DEFAULT_ARCHIVE_UNASSOCIATED
Default state for archive unassociatedprotected java.lang.Long
maxProductAge
Configured parameter for max product ageprotected java.lang.Long
maxProductTime
Configured parameter for max product timeprotected java.lang.Long
minProductAge
Configured parameter for min product ageprotected java.lang.Long
minProductTime
Configured parameter for min product timeprotected boolean
onlySuperseded
Configured parameter for only supersededprotected boolean
onlyUnassociated
Configured parameter for only unassociatedprotected java.lang.String
productSource
Configured parameter for product sourceprotected java.lang.String
productStatus
Configured parameter for product statusprotected java.lang.String
productType
Configured parameter for product type-
Fields inherited from class gov.usgs.earthquake.indexer.ArchivePolicy
ARCHIVE_EVENT_SOURCE_PROPERTY, ARCHIVE_MAX_AGE_PROPERTY, ARCHIVE_MAX_DEPTH_PROPERTY, ARCHIVE_MAX_EVENT_AGE_PROPERTY, ARCHIVE_MAX_EVENT_TIME_PROPERTY, ARCHIVE_MAX_LAT_PROPERTY, ARCHIVE_MAX_LNG_PROPERTY, ARCHIVE_MAX_MAG_PROPERTY, ARCHIVE_MIN_AGE_PROPERTY, ARCHIVE_MIN_DEPTH_PROPERTY, ARCHIVE_MIN_EVENT_AGE_PROPERTY, ARCHIVE_MIN_EVENT_TIME_PROPERTY, ARCHIVE_MIN_LAT_PROPERTY, ARCHIVE_MIN_LNG_PROPERTY, ARCHIVE_MIN_MAG_PROPERTY, eventSource, maxAge, maxDepth, maxEventAge, maxEventTime, maxLat, maxLng, maxMag, minAge, minDepth, minEventAge, minEventTime, minLat, minLng, minMag
-
-
Constructor Summary
Constructors Constructor Description ProductArchivePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Config config)
Process configuration settings.ProductIndexQuery
getIndexQuery()
java.lang.Long
getMaxProductAge()
java.lang.Long
getMaxProductTime()
java.lang.Long
getMinProductAge()
java.lang.Long
getMinProductTime()
java.lang.String
getProductSource()
java.lang.String
getProductStatus()
java.lang.String
getProductType()
boolean
isOnlySuperseded()
boolean
isOnlyUnassociated()
boolean
isValidPolicy()
void
setMaxProductAge(java.lang.Long maxProductAge)
void
setMaxProductTime(java.lang.Long maxProductTime)
void
setMinProductAge(java.lang.Long minProductAge)
void
setMinProductTime(java.lang.Long minProductTime)
void
setOnlySuperseded(boolean onlySuperseded)
void
setOnlyUnassociated(boolean onlyUnassociated)
void
setProductSource(java.lang.String productSource)
void
setProductStatus(java.lang.String productStatus)
void
setProductType(java.lang.String productType)
-
Methods inherited from class gov.usgs.earthquake.indexer.ArchivePolicy
getEventSource, getMaxAge, getMaxDepth, getMaxEventAge, getMaxEventTime, getMaxLat, getMaxLng, getMaxMag, getMinAge, getMinDepth, getMinEventAge, getMinEventTime, getMinLat, getMinLng, getMinMag, parseBigDecimal, parseDateOrLong, parseLong, setEventSource, setMaxAge, setMaxDepth, setMaxEventAge, setMaxEventTime, setMaxLat, setMaxLng, setMaxMag, setMinAge, setMinDepth, setMinEventAge, setMinEventTime, setMinLat, setMinLng, setMinMag, shutdown, startup
-
Methods inherited from class gov.usgs.util.DefaultConfigurable
getName, setName
-
-
-
-
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
-
-
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 interfaceConfigurable
- Overrides:
configure
in classArchivePolicy
- Parameters:
config
- the Config object with settings.- Throws:
java.lang.Exception
- if configuration exceptions occur.
-
getIndexQuery
public ProductIndexQuery getIndexQuery()
- Overrides:
getIndexQuery
in classArchivePolicy
- Returns:
- a ProductIndexQuery
-
isValidPolicy
public boolean isValidPolicy()
- Overrides:
isValidPolicy
in classArchivePolicy
- 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
-
-