public abstract class AbstractObservationDAO extends TimeCreator
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractObservationDAO.ObservationIdentifiers
Inner class to carry observation identifiers (featureOfInterest,
observableProperty, procedure)
|
TimeCreator.MinMax
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOGGER |
Constructor and Description |
---|
AbstractObservationDAO() |
Modifier and Type | Method and Description |
---|---|
protected org.hibernate.Criteria |
addIndeterminateTimeRestriction(org.hibernate.Criteria c,
SosConstants.SosIndeterminateTime sosIndeterminateTime)
Add an indeterminate time restriction to a criteria.
|
protected abstract void |
addObservationIdentifiersToObservation(AbstractObservationDAO.ObservationIdentifiers observationIdentifiers,
AbstractObservation observation,
org.hibernate.Session session)
Add observation identifier (procedure, observableProperty,
featureOfInterest) to observation
|
protected void |
addObservationIdentifierToCriteria(org.hibernate.Criteria criteria,
String identifier,
org.hibernate.Session session)
Add observation identifier (gml:identifier) to Hibernate Criteria
|
private AbstractObservationDAO.ObservationIdentifiers |
addOfferingsToObaservationAndGetProcedureObservableProperty(AbstractObservation hObservation,
Set<ObservationConstellation> hObservationConstellations)
Add offerings to observation and return the observation identifiers
procedure and observableProperty
|
protected void |
addPhenomenonTimeToObservation(AbstractObservation observation,
Time phenomenonTime)
Add phenomenon time to observation object
|
protected void |
addPhenomeonTimeAndResultTimeToObservation(AbstractObservation observation,
Time phenomenonTime,
TimeInstant resultTime)
Add phenomenon and result time to observation object
|
protected void |
addResultTimeToObservation(AbstractObservation observation,
TimeInstant resultTime,
Time phenomenonTime)
Add result time to observation object
|
protected void |
addValidTimeToObservation(AbstractObservation observation,
TimePeriod validTime)
Add valid time to observation object
|
protected void |
checkAndAddSpatialFilteringProfileCriterion(org.hibernate.Criteria c,
GetObservationRequest request,
org.hibernate.Session session)
Check if a Spatial Filtering Profile filter is requested and add to
criteria
|
abstract boolean |
checkBlobObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are blob observations for the offering
|
abstract boolean |
checkBooleanObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are boolean observations for the offering
|
abstract boolean |
checkCategoryObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are category observations for the offering
|
abstract boolean |
checkCountObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are count observations for the offering
|
abstract boolean |
checkGeometryObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are geometry observations for the offering
|
abstract boolean |
checkNumericObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are numeric observations for the offering
|
protected boolean |
checkObservationFor(Class clazz,
String offeringIdentifier,
org.hibernate.Session session)
Check if there are observations for the offering
|
abstract boolean |
checkSweDataArrayObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are geometry observations for the offering
|
abstract boolean |
checkTextObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are text observations for the offering
|
protected org.hibernate.Criteria |
createCriteriaForObservationClass(Class clazz,
org.hibernate.Session session)
Create Hibernate Criteria for Class
|
abstract AbstractObservation |
createObservationFromValue(Value<?> value,
org.hibernate.Session session)
Create an observation object from SOS value
|
protected void |
finalizeObservationInsertion(OmObservation sosObservation,
AbstractObservation hObservation,
org.hibernate.Session session) |
protected Codespace |
getCodespace(String codespace,
Map<String,Codespace> localCache,
org.hibernate.Session session)
If the local codespace cache isn't null, use it when retrieving
codespaces.
|
org.hibernate.Criteria |
getDefaultObservationCriteria(Class<?> clazz,
org.hibernate.Session session) |
abstract org.hibernate.Criteria |
getDefaultObservationCriteria(org.hibernate.Session session)
Get default Hibernate Criteria to query observations, default flag ==
false |
abstract org.hibernate.Criteria |
getDefaultObservationInfoCriteria(org.hibernate.Session session)
Get default Hibernate Criteria to query observation info, default flag ==
false |
protected TimePeriod |
getGlobalTemporalBoundingBox(Class clazz,
org.hibernate.Session session)
Get global temporal bounding box
|
abstract TimePeriod |
getGlobalTemporalBoundingBox(org.hibernate.Session session)
Get global temporal bounding box
|
protected org.hibernate.criterion.Projection |
getIndeterminateTimeExtremaProjection(SosConstants.SosIndeterminateTime indetTime)
Get projection for
SosConstants.SosIndeterminateTime value |
protected String |
getIndeterminateTimeFilterProperty(SosConstants.SosIndeterminateTime indetTime)
Get the AbstractObservation property to filter on for an
SosConstants.SosIndeterminateTime |
protected org.joda.time.DateTime |
getMaxPhenomenonTime(Class clazz,
org.hibernate.Session session)
Get max phenomenon time from observations
|
abstract org.joda.time.DateTime |
getMaxPhenomenonTime(org.hibernate.Session session)
Get max phenomenon time from observations
|
protected org.joda.time.DateTime |
getMaxResultTime(Class clazz,
org.hibernate.Session session)
Get max phenomenon time from observations
|
abstract org.joda.time.DateTime |
getMaxResultTime(org.hibernate.Session session)
Get max phenomenon time from observations
|
protected org.joda.time.DateTime |
getMinPhenomenonTime(Class clazz,
org.hibernate.Session session)
Get min phenomenon time from observations
|
abstract org.joda.time.DateTime |
getMinPhenomenonTime(org.hibernate.Session session)
Get min phenomenon time from observations
|
protected org.joda.time.DateTime |
getMinResultTime(Class clazz,
org.hibernate.Session session)
Get min result time from observations
|
abstract org.joda.time.DateTime |
getMinResultTime(org.hibernate.Session session)
Get min result time from observations
|
abstract AbstractObservation |
getObservationByIdentifier(String identifier,
org.hibernate.Session session)
Query observation by identifier
|
abstract org.hibernate.Criteria |
getObservationClassCriteriaForResultModel(String resultModel,
org.hibernate.Session session)
Get Hibernate Criteria for result model
|
abstract org.hibernate.Criteria |
getObservationCriteriaFor(String procedure,
String observableProperty,
org.hibernate.Session session)
Get Hibernate Criteria for observation with restrictions procedure and
observableProperty
|
abstract org.hibernate.Criteria |
getObservationCriteriaFor(String procedure,
String observableProperty,
String featureOfInterest,
org.hibernate.Session session)
Get Hibernate Criteria for observation with restrictions procedure,
observableProperty and featureOfInterest
|
abstract org.hibernate.Criteria |
getObservationCriteriaForFeatureOfInterest(String featureOfInterest,
org.hibernate.Session session)
Get Hibernate Criteria for observation with restriction featureOfInterest
|
abstract org.hibernate.Criteria |
getObservationCriteriaForObservableProperty(String observableProperty,
org.hibernate.Session session)
Get Hibernate Criteria for observation with restriction
observableProperty
|
abstract org.hibernate.Criteria |
getObservationCriteriaForProcedure(String procedure,
org.hibernate.Session session)
Get Hibernate Criteria for observation with restriction procedure
|
abstract List<String> |
getObservationIdentifiers(org.hibernate.Session session)
Get all observation identifiers
|
abstract Collection<String> |
getObservationIdentifiers(String procedureIdentifier,
org.hibernate.Session session)
Get all observation identifiers for a procedure.
|
abstract org.hibernate.Criteria |
getObservationInfoCriteriaForFeatureOfInterestAndOffering(String feature,
String offering,
org.hibernate.Session session)
Get Hibernate Criteria for querying observations with parameters
featureOfInterst and offering
|
abstract org.hibernate.Criteria |
getObservationInfoCriteriaForFeatureOfInterestAndProcedure(String feature,
String procedure,
org.hibernate.Session session)
Get Hibernate Criteria for querying observations with parameters
featureOfInterst and procedure
|
protected org.hibernate.criterion.Order |
getOrder(SosConstants.SosIndeterminateTime indetTime)
Get order for
SosConstants.SosIndeterminateTime value |
abstract List<com.vividsolutions.jts.geom.Geometry> |
getSamplingGeometries(String feature,
org.hibernate.Session session) |
protected SosEnvelope |
getSpatialFilteringProfileEnvelopeForOfferingId(Class clazz,
String offeringID,
org.hibernate.Session session) |
abstract SosEnvelope |
getSpatialFilteringProfileEnvelopeForOfferingId(String offeringID,
org.hibernate.Session session) |
protected Unit |
getUnit(String unit,
Map<String,Unit> localCache,
org.hibernate.Session session)
If the local unit cache isn't null, use it when retrieving unit.
|
void |
insertObservationMultiValue(Set<ObservationConstellation> observationConstellations,
FeatureOfInterest feature,
OmObservation containerObservation,
Map<String,Codespace> codespaceCache,
Map<String,Unit> unitCache,
org.hibernate.Session session)
Get Hibernate Criteria for observation with restriction procedure Insert
a multi value observation for observation constellations and
featureOfInterest
|
void |
insertObservationSingleValue(Set<ObservationConstellation> hObservationConstellations,
FeatureOfInterest hFeature,
OmObservation sosObservation,
Map<String,Codespace> codespaceCache,
Map<String,Unit> unitCache,
org.hibernate.Session session)
Insert a single observation for observation constellations and
featureOfInterest with local caching for codespaces and units
|
void |
insertObservationSingleValue(Set<ObservationConstellation> hObservationConstellations,
FeatureOfInterest hFeature,
OmObservation sosObservation,
org.hibernate.Session session)
Insert a single observation for observation constellations and
featureOfInterest without local caching for codespaces and units
|
protected void |
insertParameter(Collection<NamedValue<?>> parameter,
AbstractObservation observation,
org.hibernate.Session session)
Insert om:parameter into database.
|
protected void |
updateObservation(ScrollableIterable<AbstractObservation> scroll,
boolean deleteFlag,
org.hibernate.Session session)
Update observations, set deleted flag
|
addMinMaxProjection, createTimePeriod
public abstract List<String> getObservationIdentifiers(org.hibernate.Session session)
session
- Hibernate sessionpublic abstract boolean checkNumericObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic abstract boolean checkBooleanObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic abstract boolean checkCountObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic abstract boolean checkCategoryObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic abstract boolean checkTextObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic abstract boolean checkBlobObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic abstract boolean checkGeometryObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic abstract boolean checkSweDataArrayObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic abstract org.joda.time.DateTime getMinPhenomenonTime(org.hibernate.Session session)
session
- Hibernate session Hibernate sessionpublic abstract org.joda.time.DateTime getMaxPhenomenonTime(org.hibernate.Session session)
session
- Hibernate session Hibernate sessionpublic abstract org.joda.time.DateTime getMinResultTime(org.hibernate.Session session)
session
- Hibernate session Hibernate sessionpublic abstract org.joda.time.DateTime getMaxResultTime(org.hibernate.Session session)
session
- Hibernate session Hibernate sessionpublic abstract TimePeriod getGlobalTemporalBoundingBox(org.hibernate.Session session)
session
- Hibernate session the sessionpublic abstract org.hibernate.Criteria getObservationClassCriteriaForResultModel(String resultModel, org.hibernate.Session session)
resultModel
- Result modelsession
- Hibernate sessionpublic abstract AbstractObservation createObservationFromValue(Value<?> value, org.hibernate.Session session)
value
- SOS valuesession
- Hibernate sessionprotected abstract void addObservationIdentifiersToObservation(AbstractObservationDAO.ObservationIdentifiers observationIdentifiers, AbstractObservation observation, org.hibernate.Session session)
observationIdentifiers
- Observation identifiersobservation
- Observation to add identifierssession
- Hibernate sessionpublic abstract org.hibernate.Criteria getDefaultObservationCriteria(org.hibernate.Session session)
false
session
- Hiberante sessionpublic abstract org.hibernate.Criteria getDefaultObservationInfoCriteria(org.hibernate.Session session)
false
session
- Hiberante sessionpublic org.hibernate.Criteria getDefaultObservationCriteria(Class<?> clazz, org.hibernate.Session session)
public abstract org.hibernate.Criteria getObservationInfoCriteriaForFeatureOfInterestAndProcedure(String feature, String procedure, org.hibernate.Session session)
feature
- FeatureOfInterest to query forprocedure
- Procedure to query forsession
- Hiberante Sessionpublic abstract org.hibernate.Criteria getObservationInfoCriteriaForFeatureOfInterestAndOffering(String feature, String offering, org.hibernate.Session session)
feature
- FeatureOfInterest to query foroffering
- Offering to query forsession
- Hiberante Sessionpublic abstract AbstractObservation getObservationByIdentifier(String identifier, org.hibernate.Session session)
identifier
- Observation identifier (gml:identifier)session
- Hiberante sessionpublic abstract org.hibernate.Criteria getObservationCriteriaForProcedure(String procedure, org.hibernate.Session session)
procedure
- Procedure parametersession
- Hibernate sessionpublic abstract org.hibernate.Criteria getObservationCriteriaForObservableProperty(String observableProperty, org.hibernate.Session session)
observableProperty
- session
- Hibernate sessionpublic abstract org.hibernate.Criteria getObservationCriteriaForFeatureOfInterest(String featureOfInterest, org.hibernate.Session session)
featureOfInterest
- session
- Hibernate sessionpublic abstract org.hibernate.Criteria getObservationCriteriaFor(String procedure, String observableProperty, org.hibernate.Session session)
procedure
- observableProperty
- session
- Hibernate sessionpublic abstract org.hibernate.Criteria getObservationCriteriaFor(String procedure, String observableProperty, String featureOfInterest, org.hibernate.Session session)
procedure
- observableProperty
- featureOfInterest
- session
- Hibernate sessionpublic abstract Collection<String> getObservationIdentifiers(String procedureIdentifier, org.hibernate.Session session)
procedureIdentifier
- session
- public void insertObservationMultiValue(Set<ObservationConstellation> observationConstellations, FeatureOfInterest feature, OmObservation containerObservation, Map<String,Codespace> codespaceCache, Map<String,Unit> unitCache, org.hibernate.Session session) throws OwsExceptionReport
observationConstellations
- Observation constellation objectsfeature
- FeatureOfInterest objectcontainerObservation
- SOS observationcodespaceCache
- Map based codespace object cache to prevent redundant queriesunitCache
- Map based unit object cache to prevent redundant queriessession
- Hibernate sessionOwsExceptionReport
- If an error occurspublic void insertObservationSingleValue(Set<ObservationConstellation> hObservationConstellations, FeatureOfInterest hFeature, OmObservation sosObservation, org.hibernate.Session session) throws OwsExceptionReport
observationConstellations
- Observation constellation objectsfeature
- FeatureOfInterest objectsosObservation
- SOS observation to insertsession
- Hibernate sessionOwsExceptionReport
public void insertObservationSingleValue(Set<ObservationConstellation> hObservationConstellations, FeatureOfInterest hFeature, OmObservation sosObservation, Map<String,Codespace> codespaceCache, Map<String,Unit> unitCache, org.hibernate.Session session) throws OwsExceptionReport
observationConstellations
- Observation constellation objectsfeature
- FeatureOfInterest objectsosObservation
- SOS observation to insertcodespaceCache
- Map cache for codespace objects (to prevent redundant
querying)unitCache
- Map cache for unit objects (to prevent redundant querying)session
- Hibernate sessionOwsExceptionReport
protected Codespace getCodespace(String codespace, Map<String,Codespace> localCache, org.hibernate.Session session)
codespace
- CodespacelocalCache
- Cache (possibly null)session
- protected Unit getUnit(String unit, Map<String,Unit> localCache, org.hibernate.Session session)
unit
- UnitlocalCache
- Cache (possibly null)session
- protected void addObservationIdentifierToCriteria(org.hibernate.Criteria criteria, String identifier, org.hibernate.Session session)
criteria
- Hibernate Criteriaidentifier
- Observation identifier (gml:identifier)session
- Hibernate sessionprivate AbstractObservationDAO.ObservationIdentifiers addOfferingsToObaservationAndGetProcedureObservableProperty(AbstractObservation hObservation, Set<ObservationConstellation> hObservationConstellations)
hObservation
- Observation to add offeringshObservationConstellations
- Observation constellation with offerings, procedure and
observablePropertyprotected void finalizeObservationInsertion(OmObservation sosObservation, AbstractObservation hObservation, org.hibernate.Session session) throws OwsExceptionReport
OwsExceptionReport
protected void insertParameter(Collection<NamedValue<?>> parameter, AbstractObservation observation, org.hibernate.Session session) throws OwsExceptionReport
parameter
- om:Parameter to insertobservation
- related observationsession
- Hibernate sessionOwsExceptionReport
protected boolean checkObservationFor(Class clazz, String offeringIdentifier, org.hibernate.Session session)
clazz
- Observation sub classofferingIdentifier
- Offering identifiersession
- Hibernate sessionprotected org.joda.time.DateTime getMinPhenomenonTime(Class clazz, org.hibernate.Session session)
session
- Hibernate session Hibernate sessionprotected org.joda.time.DateTime getMaxPhenomenonTime(Class clazz, org.hibernate.Session session)
session
- Hibernate session Hibernate sessionprotected org.joda.time.DateTime getMinResultTime(Class clazz, org.hibernate.Session session)
session
- Hibernate session Hibernate sessionprotected org.joda.time.DateTime getMaxResultTime(Class clazz, org.hibernate.Session session)
session
- Hibernate session Hibernate sessionprotected TimePeriod getGlobalTemporalBoundingBox(Class clazz, org.hibernate.Session session)
session
- Hibernate session the sessionprotected org.hibernate.criterion.Order getOrder(SosConstants.SosIndeterminateTime indetTime)
SosConstants.SosIndeterminateTime
valueindetTime
- Value to get order forprotected org.hibernate.criterion.Projection getIndeterminateTimeExtremaProjection(SosConstants.SosIndeterminateTime indetTime)
SosConstants.SosIndeterminateTime
valueindetTime
- Value to get projection forprotected String getIndeterminateTimeFilterProperty(SosConstants.SosIndeterminateTime indetTime)
SosConstants.SosIndeterminateTime
indetTime
- Value to get property forprotected org.hibernate.Criteria addIndeterminateTimeRestriction(org.hibernate.Criteria c, SosConstants.SosIndeterminateTime sosIndeterminateTime)
c
- Criteria to add the restriction tososIndeterminateTime
- Indeterminate time restriction to addprotected org.hibernate.Criteria createCriteriaForObservationClass(Class clazz, org.hibernate.Session session)
clazz
- Classsession
- Hibernate sessionprotected void addPhenomeonTimeAndResultTimeToObservation(AbstractObservation observation, Time phenomenonTime, TimeInstant resultTime) throws CodedException
observation
- Observation objectphenomenonTime
- SOS phenomenon timeresultTime
- SOS result TimeCodedException
- If an error occursprotected void addPhenomenonTimeToObservation(AbstractObservation observation, Time phenomenonTime)
observation
- Observation objectphenomenonTime
- SOS phenomenon timeprotected void addResultTimeToObservation(AbstractObservation observation, TimeInstant resultTime, Time phenomenonTime) throws CodedException
observation
- Observation objectresultTime
- SOS result timephenomenonTime
- SOS phenomenon timeCodedException
- If an error occursprotected void addValidTimeToObservation(AbstractObservation observation, TimePeriod validTime)
observation
- Observation objectvalidTime
- SOS valid timeprotected void updateObservation(ScrollableIterable<AbstractObservation> scroll, boolean deleteFlag, org.hibernate.Session session)
scroll
- Observations to updatedeleteFlag
- New deleted flag valuesession
- Hibernate sessionprotected void checkAndAddSpatialFilteringProfileCriterion(org.hibernate.Criteria c, GetObservationRequest request, org.hibernate.Session session) throws OwsExceptionReport
c
- Criteria to add crtierionrequest
- GetObservation requestsession
- Hiberante SessionOwsExceptionReport
- If Spatial Filteirng Profile is not supported or an error
occurs.public abstract SosEnvelope getSpatialFilteringProfileEnvelopeForOfferingId(String offeringID, org.hibernate.Session session) throws OwsExceptionReport
OwsExceptionReport
protected SosEnvelope getSpatialFilteringProfileEnvelopeForOfferingId(Class clazz, String offeringID, org.hibernate.Session session) throws OwsExceptionReport
OwsExceptionReport
Copyright © 2012-2014 52north.org. All Rights Reserved.