Class IdentityPickerService
java.lang.Object
fr.paris.lutece.plugins.identitypicker.service.IdentityPickerService
Service class for managing identities in the Identity Picker plugin.
This class provides methods for searching, creating, and updating identities,
as well as retrieving rules and referential data.
-
Method Summary
Modifier and TypeMethodDescriptionfr.paris.lutece.plugins.identitystore.v3.web.rs.dto.task.IdentityTaskCreateResponsecreateAccountTask(String customerId, fr.paris.lutece.api.user.User luteceUser) Create an account creation task for a specific identity.fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.task.IdentityTaskCreateResponsecreateEmailValidationTask(String customerId, fr.paris.lutece.api.user.User luteceUser) Create an email validation task for a specific identity.fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponsecreateIdentity(Map<String, Object> data, fr.paris.lutece.api.user.User luteceUser) Creates a new identity.intgetHttpCodeFromResponse(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response) Gets the HTTP code from an IdentityChangeResponse.Optional<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto>getIdentity(String customerId, fr.paris.lutece.api.user.User luteceUser) Gets a specific identity by customer ID.Optional<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityHistory>getIdentityHistory(String customerId, fr.paris.lutece.api.user.User luteceUser) Gets the history of changes for a specific identity.getIdentityTasks(String customerId, fr.paris.lutece.api.user.User luteceUser) Gets the status of a specific identity task.static IdentityPickerServiceGets the singleton instance of IdentityPickerService.getRules(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.api.user.User luteceUser) Gets the rules and referential data.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto>searchIdentities(IdentitySearchCriteria criteria, fr.paris.lutece.api.user.User luteceUser) Searches for identities based on given criteria.fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponseupdateIdentity(String customerId, Map<String, Object> data, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto previousIdentity, fr.paris.lutece.api.user.User luteceUser) Updates an existing identity.
-
Method Details
-
getInstance
Gets the singleton instance of IdentityPickerService.- Returns:
- The IdentityPickerService instance
-
searchIdentities
public List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto> searchIdentities(IdentitySearchCriteria criteria, fr.paris.lutece.api.user.User luteceUser) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException Searches for identities based on given criteria.- Parameters:
criteria- The search criterialuteceUser- The current Lutece user- Returns:
- A list of matching IdentityDto objects
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- If an error occurs during the search
-
getIdentity
public Optional<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto> getIdentity(String customerId, fr.paris.lutece.api.user.User luteceUser) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException Gets a specific identity by customer ID.- Parameters:
customerId- The customer IDluteceUser- The current Lutece user- Returns:
- An Optional containing the IdentityDto for the specified customer, or empty if not found
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- If an error occurs while fetching the identity
-
getRules
public Rules getRules(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.api.user.User luteceUser) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException Gets the rules and referential data.- Parameters:
luteceUser- The current Lutece user- Returns:
- A Rules object containing referential data and service contract
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- If an error occurs while fetching the data
-
createIdentity
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse createIdentity(Map<String, Object> data, fr.paris.lutece.api.user.User luteceUser) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreExceptionCreates a new identity.- Parameters:
data- The identity dataluteceUser- The current Lutece user- Returns:
- The response from the identity creation request
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- If an error occurs during identity creation
-
updateIdentity
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse updateIdentity(String customerId, Map<String, Object> data, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto previousIdentity, fr.paris.lutece.api.user.User luteceUser) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreExceptionUpdates an existing identity.- Parameters:
customerId- The customer ID of the identity to updatedata- The updated identity datapreviousIdentity- The previous state of the identityluteceUser- The current Lutece user- Returns:
- The response from the identity update request
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- If an error occurs during identity update
-
getHttpCodeFromResponse
public int getHttpCodeFromResponse(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response) Gets the HTTP code from an IdentityChangeResponse.- Parameters:
response- The IdentityChangeResponse- Returns:
- The HTTP code, or 500 if the response or status is null
-
getIdentityHistory
public Optional<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityHistory> getIdentityHistory(String customerId, fr.paris.lutece.api.user.User luteceUser) Gets the history of changes for a specific identity.- Parameters:
customerId- The customer ID of the identityluteceUser- The current Lutece user- Returns:
- An Optional containing the IdentityHistory, or empty if not found or an error occurs
-
getIdentityTasks
public Optional<List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.task.IdentityTaskDto>> getIdentityTasks(String customerId, fr.paris.lutece.api.user.User luteceUser) Gets the status of a specific identity task.- Parameters:
customerId- The customer ID of the identityauthor- The request author- Returns:
- An Optional containing the IdentityTaskDto, or empty if not found or an error occurs
-
createAccountTask
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.task.IdentityTaskCreateResponse createAccountTask(String customerId, fr.paris.lutece.api.user.User luteceUser) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException Create an account creation task for a specific identity.- Parameters:
customerId- The customer ID of the identityluteceUser- The current Lutece user- Returns:
- The response from the identity task creation request
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- If an error occurs during task creation
-
createEmailValidationTask
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.task.IdentityTaskCreateResponse createEmailValidationTask(String customerId, fr.paris.lutece.api.user.User luteceUser) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException Create an email validation task for a specific identity.- Parameters:
customerId- The customer ID of the identityluteceUser- The current Lutece user- Returns:
- The response from the identity task creation request
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- If an error occurs during task creation
-