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

Examples of org.apache.directory.ldap.client.api.message.SearchResultEntry


    {
        Cursor<SearchResponse> results = reusableAdminCon.search( rdn.getName(), "(objectClass=*)", SearchScope.ONELEVEL, "*" );

        while ( results.next() )
        {
            SearchResultEntry result = ( SearchResultEntry ) results.get();
            DN childRdn = result.getEntry().getDn();
            recursivelyDelete( childRdn );
        }

        results.close();
        reusableAdminCon.delete( rdn );
View Full Code Here


        }

        assertEquals( 10, counter );
        recursivelyDelete( base );
        //noinspection EmptyCatchBlock
        SearchResultEntry entry = ( SearchResultEntry ) connection.lookup( base.getName() );
        assertNull( entry );
    }
View Full Code Here

     * @throws Exception if the search fails w/ exception other than no permission
     */
    private SearchResultEntry checkCanSearhSubentryAs( String uid, String password, DN dn ) throws Exception
    {
        LdapConnection userCtx = getConnectionAs( new DN( "uid=" + uid + ",ou=users,ou=system" ), password );
        SearchResultEntry result = null;
        Cursor<SearchResponse> list = null;

        list = userCtx.search( dn.getName(), "(objectClass=*)", SearchScope.OBJECT, "*" );
        if ( list.next() )
        {
View Full Code Here

        // get a context as the user and try a lookup of a non-existant entry under ou=groups,ou=system
        LdapConnection userCtx = getConnectionAs( "uid=billyd,ou=users,ou=system", "billyd" );

        // we should not see ou=groups,ou=system for the remaining name
        SearchResultEntry entry = ( SearchResultEntry ) userCtx.lookup( "cn=blah,ou=groups" );
        assertNull( entry );

        // now delete and replace subentry with one that does not excluse ou=groups,ou=system
        deleteAccessControlSubentry( "selectiveDiscloseOnError" );
        createAccessControlSubentry( "selectiveDiscloseOnError", "{ " + "identificationTag \"searchAci\", "
View Full Code Here

        entry.add( SchemaConstants.ENTRY_CSN_AT, csn.toString() );
       
        con.add( entry );

        // Analyze entry and description attribute
        SearchResultEntry resp = ( SearchResultEntry ) con.lookup( dn, "*", "+" );
        Entry addedEntry = resp.getEntry();
        assertNotNull( addedEntry );

        EntryAttribute attr = addedEntry.get( SchemaConstants.ENTRY_UUID_AT );
        assertNotNull( attr );
       
View Full Code Here

    LdapConnection connection = LDAPConnectionUtil.openConnection(connectionParams);
    try {
      Cursor<SearchResponse> cursor = connection.search(GROUP_ENTRY, searchQuery.toString(), SearchScope.ONELEVEL, "*");
      while (cursor.next()) {
        Group group = new GroupEntity();
        SearchResultEntry response = (SearchResultEntry) cursor.get();
        Iterator<EntryAttribute> itEntry = response.getEntry().iterator();
        while(itEntry.hasNext()) {
          EntryAttribute attribute = itEntry.next();
          String key = attribute.getId();
          if("cn".equalsIgnoreCase(key)) {
            group.setId(attribute.getString());
View Full Code Here

    try {
      Cursor<SearchResponse> cursor = connection.search(GROUP_ENTRY, "(uniqueMember= uid=" + userId
          + "," + USER_ENTRY + ")", SearchScope.ONELEVEL, "*");
      while (cursor.next()) {
        Group group = new GroupEntity();
        SearchResultEntry response = (SearchResultEntry) cursor.get();
        Iterator<EntryAttribute> itEntry = response.getEntry().iterator();
        while(itEntry.hasNext()) {
          EntryAttribute attribute = itEntry.next();
          String key = attribute.getId();
          if("cn".equalsIgnoreCase(key)) {
            group.setId(attribute.getString());
View Full Code Here

    LdapConnection connection = LDAPConnectionUtil.openConnection(connectionParams);
    try {
      Cursor<SearchResponse> cursor = connection.search(USER_GROUP, searchQuery.toString(), SearchScope.ONELEVEL, "*");
      while (cursor.next()) {
        User user = new UserEntity();
        SearchResultEntry response = (SearchResultEntry) cursor.get();
        Iterator<EntryAttribute> itEntry = response.getEntry().iterator();
        while(itEntry.hasNext()) {
          EntryAttribute attribute = itEntry.next();
          String key = attribute.getId();
          if("uid".equalsIgnoreCase(key)) {
            user.setId(attribute.getString());
View Full Code Here

TOP

Related Classes of org.apache.directory.ldap.client.api.message.SearchResultEntry

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.