use of org.platformlayer.service.openldap.ops.ldap.OrganizationalRoleLdapEntry in project platformlayer by platformlayer.
the class LdapDomainController method addChildren.
@Override
protected void addChildren() throws OpsException {
LdapDomain ldapDomain = OpsContext.get().getInstance(LdapDomain.class);
String hostName = ldapDomain.organizationName;
LdapDN ldapBase = LdapServerUtilities.createBaseDN(hostName);
File dataRoot = new File("/var/ldap/data");
File dataDir = new File(dataRoot, hostName);
String ldapBaseOrganization = hostName;
ManagedFilesystemItem directory = ManagedDirectory.build(dataDir, "0700").setGroup("openldap").setOwner("openldap");
addChild(directory);
HdbDatabaseEntry db = buildDatabase(ldapBase, dataDir, hostName);
addChild(db);
OrganizationLdapEntry organization = buildOrganization(ldapBase, ldapBaseOrganization);
organization.setTop(true);
addChild(organization);
String ldapAdminPassword = LdapPasswords.getLdapPasswordEncoded(ldapDomain.adminPassword.plaintext());
OrganizationalRoleLdapEntry organizationalRole = buildOrganizationalRole(ldapBase, LdapAttributes.MANAGER_CN, "LDAP Administrator", ldapAdminPassword);
addChild(organizationalRole);
OrganizationalUnitLdapEntry users = buildOrganizationUnit(ldapBase, LdapAttributes.LDAP_USERS_CONTAINER_OU, "Users");
addChild(users);
OrganizationalUnitLdapEntry groups = buildOrganizationUnit(ldapBase, LdapAttributes.LDAP_GROUPS_CONTAINER_OU, "Groups");
addChild(groups);
}
use of org.platformlayer.service.openldap.ops.ldap.OrganizationalRoleLdapEntry in project platformlayer by platformlayer.
the class LdapDomainController method buildOrganizationalRole.
private OrganizationalRoleLdapEntry buildOrganizationalRole(LdapDN ldapBase, String cn, String description, String userPassword) {
OrganizationalRoleLdapEntry entry = OrganizationalRoleLdapEntry.build(cn, ldapBase);
entry.setDescription(description);
entry.setUserPasssword(userPassword);
entry.setOnlyConfigureOnForce(true);
return entry;
}
Aggregations