Package org.apache.directory.server.core.interceptor.context

Examples of org.apache.directory.server.core.interceptor.context.DeleteOperationContext


     * @param target
     */
    protected void doDeleteOperation( DN target ) throws Exception
    {
        // setup the op context and populate with request controls
        DeleteOperationContext opCtx = new DeleteOperationContext( session, target );

        opCtx.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );

        // 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


    /**
     * {@inheritDoc}
     */
    public void delete( DN dn, LogChange log ) throws Exception
    {
        DeleteOperationContext opContext = new DeleteOperationContext( this, dn );

        opContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.delete( opContext );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void delete( DN dn, boolean ignoreReferral, LogChange log ) throws Exception
    {
        DeleteOperationContext opContext = new DeleteOperationContext( this, dn );
       
        opContext.setLogChange( log );
        setReferralHandling( opContext, ignoreReferral );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.delete( opContext );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void delete( InternalDeleteRequest deleteRequest, LogChange log ) throws Exception
    {
        DeleteOperationContext opContext = new DeleteOperationContext( this, deleteRequest );
       
        opContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.delete( opContext );
        deleteRequest.getResultResponse().addAll( opContext.getResponseControls() );
    }
View Full Code Here

        entry3.put( "dc", "test2" );
        addCtx.setEntry( entry3 );
       
        partition.add( addCtx );
       
        DeleteOperationContext delCtx = new DeleteOperationContext( session );

        DN dn = new DN( "dc=test1,dc=test,ou=test,ou=system" );
        dn.normalize( schemaManager.getNormalizerMapping() );
       
        delCtx.setDn( dn );
       
        partition.delete( delCtx );

        assertTrue( new File( wkdir, "ou=test,ou=system" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system.ldif" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system/dc=test" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system/dc=test.ldif" ).exists() );
        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test1" ).exists() );
        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test1.ldif" ).exists() );
        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test2" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system/dc=test/dc=test2.ldif" ).exists() );

        dn = new DN( "dc=test2,dc=test,ou=test,ou=system" );
        dn.normalize( schemaManager.getNormalizerMapping() );
       
        delCtx.setDn( dn );
       
        partition.delete( delCtx );

        assertTrue( new File( wkdir, "ou=test,ou=system" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system.ldif" ).exists() );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void delete( DN dn, LogChange log ) throws Exception
    {
        DeleteOperationContext opContext = new DeleteOperationContext( this, dn );

        opContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.delete( opContext );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void delete( DN dn, boolean ignoreReferral, LogChange log ) throws Exception
    {
        DeleteOperationContext opContext = new DeleteOperationContext( this, dn );
       
        opContext.setLogChange( log );
        setReferralHandling( opContext, ignoreReferral );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.delete( opContext );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void delete( InternalDeleteRequest deleteRequest, LogChange log ) throws Exception
    {
        DeleteOperationContext opContext = new DeleteOperationContext( this, deleteRequest );
       
        opContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.delete( opContext );
        deleteRequest.getResultResponse().addAll( opContext.getResponseControls() );
    }
View Full Code Here

        entryMvrdn.put( "dc", "mvrdn" );
        addCtx.setEntry( entryMvrdn );

        partition.add( addCtx );

        DeleteOperationContext delCtx = new DeleteOperationContext( session );

        Dn dn = new Dn( schemaManager, "dc=test1,dc=test,ou=test,ou=system" );

        delCtx.setDn( dn );

        partition.delete( delCtx );

        assertTrue( new File( wkdir, "ou=test,ou=system" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system.ldif" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system/dc=test" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system/dc=test.ldif" ).exists() );
        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test1" ).exists() );
        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test1.ldif" ).exists() );
        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test2" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system/dc=test/dc=test2.ldif" ).exists() );
        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=mvrdn%2bobjectclass=domain" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system/dc=test/dc=mvrdn%2bobjectclass=domain.ldif" ).exists() );

        dn = new Dn( schemaManager, "dc=test2,dc=test,ou=test,ou=system" );

        delCtx.setDn( dn );

        partition.delete( delCtx );

        dn = new Dn( schemaManager, "dc=mvrdn+objectClass=domain,dc=test,ou=test,ou=system" );

        delCtx.setDn( dn );

        partition.delete( delCtx );

        assertTrue( new File( wkdir, "ou=test,ou=system" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system.ldif" ).exists() );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void delete( Dn dn, LogChange log ) throws LdapException
    {
        DeleteOperationContext deleteContext = new DeleteOperationContext( this, dn );

        deleteContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.delete( deleteContext );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.interceptor.context.DeleteOperationContext

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.