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

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

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

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: 52North/SOS

protected void checkReservedCharacter(String value, String parameterName) throws OwsExceptionReport {
  if (value != null && value.contains(",")) {
    throw new InvalidParameterValueException(parameterName, value)
        .withMessage("The value '%s' contains the reserved parameter ','", value);
  }
}
origin: org.n52.arctic-sea/shetland

public InvalidParameterValueException(final String parameterName, final String value) {
  super(OwsExceptionCode.InvalidParameterValue);
  withMessage("The value '%s' of the parameter '%s' is invalid", value, parameterName).at(parameterName);
  setStatus(HTTPStatus.BAD_REQUEST);
}
origin: org.n52.iceland/iceland

public static String checkParameterSingleValue(String value, String name) throws OwsExceptionReport {
  if (checkParameterMultipleValues(value, name).size() == 1) {
    return value;
  } else {
    throw new InvalidParameterValueException(name, value);
  }
}
origin: 52North/SOS

/**
 * Unfold internal observation from result values to single internal
 * observations
 *
 * @param observation
 *            Internal observaiton to unfold
 * @return List with single interal observations
 * @throws OwsExceptionReport
 *             If an error occurs during unfolding
 */
protected List<OmObservation> getSingleObservationsFromObservation(final OmObservation observation)
    throws OwsExceptionReport {
  try {
    return new ObservationUnfolder(observation, sweHelper).unfold(isConvertComplexProfileToSingleProfiles());
  } catch (final Exception e) {
    throw new InvalidParameterValueException()
        .causedBy(e)
        .at(Sos2Constants.InsertResultParams.resultValues)
        .withMessage(
            "The resultValues format does not comply to the resultStructure of the resultTemplate!");
  }
}
origin: org.n52.shetland/shetland

public InvalidParameterValueException() {
  super(OwsExceptionCode.InvalidParameterValue);
  setStatus(HTTPStatus.BAD_REQUEST);
}
origin: org.n52.sensorweb.sos/extensions-v20

private void checkResponseFormat(String responseFormat) throws CodedOwsException {
  if (responseFormat == null || responseFormat.isEmpty()) {
    throw new MissingParameterValueException("responseFormat");
  }
  if (!(GetDataAvailabilityConstants.NS_GDA.equals(responseFormat)
      || GetDataAvailabilityConstants.NS_GDA_20.equals(responseFormat))) {
    throw new InvalidParameterValueException("responseFormat", responseFormat);
  }
}
origin: org.n52.sensorweb.sos/hibernate-handler

/**
 * Unfold internal observation from result values to single internal
 * observations
 *
 * @param observation
 *            Internal observaiton to unfold
 * @return List with single interal observations
 * @throws OwsExceptionReport
 *             If an error occurs during unfolding
 */
protected List<OmObservation> getSingleObservationsFromObservation(final OmObservation observation)
    throws OwsExceptionReport {
  try {
    return new ObservationUnfolder(observation, sweHelper).unfold(isConvertComplexProfileToSingleProfiles());
  } catch (final Exception e) {
    throw new InvalidParameterValueException()
        .causedBy(e)
        .at(Sos2Constants.InsertResultParams.resultValues)
        .withMessage(
            "The resultValues format does not comply to the resultStructure of the resultTemplate!");
  }
}
origin: org.n52.arctic-sea/shetland

public InvalidParameterValueException() {
  super(OwsExceptionCode.InvalidParameterValue);
  setStatus(HTTPStatus.BAD_REQUEST);
}
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: 52North/SOS

private void checkResponseFormat(String responseFormat) throws CodedOwsException {
  if (responseFormat == null || responseFormat.isEmpty()) {
    throw new MissingParameterValueException("responseFormat");
  }
  if (!(GetDataAvailabilityConstants.NS_GDA.equals(responseFormat)
      || GetDataAvailabilityConstants.NS_GDA_20.equals(responseFormat))) {
    throw new InvalidParameterValueException("responseFormat", responseFormat);
  }
}
origin: org.n52.iceland/iceland

  private OwsExceptionReport toOwsExceptionReport(Throwable ex) {
    if (ex instanceof OwsExceptionReport) {
      return (OwsExceptionReport) ex;
    }

    Throwable cause = ex.getCause();

    if (cause instanceof OwsExceptionReport) {
      return (OwsExceptionReport) cause;
    }

    if (ex instanceof CompositeException) {
      return toOwsExceptionReport((CompositeException) ex);
    }

    if (cause instanceof CompositeException) {
      return toOwsExceptionReport((CompositeException) cause);
    }

    String location = null;
    if (ex instanceof LocationHintException) {
      location = ((LocationHintException) ex).getLocation().orElse(null);
    } else if (cause instanceof LocationHintException) {
      location = ((LocationHintException) cause).getLocation().orElse(null);
    }

    return new InvalidParameterValueException().withMessage(ex.getMessage()).causedBy(ex).at(location);
  }
}
origin: org.n52.wps/service

