Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@

/**
* Hibernate data access class for series observations
*
*
* @since 4.0.0
*
*
*/
public class SeriesObservationDAO extends AbstractObservationDAO {

private static final Logger LOGGER = LoggerFactory.getLogger(SeriesObservationDAO.class);

/**
* Create series observation query criteria for series and offerings
*
*
* @param clazz
* Class to query
* @param series
Expand All @@ -122,7 +122,7 @@ private Criteria createCriteriaFor(Class<?> clazz, Series series, List<String> o

/**
* Create series observation query criteria for series
*
*
* @param Class
* to query
* @param series
Expand Down Expand Up @@ -191,7 +191,7 @@ public boolean checkSweDataArrayObservationsFor(String offeringIdentifier, Sessi

/**
* Query series observation for series and offerings
*
*
* @param series
* Series to get values for
* @param offerings
Expand All @@ -209,7 +209,7 @@ public List<SeriesObservation> getSeriesObservationFor(Series series, List<Strin

/**
* Query series obserations for series, temporal filter, and offerings
*
*
* @param series
* Series to get values for
* @param offerings
Expand All @@ -231,7 +231,7 @@ public List<SeriesObservation> getSeriesObservationFor(Series series, List<Strin

/**
* Query first/latest series obserations for series (and offerings)
*
*
* @param series
* Series to get values for
* @param offerings
Expand All @@ -253,7 +253,7 @@ public List<SeriesObservation> getSeriesObservationForSosIndeterminateTimeFilter

/**
* Query series observations for GetObservation request and features
*
*
* @param request
* GetObservation request
* @param features
Expand All @@ -271,7 +271,7 @@ public List<SeriesObservation> getSeriesObservationsFor(GetObservationRequest re
/**
* Query series observations {@link ScrollableResults} for GetObservation
* request and features
*
*
* @param request
* GetObservation request
* @param features
Expand All @@ -289,7 +289,7 @@ public ScrollableResults getStreamingSeriesObservationsFor(GetObservationRequest
/**
* Query series observations for GetObservation request, features, and a
* filter criterion (typically a temporal filter)
*
*
* @param request
* GetObservation request
* @param features
Expand All @@ -310,7 +310,7 @@ public List<SeriesObservation> getSeriesObservationsFor(GetObservationRequest re
/**
* Query series observations {@link ScrollableResults} for GetObservation
* request, features, and a filter criterion (typically a temporal filter)
*
*
* @param request
* GetObservation request
* @param features
Expand All @@ -331,7 +331,7 @@ public ScrollableResults getStreamingSeriesObservationsFor(GetObservationRequest
/**
* Query series observations for GetObservation request, features, and an
* indeterminate time (first/latest)
*
*
* @param request
* GetObservation request
* @param features
Expand All @@ -355,7 +355,7 @@ public List<SeriesObservation> getSeriesObservationsFor(GetObservationRequest re
* (first/latest). This method is private and accepts all possible arguments
* for request-based getSeriesObservationFor. Other public methods overload
* this method with sensible combinations of arguments.
*
*
* @param request
* GetObservation request
* @param features
Expand Down Expand Up @@ -383,7 +383,7 @@ private List<SeriesObservation> getSeriesObservationsFor(GetObservationRequest r
* (first/latest). This method is private and accepts all possible arguments
* for request-based getSeriesObservationFor. Other public methods overload
* this method with sensible combinations of arguments.
*
*
* @param request
* GetObservation request
* @param features
Expand Down Expand Up @@ -411,7 +411,7 @@ private ScrollableResults getStreamingSeriesObservationsFor(GetObservationReques
* possible arguments for request-based getSeriesObservationFor. Other
* public methods overload this method with sensible combinations of
* arguments.
*
*
* @param request
* GetObservation request
* @param features
Expand All @@ -430,7 +430,7 @@ private Criteria getSeriesObservationCriteriaFor(GetObservationRequest request,
throws OwsExceptionReport {
final Criteria c =
getDefaultObservationCriteria(SeriesObservation.class, session);

String seriesAlias = createSeriesAliasAndRestrictions(c);

checkAndAddSpatialFilteringProfileCriterion(c, request, session);
Expand Down Expand Up @@ -499,13 +499,13 @@ public List<SeriesObservation> getSeriesObservationsFor(Series series, GetObserv

/**
* Add an indeterminate time restriction to a criteria for series support.
*
*
*
*
* This allows for multiple results if more than one observation has the
* extrema time (max for latest, min for first). Note: use this method
* *after* adding all other applicable restrictions so that they will apply
* to the min/max observation time determination.
*
*
* @param c
* Criteria to add the restriction to
* @param sosIndeterminateTime
Expand All @@ -529,7 +529,7 @@ protected Criteria addIndeterminateTimeRestriction(Criteria c, SosIndeterminateT
/**
* Check if {@link Series} contains first or last timestamp for
* {@link SosIndeterminateTime}.
*
*
* @param indetTime
* {@link SosIndeterminateTime} to check
* @param series
Expand All @@ -548,7 +548,7 @@ protected boolean checkIndeterminateTimeAndSeries(SosIndeterminateTime indetTime

/**
* Get the first or last timestamp from {@link Series}
*
*
* @param indetTime
* {@link SosIndeterminateTime} to get timestamp for
* @param series
Expand All @@ -566,7 +566,7 @@ protected Date getFirstLastestTimeStamp(SosIndeterminateTime indetTime, Series s

/**
* Query the min time from series observations for series
*
*
* @param series
* Series to get values for
* @param session
Expand All @@ -585,7 +585,7 @@ public DateTime getMinSeriesObservationTime(Series series, Session session) {

/**
* Query the max time from series observations for series
*
*
* @param series
* Series to get values for
* @param session
Expand All @@ -604,7 +604,7 @@ public DateTime getMaxSeriesObservationTime(Series series, Session session) {

/**
* Create criteria to query min/max time for series from series observation
*
*
* @param series
* Series to get values for
* @param list
Expand All @@ -627,7 +627,7 @@ public Criteria getMinMaxTimeCriteriaForSeriesObservation(Series series, Collect

/**
* Get the result times for this series, offerings and filters
*
*
* @param series
* Timeseries to get result times for
* @param offerings
Expand Down Expand Up @@ -732,7 +732,7 @@ protected void addObservationIdentifiersToObservation(ObservationIdentifiers obs
observationIdentifiers.getObservableProperty(), observationIdentifiers.getProcedure(),
session);
((SeriesObservation) hObservation).setSeries(series);
seriesDAO.updateSeriesWithFirstLatestValues(series, hObservation, session);
// seriesDAO.updateSeriesWithFirstLatestValues(series, hObservation, session);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets document this, but not implement it yet. I'd like to minimize changes to 52n as much as possible.

}

@Override
Expand Down Expand Up @@ -796,7 +796,7 @@ public Criteria getObservationInfoCriteriaForFeatureOfInterestAndOffering(String

/**
* Update series observation by setting deleted flag
*
*
* @param series
* Series for which the observations should be updated
* @param deleteFlag
Expand Down Expand Up @@ -917,7 +917,7 @@ public List<Geometry> getSamplingGeometries(String feature, Session session) {

/**
* Get the first not deleted observation for the {@link Series}
*
*
* @param series
* Series to get observation for
* @param session
Expand All @@ -935,7 +935,7 @@ public SeriesObservation getFirstObservationFor(Series series, Session session)

/**
* Get the last not deleted observation for the {@link Series}
*
*
* @param series
* Series to get observation for
* @param session
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

/**
* Implementation of the abstract class AbstractInsertObservationDAO
*
*
* @since 4.0.0
*
*/
Expand All @@ -86,7 +86,7 @@ public class InsertObservationDAO extends AbstractInsertObservationDAO {

private final FeatureOfInterestDAO featureOfInterestDAO = new FeatureOfInterestDAO();

private static final int FLUSH_THRESHOLD = 50;
private static final int FLUSH_THRESHOLD = 10;

private static final String CONSTRAINT_OBSERVATION_IDENTITY = "observationIdentity";

Expand Down Expand Up @@ -255,7 +255,7 @@ public synchronized InsertObservationResponse insertObservation(final InsertObse
}

private void checkEqualsAndThrow(String constraintName, HibernateException he) throws OwsExceptionReport {
if (StringHelper.isNotEmpty(constraintName)) {
if (StringHelper.isNotEmpty(constraintName)) {
String exceptionMsg = null;
if (constraintName.equalsIgnoreCase(CONSTRAINT_OBSERVATION_IDENTITY)) {
exceptionMsg = "Observation with same values already contained in database";
Expand All @@ -270,7 +270,7 @@ private void checkEqualsAndThrow(String constraintName, HibernateException he) t
}

private void checkContainsAndThrow(String message, HibernateException he) throws OwsExceptionReport {
if (StringHelper.isNotEmpty(message)) {
if (StringHelper.isNotEmpty(message)) {
String exceptionMsg = null;
if (message.toLowerCase().contains(CONSTRAINT_OBSERVATION_IDENTITY.toLowerCase())) {
exceptionMsg = "Observation with same values already contained in database";
Expand All @@ -287,7 +287,7 @@ private void checkContainsAndThrow(String message, HibernateException he) throws
/**
* Get the hibernate FeatureOfInterest object for an AbstractFeature,
* returning it from the local cache if already requested
*
*
* @param sosObsConst
* @param featureCache
* @param session
Expand Down Expand Up @@ -343,4 +343,4 @@ private Set<String> getParentProcedureOfferings(OmObservationConstellation sosOb
}
return offerings;
}
}
}