|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.user.impl.delegation.DelegatingGroupManager
public class DelegatingGroupManager
| Constructor Summary | |
|---|---|
DelegatingGroupManager(List<GroupManager> groupManagers)
|
|
| Method Summary | |
|---|---|
void |
addMembership(Group group,
User user)
Adds the user to the specified group. |
Group |
createGroup(String groupName)
Create a new group with the specified name. |
Pager<String> |
getExternalMemberNames(Group group)
Retrieves the names of those members of the specified group which are stored in another repository. |
Group |
getGroup(String groupName)
Retrieves the group with the given name. |
List<GroupManager> |
getGroupManagers()
|
Pager<Group> |
getGroups()
Retrieves all groups in this repository. |
Pager<Group> |
getGroups(User user)
Retrieves the groups to which the given user belongs. |
RepositoryIdentifier |
getIdentifier()
|
Pager<String> |
getLocalMemberNames(Group group)
Retrieves the names of those members of the specified group which are also stored in this repository. |
Pager<String> |
getMemberNames(Group group)
Retrieves the names of all members of the specified group. |
RepositoryIdentifier |
getRepository(Entity entity)
Don't use for now. |
List<Group> |
getWritableGroups()
Gets all editable groups. |
boolean |
hasMembership(Group group,
User user)
Check whether this manager has a record of membership between the argued user and group. |
boolean |
isCreative()
Used to detemine whether an entity can be created (eg, can call UserManager.createUser(String) or
GroupManager.createGroup(String) |
boolean |
isReadOnly(Group group)
Returns true if the specified group and membership of the
specified group cannot be modified in the repository. |
void |
removeGroup(Group group)
Removes the specified group, if it is present. |
void |
removeMembership(Group group,
User user)
Removes the user from the specified group. |
boolean |
supportsExternalMembership()
Returns true if the repository supports users in other
repositories being members of groups in this repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DelegatingGroupManager(List<GroupManager> groupManagers)
| Method Detail |
|---|
public List<GroupManager> getGroupManagers()
GroupManagers which this manager delegates to,
in the order of delegation.
public Pager<Group> getGroups()
throws EntityException
GroupManager
getGroups in interface GroupManagerPager containing a Group for each group managed
by the repository. An empty pager will be returned if the repository does
not contain any groups.
EntityException
public Pager<Group> getGroups(User user)
throws EntityException
GroupManager
getGroups in interface GroupManagerPager containing a Group for each group the user
belongs to. An empty pager will be returned if the user does not belong to
any groups that this manager knows about.
EntityExceptionpublic List<Group> getWritableGroups()
GroupManager
getWritableGroups in interface GroupManagerGroups that can be edited.
public Pager<String> getMemberNames(Group group)
throws EntityException
GroupManagerCollator.getInstance().
getMemberNames in interface GroupManagerPager containing a String with the name of each
member of the group. An empty pager will be returned if the group has no
members.
EntityException
public Pager<String> getLocalMemberNames(Group group)
throws EntityException
GroupManagerCollator.getInstance().
If GroupManager.supportsExternalMembership() returns false, this
call is equivalent to GroupManager.getMemberNames(Group).
getLocalMemberNames in interface GroupManagerPager containing a String with the name of each
member of the group which is stored in the same repository. An empty pager
will be returned if the group has no local members.
EntityException
public Pager<String> getExternalMemberNames(Group group)
throws EntityException
GroupManagerCollator.getInstance().
If GroupManager.supportsExternalMembership() returns false, this
method throws UnsupportedOperationException.
getExternalMemberNames in interface GroupManagerPager containing a String with the name of each
member of the group which is stored in a different repository. An empty pager
will be returned if the group has no external members.
EntityException
public Group getGroup(String groupName)
throws EntityException
GroupManagernull if the
group does not exist in this repository.
getGroup in interface GroupManagerGroup or null if the group does not exist.
EntityException
public Group createGroup(String groupName)
throws EntityException
GroupManager
createGroup in interface GroupManagerDuplicateEntityException - if a group with the provided name already exists.
EntityException - if the Group could not be created.
public void removeGroup(Group group)
throws EntityException
removeGroup in interface GroupManagerEntityException - - representing the exception which prohibited removal
public void addMembership(Group group,
User user)
throws EntityException
GroupManagerGroupManager.supportsExternalMembership()
returns true, the user will be added as an external user.
addMembership in interface GroupManagerEntityException
public boolean hasMembership(Group group,
User user)
throws EntityException
hasMembership in interface GroupManagerRepositoryException
EntityException
public void removeMembership(Group group,
User user)
throws EntityException
GroupManager
removeMembership in interface GroupManagerEntityException - if the membership could not be removed.
public boolean supportsExternalMembership()
throws EntityException
GroupManagertrue if the repository supports users in other
repositories being members of groups in this repository.
Typically this is true of an application-specific Hibernate repository, but
not of a company's LDAP server. It is designed to allow the LDAP users to
be members of the application's groups for flexible application-level
security.
supportsExternalMembership in interface GroupManagerRepositoryIdentifier,
otherwise false.
EntityException
public boolean isReadOnly(Group group)
throws EntityException
GroupManagertrue if the specified group and membership of the
specified group cannot be modified in the repository.
If this returns true, invoking methods which attempt to
modify the group or membership of the group will fail with
UnsupportedOperationException.
isReadOnly in interface GroupManagerEntityExceptionpublic RepositoryIdentifier getIdentifier()
getIdentifier in interface EntityManagerRepositoryIdentifier which is managed by this instance.
public RepositoryIdentifier getRepository(Entity entity)
throws EntityException
getRepository in interface EntityManagerRepositoryIdentifier in which the entity is stored, otherwise null.
EntityExceptionpublic boolean isCreative()
UserManager.createUser(String) or
GroupManager.createGroup(String)
isCreative in interface EntityManagerEntity objects can be created by this manager, or false to indicate
not.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||