• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Principal类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.enterprise.adaptor.Principal的典型用法代码示例。如果您正苦于以下问题:Java Principal类的具体用法?Java Principal怎么用?Java Principal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Principal类属于com.google.enterprise.adaptor包,在下文中一共展示了Principal类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDocIds

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
/** Crawls/pushes all groups from all AdServers. */

  @Override
  public void getDocIds(DocIdPusher pusher) throws InterruptedException,
      IOException {
    log.log(Level.FINER, "getDocIds invoked - waiting for lock.");
    mutex.lock();
    try {
      clearLastCompleteGroupCatalog();
      GroupCatalog cumulativeCatalog = makeFullCatalog();
      // all servers were able to successfully populate the catalog: do a push
      // TODO(myk): Rework the structure so that a member variable of
      // cumulativeCatalog isn't passed in as a parameter to its own method.
      cumulativeCatalog.resolveForeignSecurityPrincipals(
          cumulativeCatalog.entities);
      Map<GroupPrincipal, List<Principal>> groups =
          cumulativeCatalog.makeDefs(cumulativeCatalog.entities);
      pusher.pushGroupDefinitions(groups, EVERYTHING_CASE_INSENSITIVE, REPLACE,
          null, null);
      // no longer clear cumulativeCatalog.members as part of fix for b/18028678
      lastCompleteGroupCatalog = cumulativeCatalog;
    } finally {
      mutex.unlock();
      log.log(Level.FINE, "getDocIds ending - lock released.");
    }
  }
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:27,代码来源:AdAdaptor.java


示例2: testGroupCatalogMakeDefsWithDisabledGroup

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testGroupCatalogMakeDefsWithDisabledGroup() throws Exception {
  AdAdaptor.GroupCatalog groupCatalog = new GroupCatalogBuilder().build();

  MockLdapContext ldapContext = mockLdapContextForMakeDefs(true);

  AdServer adServer = new AdServer("localhost", "" /*userSearchBaseDN*/,
      "" /*groupSearchBaseDN*/, "" /*userSearchFilter*/,
      "" /*groupSearchFilter*/, ldapContext);
  adServer.initialize();

  groupCatalog.readEverythingFrom(adServer, /*includeMembers=*/ true);

  tweakGroupCatalogForMakeDefs(groupCatalog, adServer, true);

  final Map<GroupPrincipal, List<Principal>> golden =
      new HashMap<GroupPrincipal, List<Principal>>();
  {
    golden.put(new GroupPrincipal("[email protected]", "example.com"),
        Collections.<Principal>emptyList());
    golden.put(new GroupPrincipal("known_group", "example.com"),
        Collections.<Principal>emptyList());
  }
  assertEquals(golden, groupCatalog.makeDefs(groupCatalog.entities));
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:26,代码来源:AdAdaptorTest.java


示例3: testFakeAdaptorUserAndPasswordSpecified

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testFakeAdaptorUserAndPasswordSpecified() throws Exception {
  AdAdaptor adAdaptor = new FakeAdaptor();
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  Map<String, String> configEntries = new HashMap<String, String>();
  configEntries.put("gsa.hostname", "localhost");
  configEntries.put("ad.servers", "server1");
  configEntries.put("ad.servers.server1.host", "localhost");
  configEntries.put("ad.servers.server1.port", "1234");
  configEntries.put("ad.servers.server1.user", "username");
  configEntries.put("ad.servers.server1.password", "password");
  configEntries.put("ad.servers.server1.method", "ssl");
  configEntries.put("ad.userSearchBaseDN", "ou=DoesNotMatter");
  configEntries.put("server.port", "5680");
  configEntries.put("server.dashboardPort", "5681");
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ true);
  Map<GroupPrincipal, Collection<Principal>> results =
      pusher.getGroupDefinitions();
  // the above (eventually) calls AdAdaptor.init() with the specified config.
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:22,代码来源:AdAdaptorTest.java


示例4: testFakeAdaptorDefaultUserAndPasswordSpecified

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testFakeAdaptorDefaultUserAndPasswordSpecified()
    throws Exception {
  AdAdaptor adAdaptor = new FakeAdaptor();
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  Map<String, String> configEntries = new HashMap<String, String>();
  configEntries.put("gsa.hostname", "localhost");
  configEntries.put("ad.servers", "server1");
  configEntries.put("ad.servers.server1.host", "localhost");
  configEntries.put("ad.servers.server1.port", "1234");
  configEntries.put("ad.servers.server1.method", "ssl");
  configEntries.put("ad.defaultUser", "defaultUser");
  configEntries.put("ad.defaultPassword", "defaultPassword");
  configEntries.put("ad.groupSearchBaseDN", "ou=DoesNotMatter");
  configEntries.put("server.port", "5680");
  configEntries.put("server.dashboardPort", "5681");
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ true);
  Map<GroupPrincipal, Collection<Principal>> results =
      pusher.getGroupDefinitions();
  // the above (eventually) calls AdAdaptor.init() with the specified config.
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:23,代码来源:AdAdaptorTest.java


示例5: testGetDocIdsMarkPublicFalse

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testGetDocIdsMarkPublicFalse() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("adaptor.markAllDocsAsPublic", "false");
  adaptor.init(context);

  soapFactory.memberServiceMock.addMember(
      getMember(1000, "user1", "User"));
  soapFactory.memberServiceMock.addMember(
      getMember(2000, "group1", "Group"));
  soapFactory.memberServiceMock.addMemberToGroup(
      2000, soapFactory.memberServiceMock.getMemberById(1000));

  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.getDocIds(pusher);
  Map<GroupPrincipal, List<Principal>> expected =
      new HashMap<GroupPrincipal, List<Principal>>();
  expected.put(newGroupPrincipal("group1"),
      Lists.<Principal>newArrayList(newUserPrincipal("user1")));
  assertEquals(expected, pusher.getGroupDefinitions());
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:25,代码来源:OpentextAdaptorTest.java


示例6: testGetGroupsDeletedUser

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testGetGroupsDeletedUser() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  Member active = getMember(1, "user1", "User");
  Member deleted = getMember(2, "user2", "User");
  deleted.setDeleted(true);
  Member group = getMember(11, "group1", "Group");
  soapFactory.memberServiceMock.addMember(active);
  soapFactory.memberServiceMock.addMember(deleted);
  soapFactory.memberServiceMock.addMember(group);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), active);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), deleted);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);
  OpentextAdaptor.Groups groups =
      adaptor.new Groups(soapFactory.newMemberService());
  groups.addGroups();
  Map<GroupPrincipal, List<Principal>> groupDefinitions =
      groups.getGroupDefinitions();
  assertEquals(Lists.newArrayList(newUserPrincipal("user1")),
      groupDefinitions.get(newGroupPrincipal("group1")));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:26,代码来源:OpentextAdaptorTest.java


