public class ProfileManagerGeneric extends Object implements ProfileManager
Constructor and Description |
---|
ProfileManagerGeneric() |
Modifier and Type | Method and Description |
---|---|
Profile |
addNewPopulatedProfile(User user,
String profileName,
Map attributes)
Adds a new profile based on attribute name/value pairs.
|
Profile |
addNewProfile(User user,
SOAPPrincipal principal,
Locale locale,
String profileName)
Creates and adds a new profile to a given user.
|
void |
deleteProfile(User user,
long profileID)
Deletes a the given profile from a user.
|
AttributeDAO |
getAttributeDAO() |
SOAPPrincipalHelper |
getPrincipalHelper() |
Profile |
getProfile(User user,
long profileID)
Retrieves the requested profile from a user.
|
ProfileDAO |
getProfileDAO() |
UserDAO |
getUserDAO() |
void |
makeDefaultProfile(User user,
long profileID)
Changes the default profile of a user.
|
void |
renameProfile(User user,
long profileID,
String newName)
Rename an existing profile of a user.
|
void |
setAttributeDAO(AttributeDAO attributeDAO) |
void |
setPrincipalHelper(SOAPPrincipalHelper principalHelper) |
void |
setProfileDAO(ProfileDAO profileDAO) |
void |
setSiteApprovalDAO(SiteApprovalDAO siteApprovalDAO) |
void |
setUserDAO(UserDAO userDAO) |
void |
updateProfile(User user,
long profileID,
Map attributes)
Updates a user's profile given a map of attributes.
|
public Profile addNewProfile(User user, SOAPPrincipal principal, Locale locale, String profileName) throws ProfileAlreadyExistsException
addNewProfile
in interface ProfileManager
user
- the user object to add the new profile to.principal
- the SOAPPrincipal which contains basic attribute data.locale
- the Locale of the user (to get country/language information).profileName
- the name of the new profile.ProfileAlreadyExistsException
- if the user already has a profile with the given profile name.public Profile addNewPopulatedProfile(User user, String profileName, Map attributes) throws ProfileAlreadyExistsException
addNewPopulatedProfile
in interface ProfileManager
user
- user that owns the profile.profileName
- the name of the new profile.attributes
- MapProfileAlreadyExistsException
- if the user already has a profile with the given profile name.public void updateProfile(User user, long profileID, Map attributes) throws ProfileDoesNotExistException, ProfileAccessViolationException
updateProfile
in interface ProfileManager
user
- user that owns the profile.profileID
- profile ID of the profile to update.attributes
- MapProfileDoesNotExistException
- if profile with requested profileID does not exist.ProfileAccessViolationException
- if the user does not own the profile with the requested profileID.public void makeDefaultProfile(User user, long profileID) throws ProfileDoesNotExistException, ProfileAccessViolationException
makeDefaultProfile
in interface ProfileManager
user
- user that owns the profile.profileID
- profile ID of the profile to set as default.ProfileDoesNotExistException
- if profile with requested profileID does not exist.ProfileAccessViolationException
- if the user does not own the profile with the requested profileID.public void deleteProfile(User user, long profileID) throws ProfileDoesNotExistException, ProfileAccessViolationException, DefaultProfileDeleteException
deleteProfile
in interface ProfileManager
user
- user that owns the profile.profileID
- profile ID of the profile to update.ProfileDoesNotExistException
- if profile with requested profileID does not exist.ProfileAccessViolationException
- if the user does not own the profile with the requested profileID.DefaultProfileDeleteException
- if the profile requested for deletion is the default profile of the user.public void renameProfile(User user, long profileID, String newName) throws ProfileDoesNotExistException, ProfileAccessViolationException, ProfileAlreadyExistsException
renameProfile
in interface ProfileManager
user
- user user that owns the profile.profileID
- profileID profile ID of the profile to rename.newName
- new name of the profile.ProfileDoesNotExistException
- if profile with requested profileID does not exist.ProfileAccessViolationException
- if the user does not own the profile with the requested profileID.ProfileAlreadyExistsException
- if user already has a profile with the new name.public Profile getProfile(User user, long profileID) throws ProfileDoesNotExistException, ProfileAccessViolationException
getProfile
in interface ProfileManager
user
- user that owns the profile.profileID
- profile ID of the profile to retrieve.ProfileAccessViolationException
- profile with given profileID exists but is not owned by the user.ProfileDoesNotExistException
- profile with given profileID does not exist.public ProfileDAO getProfileDAO()
public void setProfileDAO(ProfileDAO profileDAO)
public UserDAO getUserDAO()
public void setUserDAO(UserDAO userDAO)
public SOAPPrincipalHelper getPrincipalHelper()
public void setPrincipalHelper(SOAPPrincipalHelper principalHelper)
public AttributeDAO getAttributeDAO()
public void setAttributeDAO(AttributeDAO attributeDAO)
public void setSiteApprovalDAO(SiteApprovalDAO siteApprovalDAO)
Copyright © 2013 Atlassian. All Rights Reserved.