Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.DocumentList.checkpoint()


    // returned from FileNet.
    boolean tested = false;
    DocumentList docList = traverser.getDocumentList(new Checkpoint());
    Document doc;
    while ((doc = docList.nextDocument()) != null) {
      assertTrue(checkpointContains(docList.checkpoint(),
          doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
          JsonField.LAST_MODIFIED_TIME));
      tested = true;
    }
    assertTrue(tested);
View Full Code Here


      String id =
          doc.findProperty(SpiConstants.PROPNAME_DOCID).nextValue().toString();
      if (ActionType.ADD.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
        assertFalse(object instanceof FileDeletionObject);
        assertTrue(checkpointContains(docList.checkpoint(),
            doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
            JsonField.LAST_MODIFIED_TIME));
        isAddTested = true;
      } else if (ActionType.DELETE.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
View Full Code Here

            JsonField.LAST_MODIFIED_TIME));
        isAddTested = true;
      } else if (ActionType.DELETE.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
        if (object.isDeletionEvent()) {
          assertTrue(checkpointContains(docList.checkpoint(),
              doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
              JsonField.LAST_DELETION_EVENT_TIME));
          isDeletionEventTested = true;
        } else {
          assertTrue(checkpointContains(docList.checkpoint(),
View Full Code Here

          assertTrue(checkpointContains(docList.checkpoint(),
              doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
              JsonField.LAST_DELETION_EVENT_TIME));
          isDeletionEventTested = true;
        } else {
          assertTrue(checkpointContains(docList.checkpoint(),
              doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
              JsonField.LAST_CUSTOM_DELETION_TIME));
          isCustomDeletionTested = true;
        }
      }
View Full Code Here

            + "\"lastModifiedDate\":\"" + CHECKPOINT_TIMESTAMP + TZ_OFFSET
            + "\""
            : "\"uuidToDeleteDocs\":\"{CCCCCCCC-0000-0000-0000-000000000000}\","
            + "\"lastModifiedDate\":\"2010-01-01T00:00:00.000\"")
        + "}";
    assertCheckpointEquals(expectedCheckpoint, docList.checkpoint());
  }

  public void testCheckpointWithoutNextDocument() throws Exception {
    @SuppressWarnings("unchecked") IObjectStore os =
        newObjectStore("MockObjectStore", DatabaseType.MSSQL,
View Full Code Here

        newObjectStore("MockObjectStore", DatabaseType.MSSQL,
            new HashMap<IId, IBaseObject>());
    DocumentList docList = getObjectUnderTest(os, newEmptyObjectSet(),
        newEmptyObjectSet(), newEmptyObjectSet());

    assertCheckpointEquals(CHECKPOINT, docList.checkpoint());
  }

  /**
   * This simulates a first call to getDocumentList that returns no
   * documents. That's silly, of course, since it means the repository
View Full Code Here

    @SuppressWarnings("unchecked") IObjectStore os =
        newObjectStore("MockObjectStore", DatabaseType.MSSQL,
            new HashMap<IId, IBaseObject>());
    DocumentList docList = new FileDocumentList(newEmptyObjectSet(),
        newEmptyObjectSet(), newEmptyObjectSet(), os, connec, new Checkpoint());
    Checkpoint cp = new Checkpoint(docList.checkpoint());

    // The checkpoint contains empty string values for the UUIDs and
    // the current time for the dates.
    assertFalse(cp.isEmpty());
    assertEquals("", cp.getString(JsonField.UUID));
View Full Code Here

    long counter = 0;
    com.google.enterprise.connector.spi.Document doc = null;
    doc = set.nextDocument();
    while (doc != null) {
      if (counter == 113) {
        String checkpoint = set.checkpoint();
        System.out.println(checkpoint);
      }
        doc = set.nextDocument();
        counter++;
    }
View Full Code Here

      // much better mock of the Livelink DB than we have at this point.
      if (((LivelinkDocumentList) docList).recArray != null) {
        numdocs += ((LivelinkDocumentList) docList).recArray.size();
      }
      ((LivelinkDocumentList) docList).checkpoint.advanceToEnd();
      checkpoint = docList.checkpoint();
    }
    long stop = System.currentTimeMillis();
    String msg = "End Traversal: time = " + ((stop - start)/1000) + " seconds, "
                 + "docs returned = " + numdocs;
    LOGGER.info(msg);
View Full Code Here

    DocumentList list =
        getObjectUnderTest(MockConstants.IO_OBJECT_ID, 0, USER_ID);

    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertNotNull(list.checkpoint());
  }

  enum Content { NULL, NON_NULL };

  /**
 
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.