Examples of DocumentList

Boundary cases are important for {@link #checkpoint()}: The typical pattern for consuming an object that implements this interface is as follows (disregarding exception handling):
 DocumentList docList = ... Document doc; while (doc = docList.nextDocument()) { handleDoc(doc); if (whatever reason) break; } String check = doclist.checkpoint(); 
Note: because of the restriction that the next call to {@link #nextDocument()} invalidates the previous Document, and thereare similar restrictions in the {@link Document} interface, it is possibleto provide a single stateful object that implements {@link DocumentList}, {@link Document} and {@link Property}, by returning {@code this}(or {@code null}) to all calls to {@link #nextDocument()} and{@link Document#findProperty(String)}. However, if preferred, the implementor may also use separate objects for each of those interfaces. @since 1.0
  • edu.harvard.wcfia.yoshikoder.document.DocumentList
    @author will
  • org.openntf.domino.impl.DocumentList

  • Examples of com.google.enterprise.connector.spi.DocumentList

        conn.setIncludedLocationNodes(getStartNodes());

        TraversalManager mgr = sess.getTraversalManager();
        mgr.setBatchHint(3000);

        DocumentList rs = mgr.startTraversal();
        processResultSet(rs);
      }
    View Full Code Here

    Examples of com.google.enterprise.connector.spi.DocumentList

      public void testPerformance(int dummy) throws Exception {
        // Traverse the repository for a bunch of ids.
        final int batchHint = 100000;
        TraversalManager tm = session.getTraversalManager();
        tm.setBatchHint(batchHint);
        DocumentList docList = tm.startTraversal();
        ArrayList<String> docids = new ArrayList<String>();
        Document doc;
        while ((doc = docList.nextDocument()) != null) {
          Property p = doc.findProperty(SpiConstants.PROPNAME_DOCID);
          docids.add(p.nextValue().toString());
        }

        long start = 0;
    View Full Code Here

    Examples of com.google.enterprise.connector.spi.DocumentList

            objectId - 1);

        // Now push that one document
        TraversalManager mgr = sess.getTraversalManager();
        mgr.setBatchHint(1);
        DocumentList rs = mgr.resumeTraversal(checkpoint.toString() + ',');
        processResultSet(rs);
      }
    View Full Code Here

    Examples of com.google.enterprise.connector.spi.DocumentList

                                           objectId - 1);

            // Now push that one document.
            TraversalManager mgr = sess.getTraversalManager();
            mgr.setBatchHint(1);
            DocumentList rs = mgr.resumeTraversal(checkpoint.toString() + ',');
            pushResultSet(rs);
        }
    View Full Code Here

    Examples of com.google.enterprise.connector.spi.DocumentList

        };
       
        try {
          GdConnector gdc = new GdConnector();
          gdc.setService(alwaysNotModifiedService);
          DocumentList resultSet = gdc.startTraversal();
          assertNull(resultSet.nextDocument());
        } catch (RepositoryException re) {
          fail(re.toString());
        }
      }
    View Full Code Here

    Examples of com.google.enterprise.connector.spi.DocumentList

        };
       
        try {
          GdConnector gdc = new GdConnector();
          gdc.setService(alwaysOneEntryService);
          DocumentList resultSet = gdc.startTraversal();
          Document docA = resultSet.nextDocument();
          Document docB = resultSet.nextDocument();
          assertNotNull(docA);
          assertEquals("\u9762",
              getFirstStringValue(docA, SpiConstants.PROPNAME_DOCID));
          assertNull(docB);
        } catch (RepositoryException re) {
    View Full Code Here

    Examples of com.google.enterprise.connector.spi.DocumentList

      throws RepositoryException {
        LinkedList items = new LinkedList();
        items.add(makeDocument("a while ago"));
        items.add(makeDocument("just the other day"));
       
        DocumentList docList = new GdDocumentList(items, "right now");
        Document ignoredDocument = null;
       
        ignoredDocument = docList.nextDocument();
        assertEquals("a while ago", docList.checkpoint());
        ignoredDocument = docList.nextDocument();
        assertEquals("just the other day", docList.checkpoint());
        ignoredDocument = docList.nextDocument();
        assertEquals("right now", docList.checkpoint());
      }
    View Full Code Here

    Examples of com.google.enterprise.connector.spi.DocumentList

        LinkedList items = new LinkedList();
        items.add(docA);
        items.add(docB);
        items.add(docC);
       
        DocumentList docList = new GdDocumentList(items, "right now");
       
        assertSame(docA, docList.nextDocument());
        assertSame(docB, docList.nextDocument());
        assertSame(docC, docList.nextDocument());
        assertNull(null, docList.nextDocument());
      }
    View Full Code Here

    Examples of com.google.enterprise.connector.spi.DocumentList

      public void testStartTraversal() throws RepositoryException {
        expect(traverser.getDocumentList(isA(Checkpoint.class)))
            .andReturn(emptyList);
        replay(traverser);

        DocumentList docList = traversalMgr.startTraversal();
        assertEquals(emptyList, docList);
        verify(traverser);
      }
    View Full Code Here

    Examples of com.google.enterprise.connector.spi.DocumentList

        expect(traverser.getDocumentList(isA(Checkpoint.class)))
            .andReturn(emptyList);
        replay(traverser);

        // The checkpoint must be a valid JSON string.
        DocumentList docList = traversalMgr.resumeTraversal("{}");
        assertEquals(emptyList, docList);
        verify(traverser);
      }
    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.