Examples of SettingsException


Examples of org.elasticsearch.common.settings.SettingsException

      Map<String, Object> ret = parser.mapAndClose();
      if (logger.isDebugEnabled())
        logger.debug("jar packaged JSON file {} content is: {}", filePath, ret);
      return ret;
    } catch (IOException e) {
      throw new SettingsException(e.getMessage(), e);
    } finally {
      if (parser != null)
        parser.close();
    }
  }
View Full Code Here

Examples of org.elasticsearch.common.settings.SettingsException

  }

  private void validateConfigurationFieldsStructure(Map<String, Map<String, String>> value, String configFieldName) {
    for (String idxFieldName : value.keySet()) {
      if (Utils.isEmpty(idxFieldName)) {
        throw new SettingsException("Empty key found in '" + configFieldName + "' map.");
      }
      Map<String, String> fc = value.get(idxFieldName);
      if (Utils.isEmpty(fc.get(CONFIG_FIELDS_JIRAFIELD))) {
        throw new SettingsException("'jira_field' is not defined in '" + configFieldName + "/" + idxFieldName + "'");
      }
      String fil = fc.get(CONFIG_FIELDS_VALUEFILTER);
      if (fil != null && !filtersConfig.containsKey(fil)) {
        throw new SettingsException("Filter definition not found for filter name '" + fil + "' defined in '"
            + configFieldName + "/" + idxFieldName + "/value_filter'");
      }
    }
  }
View Full Code Here

Examples of org.elasticsearch.common.settings.SettingsException

    }
  }

  private void validateConfigurationString(String value, String configFieldName) throws SettingsException {
    if (Utils.isEmpty(value)) {
      throw new SettingsException("No default '" + configFieldName + "' configuration found!");
    }
  }
View Full Code Here

Examples of org.elasticsearch.common.settings.SettingsException

    }
  }

  private void validateConfigurationObject(Object value, String configFieldName) throws SettingsException {
    if (value == null) {
      throw new SettingsException("No default '" + configFieldName + "' configuration found!");
    }
  }
View Full Code Here

Examples of org.elasticsearch.common.settings.SettingsException

    if (settings.containsKey("jira")) {
      Map<String, Object> jiraSettings = (Map<String, Object>) settings.get("jira");
      jiraUrlBase = XContentMapValues.nodeStringValue(jiraSettings.get("urlBase"), null);
      if (Utils.isEmpty(jiraUrlBase)) {
        throw new SettingsException("jira/urlBase element of configuration structure not found or empty");
      }
      Integer timeout = new Long(Utils.parseTimeValue(jiraSettings, "timeout", 5, TimeUnit.SECONDS)).intValue();
      jiraUser = XContentMapValues.nodeStringValue(jiraSettings.get("username"), "Anonymous access");
      jiraClient = new JIRA5RestClient(jiraUrlBase, XContentMapValues.nodeStringValue(jiraSettings.get("username"),
          null), XContentMapValues.nodeStringValue(jiraSettings.get("pwd"), null), timeout);
      jiraClient.setListJIRAIssuesMax(XContentMapValues.nodeIntegerValue(jiraSettings.get("maxIssuesPerRequest"), 50));
      if (jiraSettings.get("jqlTimeZone") != null) {
        TimeZone tz = TimeZone.getTimeZone(XContentMapValues.nodeStringValue(jiraSettings.get("jqlTimeZone"), null));
        jiraJqlTimezone = tz.getDisplayName();
        jiraClient.setJQLDateFormatTimezone(tz);
      }
      maxIndexingThreads = XContentMapValues.nodeIntegerValue(jiraSettings.get("maxIndexingThreads"), 1);
      indexUpdatePeriod = Utils.parseTimeValue(jiraSettings, "indexUpdatePeriod", 5, TimeUnit.MINUTES);
      indexFullUpdatePeriod = Utils.parseTimeValue(jiraSettings, "indexFullUpdatePeriod", 12, TimeUnit.HOURS);
      if (jiraSettings.containsKey("projectKeysIndexed")) {
        allIndexedProjectsKeys = Utils.parseCsvString(XContentMapValues.nodeStringValue(
            jiraSettings.get("projectKeysIndexed"), null));
        if (allIndexedProjectsKeys != null) {
          // stop loading from JIRA
          allIndexedProjectsKeysNextRefresh = Long.MAX_VALUE;
        }
      }
      if (jiraSettings.containsKey("projectKeysExcluded")) {
        projectKeysExcluded = Utils.parseCsvString(XContentMapValues.nodeStringValue(
            jiraSettings.get("projectKeysExcluded"), null));
      }
    } else {
      throw new SettingsException("'jira' element of river configuration structure not found");
    }

    Map<String, Object> indexSettings = null;
    if (settings.containsKey("index")) {
      indexSettings = (Map<String, Object>) settings.get("index");
      indexName = XContentMapValues.nodeStringValue(indexSettings.get("index"), riverName.name());
      typeName = XContentMapValues.nodeStringValue(indexSettings.get("type"), INDEX_ISSUE_TYPE_NAME_DEFAULT);
    } else {
      indexName = riverName.name();
      typeName = INDEX_ISSUE_TYPE_NAME_DEFAULT;
    }

    Map<String, Object> activityLogSettings = null;
    if (settings.containsKey("activity_log")) {
      activityLogSettings = (Map<String, Object>) settings.get("activity_log");
      activityLogIndexName = Utils
          .trimToNull(XContentMapValues.nodeStringValue(activityLogSettings.get("index"), null));
      if (activityLogIndexName == null) {
        throw new SettingsException(
            "'activity_log/index' element of river configuration structure must be defined with some string");
      }
      activityLogTypeName = Utils.trimToNull(XContentMapValues.nodeStringValue(activityLogSettings.get("type"),
          INDEX_ACTIVITY_TYPE_NAME_DEFAULT));
    }
