Class IdentityPickerService

java.lang.Object
fr.paris.lutece.plugins.identitypicker.service.IdentityPickerService

public class IdentityPickerService extends Object
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 Type
    Method
    Description
    fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.task.IdentityTaskCreateResponse
    createAccountTask(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.IdentityTaskCreateResponse
    createEmailValidationTask(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.IdentityChangeResponse
    createIdentity(Map<String,Object> data, fr.paris.lutece.api.user.User luteceUser)
    Creates a new identity.
    int
    getHttpCodeFromResponse(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.
    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.
    Gets 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.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)
    Updates an existing identity.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getInstance

      public static IdentityPickerService 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 criteria
      luteceUser - 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 ID
      luteceUser - 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.IdentityStoreException
      Creates a new identity.
      Parameters:
      data - The identity data
      luteceUser - 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.IdentityStoreException
      Updates an existing identity.
      Parameters:
      customerId - The customer ID of the identity to update
      data - The updated identity data
      previousIdentity - The previous state of the identity
      luteceUser - 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 identity
      luteceUser - 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 identity
      author - 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 identity
      luteceUser - 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 identity
      luteceUser - 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