Search in sources :

Example 81 with DataEntity

use of org.n52.series.db.beans.DataEntity in project SOS by 52North.

the class AbstractObservationDao method toSosObservation.

public ObservationStream toSosObservation(Collection<DataEntity<?>> observations, AbstractObservationRequest request, Locale language, String pdf, OmObservationCreatorContext observationCreatorContext, Session session) throws OwsExceptionReport, ConverterException {
    if (observations.isEmpty()) {
        return ObservationStream.empty();
    }
    final long startProcess = System.currentTimeMillis();
    ObservationStream sosObservations = HibernateObservationUtilities.createSosObservationsFromObservations(new HashSet<>(observations), request, language, pdf, observationCreatorContext, session);
    LOGGER.debug("Time to process {} observations needs {} ms!", observations.size(), System.currentTimeMillis() - startProcess);
    return sosObservations;
}
Also used : ObservationStream(org.n52.shetland.ogc.om.ObservationStream)

Aggregations

DataEntity (org.n52.series.db.beans.DataEntity)31 Criteria (org.hibernate.Criteria)20 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)18 DatasetEntity (org.n52.series.db.beans.DatasetEntity)14 QuantityDataEntity (org.n52.series.db.beans.QuantityDataEntity)14 Test (org.junit.Test)13 NoApplicableCodeException (org.n52.shetland.ogc.ows.exception.NoApplicableCodeException)11 LinkedList (java.util.LinkedList)10 HibernateException (org.hibernate.HibernateException)9 Session (org.hibernate.Session)9 List (java.util.List)8 SubQueryIdentifier (org.n52.sos.ds.hibernate.util.ResultFilterRestrictions.SubQueryIdentifier)8 DateTime (org.joda.time.DateTime)7 OmObservation (org.n52.shetland.ogc.om.OmObservation)7 DataArrayDataEntity (org.n52.series.db.beans.DataArrayDataEntity)6 ReferencedDataEntity (org.n52.series.db.beans.ReferencedDataEntity)6 GetObservationRequest (org.n52.shetland.ogc.sos.request.GetObservationRequest)6 ComplexDataEntity (org.n52.series.db.beans.ComplexDataEntity)5 GeometryDataEntity (org.n52.series.db.beans.GeometryDataEntity)5 PhenomenonEntity (org.n52.series.db.beans.PhenomenonEntity)5