public interface

UserAccessor

implements EntityQueryParser
bucket.user.UserAccessor
Known Indirect Subclasses

Class Overview

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.

Summary

Public Methods
abstract Group addGroup(String name)
Creates a group with the specified name and returns it.
abstract void addMembership(String groupname, String username)
abstract void addMembership(Group group, User user)
abstract User addUser(String username, String password, String email, String fullname)
This method is deprecated. since 3.5 use createUser(User, Credential)
abstract User addUser(String username, String password, String email, String fullname, String[] groups)
This method is deprecated. since 3.5 use createUser(User, Credential) and addMembership(Group, User)
abstract void alterPassword(User user, String plainTextPassword)
abstract boolean authenticate(String username, String password)
abstract Group createGroup(String groupname)
abstract User createUser(User userTemplate, Credential password)
abstract User createUser(String username)
This method is deprecated. since 3.5 use createUser(User, Credential) instead
abstract void deactivateUser(User user)
Deactivate the specified user, which prevents them logging in.
abstract SearchResult<User> findUsers(Query<User> search)
abstract Group getDefaultGroup()
This method is deprecated. since 3.5 not used anywhere
abstract List<RepositoryIdentifier> getDelegatingRepositories()
This method is deprecated. since 3.5 not used anywhere
abstract Pager<String> getExternallMembers(Group group)
This method is deprecated. since 4.0 returns an empty pager
abstract Group getGroup(String name)
Returns the group with the specified name, or null if the user doesn't exist or the name is null.
abstract Group getGroupCreateIfNecessary(String name)
abstract Pager<Group> getGroups(User user)
abstract Pager<Group> getGroups()
Returns a pager of all groups in the system.
abstract Pager<String> getLocalMembers(Group group)
This method is deprecated. since 4.0 returns the same as getMemberNames(Group)
abstract Pager<String> getMemberNames(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).
abstract PropertySet getPropertySet(User user)
abstract RepositoryIdentifier getRepository(Entity entity)
This method is deprecated. since 4.0 use com.atlassian.crowd.embedded.api.CrowdDirectoryService to query for directory information
abstract User getUser(String name)
Returns the user with the specified name, or null if the user doesn't exist or the name is null.
abstract Pager<String> getUserNames()
Returns a pager of all usernames in the system.
abstract UserPreferences getUserPreferences(User user)
abstract Pager<User> getUsers()
Returns a pager of all users in the system.
abstract SearchResult getUsersByEmail(String email)
abstract Pager<User> getUsersWithConfluenceAccess()
This method is deprecated. since 3.5.1. This method is very slow, use countUsersWithConfluenceAccess() if you need to know the number of users.
abstract boolean hasMembership(Group group, 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).
abstract 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).
abstract boolean isDeactivated(User user)
Returns true if the user exists and is unable to log in, otherwise false.
abstract boolean isDeactivated(String username)
Returns true if the user with the specified username exists and is unable to log in, otherwise false.
abstract boolean isLicensedToAddMoreUsers()
abstract boolean isUserRemovable(User user)
abstract void reactivateUser(User user)
Marks the specified user as active, which allows them to log in.
abstract void removeGroup(Group group)
Removes the specified group.
abstract boolean removeMembership(String groupname, String username)
abstract boolean removeMembership(Group group, User user)
abstract void removeUser(User user)
Removes the specified user.
abstract void saveUser(User user)
Persists changes made to a user (e.g.
[Expand]
Inherited Methods
From interface com.atlassian.user.search.query.EntityQueryParser

Public Methods

public abstract Group addGroup (String name)

Creates a group with the specified name and returns it.

Throws
IllegalArgumentException if the group name is empty or null
InfrastructureException if the group could not be created

public abstract void addMembership (String groupname, String username)

public abstract void addMembership (Group group, User user)

public abstract User addUser (String username, String password, String email, String fullname)

This method is deprecated.
since 3.5 use createUser(User, Credential)

public abstract User addUser (String username, String password, String email, String fullname, String[] groups)

This method is deprecated.
since 3.5 use createUser(User, Credential) and addMembership(Group, User)

public abstract void alterPassword (User user, String plainTextPassword)

Throws
EntityException

public abstract boolean authenticate (String username, String password)

public abstract Group createGroup (String groupname)

public abstract User createUser (User userTemplate, Credential password)

public abstract User createUser (String username)

This method is deprecated.
since 3.5 use createUser(User, Credential) instead

public abstract void deactivateUser (User user)

Deactivate the specified user, which prevents them logging in. Does nothing if the user is already deactivated.

public abstract SearchResult<User> findUsers (Query<User> search)

Throws
EntityException

public abstract Group getDefaultGroup ()

This method is deprecated.
since 3.5 not used anywhere

public abstract List<RepositoryIdentifier> getDelegatingRepositories ()

This method is deprecated.
since 3.5 not used anywhere

public abstract Pager<String> getExternallMembers (Group group)

This method is deprecated.
since 4.0 returns an empty pager

public abstract Group getGroup (String name)

Returns the group with the specified name, or null if the user doesn't exist or the name is null.

public abstract Group getGroupCreateIfNecessary (String name)

public abstract Pager<Group> getGroups (User user)

public abstract Pager<Group> getGroups ()

Returns a pager of all groups in the system. Clients should not normally use this method, but perform a search using findGroups(Query) or the CrowdService API instead.

public abstract Pager<String> getLocalMembers (Group group)

This method is deprecated.
since 4.0 returns the same as getMemberNames(Group)

public abstract Pager<String> getMemberNames (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.

public abstract PropertySet getPropertySet (User user)

public abstract RepositoryIdentifier getRepository (Entity entity)

This method is deprecated.
since 4.0 use com.atlassian.crowd.embedded.api.CrowdDirectoryService to query for directory information

Throws
EntityException

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

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

public abstract UserPreferences getUserPreferences (User user)

public abstract Pager<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.

public abstract SearchResult getUsersByEmail (String email)

public abstract Pager<User> getUsersWithConfluenceAccess ()

This method is 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.

public abstract boolean hasMembership (Group group, 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.

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

public abstract boolean isDeactivated (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.

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

public abstract boolean isLicensedToAddMoreUsers ()

public abstract boolean isUserRemovable (User user)

Throws
EntityException

public abstract void reactivateUser (User user)

Marks the specified user as active, which allows them to log in. Does nothing if the user is already active.

public abstract void removeGroup (Group group)

Removes the specified group. Does nothing if the group does not exist.

Throws
InfrastructureException if the group could not be removed

public abstract boolean removeMembership (String groupname, String username)

public abstract boolean removeMembership (Group group, User user)

public abstract void removeUser (User user)

Removes the specified user. Does nothing if the user does not exist.

Throws
InfrastructureException if the user could not be removed

public abstract void saveUser (User user)

Persists changes made to a user (e.g. changing email or full name).

Throws
InfrastructureException if the user could not be updated successfully