示例7: testGetGroupsDeletedGroup

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testGetGroupsDeletedGroup() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  Member active = getMember(1, "user1", "User");
  Member group = getMember(11, "group1", "Group");
  group.setDeleted(true);
  soapFactory.memberServiceMock.addMember(active);
  soapFactory.memberServiceMock.addMember(group);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), active);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);
  OpentextAdaptor.Groups groups =
      adaptor.new Groups(soapFactory.newMemberService());
  groups.addGroups();
  Map<GroupPrincipal, List<Principal>> groupDefinitions =
      groups.getGroupDefinitions();
  assertEquals(null, groupDefinitions.get(newGroupPrincipal("group1")));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:22,代码来源:OpentextAdaptorTest.java


示例8: testGetGroupsDeletedMemberGroup

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testGetGroupsDeletedMemberGroup() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  Member active = getMember(1, "user1", "User");
  Member memberGroup = getMember(2, "memberGroup", "Group");
  memberGroup.setDeleted(true);
  Member group = getMember(11, "group1", "Group");
  soapFactory.memberServiceMock.addMember(active);
  soapFactory.memberServiceMock.addMember(memberGroup);
  soapFactory.memberServiceMock.addMember(group);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), active);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), memberGroup);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);
  OpentextAdaptor.Groups groups =
      adaptor.new Groups(soapFactory.newMemberService());
  groups.addGroups();
  Map<GroupPrincipal, List<Principal>> groupDefinitions =
      groups.getGroupDefinitions();
  assertEquals(Lists.newArrayList(newUserPrincipal("user1")),
      groupDefinitions.get(newGroupPrincipal("group1")));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:26,代码来源:OpentextAdaptorTest.java


