Package de.xima.fc.handler.entity
Class UserProfileHandler
java.lang.Object
de.xima.fc.handler.AMSApiHandler
de.xima.fc.handler.entity.GenericHandler
de.xima.fc.handler.entity.UserProfileHandler
- All Implemented Interfaces:
IAPIHandler,IGenericHandler,IUserProfileHandler,Serializable
Handler implementation for reading and writing
UserProfile entities.- Since:
- 8.0.0
- Author:
- XIMA Media GmbH
- See Also:
-
Field Summary
Fields inherited from class de.xima.fc.handler.entity.GenericHandler
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacceptDirectClientAuthorization(UserContext uc, UserProfile profile, DirectClientAuthorization authorization) Adds the given client authorization to the given profile and accepts it.addDirectClientAuthorization(UserContext uc, UserProfile userProfile, DirectClientAuthorization authorization) Adds the given client authorizations to the user profile.booleancanBeDeleted(UserContext uc, UserProfile profile) Checks whether or not the user profile can be deleted.@NotBlank StringfindUniqueUserName(UserContext uc, String candidate, UserProfile exclude) Finds a unique user name for the given candidate.getById(UserContext uc, Long id) Reads the entity with the given ID.getByLoginId(UserContext uc, String loginId) Finds the user profile by the given login ID.getByUserName(UserContext uc, String userName) Finds the user profile with the given user namegetByUserProfile(UserContext uc, org.pac4j.core.profile.UserProfile pac4jProfile) Finds the formcycle user profile for the given pac4j profile.getByUuid(UserContext uc, String uuid) Finds the user profile with the given UUID.getByUuid(UserContext uc, UUID uuid) Finds the user credentials with the given UUID.getByVerifiedCallback(UserContext uc, String identifier, String callbackUuid) Finds the user profile by the given callback information.getByVerifiedEmailAddress(UserContext uc, String email) Finds the user profile with the given verified email address.getByVerifiedPrimaryEmailAddress(UserContext uc, String email) Finds the user profile with the given verified primary email address.booleanisUserNameExisiting(UserContext uc, String name) Checks if the given user name exists within the system.@NotNull UserProfilemergeUserProfiles(UserContext uc, UserProfile main, UserProfile toBeMerged) Merges the a profile into another.update(UserContext uc, UserProfile entity) Updates the given user profile and returns the updated entity.validateUserLogin(UserContext uc, String loginId, String password) Validates the given user credentials and returns the user profile if successfull.Methods inherited from class de.xima.fc.handler.entity.GenericHandler
create, create, delete, delete, deleteBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getById, getEntityRefs, getSingleAttributes, getSingleAttributes, resultTotalCount, serializableList, update, updateMethods inherited from class de.xima.fc.handler.AMSApiHandler
getNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.xima.fc.com.interfaces.IAPIHandler
getNameMethods inherited from interface de.xima.fc.handler.interfaces.entity.IGenericHandler
create, create, delete, delete, deleteBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getById, getEntityRefs, getSingleAttributes, getSingleAttributes, resultTotalCount, update, update
-
Constructor Details
-
UserProfileHandler
public UserProfileHandler()
-
-
Method Details
-
getById
Description copied from interface:IUserProfileHandlerReads the entity with the given ID. Hibernate proxy fields may be initialized if requested.- Specified by:
getByIdin interfaceIUserProfileHandler- Parameters:
uc- user context for accessing the databaseid- of the entity- Returns:
- the entity with the given ID with possibly initialized hibernate fields.
-
update
Description copied from interface:IUserProfileHandlerUpdates the given user profile and returns the updated entity. Hibernate proxy fields may be initialized if requested.- Specified by:
updatein interfaceIUserProfileHandler- Parameters:
uc- user context for accessing the databaseentity- to update- Returns:
- the updated entity with possibly initialized hibernate fields.
-
getByLoginId
Description copied from interface:IUserProfileHandlerFinds the user profile by the given login ID. This ID may be the users primary email address or user name.- Specified by:
getByLoginIdin interfaceIUserProfileHandler- Parameters:
uc- user context for accessing the databaseloginId- primary email address (case irrelevant) or user name of the user profile.- Returns:
- The user profile for the given login ID or
null.
-
getByVerifiedEmailAddress
Description copied from interface:IUserProfileHandlerFinds the user profile with the given verified email address.- Specified by:
getByVerifiedEmailAddressin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.email- of the user profile (case irrelevant).- Returns:
- The user profile with the given verified email or
null.
-
getByVerifiedPrimaryEmailAddress
Description copied from interface:IUserProfileHandlerFinds the user profile with the given verified primary email address.- Specified by:
getByVerifiedPrimaryEmailAddressin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.email- of the user profile (case irrelevant).- Returns:
- The user profile with the given verified primary email or
null.
-
getByUserName
Description copied from interface:IUserProfileHandlerFinds the user profile with the given user name- Specified by:
getByUserNamein interfaceIUserProfileHandler- Parameters:
uc- Current user context for database transactions.userName- of the user profile- Returns:
- The user profile with the given user name or
null.
-
getByVerifiedCallback
Description copied from interface:IUserProfileHandlerFinds the user profile by the given callback information. The callback information includes the client name which identifies theSystemAuthenticatoror the authenticator type and the user identity identifier.- Specified by:
getByVerifiedCallbackin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.identifier- Identifier of the user identity.callbackUuid- Identifies theSystemAuthenticatoror the authenticator type.- Returns:
- The user profile matching the callback information.
-
getByUuid
Description copied from interface:IUserProfileHandlerFinds the user profile with the given UUID.- Specified by:
getByUuidin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.uuid- UUID of the user profile.- Returns:
- The user profile with the given UUID.
-
getByUuid
Description copied from interface:IUserProfileHandlerFinds the user credentials with the given UUID.- Specified by:
getByUuidin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.uuid- of the user profile.- Returns:
- The user profile with the given UUID.
-
getByUserProfile
public UserProfile getByUserProfile(UserContext uc, org.pac4j.core.profile.UserProfile pac4jProfile) Description copied from interface:IUserProfileHandlerFinds the formcycle user profile for the given pac4j profile.- Specified by:
getByUserProfilein interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.pac4jProfile- pac4j user profile to find the formcycle user profile for.- Returns:
- The user profile for the Pac4J profile, if any.
-
findUniqueUserName
@NotBlank public @NotBlank String findUniqueUserName(UserContext uc, String candidate, UserProfile exclude) Description copied from interface:IUserProfileHandlerFinds a unique user name for the given candidate. If the candidate is not unique a random number will be appended.- Specified by:
findUniqueUserNamein interfaceIUserProfileHandler- Parameters:
uc- user context for database transactions.candidate- desired user name.exclude- user profile to be excluded from search.- Returns:
- a unique user name.
-
isUserNameExisiting
Description copied from interface:IUserProfileHandlerChecks if the given user name exists within the system.- Specified by:
isUserNameExisitingin interfaceIUserProfileHandler- Parameters:
uc- user context for database transactions.name- user name to check.- Returns:
trueif the user name exists already andfalseotherwise.
-
validateUserLogin
Description copied from interface:IUserProfileHandlerValidates the given user credentials and returns the user profile if successfull.- Specified by:
validateUserLoginin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.loginId- user name or primary email address of the user.password- password for the user profile.- Returns:
- user profile if validation was successful.
nullotherwise.
-
addDirectClientAuthorization
public UserProfile addDirectClientAuthorization(UserContext uc, UserProfile userProfile, DirectClientAuthorization authorization) Description copied from interface:IUserProfileHandlerAdds the given client authorizations to the user profile. If the user profile already has an authorization to client than the authorizations will be merged, meaning that allrolesanduser groupswill be added to the existing client authorization of the user profile.- Specified by:
addDirectClientAuthorizationin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.userProfile- to add the direct client authorization to.authorization- to add.- Returns:
- the updated user profile or
nullif an error occurred and the client authorization could not be added.
-
acceptDirectClientAuthorization
public UserProfile acceptDirectClientAuthorization(UserContext uc, UserProfile profile, DirectClientAuthorization authorization) Description copied from interface:IUserProfileHandlerAdds the given client authorization to the given profile and accepts it. If an authorization for the client already exists than the authorizations will be merged.- Specified by:
acceptDirectClientAuthorizationin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactionsprofile- User profile to add the client authorization to.authorization- Client authorization to add- Returns:
- The user profile with the added client authorization.
-
mergeUserProfiles
@NotNull public @NotNull UserProfile mergeUserProfiles(UserContext uc, UserProfile main, UserProfile toBeMerged) Description copied from interface:IUserProfileHandlerMerges the a profile into another. Emails, identities, authorizations, permissions, roles, credentials, files will be added / merged. The custom user properties won't be affected. The profile that will be merged into the other profile will be deleted when the merge has completed.- Specified by:
mergeUserProfilesin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.main- to be extended by merging another profile into it.toBeMerged- profile that will be merged into the main profile. This profile will be deleted when the merge has completed.- Returns:
- the extended user profile.
-
canBeDeleted
Description copied from interface:IUserProfileHandlerChecks whether or not the user profile can be deleted. User profiles can't be deleted if they are the only admin of existing clients. If the user profile can't be deleted the given user context will contain a set of clients for which the user profile is the only client admin.- Specified by:
canBeDeletedin interfaceIUserProfileHandler- Parameters:
uc- User context for database transactions.profile- to check.- Returns:
trueid the user profile can be deleted (is not the single admin of any existing clients) andfalseotherwise.
-