Code example for SearchControls

Methods: setReturningAttributessetSearchScope

0
     * @return all operational attributes of the subschemaSubentry 
     * @throws NamingException if there are problems accessing this entry 
     */ 
    private Attributes getSubschemaSubentryAttributes() throws ExceptionSearchControls controls = new SearchControls();
        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
        controls.setReturningAttributes( new String[]
            { "+", "*" } ); 
 
        NamingEnumeration<SearchResult> results = getRootContext( getService() ).search( getSubschemaSubentryDN(),
            "(objectClass=*)", controls );
        SearchResult result = results.next();
        results.close();
        return result.getAttributes();
    } 
 
 
    /** 
     * Get's the subschemaSubentry attribute value from the rootDSE. 
Experience pair programming with AI  Get Codota for Java