Package javax.naming.directory

Examples of javax.naming.directory.SearchResult


    int counter = 0;
    try {
      for (String ldapBase : ldapBases) {
        NamingEnumeration<SearchResult> enm = ctx.search(ldapBase, filter, ctls);
        while (enm.hasMore()) {
          SearchResult result = enm.next();
          ldapUserList.add(result.getAttributes());
          counter++;
        }
      }
    } catch (SizeLimitExceededException e) {
      log
View Full Code Here


    for (String ldapBase : ldapBases) {
      int counter = 0;
      try {
        NamingEnumeration<SearchResult> enm = ctx.search(ldapBase, "(objectClass=" + objctClass + ")", ctls);
        while (enm.hasMore()) {
          SearchResult result = enm.next();
          Attributes attrs = result.getAttributes();
          NamingEnumeration<? extends Attribute> aEnum = attrs.getAll();
          while (aEnum.hasMore()) {
            Attribute attr = aEnum.next();
            // use lowercase username
            ldapList.add(attr.get().toString().toLowerCase());
View Full Code Here

           HashMap<String, String> innerMap = new HashMap<String, String>();
          
         y++;
        
         // Next result
           SearchResult si = (SearchResult) results.next();
          
           if(si == null){
             continue;
           }
          
           // Attribute
           javax.naming.directory.Attributes attrs = si.getAttributes();
          
           if(attrs != null){
             for(int i = 0; i < attributes.size(); i++){
              
               String key = attributes.get(i);
View Full Code Here

    searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    NamingEnumeration<SearchResult> results = null;
    try {
      results = authContext.search(searchBase, searchFilter,  searchCtls);
      while (results.hasMore()) {
        SearchResult searchResult = (SearchResult) results.next();
        String cn = searchResult.getName();
        Attributes attributes = searchResult.getAttributes();
        Attribute attrib = attributes.get("uid");
       
        if (attrib != null) {
          String uid = (String) attrib.get();
          uidCnDictionary.put(uid, cn);
View Full Code Here

            NamingEnumeration answer = ctx.search(baseSearch, filter, ctls);

            while (answer.hasMore())
            {
                SearchResult sr = (SearchResult) answer.next();
                Attributes attribs = sr.getAttributes();
                Attribute attr = attribs.get("turbineGroupName");

                if (attr != null && attr.get() != null)
                {
                    Group group = getNewGroup(attr.get().toString());
View Full Code Here

            NamingEnumeration answer = ctx.search(baseSearch, filter, ctls);

            while (answer.hasMore())
            {
                SearchResult sr = (SearchResult) answer.next();
                Attributes attribs = sr.getAttributes();
                Attribute attr = attribs.get("turbineRoleName");

                if (attr != null)
                {
                    NamingEnumeration values = attr.getAll();
View Full Code Here

            NamingEnumeration answer = ctx.search(baseSearch, filter, ctls);

            while (answer.hasMore())
            {
                SearchResult sr = (SearchResult) answer.next();
                Attributes attribs = sr.getAttributes();
                Attribute attr = attribs.get("turbineRoleName");

                if (attr != null && attr.get() != null)
                {
                    Role role = getNewRole(attr.get().toString());
View Full Code Here

            NamingEnumeration answer = ctx.search(baseSearch, filter, ctls);

            while (answer.hasMore())
            {
                SearchResult sr = (SearchResult) answer.next();
                Attributes attribs = sr.getAttributes();
                Attribute attr = attribs.get("turbinePermissionName");

                if (attr != null && attr.get() != null)
                {
                    Permission perm = getNewPermission(attr.get().toString());
View Full Code Here

            NamingEnumeration answer = ctx.search(baseSearch, filter, ctls);

            while (answer.hasMore())
            {
                SearchResult sr = (SearchResult) answer.next();
                Attributes attribs = sr.getAttributes();
                Attribute attr = attribs.get("turbinePermissionName");

                if (attr != null)
                {
                    NamingEnumeration values = attr.getAll();
View Full Code Here

            NamingEnumeration answer =
                    ctx.search(userBaseSearch, filter, ctls);

            if (answer.hasMore())
            {
                SearchResult sr = (SearchResult) answer.next();
                Attributes attribs = sr.getAttributes();
                LDAPUser ldapUser = createLDAPUser();

                ldapUser.setLDAPAttributes(attribs);
                ldapUser.setTemp("turbine.user", ldapUser);
View Full Code Here

TOP

Related Classes of javax.naming.directory.SearchResult

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.