public abstract class

DefaultUserAccessor

extends Object
implements UserAccessor
java.lang.Object
   ↳ bucket.user.DefaultUserAccessor
Known Direct Subclasses
Known Indirect Subclasses

Summary

Fields
public final String DEFAULT_GROUP_NAME
public Group defaultGroup
Protected Constructors
DefaultUserAccessor(RepositoryAccessor repositoryAccessor)
Public Methods
Group addGroup(String name)
Creates a group with the specified name and returns it.
void addMembership(String groupname, String username)
void addMembership(Group group, User user)
User addUser(String username, String password, String email, String fullname)
User addUser(String username, String password, String email, String fullname, String[] groups)
void alterPassword(User user, String plainTextPassword)
boolean authenticate(String username, String password)
Group createGroup(String groupname)
Note that this method creates a group with case sensitive name.
User createUser(User userTemplate, Credential credential)
User createUser(String username)
SearchResult<Group> findGroups(Query<Group> query, QueryContext context)
Allows specification of com.atlassian.user.search.query.QueryContext.
SearchResult<Group> findGroups(Query<Group> query)
Generates a com.atlassian.user.search.SearchResult object for each repository the entityQueryParser can search.
SearchResult<User> findUsers(Query<User> query)
SearchResult<User> findUsers(Query<User> query, QueryContext context)
Allows specification of com.atlassian.user.search.query.QueryContext.
Group getDefaultGroup()
@Deprecated List<RepositoryIdentifier> getDelegatingRepositories()
This method is deprecated. since 3.5 not used anywhere
Pager<String> getExternallMembers(Group group)
Group getGroup(String name)
Returns the group with the specified name, or null if the user doesn't exist or the name is null.
Group getGroupCreateIfNecessary(String name)
Get a group - and if it does not exist, create it first.
Pager<Group> getGroups(User user)
Pager<Group> getGroups()
Returns a pager of all groups in the system.
Pager<String> getLocalMembers(Group group)
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).
PropertySet getPropertySet(User user)
RepositoryIdentifier getRepository(Entity entity)
User getUser(String name)
Returns the user with the specified name, or null if the user doesn't exist or the name is null.
Pager<String> getUserNames()
Returns a pager of all usernames in the system.
UserPreferences getUserPreferences(User user)
Pager<User> getUsers()
Returns a pager of all users in the system.
SearchResult getUsersByEmail(String email)
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).
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(User user)
void removeGroup(Group group)
Removes the specified group.
boolean removeMembership(String groupname, String username)
boolean removeMembership(Group group, User user)
void removeUser(User user)
Removes the specified user.
void saveUser(User user)
Persists changes made to a user (e.g.
Protected Methods
Authenticator getAuthenticator()
EntityQueryParser getEntityQueryParser()
GroupManager getGroupManager()
PropertySetFactory getPropertySetFactory()
UserManager getUserManager()
[Expand]
Inherited Methods
From class java.lang.Object
From interface bucket.user.UserAccessor
From interface com.atlassian.user.search.query.EntityQueryParser

Fields

public final String DEFAULT_GROUP_NAME

Constant Value: "users"

public Group defaultGroup

Protected Constructors

protected DefaultUserAccessor (RepositoryAccessor repositoryAccessor)

Public Methods

public Group addGroup (String name)

Creates a group with the specified name and returns it.

public void addMembership (String groupname, String username)

public void addMembership (Group group, User user)

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

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

public void alterPassword (User user, String plainTextPassword)

Throws
EntityException

public boolean authenticate (String username, String password)

public 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

public User createUser (User userTemplate, Credential credential)

public User createUser (String username)

public SearchResult<Group> findGroups (Query<Group> query, QueryContext context)

Allows specification of com.atlassian.user.search.query.QueryContext.

Throws
EntityException

public SearchResult<Group> findGroups (Query<Group> query)

Generates a com.atlassian.user.search.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.
Throws
EntityException

public SearchResult<User> findUsers (Query<User> query)

Throws
EntityException

public SearchResult<User> findUsers (Query<User> query, QueryContext context)

Allows specification of com.atlassian.user.search.query.QueryContext.

Throws
EntityException

public Group getDefaultGroup ()

@Deprecated public List<RepositoryIdentifier> getDelegatingRepositories ()

This method is deprecated.
since 3.5 not used anywhere

public Pager<String> getExternallMembers (Group group)

public 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 Group getGroupCreateIfNecessary (String name)

Get a group - and if it does not exist, create it first.

public Pager<Group> getGroups (User user)

public 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 Pager<String> getLocalMembers (Group group)

public 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 PropertySet getPropertySet (User user)

public RepositoryIdentifier getRepository (Entity entity)

Throws
EntityException

public 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 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 UserPreferences getUserPreferences (User user)

public 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 SearchResult getUsersByEmail (String email)

public 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 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 boolean isLicensedToAddMoreUsers ()

public boolean isUserRemovable (User user)

Throws
EntityException

public void removeGroup (Group group)

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

public boolean removeMembership (String groupname, String username)

public boolean removeMembership (Group group, User user)

public void removeUser (User user)

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

public void saveUser (User user)

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

Protected Methods

protected Authenticator getAuthenticator ()

protected EntityQueryParser getEntityQueryParser ()

protected GroupManager getGroupManager ()

protected PropertySetFactory getPropertySetFactory ()

protected UserManager getUserManager ()