com.atlassian.crowd.embedded.core
Class FilteredCrowdServiceImpl

java.lang.Object
  extended by com.atlassian.crowd.embedded.core.FilteredCrowdServiceImpl
All Implemented Interfaces:
CrowdService

public class FilteredCrowdServiceImpl
extends Object

A layer on top of CrowdService which performs group filtering. The filtered groups are treated as if they do not exist. That is, get or search operations will never return them. The only exception being addGroup(com.atlassian.crowd.embedded.api.Group) which throws an OperationNotPermittedException} when a filtered group is added. Note that this implementation assumes there is no children groups under the filtered groups.


Field Summary
protected  CrowdService crowdService
           
 
Constructor Summary
FilteredCrowdServiceImpl(CrowdService crowdService, FilteredGroupsProvider groupProvider)
           
 
Method Summary
 Group addGroup(Group group)
           
 boolean addGroupToGroup(Group childGroup, Group parentGroup)
           
 User addUser(User user, String credential)
           
 boolean addUserToGroup(User user, Group group)
           
 User authenticate(String name, String credential)
           
 Group getGroup(String name)
           
 GroupWithAttributes getGroupWithAttributes(String name)
           
 User getUser(String name)
           
 UserWithAttributes getUserWithAttributes(String name)
           
 boolean isGroupDirectGroupMember(Group childGroup, Group parentGroup)
           
 boolean isGroupMemberOfGroup(Group childGroup, Group parentGroup)
           
 boolean isGroupMemberOfGroup(String childGroupName, String parentGroupName)
           
 boolean isUserDirectGroupMember(User user, Group group)
           
 boolean isUserMemberOfGroup(String userName, String groupName)
           
 boolean isUserMemberOfGroup(User user, Group group)
           
 void removeAllGroupAttributes(Group group)
           
 void removeAllUserAttributes(User user)
           
 boolean removeGroup(Group group)
           
 void removeGroupAttribute(Group group, String attributeName)
           
 boolean removeGroupFromGroup(Group childGroup, Group parentGroup)
           
 boolean removeUser(User user)
           
 void removeUserAttribute(User user, String attributeName)
           
 boolean removeUserFromGroup(User user, Group group)
           
 User renameUser(User user, String newUsername)
           
<T> Iterable<T>
search(Query<T> query)
           
 Iterable<User> searchUsersAllowingDuplicateNames(Query<User> query)
           
 void setGroupAttribute(Group group, String attributeName, Set<String> attributeValues)
           
 void setGroupAttribute(Group group, String attributeName, String attributeValue)
           
 void setUserAttribute(User user, String attributeName, Set<String> attributeValues)
           
 void setUserAttribute(User user, String attributeName, String attributeValue)
           
 Group updateGroup(Group group)
           
 User updateUser(User user)
           
 void updateUserCredential(User user, String credential)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crowdService

protected final CrowdService crowdService
Constructor Detail

FilteredCrowdServiceImpl

public FilteredCrowdServiceImpl(CrowdService crowdService,
                                FilteredGroupsProvider groupProvider)
Method Detail

getGroup

public Group getGroup(String name)
Specified by:
getGroup in interface CrowdService

getGroupWithAttributes

public GroupWithAttributes getGroupWithAttributes(String name)
Specified by:
getGroupWithAttributes in interface CrowdService

search

public <T> Iterable<T> search(Query<T> query)
Specified by:
search in interface CrowdService

isUserMemberOfGroup

public boolean isUserMemberOfGroup(String userName,
                                   String groupName)
Specified by:
isUserMemberOfGroup in interface CrowdService

isUserMemberOfGroup

public boolean isUserMemberOfGroup(User user,
                                   Group group)
Specified by:
isUserMemberOfGroup in interface CrowdService

isGroupMemberOfGroup

public boolean isGroupMemberOfGroup(String childGroupName,
                                    String parentGroupName)
Specified by:
isGroupMemberOfGroup in interface CrowdService

isGroupMemberOfGroup

