public static Rdn getRdn ( Name name , String key ) { Assert . notNull ( name , "name must not be null" ) ; Assert . hasText ( key , "key must not be blank" ) ; LdapName ldapName = returnOrConstructLdapNameFromName ( name ) ; List < Rdn > rdns = ldapName . getRdns ( ) ; for ( Rdn rdn : rdns ) { NamingEnumeration < String > ids = rdn . toAttributes ( ) . getIDs ( ) ; while ( ids . hasMoreElements ( ) ) { String id = ids . nextElement ( ) ; if ( key . equalsIgnoreCase ( id ) ) { return rdn ; } } } throw new NoSuchElementException ( "No Rdn with the requested key: '" + key + "'" ) ; }
Find the Rdn with the requested key in the supplied Name .