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

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


        SearchScope.ONELEVEL, "*", "+" );
    int count = 0;

    while ( cursor.next() )
    {
        Entry entry = cursor.get();
        assertNotNull( entry );
        count++;
    }

    assertEquals( 2, count );
View Full Code Here


    EntryCursor cursor = connection.search( "ou=system", "(sn=Emmanuel L\u00E9charny)", SearchScope.ONELEVEL,
        "*", "+" );

    assertTrue( cursor.next() );

    Entry entry = cursor.get();
    assertNotNull( entry );
    assertTrue( entry.contains( "cn", "elecharny" ) );
    assertTrue( entry.contains( "sn", "Emmanuel L\u00E9charny" ) );

    cursor.close();
}
View Full Code Here

            "(publicKey=\\30\\5C\\30\\0D\\06\\09\\2A\\86\\48\\86\\F7\\0D\\01\\01\\01\\05\\00\\03\\4B\\00\\30\\48\\02\\41\\00\\A6\\C7\\9C\\B1\\6C\\E4\\DD\\8F\\1E\\4D\\20\\93\\22\\3F\\83\\75\\DE\\21\\D8\\F1\\9D\\63\\80\\5B\\94\\55\\6A\\9E\\33\\59\\9B\\8D\\63\\88\\0D\\18\\7D\\4C\\85\\F1\\CF\\54\\77\\32\\E9\\61\\0C\\A2\\8F\\B3\\6B\\15\\34\\5E\\1F\\88\\BF\\A0\\73\\AC\\86\\BB\\D0\\85\\02\\03\\01\\00\\01)",
            SearchScope.SUBTREE, "publicKey" );

    assertTrue( cursor.next() );

    Entry entry = cursor.get();
    assertNotNull( entry.get( "publicKey" ) );

    cursor.close();
}
View Full Code Here

    connection.loadSchema();
    EntryCursor cursor = connection.search( "ou=system", "(cn=user1)", SearchScope.SUBTREE, "publicKey" );

    assertTrue( cursor.next() );

    Entry entry = cursor.get();
    assertEquals( "cn=user1,ou=system", entry.getDn().getName() );

    cursor.close();

    SearchRequest req = new SearchRequestImpl();
    req.setScope( SearchScope.SUBTREE );
    req.addAttributes( "*" );
    req.setTimeLimit( 0 );
    req.setBase( new Dn( "ou=system" ) );
    req.setFilter( "(cn=user1)" );

    SearchCursor searchCursor = connection.search( req );

    assertTrue( searchCursor.next() );

    Response response = searchCursor.get();

    Entry resultEntry = ( ( SearchResultEntry ) response ).getEntry();
    assertEquals( "cn=user1,ou=system", resultEntry.getDn().getName() );

    cursor.close();
}
View Full Code Here

            if( verbose )
            {
                System.out.println( "inserting into the server " + nc.getConfig().getLdapHost() + ":" + nc.getConfig().getLdapPort() );
            }
           
            Entry e = createEntry( count.incrementAndGet() );
            if ( inject( nc, e ) )
            {
                injected.add( e.getDn() );
            }
        }
       
        compareEntries( injected );
    }
View Full Code Here

        LdapNetworkConnection nc = connections.get( 0 );
       
        for( Rdn rdn : parentDn.getRdns() )
        {
            currentDn = new Dn( rdn.getName() + "," + currentDn.getName() );
            Entry e = new DefaultEntry( currentDn.getName(),
            "objectclass: top",
            "objectclass: organizationalUnit",
            "ou: " + rdn.getAva().getValue().getString() );
            nc.add( e );
        }
