Search in sources :

Example 6 with ProcedureEntity

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

the class ProcedureDAO method getProcedureForIdentifier.

/**
 * Get transactional procedure object for procedure identifier and
 * procedureDescriptionFormats
 *
 * @param identifier
 *            ProcedureEntity identifier
 * @param procedureDescriptionFormats
 *            ProcedureDescriptionFormat identifiers
 * @param session
 *            Hibernate session
 * @return Transactional procedure object
 */
public ProcedureEntity getProcedureForIdentifier(final String identifier, Set<String> procedureDescriptionFormats, final Session session) {
    Criteria criteria = getDefaultCriteria(session).add(Restrictions.eq(ProcedureEntity.IDENTIFIER, identifier));
    criteria.createCriteria(ProcedureEntity.PROPERTY_VALID_PROCEDURE_TIME).add(Restrictions.in(ProcedureHistoryEntity.PROCEDURE_DESCRIPTION_FORMAT, procedureDescriptionFormats));
    LOGGER.trace(QUERY_IDENTIFIER_LOG_TEMPLATE, HibernateHelper.getSqlString(criteria));
    return (ProcedureEntity) criteria.uniqueResult();
}
Also used : ProcedureEntity(org.n52.series.db.beans.ProcedureEntity) Criteria(org.hibernate.Criteria) DetachedCriteria(org.hibernate.criterion.DetachedCriteria)

Example 7 with ProcedureEntity

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

the class ProcedureDescriptionGeneratorSml20 method createAggregateProcess.

private AggregateProcess createAggregateProcess(ProcedureEntity procedure, Session session) throws OwsExceptionReport {
    AggregateProcess aggregateProcess = new AggregateProcess();
    setIdentifier(aggregateProcess, procedure);
    setCommonValues(procedure, aggregateProcess, session);
    return aggregateProcess;
}
Also used : AggregateProcess(org.n52.shetland.ogc.sensorML.v20.AggregateProcess)

Example 8 with ProcedureEntity

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

the class ProcedureDescriptionGeneratorSml20 method createSimpleProcess.

private SimpleProcess createSimpleProcess(ProcedureEntity procedure, Session session) throws OwsExceptionReport {
    SimpleProcess simpleProcess = new SimpleProcess();
    setIdentifier(simpleProcess, procedure);
    setCommonValues(procedure, simpleProcess, session);
    return simpleProcess;
}
Also used : SimpleProcess(org.n52.shetland.ogc.sensorML.v20.SimpleProcess)

Example 9 with ProcedureEntity

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

the class ProcedureDescriptionGeneratorSml20 method createPhysicalSystem.

private PhysicalSystem createPhysicalSystem(ProcedureEntity procedure, Session session) throws OwsExceptionReport {
    PhysicalSystem physicalSystem = new PhysicalSystem();
    setIdentifier(physicalSystem, procedure);
    setCommonValues(procedure, physicalSystem, session);
    physicalSystem.setPosition(createPosition(procedure, session));
    return physicalSystem;
}
Also used : PhysicalSystem(org.n52.shetland.ogc.sensorML.v20.PhysicalSystem)

Example 10 with ProcedureEntity

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

the class ProcedureDescriptionGeneratorSml101 method createSmlProcessModel.

/**
 * Create a SensorML ProcessModel from Hibernate procedure entity
 *
 * @param procedure
 *            Hibernate procedure entity
 *
 * @return SensorML ProcessModel
 *
 * @throws OwsExceptionReport
 *             If an error occurs
 */
private ProcessModel createSmlProcessModel(ProcedureEntity procedure, Session session) throws OwsExceptionReport {
    final ProcessModel processModel = new ProcessModel();
    setCommonValues(procedure, processModel, session);
    processModel.setMethod(createMethod(procedure, getObservablePropertiesForProcedure(procedure, session)));
    // processModel.setNames(createNames(procedure));
    return processModel;
}
Also used : ProcessModel(org.n52.shetland.ogc.sensorML.ProcessModel)

Aggregations

ProcedureEntity (org.n52.series.db.beans.ProcedureEntity)32 NoApplicableCodeException (org.n52.shetland.ogc.ows.exception.NoApplicableCodeException)14 HibernateException (org.hibernate.HibernateException)11 DatasetEntity (org.n52.series.db.beans.DatasetEntity)10 PhenomenonEntity (org.n52.series.db.beans.PhenomenonEntity)10 Criteria (org.hibernate.Criteria)9 Session (org.hibernate.Session)9 OfferingEntity (org.n52.series.db.beans.OfferingEntity)9 SosProcedureDescription (org.n52.shetland.ogc.sos.SosProcedureDescription)9 HashSet (java.util.HashSet)8 FormatEntity (org.n52.series.db.beans.FormatEntity)7 DetachedCriteria (org.hibernate.criterion.DetachedCriteria)6 DateTime (org.joda.time.DateTime)6 ArrayList (java.util.ArrayList)5 Collection (java.util.Collection)5 HashMap (java.util.HashMap)5 Transaction (org.hibernate.Transaction)5 ProcedureHistoryEntity (org.n52.series.db.beans.ProcedureHistoryEntity)5 Set (java.util.Set)4 Collectors.toCollection (java.util.stream.Collectors.toCollection)4