public boolean isGroupMemberOfGroup(Group childGroup,
                                    Group parentGroup)
Specified by:
isGroupMemberOfGroup in interface CrowdService

addGroup

public Group addGroup(Group group)
               throws InvalidGroupException,
                      OperationNotPermittedException,
                      OperationFailedException
Specified by:
addGroup in interface CrowdService
Throws:
InvalidGroupException
OperationNotPermittedException
OperationFailedException

updateGroup

public Group updateGroup(Group group)
                  throws GroupNotFoundException,
                         InvalidGroupException,
                         OperationNotPermittedException,
                         OperationFailedException
Specified by:
updateGroup in interface CrowdService
Throws:
GroupNotFoundException
InvalidGroupException
OperationNotPermittedException
OperationFailedException

setGroupAttribute

public void setGroupAttribute(Group group,
                              String attributeName,
                              String attributeValue)
                       throws GroupNotFoundException,
                              OperationNotPermittedException,
                              OperationFailedException
Specified by:
setGroupAttribute in interface CrowdService
Throws:
GroupNotFoundException
OperationNotPermittedException
OperationFailedException

setGroupAttribute

public void setGroupAttribute(Group group,
                              String attributeName,
                              Set<String> attributeValues)
                       throws GroupNotFoundException,
                              OperationNotPermittedException,
                              OperationFailedException
Specified by:
setGroupAttribute in interface CrowdService
Throws:
GroupNotFoundException
OperationNotPermittedException
OperationFailedException

removeGroupAttribute

public void removeGroupAttribute(Group group,
                                 String attributeName)
                          throws GroupNotFoundException,
                                 OperationNotPermittedException,
                                 OperationFailedException
Specified by:
removeGroupAttribute in interface CrowdService
Throws:
GroupNotFoundException
OperationNotPermittedException
OperationFailedException

removeAllGroupAttributes

public void removeAllGroupAttributes(Group group)
                              throws GroupNotFoundException,
                                     OperationNotPermittedException,
                                     OperationFailedException
Specified by:
removeAllGroupAttributes in interface CrowdService
Throws:
GroupNotFoundException
OperationNotPermittedException
OperationFailedException

removeGroup

public boolean removeGroup(Group group)
                    throws OperationNotPermittedException,
                           OperationFailedException
Specified by:
removeGroup in interface CrowdService
Throws:
OperationNotPermittedException
OperationFailedException

addUserToGroup

public boolean addUserToGroup(User user,
                              Group group)
                       throws GroupNotFoundException,
                              UserNotFoundException,
                              OperationNotPermittedException,
                              OperationFailedException
Specified by:
addUserToGroup in interface CrowdService
Throws:
GroupNotFoundException
UserNotFoundException
OperationNotPermittedException
OperationFailedException

addGroupToGroup

public boolean addGroupToGroup(Group childGroup,
                               Group parentGroup)
                        throws GroupNotFoundException,
                               OperationNotPermittedException,
                               InvalidMembershipException,
                               OperationFailedException
Specified by:
addGroupToGroup in interface CrowdService
Throws:
GroupNotFoundException
OperationNotPermittedException
InvalidMembershipException
OperationFailedException

removeUserFromGroup

public boolean removeUserFromGroup(User user,
                                   Group group)
                            throws GroupNotFoundException,
                                   UserNotFoundException,
                                   OperationNotPermittedException,
                                   OperationFailedException
Specified by:
removeUserFromGroup in interface CrowdService
Throws:
GroupNotFoundException
UserNotFoundException
OperationNotPermittedException
OperationFailedException

removeGroupFromGroup

public boolean removeGroupFromGroup(Group childGroup,
                                    Group parentGroup)
                             throws GroupNotFoundException,
                                    OperationNotPermittedException,
                                    OperationFailedException
Specified by:
removeGroupFromGroup in interface CrowdService
Throws:
GroupNotFoundException
OperationNotPermittedException
OperationFailedException

isUserDirectGroupMember

public boolean isUserDirectGroupMember(User user,
                                       Group group)
                                throws OperationFailedException