@Override
public DismissResponse handle(DismissRequest request) throws OwsExceptionReport {
  JobId jobId = request.getJobId();
  StatusInfo status;
  try {
    status = getEngine().dismiss(jobId);
  } catch (JobNotFoundException ex) {
    throw new InvalidParameterValueException(JOB_ID, jobId.getValue()).causedBy(ex);
  }
  String service = request.getService();
  String version = request.getVersion();
  return new DismissResponse(service, version, status);
}
origin: org.n52.shetland/shetland

public InvalidParameterValueException(final String parameterName, final String value) {
  super(OwsExceptionCode.InvalidParameterValue);
  withMessage("The value '%s' of the parameter '%s' is invalid", value, parameterName).at(parameterName);
  setStatus(HTTPStatus.BAD_REQUEST);
}
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: org.n52.sensorweb.sos/hibernate-common

protected Date getDateForTimeIndeterminateValue(IndeterminateValue indeterminateValue, String parameter)
    throws InvalidParameterValueException {
  if (indeterminateValue.isNow()) {
    return new DateTime().toDate();
  }
  throw new InvalidParameterValueException(parameter, indeterminateValue.getValue());
}
origin: 52North/SOS

protected void checkTemporalFilter(TemporalFilter temporalFilter) throws CodedException {
  if (temporalFilter.getTime() instanceof TimePeriod) {
    TimePeriod tp = (TimePeriod) temporalFilter.getTime();
    if (tp.isEmpty()) {
      throw new InvalidParameterValueException(SosConstants.Filter.TimePeriod, tp.toString())
          .withMessage("Begin/end time is missing!");
    }
    if (tp.getStart().isEqual(tp.getEnd())) {
      throw new InvalidParameterValueException(SosConstants.Filter.TimePeriod, tp.toString()).withMessage(
          "It is not allowed that begin and end time are equal! Begin '%s' == End '%s'", tp.getStart(),
          tp.getEnd());
    }
    if (tp.getStart().isAfter(tp.getEnd())) {
      throw new InvalidParameterValueException(SosConstants.Filter.TimePeriod, tp.toString()).withMessage(
          "It is not allowed that begin time is after end time! Begin '%s' > End '%s'", tp.getStart(),
          tp.getEnd());
    }
  }
}
origin: org.n52.wps/service

@Override
public GetStatusResponse handle(GetStatusRequest request) throws OwsExceptionReport {
  String service = request.getService();
  String version = request.getVersion();
  JobId jobId = request.getJobId();
  StatusInfo status;
  try {
    status = getEngine().getStatus(jobId);
  } catch (JobNotFoundException ex) {
    throw new InvalidParameterValueException(JOB_ID, jobId.getValue()).causedBy(ex);
  } catch (EngineException ex) {
    throw new NoApplicableCodeException().causedBy(ex);
  }
  return new GetStatusResponse(service, version, status);
}
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.sensorweb.sos/hibernate-handler

private List<String> deleteByTemplateId(Session session, List<String> resultTemplates)
    throws InvalidParameterValueException {
  List<String> deletedResultTemplates = Lists.newArrayList();
  for (String resultTemplate : resultTemplates) {
    final ResultTemplateEntity templateObject =
        daoFactory.getResultTemplateDAO().getResultTemplateObject(resultTemplate, session);
    if (templateObject == null) {
      throw new InvalidParameterValueException(DeleteResultTemplateConstants.PARAMETERS.resultTemplate,
          resultTemplate);
    }
    session.delete(templateObject);
    deletedResultTemplates.add(resultTemplate);
  }
  return deletedResultTemplates;
}
org.n52.shetland.ogc.ows.exceptionInvalidParameterValueException

Javadoc

Implementation of CodedOwsException to be used if

Operation request contains an invalid parameter value.

Most used methods

  • <init>
  • at
  • withMessage
  • causedBy
  • setStatus

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • CodeWhisperer 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