Package com.google.enterprise.connector.persist

Examples of com.google.enterprise.connector.persist.StoreContext


    }
    connectorMap.clear();
  }

  private StoreContext getStoreContext(String name) {
    return new StoreContext(name, "testType");
  }
View Full Code Here


  /**
   * Creates and registers a {@link Connector} for the provided
   * {@link Traverser} with this {@link Instantiator}.
   */
  public void setupTraverser(String traverserName, Traverser traverser) {
    StoreContext storeContext = getStoreContext(traverserName);
    ConnectorInterfaces interfaces =  new ConnectorInterfaces(traverserName,
        null, nullAuthenticationManager, nullAuthorizationManager);
    ConnectorCoordinator cc =
        new MockConnectorCoordinator(traverserName, interfaces, traverser,
            persistentStore, storeContext, threadPool);
View Full Code Here

    } catch (Exception e) {
      // won't happen
      e.printStackTrace();
      throw new RuntimeException();
    }
    StoreContext storeContext = getStoreContext(connectorName);
    QueryTraverser queryTraverser =
        new QueryTraverser(new MockPusher(), traversalManager,
            new MockTraversalStateStore(persistentStore, storeContext),
            connectorName, traversalContext,
            new SystemClock() /* TODO: use a mock clock */, null);
View Full Code Here

  }

  /** Adds an instance to the store and records the action. */
  private void addConnector(String connectorName) {
    store.storeConnectorConfiguration(
        new StoreContext(connectorName, "testType"),
        new Configuration("testType", Collections.<String, String>emptyMap(),
                          null));
    expectedChanges.add(MockChangeListener.CONNECTOR_ADDED + connectorName);
  }
View Full Code Here

    expectedChanges.add(MockChangeListener.CONNECTOR_ADDED + connectorName);
  }

  /** Updates an instance to the store and records the action. */
  private void updateConnector(String connectorName) {
    StoreContext context = new StoreContext(connectorName, "testType");
    assertNotNull(store.getConnectorConfiguration(context));
    store.storeConnectorConfiguration(context, new Configuration(
        "testType", Collections.<String, String>emptyMap(), null));
    expectedChanges.add(MockChangeListener.CONFIGURATION_CHANGED
                        + connectorName);
View Full Code Here

  }

  /** Deletes an instance from the store and records the action. */
  private void removeConnector(String connectorName) {
    store.removeConnectorConfiguration(
        new StoreContext(connectorName, "testType"));
    expectedChanges.add(MockChangeListener.CONNECTOR_REMOVED + connectorName);
  }
View Full Code Here

    expectedChanges.add(MockChangeListener.CONNECTOR_REMOVED + connectorName);
  }

  /** Sets the checkpoint for a connector instance and records the action. */
  private void setCheckpoint(String connectorName) {
    store.storeConnectorState(new StoreContext(connectorName, "testType"), "");
    expectedChanges.add(MockChangeListener.CHECKPOINT_CHANGED + connectorName);
  }
View Full Code Here

    expectedChanges.add(MockChangeListener.CHECKPOINT_CHANGED + connectorName);
  }

  /** Sets the Schedule for a connector instance and records the action. */
  private void setSchedule(String connectorName) {
    store.storeConnectorSchedule(new StoreContext(connectorName, "testType"),
                                 new Schedule());
    expectedChanges.add(MockChangeListener.SCHEDULE_CHANGED + connectorName);
  }
View Full Code Here

    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

    this.connectorName = connectorName;
    this.connectorDir = connectorDir;
    this.typeInfo = typeInfo;
    this.storeContext =
        new StoreContext(connectorName, typeInfo.getConnectorTypeName());

    if (createConnector) {
      if (config == null) {
        throw new NullConfigurationException();
      }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.persist.StoreContext

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.