public abstract class AbstractObservationDAO extends AbstractIdentifierNameDescriptionDAO
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 AbstractObservationDAO.ObservationIdentifiers |
addAdditionalObjectsToObservationIdentifiers(AbstractObservationDAO.ObservationIdentifiers observationIdentifiers,
OmObservation sosObservation,
org.hibernate.Session session) |
protected AbstractObservationDAO.ObservationIdentifiers |
addFeatureOfInterestToObservationIdentifiers(FeatureOfInterest hFeature,
AbstractObservationDAO.ObservationIdentifiers observationIdentifiers) |
protected org.hibernate.Criteria |
addIndeterminateTimeRestriction(org.hibernate.Criteria c,
SosConstants.SosIndeterminateTime sosIndeterminateTime)
Add an indeterminate time restriction to a criteria.
|
protected org.hibernate.Criteria |
addIndeterminateTimeRestriction(org.hibernate.Criteria c,
SosConstants.SosIndeterminateTime sosIndeterminateTime,
Date indeterminateExtremaTime)
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
|
protected void |
addOfferingsToObservation(AbstractObservation hObservation,
Set<ObservationConstellation> hObservationConstellations) |
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 AbstractObservationDAO.ObservationIdentifiers |
addProcedureObservablePropertyToObservationIdentifiers(Set<ObservationConstellation> hObservationConstellations,
AbstractObservationDAO.ObservationIdentifiers observationIdentifiers) |
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
|
boolean |
checkBlobObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are blob observations for the offering
|
boolean |
checkBooleanObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are boolean observations for the offering
|
boolean |
checkCategoryObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are category observations for the offering
|
boolean |
checkCountObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are count observations for the offering
|
boolean |
checkGeometryObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are geometry observations for the offering
|
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
|
boolean |
checkSweDataArrayObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are geometry observations for the offering
|
boolean |
checkTextObservationsFor(String offeringIdentifier,
org.hibernate.Session session)
Check if there are text observations for the offering
|
boolean |
containsSamplingGeometries(org.hibernate.Session session)
Check if the observation table contains samplingGeometries with values
|
protected org.hibernate.Criteria |
createCriteriaForObservationClass(Class clazz,
org.hibernate.Session session)
Create Hibernate Criteria for Class
|
AbstractObservation |
createObservationFromValue(Value<?> value,
org.hibernate.Session session)
Create an observation object from SOS value
|
protected AbstractObservationDAO.ObservationIdentifiers |
createObservationIdentifiers(Set<ObservationConstellation> hObservationConstellations) |
protected void |
finalizeObservationInsertion(OmObservation sosObservation,
AbstractObservation hObservation,
org.hibernate.Session session) |
protected abstract Class<?> |
getBlobObservationClass() |
protected abstract Class<?> |
getBooleanObservationClass() |
protected abstract Class<?> |
getCategoryObservationClass() |
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.
|
protected abstract Class<?> |
getCountObservationClass() |
private org.hibernate.Criteria |
getDefaultCriteria(Class clazz,
org.hibernate.Session session) |
org.hibernate.Criteria |
getDefaultObservationCriteria(org.hibernate.Session session)
Get default Hibernate Criteria to query observations, default flag ==
false |
org.hibernate.Criteria |
getDefaultObservationInfoCriteria(org.hibernate.Session session)
Get default Hibernate Criteria to query observation info, default flag ==
false |
org.hibernate.Criteria |
getDefaultObservationTimeCriteria(org.hibernate.Session session)
Get default Hibernate Criteria to query observation time, default flag ==
false |
protected abstract Class<?> |
getGeometryObservationClass() |
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 |
org.joda.time.DateTime |
getMaxPhenomenonTime(org.hibernate.Session session)
Get max phenomenon time from observations
|
org.joda.time.DateTime |
getMaxResultTime(org.hibernate.Session session)
Get max phenomenon time from observations
|
org.joda.time.DateTime |
getMinPhenomenonTime(org.hibernate.Session session)
Get min phenomenon time from observations
|
org.joda.time.DateTime |
getMinResultTime(org.hibernate.Session session)
Get min result time from observations
|
protected abstract Class<?> |
getNumericObservationClass() |
AbstractObservation |
getObservationByIdentifier(String identifier,
org.hibernate.Session session)
Query observation by identifier
|
protected abstract Class<?> |
getObservationClass() |
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
|
List<String> |
getObservationIdentifier(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.
|
protected abstract Class<?> |
getObservationInfoClass() |
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 abstract Class<?> |
getObservationTimeClass() |
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) |
SosEnvelope |
getSpatialFilteringProfileEnvelopeForOfferingId(String offeringID,
org.hibernate.Session session) |
protected abstract Class<?> |
getSweDataArrayObservationClass() |
protected abstract Class<?> |
getTextObservationClass() |
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
|
addDescription, addIdentifier, addIdentifierNameDescription, addName, getAndAddIdentifierNameDescription, getDescription, getIdentifier, getName, insertNameAndDescription, insertNames
addMinMaxProjection, createTimePeriod
protected abstract void addObservationIdentifiersToObservation(AbstractObservationDAO.ObservationIdentifiers observationIdentifiers, AbstractObservation observation, org.hibernate.Session session) throws CodedException
observationIdentifiers
- Observation identifiersobservation
- Observation to add identifierssession
- Hibernate sessionCodedException
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 org.hibernate.Criteria getObservationCriteriaForProcedure(String procedure, org.hibernate.Session session) throws CodedException
procedure
- Procedure parametersession
- Hibernate sessionCodedException
public abstract org.hibernate.Criteria getObservationCriteriaForObservableProperty(String observableProperty, org.hibernate.Session session) throws CodedException
observableProperty
- session
- Hibernate sessionCodedException
public abstract org.hibernate.Criteria getObservationCriteriaForFeatureOfInterest(String featureOfInterest, org.hibernate.Session session) throws CodedException
featureOfInterest
- session
- Hibernate sessionCodedException
public abstract org.hibernate.Criteria getObservationCriteriaFor(String procedure, String observableProperty, org.hibernate.Session session) throws CodedException
procedure
- observableProperty
- session
- Hibernate sessionCodedException
public abstract org.hibernate.Criteria getObservationCriteriaFor(String procedure, String observableProperty, String featureOfInterest, org.hibernate.Session session) throws CodedException
procedure
- observableProperty
- featureOfInterest
- session
- Hibernate sessionCodedException
public abstract Collection<String> getObservationIdentifiers(String procedureIdentifier, org.hibernate.Session session)
procedureIdentifier
- session
- public AbstractObservation getObservationByIdentifier(String identifier, org.hibernate.Session session)
identifier
- Observation identifier (gml:identifier)session
- Hiberante sessionpublic boolean checkNumericObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic boolean checkBooleanObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic boolean checkCountObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic boolean checkCategoryObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic boolean checkTextObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic boolean checkBlobObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic boolean checkGeometryObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic boolean checkSweDataArrayObservationsFor(String offeringIdentifier, org.hibernate.Session session)
offeringIdentifier
- Offering identifiersession
- Hibernate sessionpublic org.hibernate.Criteria getObservationClassCriteriaForResultModel(String resultModel, org.hibernate.Session session)
resultModel
- Result modelsession
- Hibernate sessionpublic AbstractObservation createObservationFromValue(Value<?> value, org.hibernate.Session session) throws CodedException
value
- SOS valuesession
- Hibernate sessionCodedException
public org.hibernate.Criteria getDefaultObservationCriteria(org.hibernate.Session session)
false
session
- Hiberante sessionpublic org.hibernate.Criteria getDefaultObservationInfoCriteria(org.hibernate.Session session)
false
session
- Hiberante sessionpublic org.hibernate.Criteria getDefaultObservationTimeCriteria(org.hibernate.Session session)
false
session
- Hiberante sessionprivate org.hibernate.Criteria getDefaultCriteria(Class clazz, org.hibernate.Session 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 void addOfferingsToObservation(AbstractObservation hObservation, Set<ObservationConstellation> hObservationConstellations)
protected AbstractObservationDAO.ObservationIdentifiers createObservationIdentifiers(Set<ObservationConstellation> hObservationConstellations)
protected AbstractObservationDAO.ObservationIdentifiers addProcedureObservablePropertyToObservationIdentifiers(Set<ObservationConstellation> hObservationConstellations, AbstractObservationDAO.ObservationIdentifiers observationIdentifiers)
protected AbstractObservationDAO.ObservationIdentifiers addFeatureOfInterestToObservationIdentifiers(FeatureOfInterest hFeature, AbstractObservationDAO.ObservationIdentifiers observationIdentifiers)
protected AbstractObservationDAO.ObservationIdentifiers addAdditionalObjectsToObservationIdentifiers(AbstractObservationDAO.ObservationIdentifiers observationIdentifiers, OmObservation sosObservation, org.hibernate.Session session)
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 sessionprotected 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 sessionpublic org.joda.time.DateTime getMinPhenomenonTime(org.hibernate.Session session)
session
- Hibernate session Hibernate sessionpublic org.joda.time.DateTime getMaxPhenomenonTime(org.hibernate.Session session)
session
- Hibernate session Hibernate sessionpublic org.joda.time.DateTime getMinResultTime(org.hibernate.Session session)
session
- Hibernate session Hibernate sessionpublic org.joda.time.DateTime getMaxResultTime(org.hibernate.Session session)
session
- Hibernate session Hibernate sessionpublic TimePeriod getGlobalTemporalBoundingBox(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 addIndeterminateTimeRestriction(org.hibernate.Criteria c, SosConstants.SosIndeterminateTime sosIndeterminateTime, Date indeterminateExtremaTime)
c
- Criteria to add the restriction tososIndeterminateTime
- Indeterminate time restriction to addindeterminateExtremaTime
- Indeterminate time extremaprotected 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 List<String> getObservationIdentifier(org.hibernate.Session session)
session
- Hibernate sessionpublic SosEnvelope getSpatialFilteringProfileEnvelopeForOfferingId(String offeringID, org.hibernate.Session session) throws OwsExceptionReport
OwsExceptionReport
public abstract List<com.vividsolutions.jts.geom.Geometry> getSamplingGeometries(String feature, org.hibernate.Session session)
protected abstract Class<?> getObservationClass()
protected abstract Class<?> getObservationInfoClass()
protected abstract Class<?> getObservationTimeClass()
protected abstract Class<?> getBlobObservationClass()
protected abstract Class<?> getBooleanObservationClass()
protected abstract Class<?> getCategoryObservationClass()
protected abstract Class<?> getCountObservationClass()
protected abstract Class<?> getGeometryObservationClass()
protected abstract Class<?> getNumericObservationClass()
protected abstract Class<?> getSweDataArrayObservationClass()
protected abstract Class<?> getTextObservationClass()
public boolean containsSamplingGeometries(org.hibernate.Session session)
session
- Hibernate sessiontrue
, if the observation table contains samplingGeometries with valuesCopyright © 2012-2015 52north.org. All Rights Reserved.