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

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

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

origin: 52North/SOS

@Override
public boolean hasExtendedOfferingFor(String identifier) {
  return this.enabled && getCache().getOfferings().contains(identifier);
}
origin: org.n52.sensorweb.sos/inspire-code

@Override
public boolean hasExtendedOfferingFor(String identifier) {
  return this.enabled && getCache().getOfferings().contains(identifier);
}
origin: 52North/SOS

private void checkOffering(final String offering) throws NoSuchOfferingException {
  LOGGER.trace("checkOffering('{}')",offering);
  LOGGER.trace("Offerings im Cache: {}",Arrays.toString(getCache().getOfferings().toArray()));
  if (!getCache().getOfferings().contains(offering)) {
    throw new NoSuchOfferingException(offering);
  }
}
origin: org.n52.sensorweb.sos/admin-controller

private void checkOffering(final String offering) throws NoSuchOfferingException {
  LOGGER.trace("checkOffering('{}')",offering);
  LOGGER.trace("Offerings im Cache: {}",Arrays.toString(getCache().getOfferings().toArray()));
  if (!getCache().getOfferings().contains(offering)) {
    throw new NoSuchOfferingException(offering);
  }
}
origin: org.n52.sensorweb.sos/admin-controller

@ResponseBody
@ResponseStatus(HttpStatus.OK)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public String getOfferingExtensions() throws OwsExceptionReport {
  final Map<String, List<SosObservationOfferingExtension>> offeringExtensions = getCapabilitiesExtensionService().getOfferingExtensions();
  final List<String> offerings = Lists.newArrayList(getCache().getOfferings());
  Collections.sort(offerings);
  ObjectNode response = Json.nodeFactory().objectNode();
  for (final String offering : offerings) {
    response.set(offering, toJson(offeringExtensions.get(offering)));
  }
  return response.toString();
}
origin: 52North/SOS

@ResponseBody
@ResponseStatus(HttpStatus.OK)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public String getOfferingExtensions() throws OwsExceptionReport {
  final Map<String, List<SosObservationOfferingExtension>> offeringExtensions = getCapabilitiesExtensionService().getOfferingExtensions();
  final List<String> offerings = Lists.newArrayList(getCache().getOfferings());
  Collections.sort(offerings);
  ObjectNode response = Json.nodeFactory().objectNode();
  for (final String offering : offerings) {
    response.set(offering, toJson(offeringExtensions.get(offering)));
  }
  return response.toString();
}
origin: org.n52.sensorweb.sos/resultHandling-v20

private void checkOffering(String offering) throws OwsExceptionReport {
  if (offering == null || offering.isEmpty()) {
    throw new MissingOfferingParameterException();
  } else if (!getCache().getOfferings().contains(offering)) {
    throw new InvalidOfferingParameterException(offering);
  }
}
origin: 52North/SOS

  @Override
  public ListMultiMap<String, SosObservationOfferingExtension> apply(final Session session) {
    @SuppressWarnings("unchecked")
    final List<OfferingExtensionImpl> extensions = session.createCriteria(OfferingExtensionImpl.class)
        .add(eq(OfferingExtensionImpl.ACTIVE, true)).list();
    final ListMultiMap<String, SosObservationOfferingExtension> map = new LinkedListMultiMap<>(
        getCache().getOfferings().size());
    for (final OfferingExtensionImpl extension : extensions) {
      LOGGER.debug("Loaded OfferingExtension: {}", extension);
      map.add(extension.getOfferingName(), extension);
    }
    return map;
  }
}
origin: 52North/SOS

