Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.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

    insertDTreeAcl(31, 1001, Client.PERM_SEECONTENTS);
    insertDTreeAcl(31, 1002, Client.PERM_SEECONTENTS);
    setUserData(1001, "ExternalAuthentication=true");
    setUserData(1002, "ExternalAuthentication=false");

    DocumentList list = getObjectUnderTest(31, 0, 1001);
    Document doc = list.nextDocument();

    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
View Full Code Here


    insertDTreeAcl(32, 2001, Client.PERM_SEECONTENTS);
    insertDTreeAcl(32, 2002, Client.PERM_SEECONTENTS);
    setUserData(2001, "ExternalAuthentication=true");
    setUserData(2002, "ExternalAuthentication=false");

    DocumentList list = getObjectUnderTest(32, 0, 1001);
    Document doc = list.nextDocument();

    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "group1",
            EVERYTHING_CASE_SENSITIVE),
View Full Code Here

  public void testInvalidUserData_UserNamespace() throws RepositoryException,
      SQLException {
    insertDTreeAcl(33, 1001, Client.PERM_SEECONTENTS);
    setUserData(1001, "invaliddata=");

    DocumentList list = getObjectUnderTest(33, 0, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, LOCAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc,
View Full Code Here

  public void testNullUserData_UserNamespace() throws RepositoryException,
      SQLException {
    insertDTreeAcl(34, 1001, Client.PERM_SEECONTENTS);
    setUserData(1001, null);

    DocumentList list = getObjectUnderTest(34, 0, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, LOCAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLUSERS, "user1"));
View Full Code Here

  public void testPublicAccess_Namespace()
      throws RepositoryException, SQLException {
    insertDTreeAcl(35, Client.RIGHT_WORLD, Client.PERM_SEECONTENTS);

    DocumentList list = getObjectUnderTest(35, 0, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, LOCAL_NAMESPACE, "Public Access",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLGROUPS, "Public Access"));
View Full Code Here

  public void testOwner_Namespace()
      throws RepositoryException, SQLException {
    insertDTreeAcl(36, Client.RIGHT_OWNER, Client.PERM_SEECONTENTS);
    setUserData(1001, "ExternalAuthentication=false,ldap=vizdom.com");

    DocumentList list = getObjectUnderTest(36, 0, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLUSERS, "user1"));
View Full Code Here

      throws RepositoryException, SQLException {
    insertDTreeAcl(37, Client.RIGHT_GROUP, Client.PERM_SEECONTENTS);
    setUserData(1001, "ExternalAuthentication=true");
    setUserData(2001, null);

    DocumentList list = getObjectUnderTest(37, 1, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, LOCAL_NAMESPACE, "group1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLGROUPS, "group1"));
View Full Code Here

  public void testUserdataLdap_Namespace()
      throws RepositoryException, SQLException {
    insertDTreeAcl(38, 1001, Client.PERM_SEECONTENTS);
    setUserData(1001, "LDAP=vizdom");

    DocumentList list = getObjectUnderTest(38, 0, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLUSERS, "user1"));
View Full Code Here

  public void testUserdataNtlm_Namespace()
      throws RepositoryException, SQLException {
    insertDTreeAcl(38, 1001, Client.PERM_SEECONTENTS);
    setUserData(1001, "ntlm=");

    DocumentList list = getObjectUnderTest(38, 0, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLUSERS, "user1"));
View Full Code Here

  public void testContentHandler() throws RepositoryException {
    ContentHandler contentHandler = createMock(ContentHandler.class);
    contentHandler.initialize(isA(LivelinkConnector.class), isA(Client.class));
    replay(contentHandler);
    DocumentList list = getObjectUnderTest(contentHandler);
    verify(contentHandler);
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.DocumentList

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.