Package org.apache.directory.ldap.client.api

Examples of org.apache.directory.ldap.client.api.LdapConnection.search()


        assertEquals( "configuration", c_ou.getString() );

        // -------------------------------------------------------------------
        // Test searching for subtypes
        // -------------------------------------------------------------------
        EntryCursor responses = connection.search( "ou=services,ou=configuration,ou=system",
            "(ObjectClass=*)", SearchScope.OBJECT, "ou" );

        while ( responses.next() )
        {
            entry = responses.get();
View Full Code Here


        Entry personEntry = getPersonEntry( "Bush", "Kate#Bush" );
        String dn = "cn=Kate\\#Bush,ou=system";
        personEntry.setDn( new DN( dn ) );
        connection.add( personEntry );

        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(cn=Kate#Bush)", SearchScope.SUBTREE, "*" );

        boolean entryFound = false;
        while ( cursor.next() )
        {
            Entry sr = ( ( SearchResultEntry ) cursor.get() ).getEntry();
View Full Code Here

        Entry entry = getPersonEntry( "Bush", "Bush, Kate" );
        String dn = "cn=Bush\\, Kate,ou=system";
        entry.setDn( new DN( dn ) );
        connection.add( entry );

        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(cn=Bush, Kate)", SearchScope.SUBTREE, "*" );

        boolean entryFound = false;
        while ( cursor.next() )
        {
            Entry sr = ( ( SearchResultEntry ) cursor.get() ).getEntry();
View Full Code Here

        String dn = "cn=Mackie \\\"The Knife\\\" Messer,ou=system";
        entry.setDn( new DN( dn ) );
        connection.add( entry );


        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(cn=Mackie \"The Knife\" Messer)", SearchScope.SUBTREE, "*" );
        boolean entryFound = false;
        while ( cursor.next() )
        {
            Entry sr = ( ( SearchResultEntry ) cursor.get() ).getEntry();
            entryFound = true;
View Full Code Here

        Entry entry = getOrgUnitEntry( "AC\\DC" );
        String dn = "ou=AC\\\\DC,ou=system";
        entry.setDn( new DN( dn ) );
        connection.add( entry );

        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(ou=AC\\5CDC)", SearchScope.SUBTREE, "*" );
        boolean entryFound= false;
       
        while ( cursor.next() )
        {
            Entry sr = ( ( SearchResultEntry ) cursor.get() ).getEntry();
View Full Code Here

        Entry entry = getOrgUnitEntry( "East -> West" );
        String dn = "ou=East -\\> West,ou=system";
        entry.setDn( new DN( dn ) );
        connection.addentry );

        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(ou=East -> West)", SearchScope.SUBTREE, "*" );

        boolean entryFound = false;
        while ( cursor.next() )
        {
            Entry sr = ( ( SearchResultEntry ) cursor.get() ).getEntry();
View Full Code Here

        Entry entry = getOrgUnitEntry( "Scissors 8<" );
        String dn = "ou=Scissors 8\\<,ou=system";
        entry.setDn( new DN( dn ) );
        connection.addentry );

        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(ou=Scissors 8<)", SearchScope.SUBTREE, "*" );

        boolean entryFound = false;
        while ( cursor.next() )
        {
            Entry sr = ( ( SearchResultEntry ) cursor.get() ).getEntry();
View Full Code Here

        Entry entry = getOrgUnitEntry( "semicolon group;" );
        String dn = "ou=semicolon group\\;,ou=system";
        entry.setDn( new DN( dn ) );
        connection.add( entry );

        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(ou=semicolon group;)", SearchScope.SUBTREE, "*" );

        boolean entryFound = false;
        while ( cursor.next() )
        {
            Entry sr = ( ( SearchResultEntry ) cursor.get() ).getEntry();
View Full Code Here

        Entry entry = getOrgUnitEntry( "nomen=omen" );
        String dn = "ou=nomen\\=omen,ou=system";
        entry.setDn( new DN( dn ) );
        connection.add( entry );

        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(ou=nomen=omen)", SearchScope.SUBTREE, "*" );
       
        boolean entryFound = false;

        while ( cursor.next() )
        {
View Full Code Here

        System.out.println( "Delta : " + deltaWarmed + "( " + ( ( ( nbIterations - 5000 ) * 1000 ) / deltaWarmed )
            + " per s ) /" + ( t1 - t0 ) );

        int nbFound = 0;
        long t2 = System.currentTimeMillis();
        EntryCursor result = connection.search( "dc=example,dc=com", "(sn=test123*)", SearchScope.SUBTREE, "*" );

        while ( result.next() )
        {
            Entry res = result.get();

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.