public class ProfileManagerGeneric extends Object implements ProfileManager
| Constructor and Description |
|---|
ProfileManagerGeneric(ProfileDAO profileDAO,
UserDAO userDAO,
AttributeDAO attributeDAO,
SiteApprovalDAO siteApprovalDAO) |
| Modifier and Type | Method and Description |
|---|---|
Profile |
addNewPopulatedProfile(User user,
String profileName,
Map<String,String> attributes)
Adds a new profile based on attribute name/value pairs.
|
Profile |
addNewProfile(User user,
User 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.
|
Profile |
getProfile(User user,
long profileID)
Retrieves the requested profile from a user.
|
void |
makeDefaultProfile(User user,
long profileID)
Changes the default profile of a user.
|
void |
updateProfile(User user,
long profileID,
Map<String,String> attributes)
Updates a user's profile given a map of attributes.
|
public ProfileManagerGeneric(ProfileDAO profileDAO, UserDAO userDAO, AttributeDAO attributeDAO, SiteApprovalDAO siteApprovalDAO)
public Profile addNewProfile(User user, User principal, Locale locale, String profileName) throws ProfileAlreadyExistsException
ProfileManageraddNewProfile in interface ProfileManageruser - the user object to add the new profile to.principal - the principal 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<String,String> attributes) throws ProfileAlreadyExistsException
ProfileManageraddNewPopulatedProfile in interface ProfileManageruser - user that owns the profile.profileName - the name of the new profile.attributes - Map<String attributeName, String attributeValue>ProfileAlreadyExistsException - if the user already has a profile with the given profile name.public void updateProfile(User user, long profileID, Map<String,String> attributes) throws ProfileDoesNotExistException, ProfileAccessViolationException
ProfileManagerupdateProfile in interface ProfileManageruser - user that owns the profile.profileID - profile ID of the profile to update.attributes - Map<String attributeName, String attributeValue>ProfileDoesNotExistException - 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
ProfileManagermakeDefaultProfile in interface ProfileManageruser - 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
ProfileManagerdeleteProfile in interface ProfileManageruser - 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 Profile getProfile(User user, long profileID) throws ProfileDoesNotExistException, ProfileAccessViolationException
ProfileManagergetProfile in interface ProfileManageruser - user that owns the profile.profileID - profile ID of the profile to retrieve.ProfileDoesNotExistException - profile with given profileID does not exist.ProfileAccessViolationException - profile with given profileID exists but is not owned by the user.Copyright © 2018 Atlassian. All rights reserved.