Tabnine Logo
InvalidParameterValueException.at
Code IndexAdd Tabnine to your IDE (free)

How to use
at
method
in
org.n52.shetland.ogc.ows.exception.InvalidParameterValueException

Best Java code snippets using org.n52.shetland.ogc.ows.exception.InvalidParameterValueException.at (Showing top 20 results out of 315)

origin: 52North/SOS

public static void checkHref(final String href, final String parameterName) throws OwsExceptionReport {
  if (!href.startsWith("http") && !href.startsWith("urn")) {
    throw new InvalidParameterValueException().at(parameterName).withMessage(
        "The reference (href) has an invalid style!");
  }
}
origin: org.n52.wps/service

private static OwsExceptionReport duplicateOutput(OwsCode id) {
  return new InvalidParameterValueException().at(OUTPUT).withMessage("Duplicate output definition for output %s",
      id);
}
origin: org.n52.sensorweb.sos/observation-converter

/**
 * Check if the requested resultType is valid
 *
 * @param resultType
 *            Requested resultType
 * @throws CodedException
 *             If the requested resultType is not valid
 */
private void checkRequestedResultType(String resultType) throws CodedException {
  if (!getValidResultTypes().contains(resultType)) {
    throw new InvalidParameterValueException().at("resultType").withMessage(
        "The requested resultType '%s' is not valid for the responseFormat '%s'", resultType,
        InspireOMSOConstants.NS_OMSO_30);
  }
}
origin: 52North/SOS

/**
 * Check if the requested resultType is valid
 *
 * @param resultType
 *            Requested resultType
 * @throws CodedException
 *             If the requested resultType is not valid
 */
private void checkRequestedResultType(String resultType) throws CodedException {
  if (!getValidResultTypes().contains(resultType)) {
    throw new InvalidParameterValueException().at("resultType").withMessage(
        "The requested resultType '%s' is not valid for the responseFormat '%s'", resultType,
        InspireOMSOConstants.NS_OMSO_30);
  }
}
origin: org.n52.iceland/iceland

public static URI checkParameterSingleURI(String values, String name) throws OwsExceptionReport {
  String value = checkParameterSingleValue(values, name);
  try {
    return new URI(value);
  } catch (URISyntaxException e) {
    throw new InvalidParameterValueException().at(name).causedBy(e)
        .withMessage("Cannot parse provided value '%s' to URI", value);
  }
}
origin: 52North/SOS

/**
 * Check if the observation contains more than one sampling geometry
 * definitions.
 *
 * @param request
 *                Request
 *
 * @throws CodedException
 *                        If more than one sampling geometry is defined
 */
private void checkParameterForSpatialFilteringProfile(InsertObservationRequest request) throws OwsExceptionReport {
  for (OmObservation observation : request.getObservations()) {
    if (observation.isSetParameter()) {
      long count = observation.getParameter().stream()
          .map(NamedValue::getName)
          .map(ReferenceType::getHref)
          .filter(Sos2Constants.HREF_PARAMETER_SPATIAL_FILTERING_PROFILE::equals)
          .count();
      if (count > 1) {
        throw new InvalidParameterValueException().at("om:parameter").withMessage(
            "The observation contains more than one ({}) sampling geometry definitions!", count);
      }
    }
  }
}
origin: org.n52.wps/service

private static OwsExceptionReport invalidInput(ProcessData input,
    String messageDetail) {
  String id = input.getId().getValue();
  return new InvalidParameterValueException().at(INPUT).withMessage(VALUE_INVALID, id, INPUT, messageDetail);
}
origin: org.n52.wps/service

