Package com.google.enterprise.adaptor

Examples of com.google.enterprise.adaptor.GroupPrincipal


    assertEquals(1, groups.size());

    Set<GroupPrincipal> groupSet = groups.keySet();
    Set<GroupPrincipal> expectedGroupSet =
        ImmutableSet.of(new GroupPrincipal("group1", LOCAL_NAMESPACE));
    assertEquals(expectedGroupSet, groupSet);

    Collection<Principal> users = groups.get(groupSet.iterator().next());
    assertTrue(users.isEmpty());
  }
View Full Code Here


    assertEquals(1, groups.size());

    Set<GroupPrincipal> groupSet = groups.keySet();
    Set<GroupPrincipal> expectedGroupSet =
        ImmutableSet.of(new GroupPrincipal("group1", LOCAL_NAMESPACE));
    assertEquals(expectedGroupSet, groupSet);

    Set<UserPrincipal> expectedUserSet =
        ImmutableSet.of(
            new UserPrincipal("user1", LOCAL_NAMESPACE),
View Full Code Here

        getGroupInfo(getGroupsAdaptor());

    assertEquals(2, groups.size());

    Set<GroupPrincipal> groupSet = groups.keySet();
    GroupPrincipal expectedGroup1 =
        new GroupPrincipal("group1", LOCAL_NAMESPACE);
    GroupPrincipal expectedGroup2 =
        new GroupPrincipal("group2", LOCAL_NAMESPACE);
    Set<GroupPrincipal> expectedGroupSet =
        ImmutableSet.of(expectedGroup1, expectedGroup2);
    assertEquals(expectedGroupSet, groupSet);

    Set<UserPrincipal> expectedUserSet1 =
View Full Code Here

    assertEquals(1, groups.size());

    Set<GroupPrincipal> groupSet = groups.keySet();
    Set<GroupPrincipal> expectedGroupSet =
        ImmutableSet.of(new GroupPrincipal("group1", LOCAL_NAMESPACE));
    assertEquals(expectedGroupSet, groupSet);

    Set<UserPrincipal> expectedUserSet =
        ImmutableSet.of(
            new UserPrincipal("user1", LOCAL_NAMESPACE),
View Full Code Here

        getGroupInfo(getGroupsAdaptor());

    assertEquals(3, groups.size());

    Set<GroupPrincipal> groupSet = groups.keySet();
    GroupPrincipal expectedGroup1 =
        new GroupPrincipal("group1", LOCAL_NAMESPACE);
    GroupPrincipal expectedGroup2 =
        new GroupPrincipal("group2", LOCAL_NAMESPACE);
    GroupPrincipal expectedGroup3 =
        new GroupPrincipal("group3", GLOBAL_NAMESPACE);
    Set<GroupPrincipal> expectedGroupSet =
        ImmutableSet.of(expectedGroup1, expectedGroup2, expectedGroup3);
    assertEquals(expectedGroupSet, groupSet);

    Set<UserPrincipal> expectedUserSet1 =
        ImmutableSet.of(
            new UserPrincipal("user1", LOCAL_NAMESPACE),
            new UserPrincipal("user2", LOCAL_NAMESPACE));
    Collection<Principal> users1 = groups.get(expectedGroup1);
    Set<Principal> userSet1 = new HashSet<Principal>(users1);
    assertEquals(expectedUserSet1, userSet1);

    Set<Principal> expectedUserSet2 = ImmutableSet.of(
        new UserPrincipal("user1", LOCAL_NAMESPACE),
        new UserPrincipal("user3", LOCAL_NAMESPACE),
        new GroupPrincipal("group1", LOCAL_NAMESPACE),
        new GroupPrincipal("group3", GLOBAL_NAMESPACE));
    Collection<Principal> users2 = groups.get(expectedGroup2);
    Set<Principal> userSet2 = new HashSet<Principal>(users2);
    assertEquals(expectedUserSet2, userSet2);

    Collection<Principal> users3 = groups.get(expectedGroup3);
View Full Code Here

      ClientValue memberUserData = groupMembers.toValue(i, "UserData");
      String memberNamespace = identityUtils.getNamespace(memberUserData);
      if (memberType == Client.USER) {
        memberPrincipals.add(new UserPrincipal(memberName, memberNamespace));
      } else if (memberType == Client.GROUP) {
        memberPrincipals.add(new GroupPrincipal(memberName, memberNamespace));
      }
    }

    return memberPrincipals;
  }
View Full Code Here

      String groupName = groupsValue.toString(i, "Name");
      LOGGER.log(Level.FINER, "Fetching group members for group name: {0}",
          groupName);
      ClientValue groupUserData = groupsValue.toValue(i, "UserData");
      String groupNamespace = identityUtils.getNamespace(groupUserData);
      GroupPrincipal groupPrincipal =
          new GroupPrincipal(groupName, groupNamespace);

      ClientValue groupMembers = client.ListMembers(groupName);
      List<Principal> memberPrincipals = getMemberPrincipalList(groupMembers);
      groups.put(groupPrincipal, memberPrincipals);
      LOGGER.log(Level.FINER, "Group principal: {0} ; Member principals: {1}",
View Full Code Here

TOP

Related Classes of com.google.enterprise.adaptor.GroupPrincipal

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.