Class SuperUserProfileService
java.lang.Object
dev.getelements.elements.service.profile.SuperUserProfileService
- All Implemented Interfaces:
ProfileService
Provides full access to the
Profile
and related types. Should be
used in conjunction with users SUPERUSER level access.
Created by patricktwohig on 6/28/17.-
Field Summary
Fields inherited from interface dev.getelements.elements.sdk.service.profile.ProfileService
PROFILE_CREATED_EVENT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateProfile
(CreateProfileRequest createProfileRequest) 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.void
setApplicationDao
(ApplicationDao applicationDao) void
setCurrentProfileOptional
(Optional<Profile> currentProfileOptional) void
setCurrentProfileSupplier
(Supplier<Profile> currentProfileSupplier) void
setElementRegistry
(ElementRegistry elementRegistry) void
setLargeObjectDao
(LargeObjectDao largeObjectDao) void
setNameService
(NameService nameService) void
setProfileDao
(ProfileDao profileDao) void
setProfileImageObjectUtils
(ProfileImageObjectUtils profileImageObjectUtils) void
setProfileServiceUtils
(ProfileServiceUtils profileServiceUtils) void
setUserDao
(UserDao userDao) updateProfile
(String profileId, UpdateProfileRequest profileRequest) Updates the suppliedProfile
.updateProfileImage
(String profileId, UpdateProfileImageRequest updateProfileImageRequest) Update profile image related fieldsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.sdk.service.profile.ProfileService
redactPrivateInformation
-
Constructor Details
-
SuperUserProfileService
public SuperUserProfileService()
-
-
Method Details
-
getProfiles
public Pagination<Profile> getProfiles(int offset, int count, String applicationNameOrId, String userId, Long lowerBoundTimestamp, Long upperBoundTimestamp) Description copied from interface:ProfileService
Lists allProfile
instances starting with the offset and count.- Specified by:
getProfiles
in interfaceProfileService
- 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
Description copied from interface:ProfileService
Lists allProfile
instances, specifying a search query.- Specified by:
getProfiles
in interfaceProfileService
- Parameters:
offset
-count
-search
-- Returns:
-
getProfile
Description copied from interface:ProfileService
Fetches a specificProfile
instance based on ID. If not found, an exception is raised.- Specified by:
getProfile
in interfaceProfileService
- Parameters:
profileId
- the profile ID- Returns:
- the
Profile
, never null
-
getCurrentProfile
Description copied from interface:ProfileService
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.- Specified by:
getCurrentProfile
in interfaceProfileService
- Returns:
- the
Profile
, or null, if no profile is found.
-
findCurrentProfile
Description copied from interface:ProfileService
Finds the currently active profile, if any.- Specified by:
findCurrentProfile
in interfaceProfileService
- Returns:
- an
Optional<Profile>
-
updateProfile
Description copied from interface:ProfileService
- Specified by:
updateProfile
in interfaceProfileService
- 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
Description copied from interface:ProfileService
Creates a new profile. The ID of the profile, as specified byProfile.getId()
, should be null and will be assigned.- Specified by:
createProfile
in interfaceProfileService
- Parameters:
createProfileRequest
- theCreateProfileRequest
with the information to create- Returns:
- the
Profile
as it was created by the service.
-
deleteProfile
Description copied from interface:ProfileService
Deletes theProfile
with the supplied profile ID.- Specified by:
deleteProfile
in interfaceProfileService
- Parameters:
profileId
- the profile ID.
-
updateProfileImage
public Profile updateProfileImage(String profileId, UpdateProfileImageRequest updateProfileImageRequest) throws IOException Description copied from interface:ProfileService
Update profile image related fields- Specified by:
updateProfileImage
in interfaceProfileService
- Parameters:
updateProfileImageRequest
- request with image object values- Throws:
IOException
-
getProfileDao
-
getUserDao
-
setUserDao
-
setProfileDao
-
getApplicationDao
-
getNameService
-
setNameService
@Inject public void setNameService(@Named("dev.getelements.elements.service.unscoped") NameService nameService) -
setApplicationDao
-
getCurrentProfileOptional
-
setCurrentProfileOptional
-
getCurrentProfileSupplier
-
setCurrentProfileSupplier
-
getProfileServiceUtils
-
setProfileServiceUtils
-
getProfileImageObjectUtils
-
setProfileImageObjectUtils
-
getLargeObjectDao
-
setLargeObjectDao
-
getElementRegistry
-
setElementRegistry
-