Package org.apache.directory.server.core.filtering

Examples of org.apache.directory.server.core.filtering.EntryFilteringCursor


            SearchOperationContext searchOperationContext = new SearchOperationContext( opContext.getSession(), baseDn,
                filter, controls );
            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );
           
            EntryFilteringCursor subentries = nexus.search( searchOperationContext );

            while ( subentries.next() )
            {
                ServerEntry candidate = subentries.get();
                DN dn = candidate.getDn();
                dn.normalize( schemaManager.getNormalizerMapping() );

                if ( evaluator.evaluate( ss, apName, dn, candidate ) )
                {
View Full Code Here


            SearchOperationContext searchOperationContext = new SearchOperationContext( opContext.getSession(), oldBaseDn,
                filter, controls );
            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );
           
            EntryFilteringCursor subentries = nexus.search( searchOperationContext );

            while ( subentries.next() )
            {
                ServerEntry candidate = subentries.get();
                DN dn = candidate.getDn();
                dn.normalize( schemaManager.getNormalizerMapping() );

                if ( evaluator.evaluate( ssOld, apName, dn, candidate ) )
                {
                    nexus.modify( new ModifyOperationContext( opContext.getSession(), dn,
                        getOperationalModsForRemove( name, candidate ) ) );
                }
            }

            // search for all selected entries by the new SS and add references to subentry
            Subentry subentry = subentryCache.getSubentry( name.toNormName() );
            ServerEntry operational = getSubentryOperatationalAttributes( name, subentry );
            DN newBaseDn = ( DN ) apName.clone();
            newBaseDn.addAll( ssNew.getBase() );
           
            searchOperationContext = new SearchOperationContext( opContext.getSession(), newBaseDn,
                filter, controls );
            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );
           
            subentries = nexus.search( searchOperationContext );
           
            while ( subentries.next() )
            {
                ServerEntry candidate = subentries.get();
                DN dn = candidate.getDn();
                dn.normalize( schemaManager.getNormalizerMapping() );

                if ( evaluator.evaluate( ssNew, apName, dn, candidate ) )
                {
View Full Code Here

            returningAttributes.add( new AttributeTypeOptions( passwordAT) );
            bindDn = (String)ldapSession.getSaslProperty( SaslConstants.SASL_USER_BASE_DN );
           
            DN baseDn = new DN( bindDn );

            EntryFilteringCursor cursor = adminSession.search(
                baseDn,
                SearchScope.SUBTREE,
                filter,
                AliasDerefMode.DEREF_ALWAYS,
                returningAttributes );
           
            cursor.beforeFirst();
           
            ClonedServerEntry entry = null;
           
            while ( cursor.next() )
            {
                entry = cursor.get();
                LdapPrincipal ldapPrincipal = new LdapPrincipal(
                    entry.getDn(),
                    AuthenticationLevel.STRONG,
                    entry.get( SchemaConstants.USER_PASSWORD_AT ).getBytes() );
                ldapSession.putSaslProperty( SaslConstants.SASL_AUTHENT_USER, ldapPrincipal );
View Full Code Here

    public EntryFilteringCursor search( InternalSearchRequest searchRequest ) throws Exception
    {
        SearchOperationContext opContext = new SearchOperationContext( this, searchRequest );
        OperationManager operationManager = directoryService.getOperationManager();
        EntryFilteringCursor cursor = operationManager.search( opContext );
        searchRequest.getResultResponse().addAll( opContext.getResponseControls() );
       
        return cursor;
    }
View Full Code Here

    }


    public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws Exception
    {
        EntryFilteringCursor cursor = nextInterceptor.search( opContext );

        if ( opContext.getSession().getDirectoryService().isAccessControlEnabled() )
        {
            return cursor;
        }

        cursor.addEntryFilter( new EntryFilter() {
            public boolean accept( SearchingOperationContext operation, ClonedServerEntry result ) throws Exception
            {
                return DefaultAuthorizationInterceptor.this.isSearchable( operation, result );
            }
        } );
View Full Code Here

    }


    public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws Exception
    {
        EntryFilteringCursor cursor = nextInterceptor.list( opContext );
       
        if ( opContext.getSession().getDirectoryService().isAccessControlEnabled() )
        {
            return cursor;
        }

        cursor.addEntryFilter( new EntryFilter()
        {
            public boolean accept( SearchingOperationContext operation, ClonedServerEntry entry ) throws Exception
            {
                return DefaultAuthorizationInterceptor.this.isSearchable( operation, entry );
            }
View Full Code Here

           
            SearchOperationContext searchOperationContext = new SearchOperationContext( session,
                baseDn, filter, ctls );
            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );

            EntryFilteringCursor results = nexus.search( searchOperationContext );

            while ( results.next() )
            {
                ServerEntry result = results.get();
                DN subentryDn = result.getDn().normalize( session.getDirectoryService().getSchemaManager().
                        getNormalizerMapping() );
                EntryAttribute aci = result.get( prescriptiveAciAT );

                if ( aci == null )
                {
                    LOG.warn( "Found accessControlSubentry '" + subentryDn + "' without any "
                        + SchemaConstants.PRESCRIPTIVE_ACI_AT );
                    continue;
                }

                subentryAdded( subentryDn, result );
            }

            results.close();
        }
    }
View Full Code Here

    }


    public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws Exception
    {
        EntryFilteringCursor cursor = nextInterceptor.list( opContext );
        cursor.addEntryFilter( SEARCH_FILTER );
        return cursor;
    }
View Full Code Here

    }


    public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws Exception
    {
        EntryFilteringCursor cursor = nextInterceptor.search( opContext );
        cursor.addEntryFilter( SEARCH_FILTER );
        return cursor;
    }
View Full Code Here


    public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext opContext )
        throws Exception
    {
        EntryFilteringCursor cursor = nextInterceptor.list( opContext );
        cursor.addEntryFilter( binaryAttributeFilter );
        return cursor;
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.filtering.EntryFilteringCursor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.