Package com.google.enterprise.connector.instantiator

Examples of com.google.enterprise.connector.instantiator.Configuration


      }
    }

    try {
      if (update) {
        Configuration previousConfig =
            manager.getConnectorConfiguration(connectorName);
        ServletUtil.replaceSensitiveData(configData, previousConfig.getMap());
        if (configXml == null &&
            connectorType.equals(previousConfig.getTypeName())) {
          configXml = previousConfig.getXml();
        }
      }

      configRes = manager.setConnectorConfiguration(connectorName,
          new Configuration(connectorType, configData, configXml),
          language, update);

      // A non-null ConfigureResponse indicates a bad configuration.
      if (configRes != null) {
        status.setMessageId(ConnectorMessageCode.INVALID_CONNECTOR_CONFIG);
View Full Code Here


          !connectorNames.contains(context.getConnectorName())) {
        continue;
      }
      // This double assignment ensures that we check the same
      // object type that we're storing.
      Configuration config = destStore.getConnectorConfiguration(context);
      if (force || config == null) {
        config = sourceStore.getConnectorConfiguration(context);
        if (config != null) {
          logMigration(sourceStore, destStore, context, "configuration");
          destStore.storeConnectorConfiguration(context, config);
View Full Code Here

    configData.put("Username", evilValue);
    configData.put("Password", evilValue);
    configData.put("Color", evilValue);
    configData.put("RepositoryFile", "MockRepositoryEventLog1.txt");
    manager.setConnectorConfiguration(connectorName,
        new Configuration(connectorType, configData, null),
        "en", false);

    // Check the properties values to make sure they were not encoded.
    Map<String, String> retrievedData =
        manager.getConnectorConfiguration(connectorName).getMap();
View Full Code Here

    configData.put("Username", evilValue);
    configData.put("Password", evilValue);
    configData.put("Color", evilValue);
    configData.put("RepositoryFile", "MockRepositoryEventLog1.txt");
    manager.setConnectorConfiguration(connectorName,
        new Configuration(connectorType, configData, connectorInstanceXml),
        "en", false);

    // Check the modifed connectorInstance.xml is used.
    assertEquals(connectorInstanceXml,
        manager.getConnectorConfiguration(connectorName).getXml());
View Full Code Here

    configData.put("Username", "bob");
    configData.put("Password", "pwd");
    configData.put("Color", "red");
    configData.put("RepositoryFile", "MockRepositoryEventLog1.txt");
    manager.setConnectorConfiguration(connectorName,
        new Configuration(connectorType, configData, null),
        "en", false);
    manager.setSchedule(connectorName, "#connector1:200:300000:1-12");
  }
View Full Code Here

    configData.put("RepositoryFile", "MockRepositoryEventLog1.txt");
    if (additionalConfig != null) {
      configData.putAll(additionalConfig);
    }
    manager.setConnectorConfiguration(connectorName,
        new Configuration(connectorType, configData, null),
        "en", false);
  }
View Full Code Here

    Map<String, String> configMap = new HashMap<String, String>();
    configMap.put("color", color);
    if (password != null) {
      configMap.put("password", password);
    }
    Configuration config = new Configuration("TestConnector", configMap, null);
    StoreContext context = new StoreContext(name, "TestConnector");
    pstore.storeConnectorConfiguration(context, config);
    Schedule schedule = new Schedule(name, false, 100, 300000, "0-0");
    pstore.storeConnectorSchedule(context, schedule);
    pstore.storeConnectorState(context, name + " checkpoint");
View Full Code Here

  }

  // Test Writing an null schedule generates an empty schedule element.
  public final void testWriteEmptySchedule() {
    ImportExportConnector connector = new LegacyImportExportConnector(
        "connector-01", new Configuration("TestConnector",
        ImportExportConnectorTest.CONFIG_MAP, null), null, null);

    String xmlResult = ImportExportConnectorTest.asXmlString(connector);
    assertEquals(ImportExportConnectorTest.NEW_FORMAT_EMPTY_SCHEDULE,
        StringUtils.normalizeNewlines(xmlResult));
View Full Code Here

    if (type == null && config == null && configXml == null) {
      return null;
    }
    try {
      Properties props = PropertiesUtils.loadFromString(config);
      return new Configuration(type, PropertiesUtils.toMap(props), configXml);
    } catch (PropertiesException e) {
      LOGGER.log(Level.WARNING, "Failed to read connector configuration for "
                 + context.getConnectorName(), e);
      return null;
    }
View Full Code Here

  // Test that schedules are written in new format.
  public final void testWriteNewSchedule() {
    Schedule schedule =
        new Schedule("connector-02", false, 100, 300000, "0-0");
    ImportExportConnector connector = new LegacyImportExportConnector(
        "connector-02", new Configuration("TestConnector",
        ImportExportConnectorTest.CONFIG_MAP, null), schedule, null);

    String xmlResult = ImportExportConnectorTest.asXmlString(connector);
    assertEquals(ImportExportConnectorTest.NEW_FORMAT_WITH_SCHEDULE,
        StringUtils.normalizeNewlines(xmlResult));
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.instantiator.Configuration

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.