private void checkOffering(String offering) throws OwsExceptionReport {
  if (offering == null || offering.isEmpty()) {
    throw new MissingOfferingParameterException();
  } else if (!getCache().getOfferings().contains(offering)) {
    throw new InvalidOfferingParameterException(offering);
  }
}
origin: 52North/SOS

  @Override
  public ListMultiMap<String, SosObservationOfferingExtension> apply(final Session session) {
    @SuppressWarnings("unchecked")
    final List<OfferingExtensionImpl> extensions = session.createCriteria(OfferingExtensionImpl.class).list();
    final ListMultiMap<String, SosObservationOfferingExtension> map = new LinkedListMultiMap<>(
        getCache().getOfferings().size());
    for (final OfferingExtensionImpl extension : extensions) {
      LOGGER.debug("Loaded OfferingExtension: {}", extension);
      map.add(extension.getOfferingName(), extension);
    }
    return map;
  }
}
origin: org.n52.sensorweb.sos/admin-controller

@RequestMapping(method = RequestMethod.GET)
public ModelAndView view() {
  Map<String, String> model = new HashMap<>(4);
  SosContentCache cache = getCache();
  model.put(OFFERINGS, asJSONArray(cache.getOfferings()));
  model.put(PROCEDURES, asJSONArray(cache.getProcedures()));
  model.put(FEATURES, asJSONArray(cache.getFeaturesOfInterest()));
  model.put(OBSERVABLE_PROPERTIES, asJSONArray(cache
       .getObservableProperties()));
  return new ModelAndView(ControllerConstants.Views.ADMIN_I18N, model);
}
origin: 52North/SOS

@RequestMapping(method = RequestMethod.GET)
public ModelAndView view() {
  Map<String, String> model = new HashMap<>(4);
  SosContentCache cache = getCache();
  model.put(OFFERINGS, asJSONArray(cache.getOfferings()));
  model.put(PROCEDURES, asJSONArray(cache.getProcedures()));
  model.put(FEATURES, asJSONArray(cache.getFeaturesOfInterest()));
  model.put(OBSERVABLE_PROPERTIES, asJSONArray(cache
       .getObservableProperties()));
  return new ModelAndView(ControllerConstants.Views.ADMIN_I18N, model);
}
origin: 52North/SOS

protected void checkOffering(String offering, String parameterName, boolean all) throws OwsExceptionReport {
  if (offering == null || offering.isEmpty()) {
    throw new MissingParameterValueException(parameterName);
  }
  if (all) {
    if (!getCache().getOfferings().contains(offering)) {
      throw new InvalidParameterValueException(parameterName, offering);
    }
  } else {
    if (!getCache().getPublishedOfferings().contains(offering)) {
      throw new InvalidParameterValueException(parameterName, offering);
    }
  }
}
origin: 52North/SOS

protected OwsDomain getOfferingParameter(String service, String version) {
  if (checkListOnlyParentOfferings()) {
    return getOfferingParameter(service, version,
        getCache().getParentOfferings(getCache().getOfferings(), false, false));
  } else {
    return getOfferingParameter(service, version, getCache().getOfferings());
  }
}
origin: org.n52.sensorweb.sos/admin-controller

public static Map<String, String> getCacheValues() {
  SosContentCache cache = Configurator.getInstance().getCache();
  Map<String, String> values = new TreeMap<>();
  values.put(LAST_UPDATE_TIME, nullSafeToString(cache.getLastUpdateTime()));
  values.put(MIN_PHENOMENON_TIME, nullSafeToString(cache.getMinPhenomenonTime()));
  values.put(MAX_PHENOMENON_TIME, nullSafeToString(cache.getMaxPhenomenonTime()));
  values.put(MIN_RESULT_TIME, nullSafeToString(cache.getMinResultTime()));
  values.put(MAX_RESULT_TIME, nullSafeToString(cache.getMaxResultTime()));
  values.put(GLOBAL_ENVELOPE, nullSafeToString(cache.getGlobalEnvelope()));
  values.put(NUM_OFFERINGS, nullSafeToString(cache.getOfferings()));
  values.put(NUM_PROCEDURES, nullSafeToString(cache.getProcedures()));
  values.put(NUM_OBSERVABLE_PROPERTIES, nullSafeToString(cache.getObservableProperties()));
  values.put(NUM_FEATURES_OF_INTEREST, nullSafeToString(cache.getFeaturesOfInterest()));
  values.put(NUM_FEATURE_OF_INTEREST_TYPES, nullSafeToString(cache.getFeatureOfInterestTypes()));
  values.put(NUM_OBSERVATION_TYPES, nullSafeToString(cache.getObservationTypes()));
  values.put(NUM_RELATED_FEATURES, nullSafeToString(cache.getRelatedFeatures()));
  values.put(NUM_RESULT_TEMPLATES, nullSafeToString(cache.getResultTemplates()));
  values.put(DEFAULT_EPSG, Integer.toString(cache.getDefaultEPSGCode()));
  values.put(NUM_EPSGS, nullSafeToString(cache.getEpsgCodes()));
  return values;
}
origin: org.n52.sensorweb.sos/aqd-v10

/**
 * checks if the passed offeringId is supported
 *
 * @param offeringIds
 *            the offeringId to be checked
 *
 *
 * @throws OwsExceptionReport
 *             if the passed offeringId is not supported
 */
private void checkOfferingId(final List<String> offeringIds) throws OwsExceptionReport {
  if (offeringIds != null) {
    final Set<String> offerings = getCache().getOfferings();
    final CompositeOwsException exceptions = new CompositeOwsException();
    for (final String offeringId : offeringIds) {
      if (offeringId == null || offeringId.isEmpty()) {
        exceptions.add(new MissingOfferingParameterException());
      } else if (offeringId.contains(SosConstants.SEPARATOR_4_OFFERINGS)) {
        final String[] offArray = offeringId.split(SosConstants.SEPARATOR_4_OFFERINGS);
        if (!offerings.contains(offArray[0])
            || !getCache().getProceduresForOffering(offArray[0]).contains(offArray[1])) {
          exceptions.add(new InvalidOfferingParameterException(offeringId));
        }
      } else if (!offerings.contains(offeringId)) {
        exceptions.add(new InvalidOfferingParameterException(offeringId));
      }
    }
    exceptions.throwIfNotEmpty();
  }
}
origin: 52North/SOS

public static Map<String, String> getCacheValues() {
  SosContentCache cache = Configurator.getInstance().getCache();
  Map<String, String> values = new TreeMap<>();
  values.put(LAST_UPDATE_TIME, nullSafeToString(cache.getLastUpdateTime()));
  values.put(MIN_PHENOMENON_TIME, nullSafeToString(cache.getMinPhenomenonTime()));
  values.put(MAX_PHENOMENON_TIME, nullSafeToString(cache.getMaxPhenomenonTime()));
  values.put(MIN_RESULT_TIME, nullSafeToString(cache.getMinResultTime()));
  values.put(MAX_RESULT_TIME, nullSafeToString(cache.getMaxResultTime()));
  values.put(GLOBAL_ENVELOPE, nullSafeToString(cache.getGlobalEnvelope()));
  values.put(NUM_OFFERINGS, nullSafeToString(cache.getOfferings()));
  values.put(NUM_PROCEDURES, nullSafeToString(cache.getProcedures()));
  values.put(NUM_OBSERVABLE_PROPERTIES, nullSafeToString(cache.getObservableProperties()));
  values.put(NUM_FEATURES_OF_INTEREST, nullSafeToString(cache.getFeaturesOfInterest()));
  values.put(NUM_FEATURE_OF_INTEREST_TYPES, nullSafeToString(cache.getFeatureOfInterestTypes()));
  values.put(NUM_OBSERVATION_TYPES, nullSafeToString(cache.getObservationTypes()));
  values.put(NUM_RELATED_FEATURES, nullSafeToString(cache.getRelatedFeatures()));
  values.put(NUM_RESULT_TEMPLATES, nullSafeToString(cache.getResultTemplates()));
  values.put(DEFAULT_EPSG, Integer.toString(cache.getDefaultEPSGCode()));
  values.put(NUM_EPSGS, nullSafeToString(cache.getEpsgCodes()));
  return values;
}
origin: org.n52.sensorweb.sos/inspire-code

