public class HibernateGetObservationHelper extends Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOGGER |
Constructor and Description |
---|
HibernateGetObservationHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addResultFilterToCriteria(org.hibernate.Criteria c,
Filter resultFilter)
Add a result filter to the Criteria
|
static boolean |
checkEncoderForMergeObservationValues(String responseFormat)
Check if the
ObservationEncoder demands for merging of
observations with the same timeseries. |
static void |
checkMaxNumberOfReturnedSeriesSize(int size)
Check if the size limit is exceeded
|
static void |
checkMaxNumberOfReturnedTimeSeries(Collection<SeriesObservation> seriesObservations,
int metadataObservationsCount)
Check if the max number of returned time series is exceeded
|
static void |
checkMaxNumberOfReturnedValues(int size)
Check if the max number of returned values is exceeded
|
static String |
checkValueForWildcardSingleCharAndEscape(ComparisonFilter resultFilter)
Check if the default SQL values for wildcard, single char or escape are
used.
|
static void |
checkValueReferenceForResultFilter(String valueReference)
Check if the requested value reference is supported.
|
static List<String> |
getAndCheckFeatureOfInterest(ObservationConstellation observationConstellation,
Set<String> featureIdentifier,
org.hibernate.Session session)
Get and check featureOfInterest identifiers for Hydrology-Profile
|
static List<ObservationConstellation> |
getAndCheckObservationConstellationSize(GetObservationRequest request,
org.hibernate.Session session)
Get ObservationConstellations and check if size limit is exceeded
|
static org.hibernate.criterion.Criterion |
getCriterionForComparisonFilter(ComparisonFilter resultFilter)
Get the Hibernate Criterion for the requested result filter
|
static List<ObservationConstellation> |
getObservationConstellations(org.hibernate.Session session,
GetObservationRequest request)
Get ObervationConstellation from requested parameters
|
static org.hibernate.criterion.Criterion |
getTemporalFilterCriterion(GetObservationRequest request)
Get Hibernate Criterion from requested temporal filters
|
static OmObservation |
toSosObservation(AbstractObservation observation,
String version,
String resultModel,
org.hibernate.Session session)
Convert observation entity to internal observationy
|
static List<OmObservation> |
toSosObservation(Collection<AbstractObservation> observations,
String version,
String resultModel,
org.hibernate.Session session)
Convert observation entities to internal observations
|
public static List<ObservationConstellation> getAndCheckObservationConstellationSize(GetObservationRequest request, org.hibernate.Session session) throws CodedException
request
- GetObservation requestsession
- Hibernate sessionObservationConstellation
CodedException
- If the size limit is exceededpublic static void checkMaxNumberOfReturnedTimeSeries(Collection<SeriesObservation> seriesObservations, int metadataObservationsCount) throws CodedException
seriesObservations
- Observations to checkmetadataObservationsCount
- Count of metadata observationsCodedException
- If the size limit is exceededpublic static void checkMaxNumberOfReturnedSeriesSize(int size) throws CodedException
size
- The size limit to checkCodedException
- If the size limit is exceededpublic static void checkMaxNumberOfReturnedValues(int size) throws CodedException
size
- Max number countCodedException
- If the size limit is exceededpublic static List<String> getAndCheckFeatureOfInterest(ObservationConstellation observationConstellation, Set<String> featureIdentifier, org.hibernate.Session session) throws CodedException
observationConstellation
- ObservationConstellationfeatureIdentifier
- FeatureOfInterest identifierssession
- Hibernate sessionCodedException
- If an error occurspublic static List<OmObservation> toSosObservation(Collection<AbstractObservation> observations, String version, String resultModel, org.hibernate.Session session) throws OwsExceptionReport, ConverterException
observations
- Observation entitiesversion
- Service versionresultModel
- Requested result modelsession
- Hibernate sessionOwsExceptionReport
- If an error occursConverterException
- If an error occurs during the conversionpublic static OmObservation toSosObservation(AbstractObservation observation, String version, String resultModel, org.hibernate.Session session) throws OwsExceptionReport, ConverterException
observation
- Observation entityversion
- Service versionresultModel
- Requested result modelsession
- Hibernate sessionOwsExceptionReport
- If an error occursConverterException
- If an error occurs during the conversionConverterException
public static void addResultFilterToCriteria(org.hibernate.Criteria c, Filter resultFilter) throws CodedException
c
- Hibernate criteriaresultFilter
- Result filter to addCodedException
- If the requested filter is not supported!public static org.hibernate.criterion.Criterion getCriterionForComparisonFilter(ComparisonFilter resultFilter) throws CodedException
resultFilter
- Requested result filterCodedException
- If the requested result filter is not supportedpublic static String checkValueForWildcardSingleCharAndEscape(ComparisonFilter resultFilter)
resultFilter
- Requested result filterpublic static void checkValueReferenceForResultFilter(String valueReference) throws CodedException
valueReference
- Requested value referenceCodedException
- If the requested value reference is not supported.public static List<ObservationConstellation> getObservationConstellations(org.hibernate.Session session, GetObservationRequest request)
session
- Hibernate sessionrequest
- GetObservation requestpublic static org.hibernate.criterion.Criterion getTemporalFilterCriterion(GetObservationRequest request) throws OwsExceptionReport
request
- GetObservation requestOwsExceptionReport
- If a temporal filter is not supportedpublic static boolean checkEncoderForMergeObservationValues(String responseFormat)
ObservationEncoder
demands for merging of
observations with the same timeseries.responseFormat
- Response formattrue
, if the ObservationEncoder
demands for
merging of observations with the same timeseries.Copyright © 2012-2014 52north.org. All Rights Reserved.