Package org.fao.geonet.exceptions

Examples of org.fao.geonet.exceptions.OperationAbortedEx


          CatalogException.unmarshal(capabil);
   
        server = new CswServer(capabil);
   
        if (!checkOperation(log, server, "GetRecords"))
          throw new OperationAbortedEx("GetRecords operation not found");
   
        if (!checkOperation(log, server, "GetRecordById"))
          throw new OperationAbortedEx("GetRecordById operation not found");

    } catch(BadXmlResponseEx e) {
            errors.add(new HarvestError(e, log, params.capabUrl));
            throw e;
    }
View Full Code Here


      // heikki: some providers forget to update their CSW namespace to the CSW 2.0.2 specification
      if(results == null) {
        // in that case, try to accommodate them anyway:
        results = response.getChild("SearchResults", Csw.NAMESPACE_CSW_OLD);
        if (results == null) {
          throw new OperationAbortedEx("Missing 'SearchResults'", response);
        }
        else {
          log.warning("Received GetRecords response with incorrect namespace: " + Csw.NAMESPACE_CSW_OLD);
        }
      }
View Full Code Here

     */
    private void configRequest(final GetRecordsRequest request, final CswOperation oper, final CswServer server,
                               final Search s, final String preferredMethod)
            throws Exception {
        if (oper.getGetUrl() == null && oper.getPostUrl() == null) {
            throw new OperationAbortedEx("No GET or POST DCP available in this service.");
        }

        // Use the preferred HTTP method and check one exist.
        if (oper.getGetUrl() != null && preferredMethod.equals("GET") && oper.getConstraintLanguage().contains("cql_text")) {
            setUpRequest(request, oper, server, s, oper.getGetUrl(), ConstraintLanguage.CQL, getCqlConstraint(s),
View Full Code Here

    }
    catch(Exception e)
    {
            errors.add(new HarvestError(e, log));
      log.warning("Raised exception when searching : "+ e);
      throw new OperationAbortedEx("Raised exception when searching: " + e.getMessage(), e);
    }
  }
View Full Code Here

  private int getRecordCount(Element results) throws OperationAbortedEx
  {
    String numRec = results.getAttributeValue("numberOfRecordsMatched");

    if (numRec == null)
      throw new OperationAbortedEx("Missing 'numberOfRecordsMatched' in 'SearchResults'");

    if (!Lib.type.isInteger(numRec))
      throw new OperationAbortedEx("Bad value for 'numberOfRecordsMatched'", numRec);

    return Integer.parseInt(numRec);
  }
View Full Code Here

                if (field != null && value != null) {
                    add(req, field, value);
                }
            }
        } catch (Exception e) {
            throw new OperationAbortedEx("Search request criteria error. " +
                    "Check that the free criteria fields '" +
                    anyField + "' and values '" +
                    anyValue + "' are correct. You MUST have the same " +
                    "number of criteria and values.", e);
        }
View Full Code Here

    if (params.getText().equals("ok")) {
      doActions(context);
    } else {
      // else what? Exceptions don't get this far so must be "ok" response
      throw new OperationAbortedEx("DoActions received unexpected request: "+Xml.getString(params));
    }

    return new Element(Jeeves.Elem.RESPONSE).setText("ok");
  }
View Full Code Here

      } else {
        dataMan.disableOptimizer();
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw new OperationAbortedEx("Parameters saved but cannot restart Lucene Index Optimizer: "+e.getMessage());
    }

        try {
        // Load proxy information into Jeeves
        ProxyInfo pi = JeevesProxyInfo.getInstance();
        boolean useProxy = settingMan.getValueAsBool(SettingManager.SYSTEM_PROXY_USE, false);
        if (useProxy) {
          String  proxyHost      = settingMan.getValue(SettingManager.SYSTEM_PROXY_HOST);
          String  proxyPort      = settingMan.getValue(SettingManager.SYSTEM_PROXY_PORT);
          String  username       = settingMan.getValue(SettingManager.SYSTEM_PROXY_USERNAME);
          String  password       = settingMan.getValue(SettingManager.SYSTEM_PROXY_PASSWORD);
          pi.setProxyInfo(proxyHost, Integer.valueOf(proxyPort), username, password);
        }
      } catch (Exception e) {
            e.printStackTrace();
            throw new OperationAbortedEx("Parameters saved but cannot set proxy information: " + e.getMessage());
        }
    // FIXME: should also restart the Z server?
  }
View Full Code Here

        }

        String currentUuid = sm.getSiteId();

        if (!sm.setValues(values))
            throw new OperationAbortedEx("Cannot set all values");

        // And reload services
        String newUuid = values.get(SettingManager.SYSTEM_SITE_SITE_ID_PATH);

        if (newUuid != null && !currentUuid.equals(newUuid)) {
View Full Code Here

      rdfFile = new File(uploadDir, fname);
            fname = fname.replaceAll("\\s+", "");
    }

    if (fname == null || "".equals(fname)) {
      throw new OperationAbortedEx(
          "File upload from URL or file return null.");
    }

    long fsize = 0;
    if (rdfFile != null && rdfFile.exists()) {
      fsize = rdfFile.length();
    } else {
      throw new OperationAbortedEx("Thesaurus file doesn't exist");
    }

    // -- check that the archive actually has something in it
    if (fsize == 0) {
      throw new OperationAbortedEx("Thesaurus file has zero size");
    }

    // Thesaurus Type (local, external)
    String type = Util.getParam(params, Params.TYPE, "external");
View Full Code Here

TOP

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

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.