|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.integration.atlassianuser.AbstractCrowdGroupManager com.atlassian.crowd.integration.atlassianuser.DirectCrowdGroupManager
public class DirectCrowdGroupManager
Crowd implementation of the atlassian-user group manager.
A group manager is responsible for all CRUD operations on groups and group memberships in a given repository. Where an operation requires aGroup
as an argument, calling the
method with a group from another repository will typically throw an
IllegalArgumentException
.
The group manager is responsible for ensuring the consistency of the underlying
repository where relevant. For example, if membership information needs to be
updated as part of the removeGroup(Group)
operation, the group manager
is responsible for ensuring it happens.
This interface is an extension of the EntityManager
interface which
is common to user and group management. The common functionality includes
initialisation and access to the repository description.
Field Summary | |
---|---|
protected com.atlassian.crowd.service.client.CrowdClient |
crowdClient
|
Constructor Summary | |
---|---|
DirectCrowdGroupManager(com.atlassian.user.repository.RepositoryIdentifier repositoryIdentifier)
|
|
DirectCrowdGroupManager(com.atlassian.user.repository.RepositoryIdentifier repositoryIdentifier,
com.atlassian.crowd.service.client.CrowdClient crowdClient)
Controls the Group management in Crowd |
Method Summary | |
---|---|
void |
addMembership(com.atlassian.user.Group group,
com.atlassian.user.User user)
Adds the user to the specified group. |
com.atlassian.user.Group |
createGroup(java.lang.String name)
Create a new group with the specified name. |
com.atlassian.user.Group |
getGroup(java.lang.String name)
Retrieves the group with the given name. |
com.atlassian.user.search.page.Pager |
getGroups()
Retrieves all groups in this repository. |
com.atlassian.user.search.page.Pager |
getGroups(com.atlassian.user.User user)
Retrieves the groups to which the given user belongs. |
com.atlassian.user.search.page.Pager |
getMemberNames(com.atlassian.user.Group group)
Retrieves the names of all members of the specified group. |
boolean |
hasMembership(com.atlassian.user.Group group,
com.atlassian.user.User user)
Returns true if the user is a member of the specified group. |
void |
removeGroup(com.atlassian.user.Group group)
Remove the group specified, if it exists in this repository. |
void |
removeMembership(com.atlassian.user.Group group,
com.atlassian.user.User user)
Removes the user from the specified group. |
Methods inherited from class com.atlassian.crowd.integration.atlassianuser.AbstractCrowdGroupManager |
---|
getExternalMemberNames, getIdentifier, getLocalMemberNames, getRepository, isCreative, isReadOnly, supportsExternalMembership |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final com.atlassian.crowd.service.client.CrowdClient crowdClient
Constructor Detail |
---|
public DirectCrowdGroupManager(com.atlassian.user.repository.RepositoryIdentifier repositoryIdentifier, com.atlassian.crowd.service.client.CrowdClient crowdClient)
repositoryIdentifier
- repository ID.crowdClient
- group and user manager.public DirectCrowdGroupManager(com.atlassian.user.repository.RepositoryIdentifier repositoryIdentifier)
Method Detail |
---|
public com.atlassian.user.search.page.Pager getGroups() throws com.atlassian.user.EntityException
Pager
containing a Group
for each group managed
by the repository. An empty pager will be returned if the repository does
not contain any groups.
com.atlassian.user.EntityException
public com.atlassian.user.search.page.Pager getGroups(com.atlassian.user.User user) throws com.atlassian.user.EntityException
Pager
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.
com.atlassian.user.EntityException
public com.atlassian.user.search.page.Pager getMemberNames(com.atlassian.user.Group group) throws com.atlassian.user.EntityException
Pager
containing a String
with the name of each
member of the group. An empty pager will be returned if the group has no
members.
com.atlassian.user.EntityException
public com.atlassian.user.Group getGroup(java.lang.String name) throws com.atlassian.user.EntityException
null
if the
group does not exist in this repository.
Group
or null if the group does not exist.
com.atlassian.user.EntityException
public com.atlassian.user.Group createGroup(java.lang.String name) throws com.atlassian.user.EntityException
com.atlassian.user.EntityException
- if the Group
could not be created.
java.lang.UnsupportedOperationException
- if AbstractCrowdGroupManager.isCreative()
returns falsepublic void removeGroup(com.atlassian.user.Group group) throws com.atlassian.user.EntityException
IllegalArgumentException
will be thrown.
If required to maintain the consistency of the repository, the group manager
should remove users from the group before removing the group itself.
com.atlassian.user.EntityException
- if the Group
could not be removed.
java.lang.UnsupportedOperationException
- if AbstractCrowdGroupManager.isReadOnly(Group)
returns true.public void addMembership(com.atlassian.user.Group group, com.atlassian.user.User user) throws com.atlassian.user.EntityException
AbstractCrowdGroupManager.supportsExternalMembership()
returns true
, the user will be added as an external user.
java.lang.UnsupportedOperationException
- if AbstractCrowdGroupManager.isReadOnly(Group)
returns true.
com.atlassian.user.EntityException
public boolean hasMembership(com.atlassian.user.Group group, com.atlassian.user.User user) throws com.atlassian.user.EntityException
AbstractCrowdGroupManager.supportsExternalMembership()
returns true
, external members will be checked as well.
com.atlassian.user.EntityException
public void removeMembership(com.atlassian.user.Group group, com.atlassian.user.User user) throws com.atlassian.user.EntityException
com.atlassian.user.EntityException
- if the membership could not be removed.
java.lang.UnsupportedOperationException
- if AbstractCrowdGroupManager.isReadOnly(Group)
returns true.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |