本文整理了Java中org.apache.directory.shared.ldap.name.DN.getRdn()
方法的一些代码示例,展示了DN.getRdn()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DN.getRdn()
方法的具体详情如下:
包路径:org.apache.directory.shared.ldap.name.DN
类名称:DN
方法名:getRdn
[英]Retrieves the last (leaf) component of this name.
[中]检索此名称的最后一个(叶)组件。
代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-tools
public String toString()
{
StringBuffer buf = new StringBuffer();
try
{
DN dn = new DN( partition.getEntryDn( id ) );
buf.append( "(" ).append( id ).append( ") " );
buf.append( dn.getRdn() );
}
catch ( Exception e )
{
buf.append( "ERROR: " + e.getLocalizedMessage() );
}
if ( children.size() > 0 )
{
buf.append( " [" ).append( children.size() ).append( "]" );
}
return buf.toString();
}
代码示例来源:origin: dwimberger/crowd-ldap-server
public LdapPrincipal authenticate(BindOperationContext ctx) throws Exception {
String user = ctx.getDn().getRdn(2).getNormValue();
String pass = new String(ctx.getCredentials(),"utf-8");
try {
User u = m_CrowdClient.authenticateUser(user, pass);
if(u == null) {
log.debug(c_ResourceBundle.getString("crowdauthenticator.authentication.failed") + "()::Authentication failed");
throw new javax.naming.AuthenticationException("Invalid credentials for user: " + user);
} else {
log.debug(MessageFormat.format(c_ResourceBundle.getString("crowdauthenticator.user"), u.toString()));
return new LdapPrincipal(ctx.getDn(), AuthenticationLevel.SIMPLE);
}
} catch (Exception ex) {
log.debug(c_ResourceBundle.getString("crowdauthenticator.authentication.failed") + "()::Authentication failed: " + ex );
throw new javax.naming.NamingException("Unable to perform authentication: " + ex);
}
}//authenticate
代码示例来源:origin: org.apache.directory.client.ldap/ldap-client-api
/**
* moves the given entry DN under the new superior DN
*
* @param entryDn the DN of the target entry
* @param newSuperiorDn DN of the new parent/superior
* @return modifyDn operations response
* @throws LdapException
*/
public ModifyDnResponse move( DN entryDn, DN newSuperiorDn ) throws LdapException
{
ModifyDnRequest modDnRequest = new ModifyDnRequest();
modDnRequest.setEntryDn( entryDn );
modDnRequest.setNewSuperior( newSuperiorDn );
//TODO not setting the below value is resulting in error
modDnRequest.setNewRdn( entryDn.getRdn() );
return modifyDn( modDnRequest );
}
代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-base
RDN nameRdn = oldChildDn.getRdn( i );
RDN ldapRdn = newParentDn.getRdn( i );
代码示例来源:origin: dwimberger/crowd-ldap-server
String name = dn.getRdn(0).getNormValue();
log.debug("Name=" + name);
if("crowd".equals(name)) {
代码示例来源:origin: org.apache.directory.shared/shared-ldif
currentRdn = currentParent.getRdn();
currentParent.remove( currentParent.size() - 1 );
newDn.add( modifiedDn.getRdn() );
代码示例来源:origin: dwimberger/crowd-ldap-server
RDN rdn = dn.getRdn(2);
String user = rdn.getNormValue();
log.debug("user=" + user);
return (userEntry != null);
} else if(isCrowdGroups(prefix)) {
RDN rdn = dn.getRdn(2);
String group = rdn.getNormValue();
log.debug("group=" + group);
代码示例来源:origin: dwimberger/crowd-ldap-server
.getNormalizerMapping()
);
RDN rdn = crowdDN.getRdn();
代码示例来源:origin: org.apache.directory.shared/shared-ldif
RDN oldRdn = parentDn.getRdn();
代码示例来源:origin: dwimberger/crowd-ldap-server
public ServerEntry createGroupEntry(DN dn) {
ServerEntry groupEntry = m_EntryCache.get(dn.getName());
if (groupEntry == null) {
try {
//1. Obtain from crowd
RDN rdn = dn.getRdn(2);
String group = rdn.getNormValue();
Group g = m_CrowdClient.getGroup(group);
List<String> users = m_CrowdClient.getNamesOfUsersOfGroup(group, 0, Integer.MAX_VALUE);
groupEntry = new DefaultServerEntry(
m_SchemaManager,
dn
);
groupEntry.put(SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.GROUP_OF_NAMES_OC);
groupEntry.put(SchemaConstants.CN_AT, g.getName());
groupEntry.put("description", g.getDescription());
for (String u : users) {
DN mdn = new DN(String.format("dn=%s,%s", u, CROWD_USERS_DN));
groupEntry.add(SchemaConstants.MEMBER_AT, mdn.getName());
}
m_EntryCache.put(dn.getName(), groupEntry);
} catch (Exception ex) {
log.debug("createGroupEntry()", ex);
}
}
return groupEntry;
}//createUserEntry
代码示例来源:origin: org.apache.directory.shared/shared-ldap
String rdnAtIndex = dn.getRdn( index ).getNormName();
代码示例来源:origin: org.apache.directory.shared/shared-ldap
newRdn = dn.getRdn( 0 );
代码示例来源:origin: dwimberger/crowd-ldap-server
try {
RDN rdn = dn.getRdn(2);
String user = rdn.getNormValue();
代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition
DN rdnDN = new DN( rdn );
rdnDN.normalize( schemaManager.getNormalizerMapping() );
childUpdn.add( rdnDN.getRdn() );
代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition
RDN oldRdn = updn.getRdn();
for ( AVA oldAtav : oldRdn )
内容来源于网络,如有侵权,请联系作者删除!