bucket.user
Class DefaultUserAccessor

java.lang.Object
  extended by bucket.user.DefaultUserAccessor
All Implemented Interfaces:
UserAccessor, com.atlassian.user.search.query.EntityQueryParser
Direct Known Subclasses:
DefaultUserAccessor

public abstract class DefaultUserAccessor
extends Object
implements UserAccessor


Field Summary
 String DEFAULT_GROUP_NAME
           
 com.atlassian.user.Group defaultGroup
           
 
Constructor Summary
protected DefaultUserAccessor(com.atlassian.user.configuration.RepositoryAccessor repositoryAccessor)
           
 
Method Summary
 com.atlassian.user.Group addGroup(String name)
          Creates a group with the specified name and returns it.
 void addMembership(com.atlassian.user.Group group, com.atlassian.user.User user)
           
 void addMembership(String groupname, String username)
           
 com.atlassian.user.User addUser(String username, String password, String email, String fullname)
           
 com.atlassian.user.User addUser(String username, String password, String email, String fullname, String[] groups)
           
 void alterPassword(com.atlassian.user.User user, String plainTextPassword)
           
 boolean authenticate(String username, String password)
           
 com.atlassian.user.Group createGroup(String groupname)
          Note that this method creates a group with case sensitive name.
 com.atlassian.user.User createUser(String username)
           
 com.atlassian.user.User createUser(com.atlassian.user.User userTemplate, com.atlassian.user.security.password.Credential credential)
           
 com.atlassian.user.search.SearchResult<com.atlassian.user.Group> findGroups(com.atlassian.user.search.query.Query<com.atlassian.user.Group> query)
          Generates a SearchResult object for each repository the entityQueryParser can search.
 com.atlassian.user.search.SearchResult<com.atlassian.user.Group> findGroups(com.atlassian.user.search.query.Query<com.atlassian.user.Group> query, com.atlassian.user.search.query.QueryContext context)
          Allows specification of QueryContext.
 com.atlassian.user.search.SearchResult<com.atlassian.user.User> findUsers(com.atlassian.user.search.query.Query<com.atlassian.user.User> query)
           
 com.atlassian.user.search.SearchResult<com.atlassian.user.User> findUsers(com.atlassian.user.search.query.Query<com.atlassian.user.User> query, com.atlassian.user.search.query.QueryContext context)
          Allows specification of QueryContext.
protected  com.atlassian.user.security.authentication.Authenticator getAuthenticator()
           
 com.atlassian.user.Group getDefaultGroup()
           
 List<com.atlassian.user.repository.RepositoryIdentifier> getDelegatingRepositories()
          Deprecated. since 3.5 not used anywhere
protected  com.atlassian.user.search.query.EntityQueryParser getEntityQueryParser()
           
 com.atlassian.user.search.page.Pager<String> getExternallMembers(com.atlassian.user.Group group)
           
 com.atlassian.user.Group getGroup(String name)
          Returns the group with the specified name, or null if the user doesn't exist or the name is null.
 com.atlassian.user.Group getGroupCreateIfNecessary(String name)
          Get a group - and if it does not exist, create it first.
protected  com.atlassian.user.GroupManager getGroupManager()
           
 com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups()
          Returns a pager of all groups in the system.
 com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups(com.atlassian.user.User user)
           
 com.atlassian.user.search.page.Pager<String> getLocalMembers(com.atlassian.user.Group group)
           
 com.atlassian.user.search.page.Pager<String> getMemberNames(com.atlassian.user.Group group)
          Returns a pager containing the usernames of users who are members of the specified group (either directly or as a member of a nested group).
 com.opensymphony.module.propertyset.PropertySet getPropertySet(com.atlassian.user.User user)
           
protected  com.atlassian.user.properties.PropertySetFactory getPropertySetFactory()
           
 com.atlassian.user.repository.RepositoryIdentifier getRepository(com.atlassian.user.Entity entity)
           
 com.atlassian.user.User getUser(String name)
          Returns the user with the specified name, or null if the user doesn't exist or the name is null.