Specified by:
isUserDirectGroupMember in interface CrowdService
Throws:
OperationFailedException

isGroupDirectGroupMember

public boolean isGroupDirectGroupMember(Group childGroup,
                                        Group parentGroup)
                                 throws OperationFailedException
Specified by:
isGroupDirectGroupMember in interface CrowdService
Throws:
OperationFailedException

authenticate

public User authenticate(String name,
                         String credential)
                  throws FailedAuthenticationException,
                         OperationFailedException
Specified by:
authenticate in interface CrowdService
Throws:
FailedAuthenticationException
OperationFailedException

getUser

public User getUser(String name)
Specified by:
getUser in interface CrowdService

getUserWithAttributes

public UserWithAttributes getUserWithAttributes(String name)
Specified by:
getUserWithAttributes in interface CrowdService

addUser

public User addUser(User user,
                    String credential)
             throws InvalidUserException,
                    InvalidCredentialException,
                    OperationNotPermittedException,
                    OperationFailedException
Specified by:
addUser in interface CrowdService
Throws:
InvalidUserException
InvalidCredentialException
OperationNotPermittedException
OperationFailedException

updateUser

public User updateUser(User user)
                throws UserNotFoundException,
                       InvalidUserException,
                       OperationNotPermittedException,
                       OperationFailedException
Specified by:
updateUser in interface CrowdService
Throws:
UserNotFoundException
InvalidUserException
OperationNotPermittedException
OperationFailedException

renameUser

public User renameUser(User user,
                       String newUsername)
                throws UserNotFoundException,
                       InvalidUserException,
                       OperationNotPermittedException,
                       OperationFailedException
Specified by:
renameUser in interface CrowdService
Throws:
UserNotFoundException
InvalidUserException
OperationNotPermittedException
OperationFailedException

updateUserCredential

public void updateUserCredential(User user,
                                 String credential)
                          throws UserNotFoundException,
                                 InvalidCredentialException,
                                 OperationNotPermittedException,
                                 OperationFailedException
Specified by:
updateUserCredential in interface CrowdService
Throws:
UserNotFoundException
InvalidCredentialException
OperationNotPermittedException
OperationFailedException

setUserAttribute

public void setUserAttribute(User user,
                             String attributeName,
                             String attributeValue)
                      throws UserNotFoundException,
                             OperationNotPermittedException,
                             OperationFailedException
Specified by:
setUserAttribute in interface CrowdService
Throws:
UserNotFoundException
OperationNotPermittedException
OperationFailedException

setUserAttribute

public void setUserAttribute(User user,
                             String attributeName,
                             Set<String> attributeValues)
                      throws UserNotFoundException,
                             OperationNotPermittedException,
                             OperationFailedException
Specified by:
setUserAttribute in interface CrowdService
Throws:
UserNotFoundException
OperationNotPermittedException
OperationFailedException

removeUserAttribute

public void removeUserAttribute(User user,
                                String attributeName)
                         throws UserNotFoundException,
                                OperationNotPermittedException,
                                OperationFailedException
Specified by:
removeUserAttribute in interface CrowdService
Throws:
UserNotFoundException
OperationNotPermittedException
OperationFailedException

removeAllUserAttributes

public void removeAllUserAttributes(User user)
                             throws UserNotFoundException,
                                    OperationNotPermittedException,
                                    OperationFailedException
Specified by:
removeAllUserAttributes in interface CrowdService
Throws:
UserNotFoundException
OperationNotPermittedException
OperationFailedException

removeUser

public boolean removeUser(User user)
                   throws OperationNotPermittedException,
                          OperationFailedException
Specified by:
removeUser in interface CrowdService
Throws:
OperationNotPermittedException
OperationFailedException

searchUsersAllowingDuplicateNames

public Iterable<User> searchUsersAllowingDuplicateNames(Query<User> query)
Specified by:
searchUsersAllowingDuplicateNames in interface CrowdService


Copyright © 2014 Atlassian. All Rights Reserved.