com.atlassian.confluence.user.crowd.jira
Class JiraJdbcRemoteDirectory
java.lang.Object
com.atlassian.confluence.user.crowd.jira.JiraJdbcRemoteDirectory
- All Implemented Interfaces:
- com.atlassian.crowd.directory.RemoteDirectory, com.atlassian.crowd.embedded.api.Attributes
public final class JiraJdbcRemoteDirectory
- extends Object
- implements com.atlassian.crowd.directory.RemoteDirectory
Crowd remote directory that connects directly to a (pre Embedded Crowd) JIRA database and reads the OSUser tables
directly. This directory should only ever be deployed behind a DbCachingRemoteDirectory as it has neither been
tested against nor optimised for direct access.
This directory is strictly read-only. Attempts to do any modifications to the directory will fail with
OperationFailedException
Method Summary |
com.atlassian.crowd.model.group.Group |
addGroup(com.atlassian.crowd.model.group.GroupTemplate group)
|
void |
addGroupToGroup(String childGroup,
String parentGroup)
|
com.atlassian.crowd.model.user.User |
addUser(com.atlassian.crowd.model.user.UserTemplate user,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
|
void |
addUserToGroup(String username,
String groupName)
|
com.atlassian.crowd.model.user.User |
authenticate(String name,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
|
com.atlassian.crowd.model.group.Group |
findGroupByName(String name)
|
com.atlassian.crowd.model.group.GroupWithAttributes |
findGroupWithAttributesByName(String name)
|
com.atlassian.crowd.model.user.User |
findUserById(long id)
|
com.atlassian.crowd.model.user.User |
findUserByName(String name)
|
com.atlassian.crowd.model.user.UserWithAttributes |
findUserWithAttributesByName(String name)
|
com.atlassian.crowd.directory.RemoteDirectory |
getAuthoritativeDirectory()
|
String |
getDescriptiveName()
|
long |
getDirectoryId()
|
Set<String> |
getKeys()
|
Iterable<com.atlassian.crowd.model.group.Membership> |
getMemberships()
|
String |
getValue(String key)
|
Set<String> |
getValues(String key)
|
boolean |
isEmpty()
|
boolean |
isGroupDirectGroupMember(String childGroup,
String parentGroup)
|
boolean |
isRolesDisabled()
|
boolean |
isUserDirectGroupMember(String username,
String groupName)
|
void |
removeGroup(String name)
|
void |
removeGroupAttributes(String groupName,
String attributeName)
|
void |
removeGroupFromGroup(String childGroup,
String parentGroup)
|
void |
removeUser(String name)
|
void |
removeUserAttributes(String username,
String attributeName)
|
void |
removeUserFromGroup(String username,
String groupName)
|
com.atlassian.crowd.model.group.Group |
renameGroup(String oldName,
String newName)
|
com.atlassian.crowd.model.user.User |
renameUser(String oldName,
String newName)
|
|
searchGroupRelationships(com.atlassian.crowd.search.query.membership.MembershipQuery<T> query)
|
|
searchGroups(com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
|
|
searchUsers(com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
|
void |
setAttributes(Map<String,String> attributes)
|
void |
setDirectoryId(long directoryId)
|
void |
storeGroupAttributes(String groupName,
Map<String,Set<String>> attributes)
|
void |
storeUserAttributes(String username,
Map<String,Set<String>> attributes)
|
boolean |
supportsInactiveAccounts()
|
boolean |
supportsNestedGroups()
|
void |
testConnection()
|
com.atlassian.crowd.model.group.Group |
updateGroup(com.atlassian.crowd.model.group.GroupTemplate group)
|
com.atlassian.crowd.model.user.User |
updateUser(com.atlassian.crowd.model.user.UserTemplate user)
|
void |
updateUserCredential(String username,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JIRAJDBC_DATASOURCE_URL_KEY
public static final String JIRAJDBC_DATASOURCE_URL_KEY
- Required directory attribute key. To configure the directory you must set this to be the JNDI URL
of a JDBC datasource that connects to the JIRA database we are loading users from.
- See Also:
- Constant Field Values
JiraJdbcRemoteDirectory
public JiraJdbcRemoteDirectory(org.springframework.jdbc.core.JdbcTemplate jdbc)
- Default constructor
- Parameters:
jdbc
- a Spring JDBC Template already pointed to the correct database.
getDirectoryId
public long getDirectoryId()
- Specified by:
getDirectoryId
in interface com.atlassian.crowd.directory.RemoteDirectory
setDirectoryId
public void setDirectoryId(long directoryId)
- Specified by:
setDirectoryId
in interface com.atlassian.crowd.directory.RemoteDirectory
getDescriptiveName
public String getDescriptiveName()
- Specified by:
getDescriptiveName
in interface com.atlassian.crowd.directory.RemoteDirectory
setAttributes
public void setAttributes(Map<String,String> attributes)
- Specified by:
setAttributes
in interface com.atlassian.crowd.directory.RemoteDirectory
findUserByName
public com.atlassian.crowd.model.user.User findUserByName(String name)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
findUserByName
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.OperationFailedException
findUserWithAttributesByName
public com.atlassian.crowd.model.user.UserWithAttributes findUserWithAttributesByName(String name)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
findUserWithAttributesByName
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.OperationFailedException
findUserById
public com.atlassian.crowd.model.user.User findUserById(long id)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.OperationFailedException
authenticate
public com.atlassian.crowd.model.user.User authenticate(String name,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.InactiveAccountException,
com.atlassian.crowd.exception.InvalidAuthenticationException,
com.atlassian.crowd.exception.ExpiredCredentialException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
authenticate
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.InactiveAccountException
com.atlassian.crowd.exception.InvalidAuthenticationException
com.atlassian.crowd.exception.ExpiredCredentialException
com.atlassian.crowd.exception.OperationFailedException
searchUsers
public <T> List<T> searchUsers(com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
throws com.atlassian.crowd.exception.OperationFailedException
- Specified by:
searchUsers
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.OperationFailedException
findGroupByName
public com.atlassian.crowd.model.group.Group findGroupByName(String name)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
findGroupByName
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.OperationFailedException
findGroupWithAttributesByName
public com.atlassian.crowd.model.group.GroupWithAttributes findGroupWithAttributesByName(String name)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
findGroupWithAttributesByName
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.OperationFailedException
searchGroups
public <T> List<T> searchGroups(com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
throws com.atlassian.crowd.exception.OperationFailedException
- Specified by:
searchGroups
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.OperationFailedException
isUserDirectGroupMember
public boolean isUserDirectGroupMember(String username,
String groupName)
throws com.atlassian.crowd.exception.OperationFailedException
- Specified by:
isUserDirectGroupMember
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.OperationFailedException
searchGroupRelationships
public <T> List<T> searchGroupRelationships(com.atlassian.crowd.search.query.membership.MembershipQuery<T> query)
throws com.atlassian.crowd.exception.OperationFailedException
- Specified by:
searchGroupRelationships
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.OperationFailedException
testConnection
public void testConnection()
throws com.atlassian.crowd.exception.OperationFailedException
- Specified by:
testConnection
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.OperationFailedException
isGroupDirectGroupMember
public boolean isGroupDirectGroupMember(String childGroup,
String parentGroup)
throws com.atlassian.crowd.exception.OperationFailedException
- Specified by:
isGroupDirectGroupMember
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.OperationFailedException
addUser
public com.atlassian.crowd.model.user.User addUser(com.atlassian.crowd.model.user.UserTemplate user,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
throws com.atlassian.crowd.exception.InvalidUserException,
com.atlassian.crowd.exception.InvalidCredentialException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
addUser
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.InvalidUserException
com.atlassian.crowd.exception.InvalidCredentialException
com.atlassian.crowd.exception.OperationFailedException
updateUser
public com.atlassian.crowd.model.user.User updateUser(com.atlassian.crowd.model.user.UserTemplate user)
throws com.atlassian.crowd.exception.InvalidUserException,
com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
updateUser
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.InvalidUserException
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.OperationFailedException
updateUserCredential
public void updateUserCredential(String username,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.InvalidCredentialException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
updateUserCredential
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.InvalidCredentialException
com.atlassian.crowd.exception.OperationFailedException
renameUser
public com.atlassian.crowd.model.user.User renameUser(String oldName,
String newName)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.InvalidUserException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
renameUser
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.InvalidUserException
com.atlassian.crowd.exception.OperationFailedException
storeUserAttributes
public void storeUserAttributes(String username,
Map<String,Set<String>> attributes)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
storeUserAttributes
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.OperationFailedException
removeUserAttributes
public void removeUserAttributes(String username,
String attributeName)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
removeUserAttributes
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.OperationFailedException
removeUser
public void removeUser(String name)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
removeUser
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.OperationFailedException
addGroup
public com.atlassian.crowd.model.group.Group addGroup(com.atlassian.crowd.model.group.GroupTemplate group)
throws com.atlassian.crowd.exception.InvalidGroupException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
addGroup
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.InvalidGroupException
com.atlassian.crowd.exception.OperationFailedException
updateGroup
public com.atlassian.crowd.model.group.Group updateGroup(com.atlassian.crowd.model.group.GroupTemplate group)
throws com.atlassian.crowd.exception.InvalidGroupException,
com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
updateGroup
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.InvalidGroupException
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.OperationFailedException
renameGroup
public com.atlassian.crowd.model.group.Group renameGroup(String oldName,
String newName)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.InvalidGroupException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
renameGroup
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.InvalidGroupException
com.atlassian.crowd.exception.OperationFailedException
storeGroupAttributes
public void storeGroupAttributes(String groupName,
Map<String,Set<String>> attributes)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
storeGroupAttributes
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.OperationFailedException
removeGroupAttributes
public void removeGroupAttributes(String groupName,
String attributeName)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
removeGroupAttributes
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.OperationFailedException
removeGroup
public void removeGroup(String name)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
removeGroup
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.OperationFailedException
addUserToGroup
public void addUserToGroup(String username,
String groupName)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
addUserToGroup
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.OperationFailedException
addGroupToGroup
public void addGroupToGroup(String childGroup,
String parentGroup)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.InvalidMembershipException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
addGroupToGroup
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.InvalidMembershipException
com.atlassian.crowd.exception.OperationFailedException
removeUserFromGroup
public void removeUserFromGroup(String username,
String groupName)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.MembershipNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
removeUserFromGroup
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.MembershipNotFoundException
com.atlassian.crowd.exception.OperationFailedException
removeGroupFromGroup
public void removeGroupFromGroup(String childGroup,
String parentGroup)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.InvalidMembershipException,
com.atlassian.crowd.exception.MembershipNotFoundException,
com.atlassian.crowd.exception.OperationFailedException
- Specified by:
removeGroupFromGroup
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.InvalidMembershipException
com.atlassian.crowd.exception.MembershipNotFoundException
com.atlassian.crowd.exception.OperationFailedException
supportsInactiveAccounts
public boolean supportsInactiveAccounts()
- Specified by:
supportsInactiveAccounts
in interface com.atlassian.crowd.directory.RemoteDirectory
supportsNestedGroups
public boolean supportsNestedGroups()
- Specified by:
supportsNestedGroups
in interface com.atlassian.crowd.directory.RemoteDirectory
isRolesDisabled
public boolean isRolesDisabled()
- Specified by:
isRolesDisabled
in interface com.atlassian.crowd.directory.RemoteDirectory
getMemberships
public Iterable<com.atlassian.crowd.model.group.Membership> getMemberships()
throws com.atlassian.crowd.exception.OperationFailedException
- Specified by:
getMemberships
in interface com.atlassian.crowd.directory.RemoteDirectory
- Throws:
com.atlassian.crowd.exception.OperationFailedException
getAuthoritativeDirectory
public com.atlassian.crowd.directory.RemoteDirectory getAuthoritativeDirectory()
- Specified by:
getAuthoritativeDirectory
in interface com.atlassian.crowd.directory.RemoteDirectory
getValues
public Set<String> getValues(String key)
- Specified by:
getValues
in interface com.atlassian.crowd.embedded.api.Attributes
getValue
public String getValue(String key)
- Specified by:
getValue
in interface com.atlassian.crowd.embedded.api.Attributes
getKeys
public Set<String> getKeys()
- Specified by:
getKeys
in interface com.atlassian.crowd.embedded.api.Attributes
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface com.atlassian.crowd.embedded.api.Attributes