com.atlassian.bamboo.user
Class BambooUserManagerImpl

java.lang.Object
  extended by DefaultUserAccessor
      extended by com.atlassian.bamboo.user.BambooUserManagerImpl
All Implemented Interfaces:
BambooUserManager
Direct Known Subclasses:
BambooUserDetailsService

public class BambooUserManagerImpl
extends DefaultUserAccessor
implements BambooUserManager


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.user.BambooUserManager
JABBER_ADDRESS_KEY
 
Constructor Summary
BambooUserManagerImpl()
           
 
Method Summary
 BambooUser addUser(String username, String password, String email, String fullName, String jabberAddress, List groups)
          Method that extends the standard addUser methods to also add Bamboo specific params
 BambooUser addUser(String username, String password, String email, String fullName, String jabberAddress, List groups, ExtendedAuthor author)
          Method that extends the standard addUser methods to also add Bamboo specific params
 BambooUser getBambooUser(String username)
          Returns a BambooUser of the given username
 List getGroupNamesAsList(User user)
          Returns groups for the User
 List getMemberNamesAsList(Group group)
           
 BambooUser injectUser(String username, String encryptedPassword, String email, String fullName, String jabberAddress)
          A variation of addUser which inserts the encryptedPassword instead - used for importing
 boolean isDeletable(User user)
           
 void removeUser(User user)
           
 void saveUser(String username, String email, String fullName, String jabberAddress, List selectedGroups)
          Saves the properties for the given user
 void saveUser(String username, String email, String fullName, String jabberAddress, List selectedGroups, ExtendedAuthor author)
          Saves the properties for the given user
 void setCommentDao(CommentDao commentDao)
           
 void setExtendedAuthorManager(ExtendedAuthorManager extendedAuthorManager)
           
 void setLabelDao(LabelDao labelDao)
           
 void setMembership(Group group, List members)
          Sets a group's members as the passed list
static String[] stringListToArray(Collection strings)
          Converts a Collection of Strings to an array of Strings
static Collection subtractNewList(Collection oldList, Collection newList)
          Works like CollectionUtils#subtract(Collection,Collection) only that it's null safe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BambooUserManagerImpl

public BambooUserManagerImpl()
Method Detail

getBambooUser

public BambooUser getBambooUser(String username)
Description copied from interface: BambooUserManager
Returns a BambooUser of the given username

Specified by:
getBambooUser in interface BambooUserManager
Returns:
The matching user, null if does not exist

addUser

public BambooUser addUser(String username,
                          String password,
                          String email,
                          String fullName,
                          String jabberAddress,
                          List groups)
Description copied from interface: BambooUserManager
Method that extends the standard addUser methods to also add Bamboo specific params

Specified by:
addUser in interface BambooUserManager
groups - - List of Strings as the group names. May be null.
Returns:
the created BambooUser object with the created properties

addUser

public BambooUser addUser(String username,
                          String password,
                          String email,
                          String fullName,
                          String jabberAddress,
                          List groups,
                          ExtendedAuthor author)
Description copied from interface: BambooUserManager
Method that extends the standard addUser methods to also add Bamboo specific params

Specified by:
addUser in interface BambooUserManager
groups - - List of Strings as the group names. May be null.
Returns:
the created BambooUser object with the created properties

saveUser

public void saveUser(String username,
                     String email,
                     String fullName,
                     String jabberAddress,
                     List selectedGroups)
              throws IllegalArgumentException
Description copied from interface: BambooUserManager
Saves the properties for the given user

Specified by:
saveUser in interface BambooUserManager
selectedGroups - - List of Strings as the group names. May be null.
Throws:
IllegalArgumentException - if ussername does not macth a user

saveUser

public void saveUser(String username,
                     String email,
                     String fullName,
                     String jabberAddress,
                     List selectedGroups,
                     ExtendedAuthor author)
              throws IllegalArgumentException
Description copied from interface: BambooUserManager
Saves the properties for the given user

Specified by:
saveUser in interface BambooUserManager
selectedGroups - - List of Strings as the group names. May be null.
Throws:
IllegalArgumentException - if ussername does not macth a user

removeUser

public void removeUser(User user)

getGroupNamesAsList

public List getGroupNamesAsList(User user)
Description copied from interface: BambooUserManager
Returns groups for the User

Specified by:
getGroupNamesAsList in interface BambooUserManager
Parameters:
user - - Must not be null
Returns:
List of String representing group names. Collections.EMPTY_LIST if none exists

setMembership

public void setMembership(Group group,
                          List members)
Description copied from interface: BambooUserManager
Sets a group's members as the passed list

Specified by:
setMembership in interface BambooUserManager
Parameters:
group - - The group to modify the user list. Cannot be null.
members - - List of username Strings. Can be null

getMemberNamesAsList

public List getMemberNamesAsList(Group group)
Specified by:
getMemberNamesAsList in interface BambooUserManager

subtractNewList

public static Collection subtractNewList(Collection oldList,
                                         Collection newList)
Works like CollectionUtils#subtract(Collection,Collection) only that it's null safe

Parameters:
oldList - - can be null
newList - - can be null
Returns:
CollectionUtils#subtract(Collection,Collection). Null lists count as empty lists.

stringListToArray

public static String[] stringListToArray(Collection strings)
Converts a Collection of Strings to an array of Strings

Parameters:
strings - - Collection of Strings. May be nukk
Returns:
Array of strings. Null if input is null or empty

injectUser

public BambooUser injectUser(String username,
                             String encryptedPassword,
                             String email,
                             String fullName,
                             String jabberAddress)
Description copied from interface: BambooUserManager
A variation of addUser which inserts the encryptedPassword instead - used for importing

Specified by:
injectUser in interface BambooUserManager
Returns:
the created BambooUser object with the created properties

isDeletable

public boolean isDeletable(User user)
Specified by:
isDeletable in interface BambooUserManager

setExtendedAuthorManager

public void setExtendedAuthorManager(ExtendedAuthorManager extendedAuthorManager)

setCommentDao

public void setCommentDao(CommentDao commentDao)

setLabelDao

public void setLabelDao(LabelDao labelDao)


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.