bucket.user
Interface UserAccessor

All Superinterfaces:
com.atlassian.user.search.query.EntityQueryParser
All Known Subinterfaces:
UserAccessor
All Known Implementing Classes:
DefaultUserAccessor, DefaultUserAccessor

public interface UserAccessor
extends com.atlassian.user.search.query.EntityQueryParser

Facade which controls calls relating to User, Group, or membership. It is also capable of relaying Query objects to underlying components which can generate SearchResult objects in reply.


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)
          Deprecated. since 3.5 use createUser(User, Credential)
 com.atlassian.user.User addUser(String username, String password, String email, String fullname, String[] groups)
          Deprecated. since 3.5 use createUser(User, Credential) and addMembership(Group, User)
 void alterPassword(com.atlassian.user.User user, String plainTextPassword)
           
 boolean authenticate(String username, String password)
           
 com.atlassian.user.Group createGroup(String groupname)
           
 com.atlassian.user.User createUser(String username)
          Deprecated. since 3.5 use createUser(User, Credential) instead
 com.atlassian.user.User createUser(com.atlassian.user.User userTemplate, com.atlassian.user.security.password.Credential password)
           
 void deactivateUser(com.atlassian.user.User user)
          Deactivate the specified user, which prevents them logging in.
 com.atlassian.user.search.SearchResult<com.atlassian.user.User> findUsers(com.atlassian.user.search.query.Query<com.atlassian.user.User> search)
           
 com.atlassian.user.Group getDefaultGroup()
          Deprecated. since 3.5 not used anywhere
 List<com.atlassian.user.repository.RepositoryIdentifier> getDelegatingRepositories()
          Deprecated. since 3.5 not used anywhere
 com.atlassian.user.search.page.Pager<String> getExternallMembers(com.atlassian.user.Group group)
          Deprecated. since 4.0 returns an empty pager
 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)
           
 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)
          Deprecated. since 4.0 returns the same as getMemberNames(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)
           
 com.atlassian.user.repository.RepositoryIdentifier getRepository(com.atlassian.user.Entity entity)
          Deprecated. since 4.0 use com.atlassian.crowd.embedded.api.CrowdDirectoryService to query for directory information
 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.
 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)
           
 com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsersWithConfluenceAccess()
          Deprecated. since 3.5.1. This method is very slow, use countUsersWithConfluenceAccess() if you need to know the number of users.
 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 isDeactivated(String username)
          Returns true if the user with the specified username exists and is unable to log in, otherwise false.
 boolean isDeactivated(com.atlassian.user.User user)
          Returns true if the user exists and is unable to log in, otherwise false.
 boolean isLicensedToAddMoreUsers()
           
 boolean isUserRemovable(com.atlassian.user.User user)
           
 void reactivateUser(com.atlassian.user.User user)
          Marks the specified user as active, which allows them to log in.
 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 interface com.atlassian.user.search.query.EntityQueryParser
findGroups, findGroups, findUsers
 

Method Detail

getRepository

com.atlassian.user.repository.RepositoryIdentifier getRepository(com.atlassian.user.Entity entity)
                                                                 throws com.atlassian.user.EntityException
Deprecated. since 4.0 use com.atlassian.crowd.embedded.api.CrowdDirectoryService to query for directory information

Throws:
com.atlassian.user.EntityException

addUser

com.atlassian.user.User addUser(String username,
                                String password,
                                String email,
                                String fullname,
                                String[] groups)
Deprecated. since 3.5 use createUser(User, Credential) and addMembership(Group, User)


addUser

com.atlassian.user.User addUser(String username,
                                String password,
                                String email,
                                String fullname)
Deprecated. since 3.5 use createUser(User, Credential)


getUser

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. 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.


getUserNames

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


getUsers

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


getGroup

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.


getGroups

com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups()
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.


addGroup

com.atlassian.user.Group addGroup(String name)
Creates a group with the specified name and returns it.

Throws:
IllegalArgumentException - if the group name is empty or null
com.atlassian.core.exception.InfrastructureException - if the group could not be created

removeGroup

