/** * Insert and get procedure description format * * @param format * Procedure description format * @param session * Hibernate session * @return Procedure description format object */ public FormatEntity getOrInsertFormatEntity(String format, Session session) { FormatEntity hFormatEntity = getFormatEntityObject(format, session); if (hFormatEntity == null) { hFormatEntity = new FormatEntity(); hFormatEntity.setFormat(format); session.save(hFormatEntity); session.flush(); } return hFormatEntity; }
@Override public boolean isSetObservationType() { return getObservationType() != null && getObservationType().isSetFormat(); }
private String getFormat(HasProcedureDescriptionFormat hpdf) { return hpdf.getFormat().getFormat(); }
/** * Insert and get procedure description format * * @param format * Procedure description format * @param session * Hibernate session * @return Procedure description format object */ public FormatEntity getOrInsertFormatEntity(String format, Session session) { FormatEntity hFormatEntity = getFormatEntityObject(format, session); if (hFormatEntity == null) { hFormatEntity = new FormatEntity(); hFormatEntity.setFormat(format); session.save(hFormatEntity); session.flush(); } return hFormatEntity; }
public boolean isSetObservationtype() { return getObservationType() != null && getObservationType().isSetFormat(); }
private String getFormat(HasProcedureDescriptionFormat hpdf) { return hpdf.getFormat().getFormat(); }
private boolean isProfileObservation(DatasetEntity observationConstellation) { return observationConstellation.isSetObservationType() && (OmConstants.OBS_TYPE_PROFILE_OBSERVATION .equals(observationConstellation.getObservationType().getFormat()) || GWMLConstants.OBS_TYPE_GEOLOGY_LOG.equals(observationConstellation.getObservationType().getFormat()) || GWMLConstants.OBS_TYPE_GEOLOGY_LOG_COVERAGE .equals(observationConstellation.getObservationType().getFormat())); }
private boolean isProfileObservation(DatasetEntity observationConstellation) { return observationConstellation.isSetObservationType() && (OmConstants.OBS_TYPE_PROFILE_OBSERVATION .equals(observationConstellation.getObservationType().getFormat()) || GWMLConstants.OBS_TYPE_GEOLOGY_LOG.equals(observationConstellation.getObservationType().getFormat()) || GWMLConstants.OBS_TYPE_GEOLOGY_LOG_COVERAGE .equals(observationConstellation.getObservationType().getFormat())); }
private Collection<String> getObservationTypes() { return datasets.stream().filter(d -> d.isSetObservationType()).map(d -> d.getObservationType().getFormat()) .collect(Collectors.toSet()); }
public boolean checkObservationType(DatasetEntity dataset, String observationType, Session session) { String hObservationType = dataset.getObservationType() == null ? null : dataset.getObservationType().getFormat(); if (hObservationType == null || hObservationType.isEmpty() || hObservationType.equals("NOT_DEFINED")) { updateSeries(dataset, observationType, session); } else if (!hObservationType.equals(observationType)) { return false; } return true; }
public boolean checkObservationType(DatasetEntity dataset, String observationType, Session session) { String hObservationType = dataset.getObservationType() == null ? null : dataset.getObservationType().getFormat(); if (hObservationType == null || hObservationType.isEmpty() || hObservationType.equals("NOT_DEFINED")) { updateSeries(dataset, observationType, session); } else if (!hObservationType.equals(observationType)) { return false; } return true; }
private Set<ObservationFormatDescriptor> getObservationFormatDescriptors(OfferingEntity entity, GDARequestContext context) { Map<String, Set<String>> responsFormatObservationTypesMap = Maps.newHashMap(); for (FormatEntity observationType : entity.getObservationTypes()) { Set<String> responseFormats = getResponseFormatsForObservationType(observationType.getFormat(), context.getRequest().getService(), context.getRequest().getVersion()); for (String responseFormat : responseFormats) { if (responsFormatObservationTypesMap.containsKey(responseFormat)) { responsFormatObservationTypesMap.get(responseFormat).add(observationType.getFormat()); } else { responsFormatObservationTypesMap.put(responseFormat, Sets.newHashSet(observationType.getFormat())); } } } Set<ObservationFormatDescriptor> formatDescriptors = Sets.newHashSet(); for (String responsFormat : responsFormatObservationTypesMap.keySet()) { formatDescriptors.add(new ObservationFormatDescriptor(responsFormat, responsFormatObservationTypesMap.get(responsFormat))); } return formatDescriptors; }
private Collection<String> getFeatureTypes() { return datasets.stream().filter(d -> d.isSetFeature()).filter(d -> d.getFeature().isSetFeatureType()) .map(d -> d.getFeature().getFeatureType().getFormat()).collect(Collectors.toSet()); }
/** * Query allowed FeatureOfInterestTypes for offering * * @param offeringIdentifier * Offering identifier * @param session * Hibernate session * @return Allowed FeatureOfInterestTypes */ public List<String> getAllowedFeatureOfInterestTypes(String offeringIdentifier, Session session) { if (HibernateHelper.isEntitySupported(OfferingEntity.class)) { Criteria criteria = getDefaultTransactionalCriteria(session) .add(Restrictions.eq(OfferingEntity.IDENTIFIER, offeringIdentifier)); LOGGER.debug("QUERY getAllowedFeatureOfInterestTypes(offering): {}", HibernateHelper.getSqlString(criteria)); OfferingEntity offering = (OfferingEntity) criteria.uniqueResult(); if (offering != null) { List<String> list = Lists.newArrayList(); for (FormatEntity featureOfInterestType : offering.getFeatureTypes()) { list.add(featureOfInterestType.getFormat()); } return list; } } return Lists.newArrayList(); }
/** * Query allowed FeatureOfInterestTypes for offering * * @param offeringIdentifier * Offering identifier * @param session * Hibernate session * @return Allowed FeatureOfInterestTypes */ public List<String> getAllowedFeatureOfInterestTypes(String offeringIdentifier, Session session) { if (HibernateHelper.isEntitySupported(OfferingEntity.class)) { Criteria criteria = getDefaultTransactionalCriteria(session) .add(Restrictions.eq(OfferingEntity.IDENTIFIER, offeringIdentifier)); LOGGER.debug("QUERY getAllowedFeatureOfInterestTypes(offering): {}", HibernateHelper.getSqlString(criteria)); OfferingEntity offering = (OfferingEntity) criteria.uniqueResult(); if (offering != null) { List<String> list = Lists.newArrayList(); for (FormatEntity featureOfInterestType : offering.getFeatureTypes()) { list.add(featureOfInterestType.getFormat()); } return list; } } return Lists.newArrayList(); }
@Override public SosProcedureDescription<?> create(ProcedureEntity p, String descriptionFormat, Locale i18n, HibernateProcedureCreationContext ctx, Session s) throws OwsExceptionReport { String xml = loadDescriptionFromHttp(p.getDescriptionFile()); return new SosProcedureDescriptionUnknownType(p.getIdentifier(), p.getFormat().getFormat(), xml); }
@Override public SosProcedureDescription<?> create(ProcedureEntity p, String descriptionFormat, Locale i18n, HibernateProcedureCreationContext ctx, Session s) throws OwsExceptionReport { String xml = loadDescriptionFromHttp(p.getDescriptionFile()); return new SosProcedureDescriptionUnknownType(p.getIdentifier(), p.getFormat().getFormat(), xml); }
@Override public SosProcedureDescription<?> create(ProcedureEntity p, String descriptionFormat, Locale i18n, HibernateProcedureCreationContext ctx, Session s) throws OwsExceptionReport { SosProcedureDescription<?> desc = new SosProcedureDescription<>(readXml(p.getDescriptionFile(), ctx)); desc.setIdentifier(p.getIdentifier()); desc.setDescriptionFormat(p.getFormat().getFormat()); return desc; }
@Override public SosProcedureDescription<?> create(ProcedureEntity p, String descriptionFormat, Locale i18n, HibernateProcedureCreationContext ctx, Session s) throws OwsExceptionReport { SosProcedureDescription<?> desc = new SosProcedureDescription<>(readXml(vpt.getXml(), ctx)); desc.setIdentifier(p.getIdentifier()); desc.setDescriptionFormat(p.getFormat().getFormat()); return desc; }