Tabnine Logo
SosContentCache.getAllowedObservationTypesForOffering
Code IndexAdd Tabnine to your IDE (free)

How to use
getAllowedObservationTypesForOffering
method
in
org.n52.sos.cache.SosContentCache

Best Java code snippets using org.n52.sos.cache.SosContentCache.getAllowedObservationTypesForOffering (Showing top 4 results out of 315)

origin: 52North/SOS

protected Collection<String> getObservationTypes(String offering) {
  Set<String> observationTypes = getCache().getObservationTypesForOffering(offering).stream()
      .filter(Predicate.isEqual(SosConstants.NOT_DEFINED).negate())
      .collect(Collectors.toSet());
  if (observationTypes.isEmpty()) {
    getCache().getAllowedObservationTypesForOffering(offering).stream()
        .filter(Predicate.isEqual(SosConstants.NOT_DEFINED).negate())
        .forEach(observationTypes::add);
  }
  return observationTypes;
}
origin: org.n52.sensorweb.sos/resultHandling-v20

private void checkObservationType(InsertResultTemplateRequest request) throws OwsExceptionReport {
  OmObservationConstellation observationConstellation = request.getObservationTemplate();
  if (observationConstellation.isSetObservationType()) {
    // TODO check why setting SweArray_Observation as type
    //observationConstellation.setObservationType(OmConstants.OBS_TYPE_SWE_ARRAY_OBSERVATION);
    // check if observation type is supported
    checkObservationType(observationConstellation.getObservationType(),
        Sos2Constants.InsertResultTemplateParams.observationType.name());
  }
  Set<String> validObservationTypesForOffering = new HashSet<>(0);
  for (String offering : observationConstellation.getOfferings()) {
    validObservationTypesForOffering.addAll(getCache()
        .getAllowedObservationTypesForOffering(offering));
  }
  // check if observation type is valid for offering
  if (!validObservationTypesForOffering.contains(observationConstellation.getObservationType())) {
    throw new InvalidParameterValueException().at(Sos2Constants.InsertResultTemplateParams.observationType)
        .withMessage("The requested observation type is not valid for the offering!");
  }
}
origin: 52North/SOS

private void checkObservationType(InsertResultTemplateRequest request) throws OwsExceptionReport {
  OmObservationConstellation observationConstellation = request.getObservationTemplate();
  if (observationConstellation.isSetObservationType()) {
    // TODO check why setting SweArray_Observation as type
    //observationConstellation.setObservationType(OmConstants.OBS_TYPE_SWE_ARRAY_OBSERVATION);
    // check if observation type is supported
    checkObservationType(observationConstellation.getObservationType(),
        Sos2Constants.InsertResultTemplateParams.observationType.name());
  }
  Set<String> validObservationTypesForOffering = new HashSet<>(0);
  for (String offering : observationConstellation.getOfferings()) {
    validObservationTypesForOffering.addAll(getCache()
        .getAllowedObservationTypesForOffering(offering));
  }
  // check if observation type is valid for offering
  if (!validObservationTypesForOffering.contains(observationConstellation.getObservationType())) {
    throw new InvalidParameterValueException().at(Sos2Constants.InsertResultTemplateParams.observationType)
        .withMessage("The requested observation type is not valid for the offering!");
  }
}
origin: 52North/SOS

private void checkObservations(final InsertObservationRequest request) throws OwsExceptionReport {
  if (CollectionHelper.isEmpty(request.getObservations())) {
    throw new MissingObservationParameterException();
  } else {
    final SosContentCache cache = getCache();
    final CompositeOwsException exceptions = new CompositeOwsException();
    for (final OmObservation observation : request.getObservations()) {
      final OmObservationConstellation obsConstallation = observation.getObservationConstellation();
      checkObservationConstellationParameter(obsConstallation);
      // Requirement 67
      checkOrSetObservationType(observation, isSplitObservations(request));
      if (!cache.getObservationTypes().contains(obsConstallation.getObservationType())) {
        exceptions.add(new InvalidObservationTypeException(obsConstallation.getObservationType()));
      } else if (obsConstallation.isSetOfferings()) {
        for (final String offeringID : obsConstallation.getOfferings()) {
          final Collection<String> allowedObservationTypes = cache
              .getAllowedObservationTypesForOffering(offeringID);
          if ((allowedObservationTypes == null ||
               !allowedObservationTypes.contains(obsConstallation.getObservationType())) &&
               !request.isSetExtensionSplitDataArrayIntoObservations()) {
            exceptions.add(new InvalidObservationTypeForOfferingException(
                obsConstallation.getObservationType(), offeringID));
          }
        }
      }
    }
    exceptions.throwIfNotEmpty();
  }
}
org.n52.sos.cacheSosContentCachegetAllowedObservationTypesForOffering

Javadoc

Returns the allowed observation types for the specified offering.

Popular methods of SosContentCache

  • getOfferings
  • getObservableProperties
  • getFeatureOfInterestTypes
  • getObservationTypes
  • getProceduresForOffering
  • hasObservableProperty
  • hasOffering
  • getChildProcedures
  • getEpsgCodes
  • getOfferingsForProcedure
  • getProcedures
  • getPublishedObservableProperties
  • getProcedures,
  • getPublishedObservableProperties,
  • getPublishedOfferings,
  • hasResultTemplate,
  • getAllObservationTypesForOffering,
  • getCompositePhenomenonsForOffering,
  • getEnvelopeForOffering,
  • getFeaturesOfInterest,
  • getFeaturesOfInterestForOffering

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JLabel (javax.swing)
  • Join (org.hibernate.mapping)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now