Class AbstractUserService
java.lang.Object
dev.getelements.elements.service.user.AbstractUserService
- All Implemented Interfaces:
UserService
- Direct Known Subclasses:
AnonUserService,SuperuserUserService
Created by patricktwohig on 3/26/15.
-
Field Summary
Fields inherited from interface dev.getelements.elements.sdk.service.user.UserService
CURRENT_USER_ALIAS, USER_CREATED_EVENT, USER_DELETED_EVENT, USER_UPDATED_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ProfileautoCreateExplicitProfileIfRequested(String userId, UserCreateRequest userCreateRequest) Auto-creates the user's primary profile for the application named byUserCreateRequest.getAutoCreateProfileApplicationNameOrId(), if requested.protected ProfilecreateProfile(String userId, CreateProfileSignupRequest createProfileSignupRequest) Creates a profile from the supplied user id andCreateProfileSignupRequest.createProfiles(String userId, List<CreateProfileSignupRequest> createProfileSignupRequests) Creates severalProfiles.Gets the currently logged in user.voidsetApplicationDao(ApplicationDao applicationDao) voidsetCurrentUser(User currentUser) voidsetElementRegistry(ElementRegistry elementRegistry) voidsetNameService(NameService nameService) voidsetProfileDao(ProfileDao profileDao) voidsetSuperUserProfileService(SuperUserProfileService superUserProfileService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.sdk.service.user.UserService
checkForCurrentUser, createUser, deleteUser, getUser, getUsers, getUsers, isCurrentUser, isCurrentUserAlias, updateUser, updateUserPassword
-
Constructor Details
-
AbstractUserService
public AbstractUserService()
-
-
Method Details
-
getCurrentUser
Description copied from interface:UserServiceGets the currently logged in user.- Specified by:
getCurrentUserin interfaceUserService- Returns:
- the currently logged in user
-
setCurrentUser
-
getElementRegistry
-
setElementRegistry
-
getProfileDao
-
setProfileDao
-
getNameService
-
setNameService
-
getApplicationDao
-
setApplicationDao
-
getSuperUserProfileService
-
setSuperUserProfileService
-
createProfile
protected Profile createProfile(String userId, CreateProfileSignupRequest createProfileSignupRequest) Creates a profile from the supplied user id andCreateProfileSignupRequest.- Parameters:
userId- the user id as specified byUser.getId()createProfileSignupRequest- theCreateProfileSignupRequest- Returns:
- the created
Profile
-
createProfiles
protected List<Profile> createProfiles(String userId, List<CreateProfileSignupRequest> createProfileSignupRequests) -
autoCreateExplicitProfileIfRequested
protected Profile autoCreateExplicitProfileIfRequested(String userId, UserCreateRequest userCreateRequest) Auto-creates the user's primary profile for the application named byUserCreateRequest.getAutoCreateProfileApplicationNameOrId(), if requested. This is an explicit, opt-in action: if that field is null, this is a no-op, preserving pre-existing behavior. If the named application also appears inUserCreateRequest.getProfiles(), this throws aBadRequestException, since the two mechanisms conflict for the same application. Otherwise, a profile is only actually created if the application is configured for it (i.e.Application.getAutoCreateProfile()istrueandApplication.getMaxProfiles()is at least 1) -- if not, this silently no-ops rather than erroring, since the field names the feature to invoke, but the application's own configuration still governs whether it does anything.- Parameters:
userId- the id of the newly createdUseruserCreateRequest- the originalUserCreateRequest- Returns:
- the auto-created
Profile, or null if none was created
-