| | |
| | | ne = attrs.getAll(); |
| | | while (ne.hasMore()) |
| | | { |
| | | Attribute attr = (Attribute)ne.next(); |
| | | Attribute attr = ne.next(); |
| | | String attrID = attr.getID(); |
| | | |
| | | if (!attrID.toLowerCase().equals( |
| | |
| | | |
| | | ne2 = dirContext.search(getInstanceKeysContainerDN(), |
| | | "(ds-cfg-key-id="+keyId+")", sc); |
| | | if (ne2.hasMore()) |
| | | boolean found = false; |
| | | while (ne2.hasMore()) |
| | | { |
| | | SearchResult certEntry = ne2.next(); |
| | | Attribute certAttr = certEntry.getAttributes().get(attrIDs[0]); |
| | | properties.put(ServerProperty.INSTANCE_PUBLIC_KEY_CERTIFICATE, |
| | | certAttr.get()); |
| | | found = true; |
| | | } |
| | | else |
| | | if (!found) |
| | | { |
| | | LOG.log(Level.WARNING, "Could not find public key for "+ |
| | | properties); |
| | |
| | | sc.setReturningAttributes(attList); |
| | | NamingEnumeration<SearchResult> ne = dirContext.search( |
| | | dnCentralAdmin, "(objectclass=*)", sc); |
| | | SearchResult sr = ne.next(); |
| | | try |
| | | { |
| | | while (ne.hasMore()) |
| | | { |
| | | SearchResult sr = ne.next(); |
| | | |
| | | currentPrivileges = sr.getAttributes().get("ds-privilege-name") |
| | | .getAll(); |
| | | currentPrivileges = sr.getAttributes().get("ds-privilege-name") |
| | | .getAll(); |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | handleCloseNamingEnumeration(ne); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | SearchControls sc = new SearchControls(); |
| | | |
| | | sc.setSearchScope(SearchControls.OBJECT_SCOPE); |
| | | result = getDirContext().search(dn, "(objectclass=*)", sc).hasMore(); |
| | | sc.setReturningAttributes(new String[] {"1.1"}); |
| | | NamingEnumeration<SearchResult> sr = |
| | | getDirContext().search(dn, "(objectclass=*)", sc); |
| | | result = false; |
| | | try |
| | | { |
| | | while (sr.hasMore()) |
| | | { |
| | | sr.next(); |
| | | result = true; |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | sr.close(); |
| | | } |
| | | } |
| | | catch (NameNotFoundException x) |
| | | { |