Package com.google.enterprise.connector.traversal

Examples of com.google.enterprise.connector.traversal.FileSizeLimitInfo


    }

    DocPusher push = null;
    try {
      push = new DocPusher(new GsaFeedConnection(null, "gogol", 19900, -1),
          "dctm", new FileSizeLimitInfo(), new DocumentFilterChain());

    } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here


        conn = LivelinkConnectorFactory.getConnector("connector.");
        sess = (LivelinkSession) conn.login();
        client = sess.getFactory().createClient();
        pusher = new DocPusher(
            new GsaFeedConnection(null, feedServer, feedPort, -1),
            "livelink", new FileSizeLimitInfo(), new DocumentFilterChain());

        // Iinitialize the Context for DocPusher.take.
        // FIXME: This code is duplicated in LivelinkQueryTraverserTest..
        String cmDir = System.getProperty("connector-manager.dir");
        if (cmDir == null)
View Full Code Here

  public void testCLOBDataScenarios(Object clobValue, String clobContent)
        throws IOException, DBException, RepositoryException {
    Map<String, Object> rowMap = getLargeObjectRow();
    rowMap.put(dbContext.getLobField(), clobValue);

    FileSizeLimitInfo fileSizeLimitInfo = new FileSizeLimitInfo();
    fileSizeLimitInfo.setMaxDocumentSize(5);
    context.setFileSizeLimitInfo(fileSizeLimitInfo);

    JsonDocument clobDoc =
        getJsonDocument(new LobDocumentBuilder(dbContext, context), rowMap);
    // As the size of the document is more than supported, clobDoc should have
    // null value.
    assertNotNull(clobDoc);
    assertEmptyContent(clobDoc);

    // Increase the maximum supported size of the document.
    fileSizeLimitInfo.setMaxDocumentSize(1024 * 1024);
    context.setFileSizeLimitInfo(fileSizeLimitInfo);
    clobDoc =
        getJsonDocument(new LobDocumentBuilder(dbContext, context), rowMap);
    assertNotNull(clobDoc);

View Full Code Here

    // Define for fetching BLOB content
    String fetchURL = "http://myhost:8030/app?dpc_id=120";
    rowMap.put(dbContext.getFetchURLField(), fetchURL);

    FileSizeLimitInfo fileSizeLimitInfo = new FileSizeLimitInfo();
    fileSizeLimitInfo.setMaxDocumentSize(5);
    context.setFileSizeLimitInfo(fileSizeLimitInfo);

    JsonDocument blobDoc =
        getJsonDocument(new LobDocumentBuilder(dbContext, context), rowMap);

    // The BLOB to too large.
    assertNotNull(blobDoc);
    assertEmptyContent(blobDoc);

    // Increase the maximum supported size of the document.
    fileSizeLimitInfo.setMaxDocumentSize(1024 * 1024);
    context.setFileSizeLimitInfo(fileSizeLimitInfo);
    blobDoc =
        getJsonDocument(new LobDocumentBuilder(dbContext, context), rowMap);

    assertNotNull(blobDoc);
View Full Code Here

        // the first document, forcing it to be submitted.  DocPusher.take()
        // should then return a signal to the caller to terminate the batch.
        LOGGER.warning("Insufficient memory available to allocate an optimally"
            + " sized feed - retrying with a much smaller feed allocation.");
        feedSize = 1024;
        FileSizeLimitInfo newLimit = new FileSizeLimitInfo();
        newLimit.setMaxFeedSize(feedSize);
        newLimit.setMaxDocumentSize(fileSizeLimit.maxDocumentSize());
        try {
          xmlFeed = new XmlFeed(connectorName, feedType, newLimit, feedLog,
              feedConnection);
        } catch (OutOfMemoryError oome) {
          throw new OutOfMemoryError(
View Full Code Here

   * {@code feedConnection}.  This constructor is Used by the tests.
   *
   * @param feedConnection a FeedConnection
   */
  public DocPusherFactory(FeedConnection feedConnection) {
    this(feedConnection, new FileSizeLimitInfo(),
         new DocumentFilterFactoryFactoryImpl(null, null));
  }
View Full Code Here

  protected void setUp() throws Exception {
    // MockFeedConnection also prints the XML it "sends".
    System.out.println("\nTest Case: " + getName());

    // Set artificially low limits as test env only has 64MB of heap space.
    fsli = new FileSizeLimitInfo();
    fsli.setMaxFeedSize(1024 * 1024);
    fsli.setMaxDocumentSize(1024 * 1024);

    dataSource = "junit";

View Full Code Here

   * In the test context, "huge" is relative.  We set the maxDocSize
   * artificially low to avoid an OutOfMemoryError in the test JVM.
   */
  private String feedHugeDocument(Document document) throws Exception {
    MockFeedConnection mockFeedConnection = new MockFeedConnection();
    FileSizeLimitInfo limit = new FileSizeLimitInfo();
    limit.setMaxDocumentSize(1024 * 1024); // 1 MB
    limit.setMaxFeedSize(64 * 1024); // 64 KB
    DocPusher dpusher =
        new DocPusher(mockFeedConnection, dataSource, limit, dfc);
    assertEquals(PusherStatus.OK, dpusher.take(document, null));
    dpusher.flush();
    return mockFeedConnection.getFeed();
View Full Code Here

   * returns an indication to stop feeding docs.
   */
  public void testProximalFeedBacklog() throws Exception {
    Document document = getTestDocument();
    // Force 1 document per feed by setting a tiny feed size.
    FileSizeLimitInfo limit = new FileSizeLimitInfo();
    limit.setMaxFeedSize(32);
    limit.setMaxDocumentSize(64 * 1024);

    // SlowFeedConnection waits 5 secs before transmission, allowing feeds
    // to back up on this end of the connection.
    SlowFeedConnection slowFeedConnection = new SlowFeedConnection();
    DocPusher dpusher =
View Full Code Here

   */
  public void testDistalFeedBacklog() throws Exception {
    Document document = getTestDocument();
    BacklogFeedConnection backlogFeedConnection = new BacklogFeedConnection();
    // Force 1 document per feed by setting a tiny feed size.
    FileSizeLimitInfo limit = new FileSizeLimitInfo();
    limit.setMaxFeedSize(32);
    limit.setMaxDocumentSize(64 * 1024);

    DocPusher dpusher =
        new DocPusher(backlogFeedConnection, dataSource, limit, dfc);
    assertEquals(PusherStatus.OK, dpusher.take(document, null));
    backlogFeedConnection.setBacklogged(true);
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.traversal.FileSizeLimitInfo

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.