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 class DefaultUserAccessor
extends java.lang.Object
implements UserAccessor


Field Summary
 java.lang.String DEFAULT_GROUP_NAME
           
 com.atlassian.user.Group defaultGroup
           
 
Constructor Summary
DefaultUserAccessor()
           
 
Method Summary
 com.atlassian.user.Group addGroup(java.lang.String name)
           
 void addMembership(com.atlassian.user.Group group, com.atlassian.user.User user)
           
 void addMembership(java.lang.String groupname, java.lang.String username)
           
 com.atlassian.user.User addUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullname)
           
 com.atlassian.user.User addUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullname, java.lang.String[] groups)
           
 void alterPassword(com.atlassian.user.User user, java.lang.String plainTextPassword)
           
 boolean authenticate(java.lang.String username, java.lang.String password)
           
protected  void checkConfiguration()
           
 com.atlassian.user.Group createGroup(java.lang.String groupname)
          Note that this method creates a group with case sensitive name.
 com.atlassian.user.User createUser(java.lang.String username)
           
 void deactivateUser(com.atlassian.user.User user)
           
 com.atlassian.user.search.SearchResult findGroups(com.atlassian.user.search.query.Query query)
          Generates a SearchResult object for each repository the entityQueryParser can search.
 com.atlassian.user.search.SearchResult findGroups(com.atlassian.user.search.query.Query query, com.atlassian.user.search.query.QueryContext context)
          Allows specification of QueryContext.
 com.atlassian.user.search.SearchResult findUsers(com.atlassian.user.search.query.Query query)
           
 com.atlassian.user.search.SearchResult findUsers(com.atlassian.user.search.query.Query 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()
           
 java.util.List getDelegatingRepositories()
           
protected  com.atlassian.user.search.query.EntityQueryParser getEntityQueryParser()
           
 com.atlassian.user.search.page.Pager<java.lang.String> getExternallMembers(com.atlassian.user.Group group)
           
 com.atlassian.user.Group getGroup(java.lang.String name)
           
 com.atlassian.user.Group getGroupCreateIfNecessary(java.lang.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()
           
 com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups(com.atlassian.user.User user)
           
 com.atlassian.user.search.page.Pager<java.lang.String> getLocalMembers(com.atlassian.user.Group group)
           
 com.atlassian.user.search.page.Pager<java.lang.String> getMemberNames(com.atlassian.user.Group 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(java.lang.String name)
           
protected  com.atlassian.user.UserManager getUserManager()
           
 com.atlassian.user.search.page.Pager<java.lang.String> getUserNames()
           
 com.atlassian.core.user.preferences.UserPreferences getUserPreferences(com.atlassian.user.User user)
           
 com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsers()
           
 com.atlassian.user.search.SearchResult getUsersByEmail(java.lang.String email)
           
 com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsersWithConfluenceAccess()
           
 boolean hasMembership(com.atlassian.user.Group group, com.atlassian.user.User user)
           
 boolean hasMembership(java.lang.String groupname, java.lang.String username)
           
 boolean isDeactivated(java.lang.String username)
           
 boolean isDeactivated(com.atlassian.user.User user)
           
 boolean isLicensedToAddMoreUsers()
           
 boolean isUserRemovable(com.atlassian.user.User user)
           
 void reactivateUser(com.atlassian.user.User user)
           
 void removeGroup(com.atlassian.user.Group group)
           
 boolean removeMembership(com.atlassian.user.Group group, com.atlassian.user.User user)
           
 boolean removeMembership(java.lang.String groupname, java.lang.String username)
           
 void removeUser(com.atlassian.user.User user)
           
protected  void removeUserFromAllGroups(com.atlassian.user.User user)
           
 void saveUser(com.atlassian.user.User user)
           
 void setAtlassianUserConfiguration(com.atlassian.user.configuration.Configuration atlassianUserConfiguration)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultGroup

public com.atlassian.user.Group defaultGroup

DEFAULT_GROUP_NAME

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

DefaultUserAccessor

public DefaultUserAccessor()
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(java.lang.String username,
                                       java.lang.String password,
                                       java.lang.String email,
                                       java.lang.String fullname,
                                       java.lang.String[] groups)
Specified by:
addUser in interface UserAccessor

addUser

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

getUserNames

public com.atlassian.user.search.page.Pager<java.lang.String> getUserNames()
Specified by:
getUserNames in interface UserAccessor

getUsers

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

getUser

public com.atlassian.user.User getUser(java.lang.String name)
Specified by:
getUser in interface UserAccessor

getGroups

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

addGroup

public com.atlassian.user.Group addGroup(java.lang.String name)
Specified by:
addGroup in interface UserAccessor

removeGroup

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

removeUser

public void removeUser(com.atlassian.user.User user)
Specified by:
removeUser in interface UserAccessor

saveUser

public void saveUser(com.atlassian.user.User user)
Specified by:
saveUser in interface UserAccessor

findUsers

public com.atlassian.user.search.SearchResult findUsers(com.atlassian.user.search.query.Query 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 findGroups(com.atlassian.user.search.query.Query 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 findUsers(com.atlassian.user.search.query.Query 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 findGroups(com.atlassian.user.search.query.Query 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(java.lang.String email)
Specified by:
getUsersByEmail in interface UserAccessor

getGroup

public com.atlassian.user.Group getGroup(java.lang.String name)
Specified by:
getGroup in interface UserAccessor

getGroupCreateIfNecessary

public com.atlassian.user.Group getGroupCreateIfNecessary(java.lang.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

removeUserFromAllGroups

protected void removeUserFromAllGroups(com.atlassian.user.User user)

deactivateUser

public void deactivateUser(com.atlassian.user.User user)
Specified by:
deactivateUser in interface UserAccessor

reactivateUser

public void reactivateUser(com.atlassian.user.User user)
Specified by:
reactivateUser in interface UserAccessor

getUsersWithConfluenceAccess

public com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsersWithConfluenceAccess()
Specified by:
getUsersWithConfluenceAccess 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)
Specified by:
hasMembership in interface UserAccessor

hasMembership

public boolean hasMembership(java.lang.String groupname,
                             java.lang.String username)
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(java.lang.String groupname,
                          java.lang.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(java.lang.String groupname,
                                java.lang.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<java.lang.String> getMemberNames(com.atlassian.user.Group group)
Specified by:
getMemberNames in interface UserAccessor

getLocalMembers

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

getExternallMembers

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

createUser

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

createGroup

public com.atlassian.user.Group createGroup(java.lang.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

isDeactivated

public boolean isDeactivated(com.atlassian.user.User user)
Specified by:
isDeactivated in interface UserAccessor

isDeactivated

public boolean isDeactivated(java.lang.String username)
Specified by:
isDeactivated in interface UserAccessor

authenticate

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

alterPassword

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

getDelegatingRepositories

public java.util.List getDelegatingRepositories()
Specified by:
getDelegatingRepositories in interface UserAccessor
Returns:
an instance of DelegatingRepository representing all Repositories being delegated or null (if there is no delegation).

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()

checkConfiguration

protected void checkConfiguration()

setAtlassianUserConfiguration

public void setAtlassianUserConfiguration(com.atlassian.user.configuration.Configuration atlassianUserConfiguration)
Specified by:
setAtlassianUserConfiguration in interface UserAccessor


Copyright © 2003-2010 Atlassian. All Rights Reserved.