X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fuseradmin%2FLdifGroup.java;h=80bff59472a7799ca5fdd1ada85ebd91215ac2cb;hb=4672ec9d1071dffc7c591f623898d32a31637d04;hp=f4e558348194c0ae336bf11c11370bc2deca3cbf;hpb=9f729eeb8255a9d800ad2506735dda8cc215a135;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java b/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java index f4e558348..80bff5947 100644 --- a/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java +++ b/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java @@ -5,6 +5,7 @@ import java.util.List; 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; @@ -12,7 +13,7 @@ import javax.naming.ldap.LdapName; 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) { @@ -73,7 +74,7 @@ class LdifGroup extends LdifUser implements DirectoryGroup { 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); } @@ -107,8 +108,8 @@ class LdifGroup extends LdifUser implements DirectoryGroup { 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); } } @@ -121,4 +122,31 @@ class LdifGroup extends LdifUser implements DirectoryGroup { 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); + } + + } }