/**
 * Get the spatial dataset identifiers
 *
 * @param version
 *            the service version
 * @return the spatial dataset identifiers
 */
private Set<InspireUniqueResourceIdentifier> getSpatialDataSetIdentifier(String version) {
  Set<InspireUniqueResourceIdentifier> spatialDataSetIdentifier = Sets.newHashSet();
  for (String offering : getCache().getOfferings()) {
    InspireUniqueResourceIdentifier iuri = new InspireUniqueResourceIdentifier(offering);
    if (getInspireHelper().isSetNamespace()) {
      iuri.setNamespace(getInspireHelper().getNamespace());
    } else {
      iuri.setNamespace(ServiceConfiguration.getInstance().getServiceURL());
    }
    spatialDataSetIdentifier.add(iuri);
  }
  return spatialDataSetIdentifier;
}
origin: 52North/SOS

/**
 * Get the spatial dataset identifiers
 *
 * @param version
 *            the service version
 * @return the spatial dataset identifiers
 */
private Set<InspireUniqueResourceIdentifier> getSpatialDataSetIdentifier(String version) {
  Set<InspireUniqueResourceIdentifier> spatialDataSetIdentifier = Sets.newHashSet();
  for (String offering : getCache().getOfferings()) {
    InspireUniqueResourceIdentifier iuri = new InspireUniqueResourceIdentifier(offering);
    if (getInspireHelper().isSetNamespace()) {
      iuri.setNamespace(getInspireHelper().getNamespace());
    } else {
      iuri.setNamespace(ServiceConfiguration.getInstance().getServiceURL());
    }
    spatialDataSetIdentifier.add(iuri);
  }
  return spatialDataSetIdentifier;
}
origin: 52North/SOS

private void checkAndAddOfferingToObservationConstallation(final InsertObservationRequest request)
    throws OwsExceptionReport {
  // TODO: Check requirement for this case in SOS 2.0 specification
  if (request.getOfferings() == null || (request.getOfferings() != null && request.getOfferings().isEmpty())) {
    throw new MissingOfferingParameterException();
  } else {
    final CompositeOwsException exceptions = new CompositeOwsException();
    for (final String offering : request.getOfferings()) {
      if (offering == null || offering.isEmpty()) {
        exceptions.add(new MissingOfferingParameterException());
      } else if (!getCache().getOfferings().contains(offering)) {
        exceptions.add(new InvalidOfferingParameterException(offering));
      } else {
        request.getObservations().forEach(observation -> observation.getObservationConstellation().addOffering(offering));
      }
    }
    exceptions.throwIfNotEmpty();
  }
}
org.n52.sos.cacheSosContentCachegetOfferings

Popular methods of SosContentCache

  • getObservableProperties
  • getFeatureOfInterestTypes
  • getObservationTypes
  • getProceduresForOffering
  • hasObservableProperty
  • hasOffering
  • getAllowedObservationTypesForOffering
  • getChildProcedures
    Returns collection containing child procedures for the passed procedures, optionally navigating the
  • getEpsgCodes
  • getOfferingsForProcedure
  • getProcedures
  • getPublishedObservableProperties
  • getProcedures,
  • getPublishedObservableProperties,
  • getPublishedOfferings,
  • hasResultTemplate,
  • getAllObservationTypesForOffering,
  • getCompositePhenomenonsForOffering,
  • getEnvelopeForOffering,
  • getFeaturesOfInterest,
  • getFeaturesOfInterestForOffering

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Menu (java.awt)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Collectors (java.util.stream)
  • JComboBox (javax.swing)
  • Github Copilot alternatives
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