View Full Code Here

    public void compareEntries( List<Dn> injected )
    {
        for( Dn dn : injected )
        {
            Entry baseEntry = null;
            Iterator<LdapNetworkConnection> itr = connections.iterator();
            LdapNetworkConnection c = itr.next();
            baseEntry = lookupWithWait( c, dn );
           
            while( itr.hasNext() )
            {
                c = itr.next();
                Entry replicaEntry = lookupWithWait( c, dn );
                boolean equal = baseEntry.equals( replicaEntry );
                if( !equal )
                {
                    System.out.println( "base entry: " + baseEntry );
                    System.out.println( "replica entry: " + replicaEntry );
View Full Code Here

    {
        try
        {
            String cn = RDN_PREFIX + num;
            Dn personDn = new Dn( "cn=" + cn + "," + REPL_AREA_SUFFIX );
            Entry person = new DefaultEntry(
                personDn.toString(),
                "ObjectClass: top",
                "ObjectClass: person",
                "cn: " + cn,
                "sn: sn_" + cn,
View Full Code Here

            t1.join();
            t2.join();
           
            cc.prepareConnections();

            Entry ctxEntry = new DefaultEntry( "dc=example,dc=com",
                "objectClass: domain",
                "objectClass: top",
                "dc: example" );

            for( LdapConnection lc : cc.connections )
            {
                lc.add( ctxEntry );
            }

            Entry replAreaEntry = new DefaultEntry( REPL_AREA_SUFFIX,
                "objectClass: organizationalunit",
                "ou: replicationarea" );

            cc.injectAndWaitTillReplicates( replAreaEntry );
           
            cc.moveOutOfReplAreaAndCompare();
           
            cc.addAndCompare();
           
            List<Dn> modified = cc.modify();
            Thread.sleep( 15000 );
           
            cc.compareEntries( modified );
           
            Entry groupEntry = new DefaultEntry( "ou=groups," + REPL_AREA_SUFFIX,
                "objectClass: organizationalUnit",
                "objectClass: top",
                "ou: groups" );
           
            cc.injectAndWaitTillReplicates( groupEntry );
           
            cc.moveAndCompare( groupEntry.getDn() );
           
            List<Dn> renamed = cc.renameAndCompare( groupEntry.getDn() );
           
            cc.deleteAndVerify( renamed );
        }
        catch( Exception e )
        {
View Full Code Here

                    System.out.println(ds.getInstanceLayout().getInstanceDirectory());
                    Dn configDn = new Dn( ds.getSchemaManager(), "ads-replConsumerId=localhost,ou=system" );
                    consumer.getConfig().setConfigEntryDn( configDn );

                    Entry provConfigEntry = new DefaultEntry( ds.getSchemaManager(), configDn,
                        "objectClass: ads-replConsumer",
                        "ads-replConsumerId: localhost",
                        "ads-searchBaseDN", consumer.getConfig().getBaseDn(),
                        "ads-replProvHostName", consumer.getConfig().getRemoteHost(),
                        "ads-replProvPort", String.valueOf( consumer.getConfig().getRemotePort() ),
                        "ads-replRefreshInterval", String.valueOf( consumer.getConfig().getRefreshInterval() ),
                        "ads-replRefreshNPersist", String.valueOf( consumer.getConfig().isRefreshNPersist() ),
                        "ads-replSearchScope", consumer.getConfig().getSearchScope().getLdapUrlValue(),
                        "ads-replSearchFilter", consumer.getConfig().getFilter(),
                        "ads-replSearchSizeLimit", String.valueOf( consumer.getConfig().getSearchSizeLimit() ),
                        "ads-replSearchTimeOut", String.valueOf( consumer.getConfig().getSearchTimeout() ),
                        "ads-replUserDn", consumer.getConfig().getReplUserDn(),
                        "ads-replUserPassword", consumer.getConfig().getReplUserPassword() );

                    provConfigEntry.put( "ads-replAliasDerefMode", consumer.getConfig().getAliasDerefMode()
                        .getJndiValue() );
                    provConfigEntry.put( "ads-replAttributes", consumer.getConfig().getAttributes() );

                    CoreSession consumerSession = peer1Server.getDirectoryService().getAdminSession();
                    consumerSession.add( provConfigEntry );
                }
                catch ( Exception e )
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.