com.atlassian.jira.user
Class MockCrowdService
java.lang.Object
com.atlassian.jira.user.MockCrowdService
- All Implemented Interfaces:
- com.atlassian.crowd.embedded.api.CrowdService
public class MockCrowdService
- extends Object
- implements com.atlassian.crowd.embedded.api.CrowdService
- Since:
- v4.1
|
Method Summary |
com.atlassian.crowd.embedded.api.Directory |
addDirectory(com.atlassian.crowd.embedded.api.Directory directory)
|
com.atlassian.crowd.embedded.api.Group |
addGroup(com.atlassian.crowd.embedded.api.Group group)
|
void |
addGroupToGroup(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup)
|
com.atlassian.crowd.embedded.api.User |
addUser(com.atlassian.crowd.embedded.api.User user,
String credential)
|
void |
addUserToGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
|
com.atlassian.crowd.embedded.api.User |
authenticate(String name,
String credential)
|
List<com.atlassian.crowd.embedded.api.Directory> |
findAllDirectories()
|
com.atlassian.crowd.embedded.api.Directory |
findDirectoryById(long directoryId)
|
com.atlassian.crowd.embedded.api.DirectorySynchronisationInformation |
getDirectorySynchronisationInformation(long directoryId)
|
com.atlassian.crowd.embedded.api.Group |
getGroup(String name)
|
com.atlassian.crowd.embedded.api.GroupWithAttributes |
getGroupWithAttributes(String name)
|
com.atlassian.crowd.embedded.api.ConnectionPoolProperties |
getStoredConnectionPoolProperties()
|
com.atlassian.crowd.embedded.api.ConnectionPoolProperties |
getSystemConnectionPoolProperties()
|
com.atlassian.crowd.embedded.api.User |
getUser(String name)
|
com.atlassian.crowd.embedded.api.UserWithAttributes |
getUserWithAttributes(String name)
|
boolean |
isDirectorySynchronisable(long directoryId)
|
boolean |
isDirectorySynchronising(long l)
|
boolean |
isGroupDirectGroupMember(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup)
|
boolean |
isGroupMemberOfGroup(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup)
|
boolean |
isGroupMemberOfGroup(String user,
String group)
|
boolean |
isUserDirectGroupMember(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
|
boolean |
isUserMemberOfGroup(String userName,
String groupName)
|
boolean |
isUserMemberOfGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
|
void |
removeAllGroupAttributes(com.atlassian.crowd.embedded.api.Group group)
|
void |
removeAllUserAttributes(com.atlassian.crowd.embedded.api.User user)
|
boolean |
removeDirectory(long directoryId)
|
boolean |
removeGroup(com.atlassian.crowd.embedded.api.Group group)
|
void |
removeGroupAttribute(com.atlassian.crowd.embedded.api.Group group,
String attributeName)
|
boolean |
removeGroupFromGroup(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup)
|
boolean |
removeUser(com.atlassian.crowd.embedded.api.User user)
|
void |
removeUserAttribute(com.atlassian.crowd.embedded.api.User user,
String key)
|
boolean |
removeUserFromGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
|
com.atlassian.crowd.embedded.api.Group |
renameGroup(String oldName,
String newName)
|
com.atlassian.crowd.embedded.api.User |
renameUser(String oldName,
String newName)
|
|
search(com.atlassian.crowd.embedded.api.Query<T> query)
|
Iterable<com.atlassian.crowd.embedded.api.User> |
searchUsersAllowingDuplicateNames(com.atlassian.crowd.embedded.api.Query<com.atlassian.crowd.embedded.api.User> userQuery)
|
void |
setConnectionPoolProperties(com.atlassian.crowd.embedded.api.ConnectionPoolProperties connectionPoolProperties)
|
void |
setDirectoryPosition(long directoryId,
int position)
|
void |
setGroupAttribute(com.atlassian.crowd.embedded.api.Group group,
String attributeName,
Set<String> attributeValues)
|
void |
setGroupAttribute(com.atlassian.crowd.embedded.api.Group group,
String attributeName,
String attributeValue)
|
void |
setUserAttribute(com.atlassian.crowd.embedded.api.User user,
String key,
Set<String> value)
|
void |
setUserAttribute(com.atlassian.crowd.embedded.api.User user,
String key,
String value)
|
void |
synchroniseDirectory(long directoryId)
|
void |
testConnection(com.atlassian.crowd.embedded.api.Directory directory)
|
com.atlassian.crowd.embedded.api.Directory |
updateDirectory(com.atlassian.crowd.embedded.api.Directory directory)
|
com.atlassian.crowd.embedded.api.Group |
updateGroup(com.atlassian.crowd.embedded.api.Group group)
|
com.atlassian.crowd.embedded.api.User |
updateUser(com.atlassian.crowd.embedded.api.User user)
|
void |
updateUserCredential(com.atlassian.crowd.embedded.api.User user,
String credential)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
users
protected Map<String,com.atlassian.crowd.embedded.api.User> users
credentials
protected Map<String,com.atlassian.crowd.embedded.api.PasswordCredential> credentials
userAttributes
protected Map<String,Map<String,Set<String>>> userAttributes
groups
protected Map<String,com.atlassian.crowd.embedded.api.Group> groups
groupMembers
protected Map<String,List<com.atlassian.crowd.embedded.api.User>> groupMembers
MockCrowdService
public MockCrowdService()
addUser
public com.atlassian.crowd.embedded.api.User addUser(com.atlassian.crowd.embedded.api.User user,
String credential)
throws com.atlassian.crowd.exception.InvalidUserException,
com.atlassian.crowd.exception.InvalidCredentialException
- Specified by:
addUser in interface com.atlassian.crowd.embedded.api.CrowdService
- Throws:
com.atlassian.crowd.exception.InvalidUserException
com.atlassian.crowd.exception.InvalidCredentialException
updateUser
public com.atlassian.crowd.embedded.api.User updateUser(com.atlassian.crowd.embedded.api.User user)
throws com.atlassian.crowd.exception.InvalidUserException
- Specified by:
updateUser in interface com.atlassian.crowd.embedded.api.CrowdService
- Throws:
com.atlassian.crowd.exception.InvalidUserException
renameUser
public com.atlassian.crowd.embedded.api.User renameUser(String oldName,
String newName)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.InvalidUserException
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.InvalidUserException
updateUserCredential
public void updateUserCredential(com.atlassian.crowd.embedded.api.User user,
String credential)
throws com.atlassian.crowd.exception.InvalidCredentialException
- Specified by:
updateUserCredential in interface com.atlassian.crowd.embedded.api.CrowdService
- Throws:
com.atlassian.crowd.exception.InvalidCredentialException
setUserAttribute
public void setUserAttribute(com.atlassian.crowd.embedded.api.User user,
String key,
String value)
- Specified by:
setUserAttribute in interface com.atlassian.crowd.embedded.api.CrowdService
setUserAttribute
public void setUserAttribute(com.atlassian.crowd.embedded.api.User user,
String key,
Set<String> value)
- Specified by:
setUserAttribute in interface com.atlassian.crowd.embedded.api.CrowdService
removeUserAttribute
public void removeUserAttribute(com.atlassian.crowd.embedded.api.User user,
String key)
- Specified by:
removeUserAttribute in interface com.atlassian.crowd.embedded.api.CrowdService
removeAllUserAttributes
public void removeAllUserAttributes(com.atlassian.crowd.embedded.api.User user)
- Specified by:
removeAllUserAttributes in interface com.atlassian.crowd.embedded.api.CrowdService
removeUser
public boolean removeUser(com.atlassian.crowd.embedded.api.User user)
- Specified by:
removeUser in interface com.atlassian.crowd.embedded.api.CrowdService
addGroup
public com.atlassian.crowd.embedded.api.Group addGroup(com.atlassian.crowd.embedded.api.Group group)
- Specified by:
addGroup in interface com.atlassian.crowd.embedded.api.CrowdService
updateGroup
public com.atlassian.crowd.embedded.api.Group updateGroup(com.atlassian.crowd.embedded.api.Group group)
- Specified by:
updateGroup in interface com.atlassian.crowd.embedded.api.CrowdService
renameGroup
public com.atlassian.crowd.embedded.api.Group renameGroup(String oldName,
String newName)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.InvalidGroupException
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.InvalidGroupException
setGroupAttribute
public void setGroupAttribute(com.atlassian.crowd.embedded.api.Group group,
String attributeName,
String attributeValue)
- Specified by:
setGroupAttribute in interface com.atlassian.crowd.embedded.api.CrowdService
setGroupAttribute
public void setGroupAttribute(com.atlassian.crowd.embedded.api.Group group,
String attributeName,
Set<String> attributeValues)
- Specified by:
setGroupAttribute in interface com.atlassian.crowd.embedded.api.CrowdService
removeGroupAttribute
public void removeGroupAttribute(com.atlassian.crowd.embedded.api.Group group,
String attributeName)
- Specified by:
removeGroupAttribute in interface com.atlassian.crowd.embedded.api.CrowdService
removeAllGroupAttributes
public void removeAllGroupAttributes(com.atlassian.crowd.embedded.api.Group group)
- Specified by:
removeAllGroupAttributes in interface com.atlassian.crowd.embedded.api.CrowdService
removeGroup
public boolean removeGroup(com.atlassian.crowd.embedded.api.Group group)
- Specified by:
removeGroup in interface com.atlassian.crowd.embedded.api.CrowdService
addUserToGroup
public void addUserToGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
- Specified by:
addUserToGroup in interface com.atlassian.crowd.embedded.api.CrowdService
addGroupToGroup
public void addGroupToGroup(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup)
- Specified by:
addGroupToGroup in interface com.atlassian.crowd.embedded.api.CrowdService
removeUserFromGroup
public boolean removeUserFromGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
- Specified by:
removeUserFromGroup in interface com.atlassian.crowd.embedded.api.CrowdService
removeGroupFromGroup
public boolean removeGroupFromGroup(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup)
- Specified by:
removeGroupFromGroup in interface com.atlassian.crowd.embedded.api.CrowdService
isUserDirectGroupMember
public boolean isUserDirectGroupMember(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
- Specified by:
isUserDirectGroupMember in interface com.atlassian.crowd.embedded.api.CrowdService
isGroupDirectGroupMember
public boolean isGroupDirectGroupMember(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup)
- Specified by:
isGroupDirectGroupMember in interface com.atlassian.crowd.embedded.api.CrowdService
addDirectory
public com.atlassian.crowd.embedded.api.Directory addDirectory(com.atlassian.crowd.embedded.api.Directory directory)
testConnection
public void testConnection(com.atlassian.crowd.embedded.api.Directory directory)
findAllDirectories
public List<com.atlassian.crowd.embedded.api.Directory> findAllDirectories()
findDirectoryById
public com.atlassian.crowd.embedded.api.Directory findDirectoryById(long directoryId)
updateDirectory
public com.atlassian.crowd.embedded.api.Directory updateDirectory(com.atlassian.crowd.embedded.api.Directory directory)
setDirectoryPosition
public void setDirectoryPosition(long directoryId,
int position)
removeDirectory
public boolean removeDirectory(long directoryId)
isDirectorySynchronisable
public boolean isDirectorySynchronisable(long directoryId)
synchroniseDirectory
public void synchroniseDirectory(long directoryId)
authenticate
public com.atlassian.crowd.embedded.api.User authenticate(String name,
String credential)
throws com.atlassian.crowd.exception.InactiveAccountException,
com.atlassian.crowd.exception.FailedAuthenticationException
- Specified by:
authenticate in interface com.atlassian.crowd.embedded.api.CrowdService
- Throws:
com.atlassian.crowd.exception.InactiveAccountException
com.atlassian.crowd.exception.FailedAuthenticationException
getUser
public com.atlassian.crowd.embedded.api.User getUser(String name)
- Specified by:
getUser in interface com.atlassian.crowd.embedded.api.CrowdService
getUserWithAttributes
public com.atlassian.crowd.embedded.api.UserWithAttributes getUserWithAttributes(String name)
- Specified by:
getUserWithAttributes in interface com.atlassian.crowd.embedded.api.CrowdService
getGroup
public com.atlassian.crowd.embedded.api.Group getGroup(String name)
- Specified by:
getGroup in interface com.atlassian.crowd.embedded.api.CrowdService
getGroupWithAttributes
public com.atlassian.crowd.embedded.api.GroupWithAttributes getGroupWithAttributes(String name)
- Specified by:
getGroupWithAttributes in interface com.atlassian.crowd.embedded.api.CrowdService
search
public <T> Iterable<T> search(com.atlassian.crowd.embedded.api.Query<T> query)
- Specified by:
search in interface com.atlassian.crowd.embedded.api.CrowdService
isUserMemberOfGroup
public boolean isUserMemberOfGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group)
- Specified by:
isUserMemberOfGroup in interface com.atlassian.crowd.embedded.api.CrowdService
isUserMemberOfGroup
public boolean isUserMemberOfGroup(String userName,
String groupName)
- Specified by:
isUserMemberOfGroup in interface com.atlassian.crowd.embedded.api.CrowdService
isGroupMemberOfGroup
public boolean isGroupMemberOfGroup(String user,
String group)
- Specified by:
isGroupMemberOfGroup in interface com.atlassian.crowd.embedded.api.CrowdService
isGroupMemberOfGroup
public boolean isGroupMemberOfGroup(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup)
- Specified by:
isGroupMemberOfGroup in interface com.atlassian.crowd.embedded.api.CrowdService
isDirectorySynchronising
public boolean isDirectorySynchronising(long l)
getDirectorySynchronisationInformation
public com.atlassian.crowd.embedded.api.DirectorySynchronisationInformation getDirectorySynchronisationInformation(long directoryId)
setConnectionPoolProperties
public void setConnectionPoolProperties(com.atlassian.crowd.embedded.api.ConnectionPoolProperties connectionPoolProperties)
getStoredConnectionPoolProperties
public com.atlassian.crowd.embedded.api.ConnectionPoolProperties getStoredConnectionPoolProperties()
getSystemConnectionPoolProperties
public com.atlassian.crowd.embedded.api.ConnectionPoolProperties getSystemConnectionPoolProperties()
searchUsersAllowingDuplicateNames
public Iterable<com.atlassian.crowd.embedded.api.User> searchUsersAllowingDuplicateNames(com.atlassian.crowd.embedded.api.Query<com.atlassian.crowd.embedded.api.User> userQuery)
- Specified by:
searchUsersAllowingDuplicateNames in interface com.atlassian.crowd.embedded.api.CrowdService
Copyright © 2002-2011 Atlassian. All Rights Reserved.