Package com.google.enterprise.connector.spi

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


   */
  public static void addPrincipals(List<Value> list,
      PrincipalType principalType, String namespace, Set<String> names,
      CaseSensitivityType caseSensitivityType) {
    for (String name : names) {
      Principal principal = new Principal(principalType, namespace, name,
          caseSensitivityType);
      list.add(Value.getPrincipalValue(principal));
    }
  }
View Full Code Here


    if (null != adGroups && adGroups.size() > 0) {
      String globalNamespace =
          sharepointClientContext.getGoogleGlobalNamespace();
      for (String adGroup : addGroupNameFormatForTheGroups(adGroups)) {
        finalADGroups.add(
            new Principal(PrincipalType.UNKNOWN, globalNamespace, adGroup));
      }
      finalADGroups.add(
          new Principal(PrincipalType.UNKNOWN, globalNamespace, "Everyone"));
      finalADGroups.add(new Principal(PrincipalType.UNKNOWN,
          globalNamespace, "NT AUTHORITY\\authenticated users"));
      finalADGroups.add(new Principal(PrincipalType.UNKNOWN,
          globalNamespace, "NT AUTHORITY\\interactive"));
    }
    String finalSearchUserName = addUserNameFormatForTheSearchUser(searchUser);
    LOGGER.info("Querying user data store with the AD groups: "
        + finalADGroups + " and search user [" + finalSearchUserName + "]");
View Full Code Here

      Set<Principal> groups, String principalName, String webStateUrl,
      Set<UserGroupMembership> memberships, WebState webState) {
    String globalNamespace = sharepointClientContext.getGoogleGlobalNamespace();
    String localNamespace = sharepointClientContext.getGoogleLocalNamespace();
    if (PrincipalType.USER.equals(principal.getType())) {
      users.add(new Principal(SpiConstants.PrincipalType.UNKNOWN,
              globalNamespace, principalName,
              CaseSensitivityType.EVERYTHING_CASE_INSENSITIVE));
    } else if (PrincipalType.DOMAINGROUP.equals(principal.getType())) {
      groups.add(new Principal(SpiConstants.PrincipalType.UNKNOWN,
              globalNamespace, principalName,
              CaseSensitivityType.EVERYTHING_CASE_INSENSITIVE));
    } else if (PrincipalType.SPGROUP.equals(principal.getType())) {
      groups.add(Util.getSharePointGroupPrincipal(localNamespace,
          webStateUrl, principalName));
View Full Code Here

        + "' where ID = " + userId);
  }

  private Principal getAclPrincipal(Document doc, String prop, String name)
      throws RepositoryException {
    Principal aclPrincipal = null;
    PrincipalValue prValue;
    Property property = doc.findProperty(prop);
    while ((prValue = (PrincipalValue) property.nextValue()) != null) {
      if (prValue.getPrincipal().getName().equalsIgnoreCase(name)) {
        aclPrincipal = prValue.getPrincipal();
View Full Code Here

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

    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLUSERS, "user1"));
    assertEquals(
        new Principal(UNKNOWN, LOCAL_NAMESPACE, "user2",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLUSERS, "user2"));
  }
View Full Code Here

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

    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "group1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLGROUPS, "group1"));
    assertEquals(
        new Principal(UNKNOWN, LOCAL_NAMESPACE, "group2",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLGROUPS, "group2"));
  }
View Full Code Here

    DocumentList list = getObjectUnderTest(33, 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

    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

    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

    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

TOP

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

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.