public abstract class DeleteObservationCacheFeederDAO extends DatasourceCacheUpdate
Modifier and Type | Field and Description |
---|---|
protected static double |
EPSILON
Maximal difference between double values to consider them "equal".
|
private boolean |
globalSpatialBoundingBoxUpdated
Boolean to keep track if we already updated the global bounding box.
|
protected static org.slf4j.Logger |
log |
private OmObservation |
o
The deleted observation.
|
private Set<String> |
updatedOfferingBoundingBoxes
Set of offering identifiers to keep track for which offerings we already
updated the spatial bounding box.
|
Constructor and Description |
---|
DeleteObservationCacheFeederDAO() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
cleanup()
Will be called after the update is finished.
|
void |
execute() |
protected abstract Object |
getConnection() |
OmObservation |
getDeletedObservation() |
protected SosEnvelope |
getEnvelope(Set<String> features)
Translates the dbFeature identifiers to database dbFeature identifiers
and queries the FeatureQueryHandler for the envelope.
|
protected abstract org.joda.time.DateTime |
getMaxDateForOffering(String offering) |
protected abstract org.joda.time.DateTime |
getMaxDateForProcedure(String procedure) |
protected abstract org.joda.time.DateTime |
getMaxPhenomenonTime() |
protected abstract org.joda.time.DateTime |
getMaxResultTime() |
protected abstract org.joda.time.DateTime |
getMaxResultTimeForOffering(String offering) |
protected abstract org.joda.time.DateTime |
getMinDateForOffering(String offering) |
protected abstract org.joda.time.DateTime |
getMinDateForProcedure(String procedure) |
protected abstract org.joda.time.DateTime |
getMinPhenomenonTime() |
protected abstract org.joda.time.DateTime |
getMinResultTime() |
protected abstract org.joda.time.DateTime |
getMinResultTimeForOffering(String offering) |
protected boolean |
isCritical(com.vividsolutions.jts.geom.Envelope e1,
com.vividsolutions.jts.geom.Envelope e2)
Check if the two envelopes have common edges.
|
protected abstract boolean |
isLastForOffering(String feature,
String offering)
Checks if there is no observation with the specified offering/feature
combination.
|
protected abstract boolean |
isLastForProcedure(String feature,
String procedure)
Check if there is no observation with the specified dbProcedure/feature
combination.
|
protected abstract void |
prepare()
Will be called before the update starts.
|
void |
setDeletedObservation(OmObservation deletedObservation) |
protected void |
updateFeatureOfInterest()
Disassociates the feature of interest from the procedure and offerings if
there are no observations left.
|
protected void |
updateIdentifiers()
Deprecated.
|
protected void |
updateSpatialBoundingBoxes()
Update the spatial bounding boxes for the deleted observation.
|
protected void |
updateSpatialBoundingBoxes(AbstractFeature featureOfInterest)
Update the global and offering specific spatial bounding box for the
specified dbFeature of interest.
|
protected void |
updateTemporalBoundingBoxes()
Update the global and offering specific temporal bounding boxes.
|
getCache, getErrors, getFeatureQueryHandler, setCache, setErrors, toString
run, setParentCountDownLatch
getStopwatchResult, startStopwatch
protected static final org.slf4j.Logger log
protected static final double EPSILON
private boolean globalSpatialBoundingBoxUpdated
private OmObservation o
public void setDeletedObservation(OmObservation deletedObservation)
public OmObservation getDeletedObservation()
protected SosEnvelope getEnvelope(Set<String> features) throws OwsExceptionReport
features
- the dbFeature identifiersOwsExceptionReport
- if the FeatureQueryHandler failsprotected boolean isCritical(com.vividsolutions.jts.geom.Envelope e1, com.vividsolutions.jts.geom.Envelope e2)
e1
(or e2
) is removed from a collection of geometries
represented by e2
(or e1
), e2
(or e2
) has
to be updated.e1
- the first envelopee2
- the second envelopetrue
if the envelopes have to be updatedpublic void execute()
protected void updateFeatureOfInterest() throws CodedException
CodedException
@Deprecated protected void updateIdentifiers()
protected void updateSpatialBoundingBoxes() throws OwsExceptionReport
OwsExceptionReport
- if the dbFeature of interest is not supported or the
FeatureQueryHandler fails.protected void updateSpatialBoundingBoxes(AbstractFeature featureOfInterest) throws OwsExceptionReport
featureOfInterest
is a FeatureCollection
while keeping
track which offerings are already updated.
This method will use the cache for dbFeature identifiers. These have to
be updated beforehand.featureOfInterest
- the dbFeature to checkOwsExceptionReport
- if the FeatureQueryHandler failsprotected void updateTemporalBoundingBoxes() throws CodedException
CodedException
protected abstract boolean isLastForOffering(String feature, String offering) throws CodedException
feature
- the feature identifieroffering
- the offering identifierCodedException
protected abstract boolean isLastForProcedure(String feature, String procedure) throws CodedException
feature
- the feature identifierprocedure
- the procedure identifierCodedException
protected abstract org.joda.time.DateTime getMaxDateForOffering(String offering) throws CodedException
CodedException
protected abstract org.joda.time.DateTime getMinDateForOffering(String offering) throws CodedException
CodedException
protected abstract org.joda.time.DateTime getMaxDateForProcedure(String procedure) throws CodedException
CodedException
protected abstract org.joda.time.DateTime getMinDateForProcedure(String procedure) throws CodedException
CodedException
protected abstract org.joda.time.DateTime getMaxResultTime()
protected abstract org.joda.time.DateTime getMinResultTime()
protected abstract org.joda.time.DateTime getMaxPhenomenonTime()
protected abstract org.joda.time.DateTime getMinPhenomenonTime()
protected abstract org.joda.time.DateTime getMaxResultTimeForOffering(String offering) throws CodedException
CodedException
protected abstract org.joda.time.DateTime getMinResultTimeForOffering(String offering) throws CodedException
CodedException
protected abstract void prepare() throws OwsExceptionReport
OwsExceptionReport
- if an error occures during preperationprotected abstract void cleanup()
OwsExceptionReport
is thrown while updating or not.protected abstract Object getConnection()
Copyright © 2012-2014 52north.org. All Rights Reserved.