Package org.fao.geonet.exceptions

Examples of org.fao.geonet.exceptions.BadParameterEx


     * @param port
     * @throws BadParameterEx
     */
  protected void checkPort(int port) throws BadParameterEx {
        if(port < 1 || port > 65535) {
      throw new BadParameterEx("port", port);
  }
  }
View Full Code Here


        }

    int operID = dm.getAccessManager().getPrivilegeId(operName);

        if(operID == - 1) {
      throw new BadParameterEx("attribute:name", operName);
        }

        if(operID == 2 || operID == 4) {
      throw new BadParameterEx("attribute:name", operName);
        }

    return operID;
  }
View Full Code Here

            if (categId == null || categId.trim().isEmpty()) {
                // categoryId is not mandatory.
                continue;
            }
            if (!Lib.type.isInteger(categId)) {
                throw new BadParameterEx("attribute:id", categElem);
            }

            addCategory(categId);
        }
  }
View Full Code Here

    log.info("Parsing query :\n" + params.query);
    try {
      wfsQuery = Xml.loadString(params.query, false);
    } catch (JDOMException e) {
            errors.add(new HarvestError(e, log));
      throw new BadParameterEx("GetFeature Query failed to parse\n", params.query);
    }

    //--- harvest metadata and subtemplates from fragments using generic fragment harvester
    FragmentHarvester fragmentHarvester = new FragmentHarvester(log, context, getFragmentHarvesterParams());
View Full Code Here

      }

    }
    catch(Exception e)
    {
      throw new BadParameterEx("from", from);
    }

    //--- check until parameter

    try
    {
      if (!until.equals(""))
      {
        untilDate = new ISODate(until);
        until     = untilDate.getDateAsString();
      }
    }
    catch(Exception e)
    {
      throw new BadParameterEx("until", until);
    }

    //--- check from <= until

    if (fromDate != null && untilDate != null)
      if (fromDate.timeDifferenceInSeconds(untilDate) > 0)
        throw new BadParameterEx("from greater than until", from +">"+ until);
  }
View Full Code Here

     * @return
     */
    public static AbstractHarvester<?> create(String type, ServiceContext context) throws BadParameterEx, OperationAbortedEx {
        //--- raises an exception if type is null
        if (type == null) {
            throw new BadParameterEx("type", null);
        }

        try {
            AbstractHarvester ah = context.getApplicationContext().getBean(type, AbstractHarvester.class);
            ah.setContext(context);
View Full Code Here

            } else if (type.equals("status")) {
        result.addContent(context.getBean(StatusValueRepository.class).findAllAsXml());

            } else {
        throw new BadParameterEx("Unknown type parameter value.", type);
            }
    }
   
    result.addContent(getEnv(context));
    Element response = Xml.transform(result, xslPath +"/info.xsl");
View Full Code Here

      throw new MissingParameterEx("attribute:policy", group);

    policy = CopyPolicy.parse(t);

    if (policy == null)
      throw new BadParameterEx("attribute:policy", policy);

    //--- '1' is the 'All' group

    if (policy == CopyPolicy.COPY_TO_INTRANET && !isAllGroup())
      throw new BadParameterEx("attribute:policy", policy);

    if (policy == CopyPolicy.CREATE_AND_COPY && isAllGroup())
      throw new BadParameterEx("attribute:policy", policy);
  }
View Full Code Here

   * (ie. GetRecords and GetRecordById)
   * are available in remote node.
   */
  private CswServer retrieveCapabilities(Logger log) throws Exception {   
    if (!Lib.net.isUrlValid(params.capabUrl))
      throw new BadParameterEx("Capabilities URL", params.capabUrl);

    XmlRequest req;
    // Support both full GetCapbilities URL or CSW entry point
        final GeonetHttpRequestFactory requestFactory = context.getBean(GeonetHttpRequestFactory.class);
        if (params.capabUrl.contains("GetCapabilities")) {
View Full Code Here

            s.siteId = Util.getParam(search, "siteId", "");

            alSearches.add(s);

            if (s.siteId.equals("")) {
                throw new BadParameterEx("siteId", "");
            }
        }
  }
View Full Code Here

TOP

Related Classes of org.fao.geonet.exceptions.BadParameterEx

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.