protected  com.atlassian.user.UserManager getUserManager()
           
 com.atlassian.user.search.page.Pager<String> getUserNames()
          Returns a pager of all usernames in the system.
 com.atlassian.core.user.preferences.UserPreferences getUserPreferences(com.atlassian.user.User user)
           
 com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsers()
          Returns a pager of all users in the system.
 com.atlassian.user.search.SearchResult getUsersByEmail(String email)
           
 boolean hasMembership(com.atlassian.user.Group group, com.atlassian.user.User user)
          Returns true if the specified user and group both exist, and the user is a member of the group (either directly or as a member of a nested group).
 boolean hasMembership(String groupName, String username)
          Returns true if the specified user and group both exist, and the user is a member of the group (either directly or as a member of a nested group).
 boolean isLicensedToAddMoreUsers()
           
 boolean isUserRemovable(com.atlassian.user.User user)
           
 void removeGroup(com.atlassian.user.Group group)
          Removes the specified group.
 boolean removeMembership(com.atlassian.user.Group group, com.atlassian.user.User user)
           
 boolean removeMembership(String groupname, String username)
           
 void removeUser(com.atlassian.user.User user)
          Removes the specified user.
 void saveUser(com.atlassian.user.User user)
          Persists changes made to a user (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bucket.user.UserAccessor
deactivateUser, getUsersWithConfluenceAccess, isDeactivated, isDeactivated, reactivateUser
 

Field Detail

defaultGroup

public com.atlassian.user.Group defaultGroup

DEFAULT_GROUP_NAME

public final String DEFAULT_GROUP_NAME
See Also:
Constant Field Values
Constructor Detail

DefaultUserAccessor

protected DefaultUserAccessor(com.atlassian.user.configuration.RepositoryAccessor repositoryAccessor)
Method Detail

getRepository

public com.atlassian.user.repository.RepositoryIdentifier getRepository(com.atlassian.user.Entity entity)
                                                                 throws com.atlassian.user.EntityException
Specified by:
getRepository in interface UserAccessor
Throws:
com.atlassian.user.EntityException

addUser

public com.atlassian.user.User addUser(String username,
                                       String password,
                                       String email,
                                       String fullname,
                                       String[] groups)
Specified by:
addUser in interface UserAccessor

addUser

public com.atlassian.user.User addUser(String username,
                                       String password,
                                       String email,
                                       String fullname)
Specified by:
addUser in interface UserAccessor

createUser

public com.atlassian.user.User createUser(com.atlassian.user.User userTemplate,
                                          com.atlassian.user.security.password.Credential credential)
Specified by:
createUser in interface UserAccessor

getUserNames

public com.atlassian.user.search.page.Pager<String> getUserNames()
Description copied from interface: UserAccessor
Returns a pager of all usernames in the system. Clients should not normally use this method, but perform a search using UserAccessor.findUsers(Query) or the CrowdService API instead.

Specified by:
getUserNames in interface UserAccessor

getUsers

public com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsers()
Description copied from interface: UserAccessor
Returns a pager of all users in the system. Clients should not normally use this method, but perform a search using UserAccessor.findUsers(Query) or the CrowdService API instead.

Specified by:
getUsers in interface UserAccessor

getUser

public com.atlassian.user.User getUser(String name)
Description copied from interface: UserAccessor
Returns the user with the specified name, or null if the user doesn't exist or the name is null. Note that username lookups are case-insensitive, so the user you get back may not have exactly the same name as the name passed to this method.

Specified by:
getUser in interface UserAccessor

getGroups

public com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups()
Description copied from interface: UserAccessor
Returns a pager of all groups in the system. Clients should not normally use this method, but perform a search using EntityQueryParser.findGroups(Query) or the CrowdService API instead.

Specified by:
getGroups in interface UserAccessor

addGroup

public com.atlassian.user.Group addGroup(String name)
Description copied from interface: UserAccessor
Creates a group with the specified name and returns it.

Specified by:
addGroup in interface UserAccessor

removeGroup

public void removeGroup(com.atlassian.user.Group group)
Description copied from interface: UserAccessor
Removes the specified group. Does nothing if the group does not exist.

Specified by:
removeGroup in interface UserAccessor

removeUser

public void removeUser(com.atlassian.user.User user)
Description copied from interface: UserAccessor
Removes the specified user. Does nothing if the user does not exist.

Specified by:
removeUser in interface UserAccessor

saveUser

public void saveUser(com.atlassian.user.User user)
Description copied from interface: UserAccessor
Persists changes made to a user (e.g. changing email or full name).

Specified by:
saveUser in interface UserAccessor

findUsers

public com.atlassian.user.search.SearchResult<com.atlassian.user.User> findUsers(com.atlassian.user.search.query.Query<com.atlassian.user.User> query)
                                                                          throws com.atlassian.user.EntityException
Specified by:
findUsers in interface UserAccessor
Specified by:
findUsers in interface com.atlassian.user.search.query.EntityQueryParser
Throws:
com.atlassian.user.EntityException

findGroups

public com.atlassian.user.search.SearchResult<com.atlassian.user.Group> findGroups(com.atlassian.user.search.query.Query<com.atlassian.user.Group> query)
                                                                            throws com.atlassian.user.EntityException
Generates a SearchResult object for each repository the entityQueryParser can search. These are grouped in an array and returned.

Thus, if the entityQueryParser only knows about one configuration, the array will either have a size of 0 (no sucesses) or 1.

Specified by:
findGroups in interface com.atlassian.user.search.query.EntityQueryParser
Throws:
com.atlassian.user.EntityException

findUsers

public com.atlassian.user.search.SearchResult<com.atlassian.user.User> findUsers(com.atlassian.user.search.query.Query<com.atlassian.user.User> query,
                                                                                 com.atlassian.user.search.query.QueryContext context)
                                                                          throws com.atlassian.user.EntityException
Allows specification of QueryContext.

Specified by:
findUsers in interface com.atlassian.user.search.query.EntityQueryParser
Throws:
com.atlassian.user.EntityException

findGroups

public com.atlassian.user.search.SearchResult<com.atlassian.user.Group> findGroups(com.atlassian.user.search.query.Query<com.atlassian.user.Group> query,
                                                                                   com.atlassian.user.search.query.QueryContext context)
                                                                            throws com.atlassian.user.EntityException
Allows specification of QueryContext.

Specified by:
findGroups in interface com.atlassian.user.search.query.EntityQueryParser
Throws:
com.atlassian.user.EntityException

getUsersByEmail

public com.atlassian.user.search.SearchResult getUsersByEmail(String email)
Specified by:
getUsersByEmail in interface UserAccessor

getGroup

public com.atlassian.user.Group getGroup(String name)
Description copied from interface: UserAccessor
Returns the group with the specified name, or null if the user doesn't exist or the name is null.

Specified by:
getGroup in interface UserAccessor

getGroupCreateIfNecessary

public com.atlassian.user.Group getGroupCreateIfNecessary(String name)
Get a group - and if it does not exist, create it first.

Specified by:
getGroupCreateIfNecessary in interface UserAccessor

getUserPreferences

public com.atlassian.core.user.preferences.UserPreferences getUserPreferences(com.atlassian.user.User user)
Specified by:
getUserPreferences in interface UserAccessor

isLicensedToAddMoreUsers

public boolean isLicensedToAddMoreUsers()
Specified by:
isLicensedToAddMoreUsers in interface UserAccessor

isUserRemovable

public boolean isUserRemovable(com.atlassian.user.User user)
                        throws com.atlassian.user.EntityException
Specified by:
isUserRemovable in interface UserAccessor
Throws:
com.atlassian.user.EntityException

getDefaultGroup

public com.atlassian.user.Group getDefaultGroup()
Specified by:
getDefaultGroup in interface UserAccessor

getGroups

public com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups(com.atlassian.user.User user)
Specified by:
getGroups in interface UserAccessor

hasMembership

public boolean hasMembership(com.atlassian.user.Group group,
                             com.atlassian.user.User user)
Description copied from interface: UserAccessor
Returns true if the specified user and group both exist, and the user is a member of the group (either directly or as a member of a nested group). In all other circumstances, returns false.

Specified by:
hasMembership in interface UserAccessor

hasMembership

public boolean hasMembership(String groupName,
                             String username)
Description copied from interface: UserAccessor
Returns true if the specified user and group both exist, and the user is a member of the group (either directly or as a member of a nested group). In all other circumstances, returns false.

Specified by:
hasMembership in interface UserAccessor

addMembership

public void addMembership(com.atlassian.user.Group group,
                          com.atlassian.user.User user)
Specified by:
addMembership in interface UserAccessor

addMembership

public void addMembership(String groupname,
                          String username)
Specified by:
addMembership in interface UserAccessor

removeMembership

public boolean removeMembership(com.atlassian.user.Group group,
                                com.atlassian.user.User user)
Specified by:
removeMembership in interface UserAccessor

removeMembership

public boolean removeMembership(String groupname,
                                String username)
Specified by:
removeMembership in interface UserAccessor

getPropertySet

public com.opensymphony.module.propertyset.PropertySet getPropertySet(com.atlassian.user.User user)
Specified by:
getPropertySet in interface UserAccessor

getMemberNames

public com.atlassian.user.search.page.Pager<String> getMemberNames(com.atlassian.user.Group group)
Description copied from interface: UserAccessor
Returns a pager containing the usernames of users who are members of the specified group (either directly or as a member of a nested group). Returns an empty pager if the group has no members or doesn't exist.

Specified by:
getMemberNames in interface UserAccessor

getLocalMembers

public com.atlassian.user.search.page.Pager<String> getLocalMembers(com.atlassian.user.Group group)
Specified by:
getLocalMembers in interface UserAccessor

getExternallMembers

public com.atlassian.user.search.page.Pager<String> getExternallMembers(com.atlassian.user.Group group)
Specified by:
getExternallMembers in interface UserAccessor

createUser

public com.atlassian.user.User createUser(String username)
Specified by:
createUser in interface UserAccessor

createGroup

public com.atlassian.user.Group createGroup(String groupname)
Note that this method creates a group with case sensitive name. If you want to add a group with the name lower-cased, use addGroup instead

Specified by:
createGroup in interface UserAccessor

authenticate

public boolean authenticate(String username,
                            String password)
Specified by:
authenticate in interface UserAccessor

alterPassword

public void alterPassword(com.atlassian.user.User user,
                          String plainTextPassword)
                   throws com.atlassian.user.EntityException
Specified by:
alterPassword in interface UserAccessor
Throws:
com.atlassian.user.EntityException

getDelegatingRepositories

@Deprecated
public List<com.atlassian.user.repository.RepositoryIdentifier> getDelegatingRepositories()
Deprecated. since 3.5 not used anywhere

Specified by:
getDelegatingRepositories in interface UserAccessor

getUserManager

protected com.atlassian.user.UserManager getUserManager()

getGroupManager

protected com.atlassian.user.GroupManager getGroupManager()

getAuthenticator

protected com.atlassian.user.security.authentication.Authenticator getAuthenticator()

getPropertySetFactory

protected com.atlassian.user.properties.PropertySetFactory getPropertySetFactory()

getEntityQueryParser

protected com.atlassian.user.search.query.EntityQueryParser getEntityQueryParser()


Copyright © 2003-2013 Atlassian. All Rights Reserved.