public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter, SearchControls searchCtls ) throws NamingException { return nexus.search( base, env, filter, searchCtls ); }
/** * @see javax.naming.Context#listBindings(javax.naming.Name) */ public NamingEnumeration listBindings( Name name ) throws NamingException { // Conduct a special one level search at base for all objects LdapDN base = buildTarget( name ); PresenceNode filter = new PresenceNode( "objectClass" ); SearchControls ctls = new SearchControls(); ctls.setSearchScope( SearchControls.ONELEVEL_SCOPE ); return nexusProxy.search( base, getEnvironment(), filter, ctls ); }
/** * Checks to see if an entry being renamed has a descendant that is an * administrative point. * * @param name the name of the entry which is used as the search base * @return true if name is an administrative point or one of its descendants * are, false otherwise * @throws NamingException if there are errors while searching the directory */ private boolean hasAdministrativeDescendant( LdapDN name ) throws NamingException { ExprNode filter = new PresenceNode( "administrativeRole" ); SearchControls controls = new SearchControls(); controls.setSearchScope( SearchControls.SUBTREE_SCOPE ); NamingEnumeration aps = nexus.search( name, factoryCfg.getEnvironment(), filter, controls ); if ( aps.hasMore() ) { aps.close(); return true; } return false; }
private void initialize() throws NamingException { // search all naming contexts for access control subentenries // generate ACITuple Arrays for each subentry // add that subentry to the hash Iterator suffixes = nexus.listSuffixes(); while ( suffixes.hasNext() ) { String suffix = ( String ) suffixes.next(); LdapDN baseDn = parseNormalized( suffix ); ExprNode filter = new SimpleNode( OC_ATTR, ACSUBENTRY_OC, SimpleNode.EQUALITY ); SearchControls ctls = new SearchControls(); ctls.setSearchScope( SearchControls.SUBTREE_SCOPE ); NamingEnumeration results = nexus.search( baseDn, env, filter, ctls ); while ( results.hasMore() ) { SearchResult result = ( SearchResult ) results.next(); String subentryDn = result.getName(); Attribute aci = result.getAttributes().get( ACI_ATTR ); if ( aci == null ) { log.warn( "Found accessControlSubentry '" + subentryDn + "' without any " + ACI_ATTR ); continue; } LdapDN normName = parseNormalized( subentryDn ); subentryAdded( subentryDn, normName, result.getAttributes() ); } results.close(); } }
/** * A search overload that is used for optimizing search handling in the * LDAP protocol provider which deals with an ExprNode instance rather than * a String for the filter. * * @param name the relative name of the object serving as the search base * @param filter the search filter as an expression tree * @param cons the search controls to use * @return an enumeration over the SearchResults * @throws NamingException if there are problems performing the search */ public NamingEnumeration search( Name name, ExprNode filter, SearchControls cons ) throws NamingException { /*Name newName = new LdapDN( name.toString() ); newName = LdapDN.oidToName( newName, DnOidContainer.getOids() ); Name target = buildTarget( ((LdapDN)newName).toLdapName() );*/ LdapDN target = buildTarget( name ); return getNexusProxy().search( target, getEnvironment(), filter, cons ); }
SearchControls ctls = new SearchControls(); ctls.setSearchScope( SearchControls.SUBTREE_SCOPE ); NamingEnumeration results = nexus.search( baseDn, env, filter, ctls );
/** * @see javax.naming.directory.DirContext#search(javax.naming.Name, * java.lang.String, javax.naming.directory.SearchControls) */ public NamingEnumeration search( Name name, String filter, SearchControls cons ) throws NamingException { ExprNode filterNode; LdapDN target = buildTarget( name ); try { filterNode = filterParser.parse( filter ); } catch ( ParseException pe ) { InvalidSearchFilterException isfe = new InvalidSearchFilterException( "Encountered parse exception while parsing the filter: '" + filter + "'" ); isfe.setRootCause( pe ); throw isfe; } catch ( IOException ioe ) { NamingException ne = new NamingException( "Parser failed with IO exception on filter: '" + filter + "'" ); ne.setRootCause( ioe ); throw ne; } return getNexusProxy().search( target, getEnvironment(), filterNode, cons ); }
addReferrals( nexus.search( suffix, env, getReferralFilter(), getControls() ), suffix );
NamingEnumeration subentries = nexus.search( suffix, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() )
new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService ); EntryFilteringCursor cursor = nexus.search( new SearchOperationContext( adminSession, contextName, AliasDerefMode.DEREF_ALWAYS, filter, ctrl ) );
{ "+", "*" } ); NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() )
controls.setReturningAttributes( new String[] { "+", "*" } ); NamingEnumeration subentries = nexus.search( oldBaseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() ) LdapDN newBaseDn = ( LdapDN ) apName.clone(); newBaseDn.addAll( ssNew.getBase() ); subentries = nexus.search( newBaseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() )
controls.setReturningAttributes( new String[] { "+", "*" } ); NamingEnumeration subentries = nexus.search( oldBaseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() ) LdapDN newBaseDn = ( LdapDN ) apName.clone(); newBaseDn.addAll( ssNew.getBase() ); subentries = nexus.search( newBaseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() )
controls.setReturningAttributes( new String[] { "+", "*" } ); NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() )
{ "+", "*" } ); NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() )
controls.setSearchScope( SearchControls.SUBTREE_SCOPE ); controls.setReturningAttributes( new String[] { "+", "*" } ); NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() )
controls.setSearchScope( SearchControls.SUBTREE_SCOPE ); controls.setReturningAttributes( new String[] { "+", "*" } ); NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() )
new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), ctx.getDirectoryService() ); EntryFilteringCursor cursor = ctx.getDirectoryService().getPartitionNexus().search( new SearchOperationContext( adminSession, contextName, AliasDerefMode.DEREF_ALWAYS, new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), ctrl ) );
new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), ds ); EntryFilteringCursor cursor = nexus.search( new SearchOperationContext( adminSession, oldName, AliasDerefMode.DEREF_ALWAYS, new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), ctrl ) );