Interface ProfileService
- All Known Implementing Classes:
SuperUserProfileService,UserProfileService
public interface ProfileService
Manages instances of
Profile.
Created by patricktwohig on 6/27/17.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateProfile(CreateProfileRequest profileRequest) Creates a new profile.voiddeleteProfile(String profileId) Deletes theProfilewith the supplied profile ID.Finds the currently active profile, if any.Returns theProfileof the currently logged-in user.getProfile(String profileId) Fetches a specificProfileinstance based on ID.getProfiles(int offset, int count, String search) Lists allProfileinstances, specifying a search query.getProfiles(int offset, int count, String applicationNameOrId, String userId, Long lowerBoundTimestamp, Long upperBoundTimestamp) Lists allProfileinstances starting with the offset and count.default ProfileredactPrivateInformation(Profile profile) Redacts any private information from theProfileand returns either a new instance or the current instance modified.updateProfile(String profileId, UpdateProfileRequest profileRequest) Updates the suppliedProfile.updateProfileImage(String profileId, UpdateProfileImageRequest updateProfileImageRequest) Update profile image related fields
-
Field Details
-
PROFILE_CREATED_EVENT
- See Also:
-
-
Method Details
-
getProfiles
Pagination<Profile> getProfiles(int offset, int count, String applicationNameOrId, String userId, Long lowerBoundTimestamp, Long upperBoundTimestamp) Lists allProfileinstances starting with the offset and count.- Parameters:
offset- the offsetcount- the countapplicationNameOrId- the application name or ID to use when fetching the profilesuserId- the userId which to use when filtering. If null, then no filtering will be applied.lowerBoundTimestamp-upperBoundTimestamp-- Returns:
- a
PaginationofProfileinstances
-
getProfiles
Lists allProfileinstances, specifying a search query.- Parameters:
offset-count-search-- Returns:
-
redactPrivateInformation
Redacts any private information from theProfileand returns either a new instance or the current instance modified. The default implementation simply sets the user to null and returns the supplied instance. Other implementations such as those used for superuser access may redact information differently. -
getProfile
Fetches a specificProfileinstance based on ID. If not found, an exception is raised.- Parameters:
profileId- the profile ID- Returns:
- the
Profile, never null
-
getCurrentProfile
Profile getCurrentProfile()Returns theProfileof the currently logged-in user. If the user has no profile, or that information is not available, then this will throw an exception. Using a profile is not required for all calls. Therefore, it should be expected that this will throwNotFoundExceptionunder normal circumstances.- Returns:
- the
Profile, or null, if no profile is found.
-
findCurrentProfile
Finds the currently active profile, if any. -
updateProfile
- Parameters:
profileId- the profile id of theProfileto updateprofileRequest- theUpdateProfileRequestwith the information to update- Returns:
- the
Profileas it was changed by the service.
-
createProfile
Creates a new profile. The ID of the profile, as specified byProfile.getId(), should be null and will be assigned.- Parameters:
profileRequest- theCreateProfileRequestwith the information to create- Returns:
- the
Profileas it was created by the service.
-
deleteProfile
Deletes theProfilewith the supplied profile ID.- Parameters:
profileId- the profile ID.
-
updateProfileImage
Profile updateProfileImage(String profileId, UpdateProfileImageRequest updateProfileImageRequest) throws IOException Update profile image related fields- Parameters:
updateProfileImageRequest- request with image object values- Throws:
IOException
-