View Full Code Here

Examples of org.elasticsearch.common.settings.SettingsException

        for (Map<String, Object> ppc : preproclist) {
          try {
            indexStructureBuilder.addIssueDataPreprocessor(StructuredContentPreprocessorFactory.createPreprocessor(ppc,
                client));
          } catch (IllegalArgumentException e) {
            throw new SettingsException(e.getMessage(), e);
          }
        }
      }
    }
  }
View Full Code Here

Examples of org.springframework.richclient.settings.SettingsException

            settings.load();
            return settings;
        } catch( IncorrectResultSizeDataAccessException e ) {
            return new JdbcSettings( dataSource, userNameProvider.getUser(), null, key );
        } catch( IOException e ) {
            throw new SettingsException( "Unable to create settings with name " + key, e );
        }
    }
View Full Code Here

Examples of org.springframework.richclient.settings.SettingsException

            file.getParentFile().mkdirs();

      TransformerFactory.newInstance().newTransformer().transform(new DOMSource(settings.getDocument()),
          new StreamResult(new FileOutputStream(file)));
    } catch (TransformerConfigurationException e) {
      throw new SettingsException("Unable to write document", e);
    } catch (TransformerException e) {
      throw new SettingsException("Unable to write document", e);
    } catch (TransformerFactoryConfigurationError e) {
      throw new SettingsException("Unable to write document", e);
    } catch (FileNotFoundException e) {
      throw new SettingsException("Unable to write document", e);
    }
  }
View Full Code Here

Examples of org.springframework.richclient.settings.SettingsException

      RootXmlSettings settings = new RootXmlSettings(doc, this);

      return settings;
    } catch (SAXException e) {
      throw new SettingsException("Unable to read xml", e);
    } catch (IOException e) {
      throw new SettingsException("Unable to read xml", e);
    } catch (ParserConfigurationException e) {
      throw new SettingsException("Unable to read xml", e);
    } catch (FactoryConfigurationError e) {
      throw new SettingsException("Unable to read xml", e);
    }
  }
View Full Code Here

Examples of org.springframework.richclient.settings.SettingsException

    try {
      buffer = new StringWriter();
      TransformerFactory.newInstance().newTransformer().transform(new DOMSource(settings.getDocument()),
          new StreamResult(buffer));
    } catch (Exception e) {
      throw new SettingsException("Unable to write xml", e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.