Package org.fao.geonet.csw.common.exceptions

Examples of org.fao.geonet.csw.common.exceptions.InvalidParameterValueEx


     * @throws InvalidParameterValueEx hmm
     */
    private void checkResponseHandler(String responseHandler) throws InvalidParameterValueEx {
        this.protocol = Protocol.validate(responseHandler);
        if(this.protocol == null) {
            throw new InvalidParameterValueEx("ResponseHandler", "Unsupported protocol in responseHandler " + responseHandler + ". Supported protocols are: ftp://, http://, and mailto:");
        }
        if(Log.isDebugEnabled(Geonet.CSW_HARVEST))
            Log.debug(Geonet.CSW_HARVEST, "CSW Harvest checkResponseHandler: OK");
    }
View Full Code Here


        SupportedResourceType supportedResourceType = SupportedResourceType.fromString(resourceType);
        //
        // resource type not supported
        //
        if(supportedResourceType == null) {
            throw new InvalidParameterValueEx("ResourceType", "ResourceType not supported: " + resourceType);
        }
        if(Log.isDebugEnabled(Geonet.CSW_HARVEST))
            Log.debug(Geonet.CSW_HARVEST, "CSW Harvest checkResourceType OK, returns: " + resourceType);
        return resourceType;
  }
View Full Code Here

     * @throws InvalidParameterValueEx hmm
     */
    private void checkResourceFormat(Element request) throws InvalidParameterValueEx {
        String resourceFormat = request.getChildText("ResourceFormat", Csw.NAMESPACE_CSW);
        if(StringUtils.isNotEmpty(resourceFormat) && !resourceFormat.equals("application/xml")) {
            throw new InvalidParameterValueEx("ResourceFormat", "ResourceFormat not supported: " + resourceFormat + ". This catalog only supports XML metadata.");
        }
        if(Log.isDebugEnabled(Geonet.CSW_HARVEST))
            Log.debug(Geonet.CSW_HARVEST, "CSW Harvest checkResourceFormat: OK");
    }
View Full Code Here

        try {
            new URL(source);
        }
        // not a valid url
        catch (MalformedURLException x) {
            throw new InvalidParameterValueEx("Source", "Invalid source URL:" + source + " - " + x.getMessage());
  }

        if(Log.isDebugEnabled(Geonet.CSW_HARVEST))
            Log.debug(Geonet.CSW_HARVEST, "CSW Harvest checkSource OK, returns: " + source);
        return source;
View Full Code Here

    if (StringUtils.isEmpty(service)) {
      throw new MissingParameterValueEx("service");
        }
        // TODO heikki: that csw namespace is not a valid value. Earlier comment here states: "//--- this is just a fix to the incorrect XSD schema default." Check if that's still necessary.
    if(!(service.equals(Csw.SERVICE)||service.equals("http://www.opengis.net/cat/csw"))) {
            throw new InvalidParameterValueEx("service", service);
        }
  }
View Full Code Here

    String version = request.getAttributeValue("version");
    if (StringUtils.isEmpty(version)) {
      throw new MissingParameterValueEx("version");
        }
    if (!version.equals(Csw.CSW_VERSION)) {
      throw new InvalidParameterValueEx("version", version);
        }
  }
View Full Code Here

                }

        String ns= hmNamespaces.get(prefix);

        if (ns == null)
          throw new InvalidParameterValueEx("typeName", "Can't find a valid namespace for typename "+typeName+". Check namespace parameter.");

        hmTypeNames.put(typeName, ns);
      }
    }
View Full Code Here

    // Check version in both cas (CQL or filter) in order to specify parser
    // version.
    if (!version.equals(Csw.FILTER_VERSION_1_0)
        && !version.equals(Csw.FILTER_VERSION_1_1))
      throw new InvalidParameterValueEx("version", version + ". Supported versions are "
          + Csw.FILTER_VERSION_1_0 + "," + Csw.FILTER_VERSION_1_1 + ".");

    return version;
  }
View Full Code Here

      String oper = "unknown";
      if (!children.isEmpty()) {
          oper = Xml.getString((Element) children.get(0));
      }

      throw new InvalidParameterValueEx(type, oper);
    }

        for (Element aChildren : children) {
            checkForErrors(aChildren);
        }
View Full Code Here

    if (format == null)
      return;

    if (!format.equals("application/xml"))
      throw new InvalidParameterValueEx("outputFormat", format);
  }
View Full Code Here

TOP

Related Classes of org.fao.geonet.csw.common.exceptions.InvalidParameterValueEx

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.