示例9: testGetGroupsLoginDisabledUser

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testGetGroupsLoginDisabledUser() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  Member active = getMember(1, "user1", "User");
  User disabled = (User) getMember(2, "user2", "User");
  MemberPrivileges memberPrivileges = disabled.getPrivileges();
  memberPrivileges.setLoginEnabled(false);
  Member group = getMember(11, "group1", "Group");
  soapFactory.memberServiceMock.addMember(active);
  soapFactory.memberServiceMock.addMember(disabled);
  soapFactory.memberServiceMock.addMember(group);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), active);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), disabled);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);
  OpentextAdaptor.Groups groups =
      adaptor.new Groups(soapFactory.newMemberService());
  groups.addGroups();
  Map<GroupPrincipal, List<Principal>> groupDefinitions =
      groups.getGroupDefinitions();
  assertEquals(Lists.newArrayList(newUserPrincipal("user1")),
      groupDefinitions.get(newGroupPrincipal("group1")));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:27,代码来源:OpentextAdaptorTest.java


示例10: testGetPublicAccessGroupDisabledUser

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testGetPublicAccessGroupDisabledUser()
    throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  User active = (User) getMember(1, "user1", "User");
  MemberPrivileges memberPrivileges = active.getPrivileges();
  memberPrivileges.setPublicAccessEnabled(true);
  User disabled = (User) getMember(2, "user2", "User");
  memberPrivileges = disabled.getPrivileges();
  memberPrivileges.setPublicAccessEnabled(true);
  memberPrivileges.setLoginEnabled(false);
  soapFactory.memberServiceMock.addMember(active);
  soapFactory.memberServiceMock.addMember(disabled);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);
  OpentextAdaptor.Groups groups =
      adaptor.new Groups(soapFactory.newMemberService());
  groups.addPublicAccessGroup("[Public Access]", LOCAL_NAMESPACE);
  List<Principal> publicAccessGroup =
      groups.getGroupDefinitions().get(newGroupPrincipal("[Public Access]"));
  assertEquals(Lists.newArrayList(newUserPrincipal("user1")),
      publicAccessGroup);
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:27,代码来源:OpentextAdaptorTest.java


