com.unboundid.ldap.sdk.DN.getRDN()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中com.unboundid.ldap.sdk.DN.getRDN()方法的一些代码示例,展示了DN.getRDN()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DN.getRDN()方法的具体详情如下:
包路径:com.unboundid.ldap.sdk.DN
类名称:DN
方法名:getRDN

DN.getRDN介绍

[英]Retrieves the leftmost (i.e., furthest from the naming context) RDN component for this DN.
[中]检索此DN的最左侧(即距离命名上下文最远的)RDN组件。

代码示例

代码示例来源:origin: spring-projects/spring-security

  1. @Override
  2. public void start() {
  3. if (isRunning()) {
  4. return;
  5. }
  6. try {
  7. InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(this.defaultPartitionSuffix);
  8. config.addAdditionalBindCredentials("uid=admin,ou=system", "secret");
  9. config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("LDAP", this.port));
  10. config.setEnforceSingleStructuralObjectClass(false);
  11. config.setEnforceAttributeSyntaxCompliance(true);
  12. DN dn = new DN(this.defaultPartitionSuffix);
  13. Entry entry = new Entry(dn);
  14. entry.addAttribute("objectClass", "top", "domain", "extensibleObject");
  15. entry.addAttribute("dc", dn.getRDN().getAttributeValues()[0]);
  16. InMemoryDirectoryServer directoryServer = new InMemoryDirectoryServer(config);
  17. directoryServer.add(entry);
  18. importLdif(directoryServer);
  19. directoryServer.startListening();
  20. this.port = directoryServer.getListenPort();
  21. this.directoryServer = directoryServer;
  22. this.running = true;
  23. } catch (LDAPException ex) {
  24. throw new RuntimeException("Server startup failed", ex);
  25. }
  26. }

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

  1. final RDN originalRDN = dn.getRDN();
  2. final Entry updatedEntry = originalEntry.duplicate();
  3. updatedEntry.setDN(newDN);

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

  1. /**
  2. * Retrieves the RDN for this entry.
  3. *
  4. * @return The RDN for this entry, or {@code null} if the DN is the null DN.
  5. *
  6. * @throws LDAPException If the DN string cannot be parsed as a valid DN.
  7. */
  8. public final RDN getRDN()
  9. throws LDAPException
  10. {
  11. return getParsedDN().getRDN();
  12. }

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

  1. /**
  2. * Retrieves the RDN for this entry.
  3. *
  4. * @return The RDN for this entry, or {@code null} if the DN is the null DN.
  5. *
  6. * @throws LDAPException If the DN string cannot be parsed as a valid DN.
  7. */
  8. public RDN getRDN()
  9. throws LDAPException
  10. {
  11. return getParsedDN().getRDN();
  12. }

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

  1. /**
  2. * Retrieves the RDN for this entry.
  3. *
  4. * @return The RDN for this entry, or {@code null} if the DN is the null DN.
  5. *
  6. * @throws LDAPException If the DN string cannot be parsed as a valid DN.
  7. */
  8. public RDN getRDN()
  9. throws LDAPException
  10. {
  11. return getParsedDN().getRDN();
  12. }

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

  1. /**
  2. * Retrieves the RDN for this entry.
  3. *
  4. * @return The RDN for this entry, or {@code null} if the DN is the null DN.
  5. *
  6. * @throws LDAPException If the DN string cannot be parsed as a valid DN.
  7. */
  8. public final RDN getRDN()
  9. throws LDAPException
  10. {
  11. return getParsedDN().getRDN();
  12. }

代码示例来源:origin: org.geomajas.plugin/geomajas-plugin-staticsecurity-ldap

  1. /**
  2. * Set the authorizations for the roles which may be defined. If the keys are DN values, the application role names
  3. * are taken from the leftmost RDN value. Use {@link LdapAuthenticationService#setNamedRoles(Map)} instead of this
  4. * method to explicitly define application role names.
  5. *
  6. * @param roles map with roles, keys are the values for {@link #rolesAttribute}, probably DN values
  7. * @since 1.10.0 (actually already from 1.9.0 but annotations was missing)
  8. */
  9. @Api
  10. public void setRoles(Map<String, List<AuthorizationInfo>> roles) {
  11. Map<String, List<NamedRoleInfo>> namedRoles = new HashMap<String, List<NamedRoleInfo>>();
  12. for (String ldapRole : roles.keySet()) {
  13. DN dn;
  14. List<AuthorizationInfo> auth = roles.get(ldapRole);
  15. NamedRoleInfo role = new NamedRoleInfo();
  16. role.setAuthorizations(auth);
  17. try {
  18. dn = new DN(ldapRole);
  19. role.setName(dn.getRDN().getAttributeValues()[0]);
  20. } catch (LDAPException e) {
  21. role.setName(ldapRole);
  22. }
  23. namedRoles.put(ldapRole, Collections.singletonList(role));
  24. }
  25. setNamedRoles(namedRoles);
  26. }

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

  1. try
  2. rdn = entry.getParsedDN().getRDN();

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

  1. final RDN rdn = parsedDN.getRDN();
  2. for (final String name : names)

代码示例来源:origin: apache/servicemix-bundles

  1. @Override
  2. public void start() {
  3. if (isRunning()) {
  4. return;
  5. }
  6. try {
  7. InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(this.defaultPartitionSuffix);
  8. config.addAdditionalBindCredentials("uid=admin,ou=system", "secret");
  9. config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("LDAP", this.port));
  10. config.setEnforceSingleStructuralObjectClass(false);
  11. config.setEnforceAttributeSyntaxCompliance(true);
  12. DN dn = new DN(this.defaultPartitionSuffix);
  13. Entry entry = new Entry(dn);
  14. entry.addAttribute("objectClass", "top", "domain", "extensibleObject");
  15. entry.addAttribute("dc", dn.getRDN().getAttributeValues()[0]);
  16. InMemoryDirectoryServer directoryServer = new InMemoryDirectoryServer(config);
  17. directoryServer.add(entry);
  18. importLdif(directoryServer);
  19. directoryServer.startListening();
  20. this.port = directoryServer.getListenPort();
  21. this.directoryServer = directoryServer;
  22. this.running = true;
  23. } catch (LDAPException ex) {
  24. throw new RuntimeException("Server startup failed", ex);
  25. }
  26. }

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

  1. final RDN rdn = dn.getRDN();
  2. final String[] rdnAttrNames = rdn.getAttributeNames();
  3. final byte[][] rdnAttrValues = rdn.getByteArrayAttributeValues();

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

  1. final RDN parsedOldRDN = parsedOldDN.getRDN();
  2. final DN parsedOldSuperiorDN = parsedOldDN.getParent();

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

  1. final RDN parsedOldRDN = parsedOldDN.getRDN();
  2. final DN parsedOldSuperiorDN = parsedOldDN.getParent();

相关文章