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

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

本文整理了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

@Override
public void start() {
  if (isRunning()) {
    return;
  }
  try {
    InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(this.defaultPartitionSuffix);
    config.addAdditionalBindCredentials("uid=admin,ou=system", "secret");
    config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("LDAP", this.port));
    config.setEnforceSingleStructuralObjectClass(false);
    config.setEnforceAttributeSyntaxCompliance(true);
    DN dn = new DN(this.defaultPartitionSuffix);
    Entry entry = new Entry(dn);
    entry.addAttribute("objectClass", "top", "domain", "extensibleObject");
    entry.addAttribute("dc", dn.getRDN().getAttributeValues()[0]);
    InMemoryDirectoryServer directoryServer = new InMemoryDirectoryServer(config);
    directoryServer.add(entry);
    importLdif(directoryServer);
    directoryServer.startListening();
    this.port = directoryServer.getListenPort();
    this.directoryServer = directoryServer;
    this.running = true;
  } catch (LDAPException ex) {
    throw new RuntimeException("Server startup failed", ex);
  }
}

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

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

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

/**
 * Retrieves the RDN for this entry.
 *
 * @return  The RDN for this entry, or {@code null} if the DN is the null DN.
 *
 * @throws  LDAPException  If the DN string cannot be parsed as a valid DN.
 */
public final RDN getRDN()
    throws LDAPException
{
 return getParsedDN().getRDN();
}

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

/**
 * Retrieves the RDN for this entry.
 *
 * @return  The RDN for this entry, or {@code null} if the DN is the null DN.
 *
 * @throws  LDAPException  If the DN string cannot be parsed as a valid DN.
 */
public RDN getRDN()
    throws LDAPException
{
 return getParsedDN().getRDN();
}

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

/**
 * Retrieves the RDN for this entry.
 *
 * @return  The RDN for this entry, or {@code null} if the DN is the null DN.
 *
 * @throws  LDAPException  If the DN string cannot be parsed as a valid DN.
 */
public RDN getRDN()
    throws LDAPException
{
 return getParsedDN().getRDN();
}

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

/**
 * Retrieves the RDN for this entry.
 *
 * @return  The RDN for this entry, or {@code null} if the DN is the null DN.
 *
 * @throws  LDAPException  If the DN string cannot be parsed as a valid DN.
 */
public final RDN getRDN()
    throws LDAPException
{
 return getParsedDN().getRDN();
}

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

/**
 * Set the authorizations for the roles which may be defined. If the keys are DN values, the application role names
 * are taken from the leftmost RDN value. Use {@link LdapAuthenticationService#setNamedRoles(Map)} instead of this
 * method to explicitly define application role names.
 * 
 * @param roles map with roles, keys are the values for {@link #rolesAttribute}, probably DN values
 * @since 1.10.0 (actually already from 1.9.0 but annotations was missing)
 */
@Api
public void setRoles(Map<String, List<AuthorizationInfo>> roles) {
  Map<String, List<NamedRoleInfo>> namedRoles = new HashMap<String, List<NamedRoleInfo>>();
  for (String ldapRole : roles.keySet()) {
    DN dn;
    List<AuthorizationInfo> auth = roles.get(ldapRole);
    NamedRoleInfo role = new NamedRoleInfo();
    role.setAuthorizations(auth);
    try {
      dn = new DN(ldapRole);
      role.setName(dn.getRDN().getAttributeValues()[0]);
    } catch (LDAPException e) {
      role.setName(ldapRole);
    }
    namedRoles.put(ldapRole, Collections.singletonList(role));
  }
  setNamedRoles(namedRoles);
}

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

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

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

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

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

@Override
public void start() {
  if (isRunning()) {
    return;
  }
  try {
    InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(this.defaultPartitionSuffix);
    config.addAdditionalBindCredentials("uid=admin,ou=system", "secret");
    config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("LDAP", this.port));
    config.setEnforceSingleStructuralObjectClass(false);
    config.setEnforceAttributeSyntaxCompliance(true);
    DN dn = new DN(this.defaultPartitionSuffix);
    Entry entry = new Entry(dn);
    entry.addAttribute("objectClass", "top", "domain", "extensibleObject");
    entry.addAttribute("dc", dn.getRDN().getAttributeValues()[0]);
    InMemoryDirectoryServer directoryServer = new InMemoryDirectoryServer(config);
    directoryServer.add(entry);
    importLdif(directoryServer);
    directoryServer.startListening();
    this.port = directoryServer.getListenPort();
    this.directoryServer = directoryServer;
    this.running = true;
  } catch (LDAPException ex) {
    throw new RuntimeException("Server startup failed", ex);
  }
}

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

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

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

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

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

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

相关文章