示例11: getDocIdsSiteCollectionOnly

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
private void getDocIdsSiteCollectionOnly(DocIdPusher pusher)
    throws InterruptedException,IOException {
  log.entering("SharePointAdaptor", "getDocIdsSiteCollectionOnly", pusher);
  SiteAdaptor scAdaptor = getSiteAdaptor(sharePointUrl.getSharePointUrl(), 
      sharePointUrl.getSharePointUrl());
  SiteDataClient scClient = scAdaptor.getSiteDataClient();
  Site site = scClient.getContentSite();
  String siteCollectionUrl = getCanonicalUrl(site.getMetadata().getURL());
  // Reset site collection URL instance to use correct URL.
  scAdaptor = getSiteAdaptor(siteCollectionUrl, siteCollectionUrl);
  DocId siteCollectionDocId = scAdaptor.encodeDocId(siteCollectionUrl);
  pusher.pushDocIds(Arrays.asList(siteCollectionDocId));
  Map<GroupPrincipal, Collection<Principal>> groupDefs 
      = new HashMap<GroupPrincipal, Collection<Principal>>();
  groupDefs.putAll(scAdaptor.computeMembersForGroups(site.getGroups()));
  String siteId = site.getMetadata().getID();
  sitePushGroupDefinitions(siteId, pusher, groupDefs);
  log.exiting("SharePointAdaptor", "getDocIdsSiteCollectionOnly");
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:20,代码来源:SharePointAdaptor.java


示例12: generateAcl

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
private Acl.Builder generateAcl(List<Permission> permissions,
    final long necessaryPermissionMask) throws IOException {
  List<Principal> permits = new LinkedList<Principal>();
  IdMappings idMapping = new IdMappings();
  for (Permission permission : permissions) {
    // Although it is named "mask", this is really a bit-field of
    // permissions.
    long mask = permission.getMask().longValue();
    if ((necessaryPermissionMask & mask) != necessaryPermissionMask) {
      continue;
    }
    Integer id = permission.getMemberid();
    Principal principal = idMapping.resolvePrincipal(id);
    if (principal == null) {
      log.log(Level.WARNING, "Could not resolve member id {0} for Web "
          + "[{1}] under Site Collection [{2}].", 
          new Object[] {id, webUrl, siteUrl});
      continue;
    }
    permits.add(principal);
  }
  return new Acl.Builder().setEverythingCaseInsensitive()
      .setPermits(permits);
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:25,代码来源:SharePointAdaptor.java


示例13: addPermitUserToAcl

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
private void addPermitUserToAcl(int userId, Acl.Builder aclToUpdate)
    throws IOException {
  if (userId == -1) {
    return;
  }
  IdMappings idMapping = new IdMappings();
  Principal principal = idMapping.resolvePrincipal(userId);
  if (principal == null) {
    log.log(Level.WARNING, "Could not resolve user id {0}", userId);
    return;
  }

  List<Principal> permits
      = new LinkedList<Principal>(aclToUpdate.build().getPermits());
  permits.add(principal);
  aclToUpdate.setPermits(permits);
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:18,代码来源:SharePointAdaptor.java


示例14: retrieveMemberIdMapping

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
private MemberIdMapping retrieveMemberIdMapping() throws IOException {
  log.entering("SiteAdaptor", "retrieveMemberIdMapping");
  Site site = siteDataClient.getContentSite();
  Map<Integer, Principal> map = new HashMap<Integer, Principal>();
  for (GroupMembership.Group group : site.getGroups().getGroup()) {
    map.put(group.getGroup().getID(), new GroupPrincipal(
        group.getGroup().getName(),
        defaultNamespace + "_" + site.getMetadata().getURL()));
  }
  for (UserDescription user : site.getWeb().getUsers().getUser()) {
    Principal principal = userDescriptionToPrincipal(user);
    if (principal == null) {
      log.log(Level.WARNING,
          "Unable to determine login name. Skipping user with ID {0}",
          user.getID());
      continue;
    }
    map.put(user.getID(), principal);
  }
  MemberIdMapping mapping = new MemberIdMapping(map);
  log.exiting("SiteAdaptor", "retrieveMemberIdMapping", mapping);
  return mapping;
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:24,代码来源:SharePointAdaptor.java


示例15: computeMembersForGroups

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
private Map<GroupPrincipal, Collection<Principal>> computeMembersForGroups(
    GroupMembership groups) {
  Map<GroupPrincipal, Collection<Principal>> defs
      = new HashMap<GroupPrincipal, Collection<Principal>>();
  for (GroupMembership.Group group : groups.getGroup()) {
    GroupPrincipal groupPrincipal = new GroupPrincipal(
        group.getGroup().getName(), defaultNamespace + "_" + siteUrl);
    Collection<Principal> members = new LinkedList<Principal>();
    // We always provide membership details, even for empty groups.
    defs.put(groupPrincipal, members);
    if (group.getUsers() == null) {
      continue;
    }
    for (UserDescription user : group.getUsers().getUser()) {
      Principal principal = userDescriptionToPrincipal(user);
      if (principal == null) {
        log.log(Level.WARNING,
            "Unable to determine login name. Skipping user with ID {0}",
            user.getID());
        continue;
      }
      members.add(principal);
    }
  }
  return defs;
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:27,代码来源:SharePointAdaptor.java


示例16: testModifiedGetDocIdsClient

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testModifiedGetDocIdsClient() throws Exception {
  final String getChangesContentDatabase
      = loadTestString("testModifiedGetDocIdsClient.changes-cd.xml");
  adaptor = new SharePointAdaptor(initableSoapFactory,
      new UnsupportedHttpClient(), executorFactory,
      new MockAuthenticationClientFactoryForms(),
      new UnsupportedActiveDirectoryClientFactory());
  adaptor.init(new MockAdaptorContext(config, pusher));
  SPContentDatabase result = parseChanges(getChangesContentDatabase);
  List<DocId> docIds = new ArrayList<DocId>();
  Map<GroupPrincipal, Collection<Principal>> groupDefs
      = new HashMap<GroupPrincipal, Collection<Principal>>();
  Set<String> updatedSiteSecurity = new HashSet<String>();
  adaptor.getModifiedDocIdsContentDatabase(
      result, docIds, updatedSiteSecurity);    
  assertEquals(Arrays.asList(
        new DocId("http://localhost:1/Lists/Announcements/2_.000")),
      docIds);
  assertEquals(Collections.emptyMap(), groupDefs);
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:22,代码来源:SharePointAdaptorTest.java


示例17: pushCollection

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Override
protected Checkpoint pushCollection(DocIdPusher pusher)
    throws InterruptedException {
  FeedType feedType;
  if ((queryBatchSize > 0) || caughtException || prevError) {
    feedType = FeedType.INCREMENTAL;
  } else {
    feedType = this.feedType;
  }

  Map<GroupPrincipal, Collection<Principal>> groupDefs = groups.build();
  pusher.pushGroupDefinitions(groupDefs,
      caseSensitivityType == CaseSensitivityType.EVERYTHING_CASE_SENSITIVE,
      feedType, null, null);
  // If we caught an exception, then the next push will also be incomplete,
  // else (modulo batching) we finished sending all the groups, and the
  // next push can be full again.
  prevError = caughtException;
  return groupsCheckpoint;
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:21,代码来源:DocumentumAdaptor.java


示例18: addGroup

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
/** Adds a group and its members to the collection of groups. */
private void addGroup(String groupName,
    ImmutableMap.Builder<GroupPrincipal, Collection<Principal>> groupsBuilder,
    ImmutableSet.Builder<Principal> membersBuilder, Principals principals)
    throws DfException {
  if (membersBuilder == null) {
    return;
  }
  GroupPrincipal groupPrincipal = (GroupPrincipal)
      principals.getPrincipal(groupName, true);
  if (groupPrincipal == null) {
    return;
  }
  ImmutableSet<Principal> members = membersBuilder.build();
  groupsBuilder.put(groupPrincipal, members);
  logger.log(Level.FINEST, "Pushing Group {0}: {1}",
      new Object[] { groupPrincipal.getName(), members });
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:19,代码来源:DocumentumAdaptor.java


示例19: getBasicAcl

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
private Acl getBasicAcl(String parentAclId,
    Set<Principal> permits, Set<Principal> denies,
    Acl.InheritanceType inheritanceType) throws DfException {
  Acl.Builder builder = new Acl.Builder()
      .setPermits(permits)
      .setDenies(denies)
      .setInheritanceType(inheritanceType);
  if (caseSensitivityType
      .equals(CaseSensitivityType.EVERYTHING_CASE_SENSITIVE)) {
    builder.setEverythingCaseSensitive();
  } else {
    builder.setEverythingCaseInsensitive();
  }
  if (parentAclId != null) {
    builder.setInheritFrom(new DocId(parentAclId));
  }
  return builder.build();
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:19,代码来源:DocumentumAcls.java


示例20: testGetGroupsDmWorldOnly

import com.google.enterprise.adaptor.Principal; //导入依赖的package包/类
@Test
public void testGetGroupsDmWorldOnly() throws Exception {
  insertUsers("User1", "User2", "User3", "User4", "User5");

  // The only group should be the virtual group, dm_world, which consists
  // of all users.
  ImmutableMap<GroupPrincipal, ? extends Collection<? extends Principal>>
      expected = ImmutableMap.of(new GroupPrincipal("dm_world", "NS_Local"),
          ImmutableSet.of(new UserPrincipal("User1", "NS"),
                          new UserPrincipal("User2", "NS"),
                          new UserPrincipal("User3", "NS"),
                          new UserPrincipal("User4", "NS"),
                          new UserPrincipal("User5", "NS")));

  // Fetch all the dm_world members in various sized batches.
  // Note: a batch size of 0, means no batching.
  for (int batchSize = 0; batchSize <= expected.size() + 1; batchSize++) {
    assertEquals("batchSize: " + batchSize, expected,
        getGroups(ImmutableMap.of("documentum.queryBatchSize", batchSize)));
  }
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:22,代码来源:DocumentumAdaptorTest.java



注:本文中的com.google.enterprise.adaptor.Principal类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HtmlOutputLink类代码示例发布时间:2022-05-22
下一篇:
Java CoNLLWord类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap