Package org.apache.directory.server.core

Examples of org.apache.directory.server.core.OperationManager


        // Inject the referral handling into the operation context
        injectReferralControl( moveContext );

        // execute move operation
        OperationManager operationManager = service.getOperationManager();
        operationManager.move( moveContext );

        // clear the request controls and set the response controls
        requestControls = EMPTY_CONTROLS;
        responseControls = JndiUtils.toJndiControls( getDirectoryService().getLdapCodecService(),
            moveContext.getResponseControls() );
View Full Code Here


        // Inject the referral handling into the operation context
        injectReferralControl( renameContext );

        // execute rename operation
        OperationManager operationManager = service.getOperationManager();
        operationManager.rename( renameContext );

        // clear the request controls and set the response controls
        requestControls = EMPTY_CONTROLS;
        responseControls = JndiUtils.toJndiControls( getDirectoryService().getLdapCodecService(),
            renameContext.getResponseControls() );
View Full Code Here

     * @see javax.naming.Context#rebind(javax.naming.Name, java.lang.Object)
     */
    public void rebind( Name name, Object obj ) throws NamingException
    {
        Dn target = buildTarget( JndiUtils.fromName( name ) );
        OperationManager operationManager = service.getOperationManager();

        try
        {
            if ( operationManager.hasEntry( new EntryOperationContext( session, target ) ) )
            {
                doDeleteOperation( target );
            }
        }
        catch ( Exception e )
View Full Code Here

         */
        BindOperationContext opContext = doBindOperation( props.getBindDn(), props.getCredentials(),
            props.getSaslMechanism(), props.getSaslAuthId() );

        session = opContext.getSession();
        OperationManager operationManager = service.getOperationManager();
       
        if ( ! operationManager.hasEntry( new EntryOperationContext( session, dn ) ) )
        {
            throw new NameNotFoundException( I18n.err( I18n.ERR_490, dn ) );
        }
    }
View Full Code Here

        this.env = new Hashtable<String, Object>();
        this.env.put( PROVIDER_URL, dn.toString() );
        this.env.put( DirectoryService.JNDI_KEY, service );
        session = new DefaultCoreSession( principal, service );
        OperationManager operationManager = service.getOperationManager();
       
        if ( ! operationManager.hasEntry( new EntryOperationContext( session, dn ) ) )
        {
            throw new NameNotFoundException( I18n.err( I18n.ERR_490, dn ) );
        }
    }
View Full Code Here

        this.dn = (DN)(DN.fromName( name ).clone());
        this.env = new Hashtable<String, Object>();
        this.env.put( PROVIDER_URL, dn.toString() );
        this.env.put( DirectoryService.JNDI_KEY, service );
        this.session = session;
        OperationManager operationManager = service.getOperationManager();
       
        if ( ! operationManager.hasEntry( new EntryOperationContext( session, ( DN ) dn ) ) )
        {
            throw new NameNotFoundException( I18n.err( I18n.ERR_490, dn ) );
        }
    }
View Full Code Here

       
        // Inject the referral handling into the operation context
        injectReferralControl( opCtx );
       
        // execute add operation
        OperationManager operationManager = service.getOperationManager();
        operationManager.add( opCtx );
   
        // clear the request controls and set the response controls
        requestControls = EMPTY_CONTROLS;
        responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
    }
View Full Code Here

        // Inject the referral handling into the operation context
        injectReferralControl( opCtx );

        // execute delete operation
        OperationManager operationManager = service.getOperationManager();
        operationManager.delete( opCtx );

        // clear the request controls and set the response controls
        requestControls = EMPTY_CONTROLS;
        responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
    }
View Full Code Here

     * @return NamingEnumeration
     */
    protected EntryFilteringCursor doSearchOperation( DN dn, AliasDerefMode aliasDerefMode,
        ExprNode filter, SearchControls searchControls ) throws Exception
    {
        OperationManager operationManager = service.getOperationManager();
        EntryFilteringCursor results = null;
        OperationContext opContext;
       
        Object typesOnlyObj = getEnvironment().get( "java.naming.ldap.typesOnly" );
        boolean typesOnly = false;
        if( typesOnlyObj != null )
        {
            typesOnly = Boolean.parseBoolean( typesOnlyObj.toString() );
        }

        // We have to check if it's a compare operation or a search.
        // A compare operation has a OBJECT scope search, the filter must
        // be of the form (object=value) (no wildcards), and no attributes
        // should be asked to be returned.
        if ( ( searchControls.getSearchScope() == SearchControls.OBJECT_SCOPE )
            && ( ( searchControls.getReturningAttributes() != null )
                && ( searchControls.getReturningAttributes().length == 0 ) )
            && ( filter instanceof EqualityNode ) )
        {
            opContext = new CompareOperationContext( session, dn, ((EqualityNode)filter).getAttribute(), ((EqualityNode)filter).getValue() );
           
            // Inject the referral handling into the operation context
            injectReferralControl( opContext );

            // Call the operation
            boolean result = operationManager.compare( (CompareOperationContext)opContext );

            // setup the op context and populate with request controls
            opContext = new SearchOperationContext( session, dn, filter,
                searchControls );
            ((SearchOperationContext)opContext).setAliasDerefMode( aliasDerefMode );
            opContext.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
           
            ( ( SearchOperationContext ) opContext ).setTypesOnlytypesOnly );
           
            if ( result )
            {
                ServerEntry emptyEntry = new DefaultServerEntry( service.getSchemaManager(), DN.EMPTY_DN );
                return new BaseEntryFilteringCursor( new SingletonCursor<ServerEntry>( emptyEntry ), (SearchOperationContext)opContext );
            }
            else
            {
                return new BaseEntryFilteringCursor( new EmptyCursor<ServerEntry>(), (SearchOperationContext)opContext );
            }
        }
        else
        {
            // It's a Search
           
            // setup the op context and populate with request controls
            opContext = new SearchOperationContext( session, dn, filter, searchControls );
            ( ( SearchOperationContext ) opContext ).setAliasDerefMode( aliasDerefMode );
            opContext.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
            ( ( SearchOperationContext ) opContext ).setTypesOnlytypesOnly );
           
            // Inject the referral handling into the operation context
            injectReferralControl( opContext );

            // execute search operation
            results = operationManager.search( (SearchOperationContext)opContext );
        }

        // clear the request controls and set the response controls
        requestControls = EMPTY_CONTROLS;
        responseControls = JndiUtils.toJndiControls( opContext.getResponseControls() );
View Full Code Here

        // setup the op context and populate with request controls
        ListOperationContext opCtx = new ListOperationContext( session, target );
        opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );

        // execute list operation
        OperationManager operationManager = service.getOperationManager();
        EntryFilteringCursor results = operationManager.list( opCtx );

        // clear the request controls and set the response controls
        requestControls = EMPTY_CONTROLS;
        responseControls = JndiUtils.toJndiControls( opCtx.getResponseControls() );
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.OperationManager

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.