Transformer transformer1 = new SearchResultToAttrValueList( "uniqueMember", "uid" ); //$NON-NLS-1$ //$NON-NLS-2$
GrantedAuthorityToString transformer2 = new GrantedAuthorityToString();
LdapSearch usernamesInRoleSearch =
new GenericLdapSearch( getContextSource(), paramFactory, transformer1, transformer2 );
SearchControls con2 = new SearchControls();
con2.setReturningAttributes( new String[] { "uid" } ); //$NON-NLS-1$
LdapSearchParamsFactory paramFactory2 =
new LdapSearchParamsFactoryImpl( "ou=users", "(businessCategory=cn={0}*)", con2 ); //$NON-NLS-1$//$NON-NLS-2$
Transformer transformer3 = new SearchResultToAttrValueList( "uid" ); //$NON-NLS-1$
GrantedAuthorityToString transformer4 = new GrantedAuthorityToString();
LdapSearch usernamesInRoleSearch2 =
new GenericLdapSearch( getContextSource(), paramFactory2, transformer3, transformer4 );
Set searches = new HashSet();
searches.add( usernamesInRoleSearch );
searches.add( usernamesInRoleSearch2 );