Interface IUserProfileHandler
-
- All Superinterfaces:
IAPIHandler
,IGenericHandler
,Serializable
- All Known Implementing Classes:
UserProfileHandler
public interface IUserProfileHandler extends IGenericHandler
Handler forUserProfile
entities- Since:
- 8.0.0
- Author:
- XIMA Media GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UserProfile
acceptDirectClientAuthorization(UserContext uc, UserProfile profile, DirectClientAuthorization authorization)
Adds the given client authorization to the given profile and accepts it.UserProfile
addDirectClientAuthorization(UserContext uc, UserProfile userProfile, DirectClientAuthorization authorization)
Adds the given client authorizations to the user profile.boolean
canBeDeleted(UserContext uc, UserProfile profile)
Checks whether or not the user profile can be deleted.@NotBlank String
findUniqueUserName(UserContext uc, String candidate, UserProfile exclude)
Finds a unique user name for the given candidate.UserProfile
getById(UserContext uc, Long id)
Reads the entity with the given ID.UserProfile
getByLoginId(UserContext uc, String loginId)
Finds the user profile by the given login ID.UserProfile
getByUserName(UserContext uc, String userName)
Finds the user profile with the given user nameUserProfile
getByUserProfile(UserContext uc, org.pac4j.core.profile.UserProfile pac4jProfile)
Finds the formcycle user profile for the given pac4j profile.UserProfile
getByUuid(UserContext uc, String uuid)
Finds the user profile with the given UUID.UserProfile
getByUuid(UserContext uc, UUID uuid)
Finds the user credentials with the given UUID.UserProfile
getByVerifiedCallback(UserContext uc, String identifier, String clientName)
Finds the user profile by the given callback information.UserProfile
getByVerifiedEmailAddress(UserContext uc, String email)
Finds the user profile with the given verified email address.UserProfile
getByVerifiedPrimaryEmailAddress(UserContext uc, String email)
Finds the user profile with the given verified primary email address.boolean
isUserNameExisiting(UserContext uc, String name)
Checks if the given user name exists within the system.@NotNull UserProfile
mergeUserProfiles(UserContext uc, UserProfile main, UserProfile toBeMerged)
Merges the a profile into another.UserProfile
update(UserContext uc, UserProfile entity)
Updates the given user profile and returns the updated entity.org.pac4j.core.profile.UserProfile
validateSuperUserLogin(UserContext uc, String loginId, String password)
Validates the given user credentials and returns the user profile of the super user if successfully.org.pac4j.core.profile.UserProfile
validateUserLogin(UserContext uc, String loginId, String password)
Validates the given user credentials and returns the user profile if successfully.-
Methods inherited from interface de.xima.fc.com.interfaces.IAPIHandler
getName
-
Methods 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
-
-
-
-
Method Detail
-
getById
@Nullable UserProfile getById(UserContext uc, Long id)
Reads the entity with the given ID. Hibernate proxy fields may be initialized if requested.- Parameters:
uc
- user context for accessing the databaseid
- of the entity- Returns:
- the entity with the given ID with possibly initialized hibernate fields.
-
update
UserProfile update(UserContext uc, UserProfile entity)
Updates the given user profile and returns the updated entity. Hibernate proxy fields may be initialized if requested.- Parameters:
uc
- user context for accessing the databaseentity
- to update- Returns:
- the updated entity with possibly initialized hibernate fields.
-
getByLoginId
@Nullable UserProfile getByLoginId(UserContext uc, String loginId)
Finds the user profile by the given login ID. This ID may be the users primary email address or user name.- 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
UserProfile getByVerifiedEmailAddress(UserContext uc, String email)
Finds the user profile with the given verified email address.- 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
UserProfile getByVerifiedPrimaryEmailAddress(UserContext uc, String email)
Finds the user profile with the given verified primary email address.- 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
UserProfile getByUserName(UserContext uc, String userName)
Finds the user profile with the given user name- 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
UserProfile getByVerifiedCallback(UserContext uc, String identifier, String clientName)
Finds the user profile by the given callback information. The callback information includes the client name which identifies theSystemAuthenticator
or the authenticator type and the user identity identifier.- Parameters:
uc
- User context for database transactions.identifier
- Identifier of the user identity.clientName
- Identifies theSystemAuthenticator
or the authenticator type.- Returns:
- The user profile matching the callback information.
-
getByUuid
UserProfile getByUuid(UserContext uc, String uuid)
Finds the user profile with the given UUID.- Parameters:
uc
- User context for database transactions.uuid
- UUID of the user profile.- Returns:
- The user profile with the given UUID.
-
getByUuid
UserProfile getByUuid(UserContext uc, UUID uuid)
Finds the user credentials with the given UUID.- Parameters:
uc
- User context for database transactions.uuid
- of the user profile.- Returns:
- The user profile with the given UUID.
-
getByUserProfile
UserProfile getByUserProfile(UserContext uc, org.pac4j.core.profile.UserProfile pac4jProfile)
Finds the formcycle user profile for the given pac4j profile.- 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 @NotBlank String findUniqueUserName(UserContext uc, String candidate, UserProfile exclude)
Finds a unique user name for the given candidate. If the candidate is not unique a random number will be appended.- 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
boolean isUserNameExisiting(UserContext uc, String name)
Checks if the given user name exists within the system.- Parameters:
uc
- user context for database transactions.name
- user name to check.- Returns:
true
if the user name exists already andfalse
otherwise.
-
validateUserLogin
org.pac4j.core.profile.UserProfile validateUserLogin(UserContext uc, String loginId, String password)
Validates the given user credentials and returns the user profile if successfully. If enabled, the super user will also be taken into account- 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.
null
otherwise.
-
validateSuperUserLogin
org.pac4j.core.profile.UserProfile validateSuperUserLogin(UserContext uc, String loginId, String password)
Validates the given user credentials and returns the user profile of the super user if successfully.- 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.
null
otherwise.
-
addDirectClientAuthorization
UserProfile addDirectClientAuthorization(UserContext uc, UserProfile userProfile, DirectClientAuthorization authorization)
Adds 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 allroles
anduser groups
will be added to the existing client authorization of the user profile.- Parameters:
uc
- User context for database transactions.userProfile
- to add the direct client authorization to.authorization
- to add.- Returns:
- the updated user profile or
null
if an error occurred and the client authorization could not be added.
-
mergeUserProfiles
@NotNull @NotNull UserProfile mergeUserProfiles(UserContext uc, UserProfile main, UserProfile toBeMerged)
Merges 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.- 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.
-
acceptDirectClientAuthorization
UserProfile acceptDirectClientAuthorization(UserContext uc, UserProfile profile, DirectClientAuthorization authorization)
Adds 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.- 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.
-
canBeDeleted
boolean canBeDeleted(UserContext uc, UserProfile profile)
Checks 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.- Parameters:
uc
- User context for database transactions.profile
- to check.- Returns:
true
id the user profile can be deleted (is not the single admin of any existing clients) andfalse
otherwise.
-
-