import javax.naming.InvalidNameException;
import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.ldap.LdapName;
+import org.argeo.util.directory.FunctionalGroup;
+import org.argeo.util.directory.Organization;
+import org.argeo.util.directory.SystemPermissions;
import org.osgi.service.useradmin.Role;
/** Directory group implementation */
-class LdifGroup extends LdifUser implements DirectoryGroup {
+abstract class LdifGroup extends LdifUser implements DirectoryGroup {
private final String memberAttributeId;
LdifGroup(AbstractUserDirectory userAdmin, LdapName dn, Attributes attributes) {
for (LdapName ldapName : getMemberNames()) {
Role role = findRole(ldapName);
if (role == null) {
- throw new UserDirectoryException("Role " + ldapName + " cannot be added.");
+ throw new IllegalStateException("Role " + ldapName + " not found.");
}
directMembers.add(role);
}
roles.add(dn);
}
return roles;
- } catch (Exception e) {
- throw new UserDirectoryException("Cannot get members", e);
+ } catch (NamingException e) {
+ throw new IllegalStateException("Cannot get members", e);
}
}
public int getType() {
return GROUP;
}
+
+ /*
+ * KIND
+ */
+ static class LdifFunctionalGroup extends LdifGroup implements FunctionalGroup {
+
+ public LdifFunctionalGroup(AbstractUserDirectory userAdmin, LdapName dn, Attributes attributes) {
+ super(userAdmin, dn, attributes);
+ }
+
+ }
+
+ static class LdifOrganization extends LdifGroup implements Organization {
+
+ public LdifOrganization(AbstractUserDirectory userAdmin, LdapName dn, Attributes attributes) {
+ super(userAdmin, dn, attributes);
+ }
+
+ }
+
+ static class LdifSystemPermissions extends LdifGroup implements SystemPermissions {
+
+ public LdifSystemPermissions(AbstractUserDirectory userAdmin, LdapName dn, Attributes attributes) {
+ super(userAdmin, dn, attributes);
+ }
+
+ }
}