Package org.apache.directory.api.ldap.model.entry

Examples of org.apache.directory.api.ldap.model.entry.Entry


        while ( itr.hasNext() )
        {
            ldifEntry = itr.next();

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

            addMandatoryOpAt( entry );

            AddOperationContext addContext = new AddOperationContext( null, entry );
            super.add( addContext );
View Full Code Here


        {
            super.add( addContext );

            if ( contextEntry == null )
            {
                Entry entry = addContext.getEntry();

                if ( entry.getDn().equals( suffixDn ) )
                {
                    contextEntry = entry;
                }
            }
View Full Code Here

    {
        synchronized ( lock )
        {
            try
            {
                Entry modifiedEntry = super.modify( modifyContext.getDn(),
                    modifyContext.getModItems().toArray( new Modification[]
                        {} ) );

                // Remove the EntryDN
                modifiedEntry.removeAttributes( ENTRY_DN_AT );

                modifyContext.setAlteredEntry( modifiedEntry );
            }
            catch ( Exception e )
            {
View Full Code Here

    @Override
    public Entry delete( String id ) throws LdapException
    {
        synchronized ( lock )
        {
            Entry deletedEntry = super.delete( id );
            dirty = true;
            rewritePartitionData();

            return deletedEntry;
        }
View Full Code Here

                ParentIdAndRdn suffixEntry = rdnIdx.reverseLookup( suffixId );

                if ( suffixEntry != null )
                {
                    Entry entry = master.get( suffixId );

                    // Don't write the EntryDN attribute
                    entry.removeAttributes( ENTRY_DN_AT );

                    entry.setDn( suffixDn );

                    appendLdif( entry );

                    appendRecursive( suffixId, suffixEntry.getNbChildren() );
                }
View Full Code Here

        while ( cursor.next() && ( countChildren < nbSibbling ) )
        {
            IndexEntry<ParentIdAndRdn, String> element = cursor.get();
            String childId = element.getId();
            Entry entry = fetch( childId );

            // Remove the EntryDn
            entry.removeAttributes( SchemaConstants.ENTRY_DN_AT );

            appendLdif( entry );

            countChildren++;
View Full Code Here

    public void testPsearchMove() throws Exception
    {
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
        connection.bind( "uid=admin,ou=system", "secret" );
       
        Entry newOu = new DefaultEntry( "uid=persist, ou=users,ou=system" );
        newOu.add( "objectClass", "inetOrgPerson" );
        newOu.add( "cn", "persist_cn" );
        newOu.add( "sn", "persist_sn" );
       
        connection.add( newOu );
       
        SearchRequest sr = new SearchRequestImpl();
        sr.setBase( new Dn( BASE ) );
        sr.setFilter( "(objectClass=*)" );
        sr.setScope( SearchScope.SUBTREE );
       
        PersistentSearch ps = new PersistentSearchImpl();
        ps.setChangesOnly( true );
        ps.setReturnECs( true );
        ps.setCritical( true );
       
        sr.addControl( ps );
       
        final SearchCursor cursor = connection.search( sr );
       
        final List<Entry> entryList = new ArrayList<Entry>();
       
        Runnable r = new Runnable()
        {
           
            @Override
            public void run()
            {
                try
                {
                    while( cursor.next() )
                    {
                        entryList.add( cursor.getEntry() );
                    }
                }
                catch( Exception e )
                {
                    throw new RuntimeException( e );
                }
            }
        };
       
        new Thread( r ).start();
       
        connection.move( newOu.getDn(), newOu.getDn().getParent().getParent() );
        Thread.sleep( 1000 );
        assertFalse( entryList.isEmpty() );
        assertEquals( 1, entryList.size() );
        assertEquals( "uid=persist,ou=system", entryList.get( 0 ).getDn().getName() );
       
View Full Code Here

            log.info( "Cursor has been abandoned." );
            close();
            throw new OperationAbandonedException();
        }

        Entry tempResult = null;

        outer: while ( wrapped.next() )
        {
            Entry tempEntry = wrapped.get();

            if ( tempEntry == null )
            {
                // no candidate
                continue;
View Full Code Here

            log.info( "Cursor has been abandoned." );
            close();
            throw new OperationAbandonedException();
        }

        Entry tempResult = null;

        outer: while ( wrapped.previous() )
        {
            Entry entry = wrapped.get();

            if ( entry == null )
            {
                continue;
            }
View Full Code Here

        Cursor<Entry> cursor = buildCursor( exprNode );

        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        Entry entry = cursor.get();
        assertEquals( Strings.getUUID( 5 ), entry.get( "entryUUID" ).getString() );
        assertEquals( "JOhnny WAlkeR", entry.get( "cn" ).getString() );

        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        entry = cursor.get();
        assertEquals( Strings.getUUID( 7 ), entry.get( "entryUUID" ).getString() );
        assertEquals( "Apache", entry.get( "ou" ).getString() );

        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        entry = cursor.get();
        assertEquals( Strings.getUUID( 9 ), entry.get( "entryUUID" ).getString() );
        assertEquals( "Jim Bean", entry.get( "cn" ).getString() );

        assertFalse( cursor.next() );
        cursor.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.entry.Entry

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.