Package org.geomajas.global

Examples of org.geomajas.global.GeomajasException


  }

  public <TYPE> TYPE get(String key, Class<TYPE> type) throws GeomajasException {
    TYPE res = getOptional(key, type);
    if (null == res) {
      throw new GeomajasException(ExceptionCode.PIPELINE_CONTEXT_MISSING, key);
    }
    return res;
  }
View Full Code Here


        try {
          CoordinateReferenceSystem crs = CRS.parseWKT(crsInfo.getCrsWkt());
          String code = crsInfo.getKey();
          crsCache.put(code, CrsFactory.getCrs(code, crs));
        } catch (FactoryException e) {
          throw new GeomajasException(e, ExceptionCode.CRS_DECODE_FAILURE_FOR_MAP, crsInfo.getKey());
        }
      }
    }
    if (null != crsTransformDefinitions) {
      for (CrsTransformInfo crsTransformInfo : crsTransformDefinitions.values()) {
View Full Code Here

      } catch (Exception e) {
        transform = CRS.findMathTransform(sourceCrs, targetCrs, true);
      }
      return transform;
    } catch (FactoryException fe) {
      throw new GeomajasException(fe, ExceptionCode.CRS_TRANSFORMATION_NOT_POSSIBLE, sourceCrs.getId(),
          targetCrs.getId());
    }
  }
View Full Code Here

    if (null == pipeline) {
      stamp = new PipelineStamp(pipelineName, null);
      pipeline = pipelineMap.get(stamp);
    }
    if (null == pipeline) {
      throw new GeomajasException(ExceptionCode.PIPELINE_UNKNOWN, pipelineName, layerId);
    }
    return pipeline;
  }
View Full Code Here

    // sort pipelines so a pipeline is always before it's delegate (to make sure delegates are not handled before
    // delegating), and some sanity checks
    List<PipelineInfo<RESPONSE>> delegateLast = new ArrayList<PipelineInfo<RESPONSE>>();
    for (PipelineInfo<RESPONSE> pipeline : pipelineInfos) {
      if (null != pipeline.getPipeline() && null != pipeline.getDelegatePipeline()) {
        throw new GeomajasException(ExceptionCode.PIPELINE_DEFINED_AND_DELEGATE, pipeline.getPipelineName());
      }

      List<PipelineInfo<RESPONSE>> missing = new ArrayList<PipelineInfo<RESPONSE>>();
      PipelineInfo<RESPONSE> delegate = pipeline;
      while (delegate != null && !delegateLast.contains(delegate)) {
View Full Code Here

          count += extList.size();
        }
      }
    }
    if (count != total) {
      throw new GeomajasException(ExceptionCode.PIPELINE_UNSATISFIED_EXTENSION, pipeline.getPipelineName(),
          pipeline.getLayerId());
    }
    pipeline.setPipeline(steps);
  }
View Full Code Here

            toIndex = i;
          }
        }
      }
      if (fromIndex > toIndex) {
        throw new GeomajasException(ExceptionCode.PIPELINE_INTERCEPTOR_INVALID_NESTING,
            interceptorStep.getId());
      }
      // nest the steps
      interceptorStep.setSteps(new ArrayList<PipelineStep<RESPONSE>>(steps.subList(fromIndex, toIndex + 1)));
      for (int i = toIndex; i >= fromIndex; i--) {
View Full Code Here

          toStep = pipelineStep;
        }
      }
      if (fromIndex == -1) {
        if (null != interceptor.getFromStepId()) {
          throw new GeomajasException(ExceptionCode.PIPELINE_INTERCEPTOR_INVALID_STEP, interceptor.getId(),
              interceptor.getFromStepId());
        } else {
          fromIndex = 0;
          fromStep = steps.get(0);
        }
      }
      if (toIndex == -1) {
        if (null != interceptor.getToStepId()) {
          throw new GeomajasException(ExceptionCode.PIPELINE_INTERCEPTOR_INVALID_STEP, interceptor.getId(),
              interceptor.getToStepId());
        } else {
          int pos = steps.size() - 1;
          toIndex = pos;
          toStep = steps.get(pos);
        }
      }
      if (fromIndex > toIndex) {
        throw new GeomajasException(ExceptionCode.PIPELINE_INTERCEPTOR_STEPS_ORDER, interceptor.getId());
      }
      width = toIndex - fromIndex + 1;
    }
View Full Code Here

   * ratio is also checked. The resulting list of features is added to the command result so it can be send back to
   * the client.
   */
  public void execute(SearchByLocationRequest request, SearchByLocationResponse response) throws Exception {
    if (null == request.getLayerIds()) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layerIds");
    }
    String crsCode = request.getCrs();
    if (null == crsCode) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "crs");
    }
    String[] layerIds = request.getLayerIds();
    Geometry location = converter.toInternal(request.getLocation());
    int queryType = request.getQueryType();
    double ratio = request.getRatio();
View Full Code Here

  }

  public void execute(SearchFeatureRequest request, SearchFeatureResponse response) throws Exception {
    String layerId = request.getLayerId();
    if (null == layerId) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer");
    }
    String crs = request.getCrs();
    if (null == crs) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "crs");
    }

    Filter filter = createFilter(request, layerId);
    log.debug("filter to apply : {}", filter);
View Full Code Here

TOP

Related Classes of org.geomajas.global.GeomajasException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.