private static OwsExceptionReport invalidOutput(OutputDefinition output,
    String messageDetail) {
  String id = output.getId().getValue();
  return new InvalidParameterValueException().at(OUTPUT).withMessage(VALUE_INVALID, id, OUTPUT, messageDetail);
}
origin: 52North/SOS

} else {
  throw new InvalidParameterValueException()
      .at(GetCapabilitiesParams.Section)
      .withMessage("The requested section '%s' does not exist or is not supported!", section);
origin: org.n52.wps/service

private void validateCardinalities(List<ProcessData> inputs,
    ProcessDescription description) throws OwsExceptionReport {
  CompositeOwsException exception = new CompositeOwsException();
  InputOccurenceCollector collector = new InputOccurenceCollector();
  Map<Chain<OwsCode>, BigInteger> cardinalities = inputs.stream().collect(MoreCollectors.toCardinalities(
      ProcessData::getId, ProcessData::isGroup, x -> x.asGroup().stream()));
  Map<Chain<OwsCode>, InputOccurence> occurences = description.getInputDescriptions().stream().map(input -> input
      .visit(collector)).collect(HashMap::new, Map::putAll, Map::putAll);
  // check the cardinalities of existing inputs
  // ignore if there is no cardinality, as this
  // will be catched by another method
  cardinalities.forEach((chain,
      cardinality) ->
  Optional.ofNullable(occurences.get(chain)).filter(occurence -> !occurence.isInBounds(cardinality)).ifPresent(
      occurence -> exception.add(new InvalidParameterValueException().at(INPUT).withMessage(
          "The input %s has an invalid cardinality of %s; should be in %s.", chain.toString(),
          cardinality, occurence))));
  // check for missing inputs
  occurences.forEach((chain,
      occurence) -> {
    if (occurence.isRequired() && !cardinalities.containsKey(chain)) {
      exception.add(new MissingParameterValueException().at(INPUT).withMessage("The input %s is required",
          chain.toString()));
    }
  });
  exception.throwIfNotEmpty();
}
origin: 52North/SOS

/**
 * Checks the requested procedureDescriptionFormat with the datasource
 * procedureDescriptionFormat.
 *
 * @param identifier
 *
 * @param identifier
 *            the procedure identifier
 * @param requestedFormat
 *            requested procedureDescriptionFormat
 *
 * @throws OwsExceptionReport
 *             If procedureDescriptionFormats are invalid
 */
private boolean checkOutputFormatWithDescriptionFormat(String identifier, String requestedFormat)
    throws OwsExceptionReport {
  if (existsGenerator(requestedFormat)) {
    return true;
  }
  throw new InvalidParameterValueException().at(SosConstants.DescribeSensorParams.procedure)
      .withMessage("The value of the output format is wrong and has to be %s for procedure %s",
          requestedFormat, identifier)
      .setStatus(HTTPStatus.BAD_REQUEST);
}
origin: 52North/SOS

private void checkParentChildProcedures(SosProcedureDescription<?> procedureDescription, String assignedIdentifier)
    throws CodedException {
  if (procedureDescription.isSetChildProcedures()) {
    for (AbstractSensorML child : procedureDescription.getChildProcedures()) {
      if (child.getIdentifier().equalsIgnoreCase(assignedIdentifier)) {
        throw new InvalidParameterValueException().at("childProcdureIdentifier").withMessage(
            "The procedure with the identifier '%s' is linked to itself as child procedure !",
            procedureDescription.getIdentifier());
      }
    }
  }
  if (procedureDescription.isSetParentProcedure()) {
    if (procedureDescription.getParentProcedure().getHref().equals(assignedIdentifier)) {
      throw new InvalidParameterValueException().at("parentProcdureIdentifier").withMessage(
          "The procedure with the identifier '%s' is linked to itself as parent procedure !",
          procedureDescription.getIdentifier());
    }
  }
}
origin: 52North/SOS

private void checkProcedureAndOfferingCombination(InsertSensorRequest request) throws OwsExceptionReport {
  for (SosOffering offering : request.getAssignedOfferings()) {
    if (!offering.isParentOffering() && getCache().getPublishedOfferings().contains(offering.getIdentifier())) {
      throw new InvalidParameterValueException().at(Sos2Constants.InsertSensorParams.offeringIdentifier)
          .withMessage(
              "The offering with the identifier '%s' still exists in this service and it is not allowed to insert more than one procedure to an offering!",
              offering.getIdentifier());
    }
  }
}
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: org.n52.sensorweb.sos/extensions-v20

private void checkFeatureMembers(List<AbstractFeature> featureMembers) throws OwsExceptionReport {
  for (AbstractFeature abstractFeature : featureMembers) {
    if (!abstractFeature.isSetIdentifier()) {
      abstractFeature.setIdentifier(JavaHelper.generateID(abstractFeature.toString()));
    }
    if (getCache().hasFeatureOfInterest(abstractFeature.getIdentifier())) {
      throw new InvalidParameterValueException()
        .at("featureMember.identifier")
        .withMessage(
            "The featureOfInterest with identifier '%s' still exists!",
            abstractFeature.getIdentifier());
    }
  }
}
origin: org.n52.sensorweb.sos/hibernate-common

throw new InvalidParameterValueException().at(SosConstants.DescribeSensorParams.procedure)
    .withMessage("The value of the output format is wrong and has to be %s for procedure %s",
        descriptionFormat, identifier)
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 checkFeatureMembers(List<AbstractFeature> featureMembers) throws OwsExceptionReport {
  for (AbstractFeature abstractFeature : featureMembers) {
    if (!abstractFeature.isSetIdentifier()) {
      abstractFeature.setIdentifier(JavaHelper.generateID(abstractFeature.toString()));
    }
    if (getCache().hasFeatureOfInterest(abstractFeature.getIdentifier())) {
      throw new InvalidParameterValueException()
        .at("featureMember.identifier")
        .withMessage(
            "The featureOfInterest with identifier '%s' still exists!",
            abstractFeature.getIdentifier());
    }
  }
}
origin: 52North/SOS

/**
 * method checks whether this SOS supports the single requested version
 *
 * @param request
 *            the request
 *
 *
 * @throws OwsExceptionReport
 *             * if this SOS does not support the requested versions
 */
protected void checkSingleVersionParameter(OwsServiceRequest request) throws OwsExceptionReport {
  // if version is incorrect, throw exception
  if (request.getVersion() == null) {
    throw new MissingVersionParameterException();
  }
  if ( !this.serviceOperatorRepository.isVersionSupported(request.getService(), request.getVersion())) {
    throw new InvalidParameterValueException().at(OWSConstants.RequestParams.version).withMessage(
        "The parameter '%s' does not contain version(s) supported by this Service: '%s'!",
        OWSConstants.RequestParams.version.name(),
        Joiner.on(", ").join(this.serviceOperatorRepository.getSupportedVersions(request.getService())));
  }
}
origin: org.n52.wps/service

private void validate(ExecuteRequest request,
    ProcessDescription description) throws OwsExceptionReport {
  CompositeOwsException exception = new CompositeOwsException();
  if (request.getResponseMode() == ResponseMode.RAW && (request.getOutputs().size() > 1 || (request.getOutputs()
      .isEmpty() && description.getOutputs().size() > 1))) {
    exception.add(new InvalidParameterValueException().at("responseMode").withMessage(
        "The value 'raw' of the parameter 'responseMode' is invalid. Single output is required."));
  }
  try {
    validateInputs(request.getInputs(), description);
  } catch (OwsExceptionReport ex) {
    exception.add(ex);
  }
  try {
    validateOutputs(request.getOutputs(), description);
  } catch (OwsExceptionReport ex) {
    exception.add(ex);
  }
  try {
    validateCardinalities(request.getInputs(), description);
  } catch (OwsExceptionReport ex) {
    exception.add(ex);
  }
  exception.throwIfNotEmpty();
}
org.n52.shetland.ogc.ows.exceptionInvalidParameterValueExceptionat

Popular methods of InvalidParameterValueException

  • <init>
  • withMessage
  • causedBy
  • setStatus

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Kernel (java.awt.image)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Best plugins for Eclipse
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