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.void
deleteProfile
(String profileId) Deletes theProfile
with the supplied profile ID.Finds the currently active profile, if any.Returns theProfile
of the currently logged-in user.getProfile
(String profileId) Fetches a specificProfile
instance based on ID.getProfiles
(int offset, int count, String search) Lists allProfile
instances, specifying a search query.getProfiles
(int offset, int count, String applicationNameOrId, String userId, Long lowerBoundTimestamp, Long upperBoundTimestamp) Lists allProfile
instances starting with the offset and count.default Profile
redactPrivateInformation
(Profile profile) Redacts any private information from theProfile
and 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 allProfile
instances 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
Pagination
ofProfile
instances
-
getProfiles
Lists allProfile
instances, specifying a search query.- Parameters:
offset
-count
-search
-- Returns:
-
redactPrivateInformation
Redacts any private information from theProfile
and 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 specificProfile
instance based on ID. If not found, an exception is raised.- Parameters:
profileId
- the profile ID- Returns:
- the
Profile
, never null
-
getCurrentProfile
Profile getCurrentProfile()Returns theProfile
of 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 throwNotFoundException
under 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 theProfile
to updateprofileRequest
- theUpdateProfileRequest
with the information to update- Returns:
- the
Profile
as 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
- theCreateProfileRequest
with the information to create- Returns:
- the
Profile
as it was created by the service.
-
deleteProfile
Deletes theProfile
with 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
-