public void add( String upId, AttributeType attributeType, byte[]... values ) throws LdapException { clonedEntry.add( attributeType, values ); }
public void add( String upId, AttributeType attributeType, String... values ) throws LdapException { clonedEntry.add( attributeType, values ); }
private void addAccessControlAttributes(ServerEntry serverEntry) throws LdapException { serverEntry.add("administrativeRole", "accessControlSpecificArea"); }
public void add( AttributeType attributeType, String... values ) throws LdapException { clonedEntry.add( attributeType, values ); }
public void add( String upId, byte[]... values ) throws LdapException { clonedEntry.add( upId, values ); }
public void add( AttributeType attributeType, byte[]... values ) throws LdapException { clonedEntry.add( attributeType, values ); }
public void add( AttributeType attributeType, Value<?>... values ) throws LdapException { clonedEntry.add( attributeType, values ); }
public void add( String upId, AttributeType attributeType, Value<?>... values ) throws LdapException { clonedEntry.add( attributeType, values ); }
public void add( EntryAttribute... attributes ) throws LdapException { clonedEntry.add( attributes ); }
public void add( String upId, String... values ) throws LdapException { clonedEntry.add( upId, values ); }
public void add( String upId, Value<?>... values ) throws LdapException { clonedEntry.add( upId, values ); }
/** * * adds a given <i>ServerEntry</i> to the store after injecting entryCSN and entryUUID operational * attributes * * @param store the store * @param dn the normalized DN * @param entry the server entry * @throws Exception in case of any problems in adding the entry to the store */ public static void injectEntryInStore( Store<ServerEntry, Long> store, ServerEntry entry ) throws Exception { entry.add( SchemaConstants.ENTRY_CSN_AT, CSN_FACTORY.newInstance().toString() ); entry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() ); store.add( entry ); } }
private static void addObjectClasses(ServerEntry serverEntry, List<String> objectClasses) throws DirectoryServerException { for (String objectClass : objectClasses) { try { serverEntry.add("objectClass", objectClass); } catch (LdapException e) { throwDirectoryServerException("Could not add class to partition " + serverEntry.getDn().getName(), e); } } }
private void addPartitionAttributes(String partitionDN, List<String> objectClasses, String realm, String dc) throws DirectoryServerException { try { DN adminDN = new DN(partitionDN); ServerEntry serverEntry = this.directoryService.newEntry(adminDN); addObjectClasses(serverEntry, objectClasses); serverEntry.add("o", realm); if (dc == null) { logger.warn("Domain component not found for partition with DN - " + partitionDN + ". Not setting domain component."); } else { serverEntry.add("dc", dc); } addAccessControlAttributes(serverEntry); this.directoryService.getAdminSession().add(serverEntry); } catch (Exception e) { String msg = "Could not add partition attributes for partition - " + partitionDN; throwDirectoryServerException(msg, e); } }
private void addGroupStoreToPartition(String partitionSuffixDn) throws DirectoryServerException { ServerEntry groupsEntry; try { DN groupsDN = new DN("ou=Groups," + partitionSuffixDn); groupsEntry = this.directoryService.newEntry(groupsDN); groupsEntry.add("objectClass", "organizationalUnit", "top"); groupsEntry.add("ou", "Groups"); this.directoryService.getAdminSession().add(groupsEntry); } catch (NamingException e) { String msg = "Could not add group store to partition - " + partitionSuffixDn + ". Cause - partition domain name is not valid."; throwDirectoryServerException(msg, e); } catch (LdapException e) { String msg = "Could not add group store to partition - " + partitionSuffixDn; throwDirectoryServerException(msg, e); } catch (Exception e) { String msg = "Could not add group store to partition admin session. - " + partitionSuffixDn; throwDirectoryServerException(msg, e); } }
private void addSharedGroupToPartition(String partitionSuffixDn) throws DirectoryServerException { ServerEntry groupsEntry; try { DN groupsDN = new DN("ou=SharedGroups," + partitionSuffixDn); groupsEntry = this.directoryService.newEntry(groupsDN); groupsEntry.add("objectClass", "organizationalUnit", "top"); groupsEntry.add("ou", "SharedGroups"); this.directoryService.getAdminSession().add(groupsEntry); } catch (NamingException e) { String msg = "Could not add shared group store to partition - " + partitionSuffixDn + ". Cause - partition domain name is not valid."; throwDirectoryServerException(msg, e); } catch (LdapException e) { String msg = "Could not add shared group store to partition - " + partitionSuffixDn; throwDirectoryServerException(msg, e); } catch (Exception e) { String msg = "Could not add shared group store to partition admin session. - " + partitionSuffixDn; throwDirectoryServerException(msg, e); } }
private void addUserStoreToPartition(String partitionSuffixDn) throws DirectoryServerException { try { DN usersDN = new DN("ou=Users," + partitionSuffixDn); ServerEntry usersEntry = this.directoryService.newEntry(usersDN); usersEntry.add("objectClass", "organizationalUnit", "top"); usersEntry.add("ou", "Users"); this.directoryService.getAdminSession().add(usersEntry); } catch (LdapInvalidDnException e) { String msg = "Could not add user store to partition - " + partitionSuffixDn + ". Cause - partition domain name is not valid."; throwDirectoryServerException(msg, e); } catch (LdapException e) { String msg = "Could not add user store to partition - " + partitionSuffixDn; throwDirectoryServerException(msg, e); } catch (NamingException e) { String msg = "Could not add user store to partition - " + partitionSuffixDn + ". Cause - partition domain name is not valid."; throwDirectoryServerException(msg, e); } catch (Exception e) { String msg = "Could not add user store to partition admin session. - " + partitionSuffixDn; throwDirectoryServerException(msg, e); } }
public ServerEntry createGroupEntry(DN dn) { ServerEntry groupEntry = m_EntryCache.get(dn.getName()); if (groupEntry == null) { try { //1. Obtain from crowd RDN rdn = dn.getRdn(2); String group = rdn.getNormValue(); Group g = m_CrowdClient.getGroup(group); List<String> users = m_CrowdClient.getNamesOfUsersOfGroup(group, 0, Integer.MAX_VALUE); groupEntry = new DefaultServerEntry( m_SchemaManager, dn ); groupEntry.put(SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.GROUP_OF_NAMES_OC); groupEntry.put(SchemaConstants.CN_AT, g.getName()); groupEntry.put("description", g.getDescription()); for (String u : users) { DN mdn = new DN(String.format("dn=%s,%s", u, CROWD_USERS_DN)); groupEntry.add(SchemaConstants.MEMBER_AT, mdn.getName()); } m_EntryCache.put(dn.getName(), groupEntry); } catch (Exception ex) { log.debug("createGroupEntry()", ex); } } return groupEntry; }//createUserEntry