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

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


     * @param target
     */
    protected void doAddOperation( Dn target, Entry entry ) throws Exception
    {
        // setup the op context and populate with request controls
        AddOperationContext opCtx = new AddOperationContext( session, entry );

        opCtx.addRequestControls( convertControls( true, requestControls ) );

        // 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( getDirectoryService().getLdapCodecService(),
            opCtx.getResponseControls() );
    }
View Full Code Here


            // Checking the context entry
            if ( suffixDn.equals( contextEntry.getDn() ) )
            {
                addMandatoryOpAt( contextEntry );
               
                AddOperationContext addContext = new AddOperationContext( null, contextEntry );
                super.add( addContext );
            }
            else
            {
                throw new LdapException( "The given LDIF file doesn't contain the context entry" );
            }

            // Iterating on all entries
            while ( itr.hasNext() )
            {
                Entry entry = new DefaultEntry( schemaManager, itr.next().getEntry() );
                addMandatoryOpAt( entry );
               
                AddOperationContext addContext = new AddOperationContext( null, contextEntry );
                super.add( addContext );
            }

            // Closing the reader
            reader.close();
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void add( Entry entry, LogChange log ) throws LdapException
    {
        AddOperationContext addContext = new AddOperationContext( this, entry );

        addContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.add( addContext );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void add( Entry entry, boolean ignoreReferral, LogChange log ) throws LdapException
    {
        AddOperationContext addContext = new AddOperationContext( this, entry );

        addContext.setLogChange( log );
        setReferralHandling( addContext, ignoreReferral );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.add( addContext );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void add( AddRequest addRequest, LogChange log ) throws LdapException
    {
        AddOperationContext addContext = new AddOperationContext( this, addRequest );

        addContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        try
        {
            operationManager.add( addContext );
        }
        catch ( LdapException e )
        {
            addRequest.getResultResponse().addAllControls( addContext.getResponseControls() );
            throw e;
        }
        addRequest.getResultResponse().addAllControls( addContext.getResponseControls() );
    }
View Full Code Here

                        String uuid = UUID.randomUUID().toString();
                        contextEntry.add( SchemaConstants.ENTRY_UUID_AT, uuid );
                    }
       
                    // And add this entry to the underlying partition
                    AddOperationContext addContext = new AddOperationContext( null, contextEntry );
                    add( addContext );
                }
            }
        }
    }
View Full Code Here

                    {
                        serverEntry.put( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
                    }

                    // call add on the wrapped partition not on the self
                    AddOperationContext addContext = new AddOperationContext( null, serverEntry );
                    super.add( addContext );
                }
            }

        }
View Full Code Here

                Entry attrs = new DefaultEntry( schemaManager, entry.getEntry() );

                if ( null == partition.getEntryId( ndn ) )
                {
                    partition.add( new AddOperationContext( null, attrs ) );
                    load();
                }
            }
        }
        catch ( NamingException e )
View Full Code Here

        attrs.add( "cn", "jane doe" );
        attrs.add( "sn", "doe" );
        attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
        attrs.add( "entryUUID", UUID.randomUUID().toString() );
       
        AddOperationContext addContext = new AddOperationContext( null, attrs );
        ((Partition)store).add( addContext );

        indexEntry.setId( 12L );
        assertTrue( evaluator.evaluate( indexEntry ) );
    }
View Full Code Here

        entry.add( "cn", "jd" );
        entry.add( "aliasedObjectName", "cn=Jack Daniels,ou=Engineering,o=Good Times Co." );
        entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
        entry.add( "entryUUID", UUID.randomUUID().toString() );

        AddOperationContext addContext = new AddOperationContext( null, entry );
        ((Partition)store).add( addContext );

        dn = new Dn( schemaManager, SchemaConstants.CN_AT_OID + "=jdoe," + SchemaConstants.OU_AT_OID + "=board of directors,"
            + SchemaConstants.O_AT_OID + "=good times co." );

        entry = new DefaultEntry( schemaManager, dn );
        entry.add( "objectClass", "person" );
        entry.add( "cn", "jdoe" );
        entry.add( "sn", "doe" );
        entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
        entry.add( "entryUUID", UUID.randomUUID().toString() );
       
        addContext = new AddOperationContext( null, entry );
        ((Partition)store).add( addContext );

        ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, new Dn( SchemaConstants.OU_AT_OID
            + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co." ), SearchScope.ONELEVEL );
        OneLevelScopeEvaluator<Entry, Long> evaluator = new OneLevelScopeEvaluator<Entry, Long>( store,
View Full Code Here

TOP

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

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.