void removeGroup(com.atlassian.user.Group group)
Removes the specified group. Does nothing if the group does not exist.

Throws:
com.atlassian.core.exception.InfrastructureException - if the group could not be removed

removeUser

void removeUser(com.atlassian.user.User user)
                throws com.atlassian.core.exception.InfrastructureException
Removes the specified user. Does nothing if the user does not exist.

Throws:
com.atlassian.core.exception.InfrastructureException - if the user could not be removed

getGroupCreateIfNecessary

com.atlassian.user.Group getGroupCreateIfNecessary(String name)

getUserPreferences

com.atlassian.core.user.preferences.UserPreferences getUserPreferences(com.atlassian.user.User user)

saveUser

void saveUser(com.atlassian.user.User user)
Persists changes made to a user (e.g. changing email or full name).

Throws:
com.atlassian.core.exception.InfrastructureException - if the user could not be updated successfully

getUsersByEmail

com.atlassian.user.search.SearchResult getUsersByEmail(String email)

deactivateUser

void deactivateUser(com.atlassian.user.User user)
Deactivate the specified user, which prevents them logging in. Does nothing if the user is already deactivated.


reactivateUser

void reactivateUser(com.atlassian.user.User user)
Marks the specified user as active, which allows them to log in. Does nothing if the user is already active.


getUsersWithConfluenceAccess

com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsersWithConfluenceAccess()
Deprecated. since 3.5.1. This method is very slow, use countUsersWithConfluenceAccess() if you need to know the number of users.

Returns all the users with access to use Confluence.


isLicensedToAddMoreUsers

boolean isLicensedToAddMoreUsers()

isUserRemovable

boolean isUserRemovable(com.atlassian.user.User user)
                        throws com.atlassian.user.EntityException
Throws:
com.atlassian.user.EntityException

getGroups

com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups(com.atlassian.user.User user)

hasMembership

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). In all other circumstances, returns false.


hasMembership

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). In all other circumstances, returns false.


addMembership

void addMembership(com.atlassian.user.Group group,
                   com.atlassian.user.User user)

addMembership

void addMembership(String groupname,
                   String username)

removeMembership

boolean removeMembership(com.atlassian.user.Group group,
                         com.atlassian.user.User user)

getPropertySet

com.opensymphony.module.propertyset.PropertySet getPropertySet(com.atlassian.user.User user)

getMemberNames

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). Returns an empty pager if the group has no members or doesn't exist.


getLocalMembers

com.atlassian.user.search.page.Pager<String> getLocalMembers(com.atlassian.user.Group group)
Deprecated. since 4.0 returns the same as getMemberNames(Group)


getExternallMembers

com.atlassian.user.search.page.Pager<String> getExternallMembers(com.atlassian.user.Group group)
Deprecated. since 4.0 returns an empty pager


createUser

com.atlassian.user.User createUser(String username)
Deprecated. since 3.5 use createUser(User, Credential) instead


createUser

com.atlassian.user.User createUser(com.atlassian.user.User userTemplate,
                                   com.atlassian.user.security.password.Credential password)

createGroup

com.atlassian.user.Group createGroup(String groupname)

isDeactivated

boolean isDeactivated(com.atlassian.user.User user)
Returns true if the user exists and is unable to log in, otherwise false. Returns false if the user is null.

Returns:
true if the user exists and is unable to log in, otherwise false.

isDeactivated

boolean isDeactivated(String username)
Returns true if the user with the specified username exists and is unable to log in, otherwise false. Returns false if the username is null.

Returns:
true if the user with the specified username exists and is unable to log in, otherwise false.

authenticate

boolean authenticate(String username,
                     String password)

findUsers

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

getDefaultGroup

com.atlassian.user.Group getDefaultGroup()
Deprecated. since 3.5 not used anywhere


alterPassword

void alterPassword(com.atlassian.user.User user,
                   String plainTextPassword)
                   throws com.atlassian.user.EntityException
Throws:
com.atlassian.user.EntityException

getDelegatingRepositories

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


removeMembership

boolean removeMembership(String groupname,
                         String username)


Copyright © 2003-2011 Atlassian. All Rights Reserved.