java.lang.Object
fr.paris.lutece.plugins.identitystore.service.identity.IdentityService

public class IdentityService extends Object
  • Field Summary

    Fields
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>>
    cancelMerge(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.merge.IdentityMergeRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, String clientCode)
    Detach a merged Identity from its master Identity
    org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>>
    create(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, ServiceContract serviceContract, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus> formatStatuses)
    Creates a new Identity according to the given IdentityChangeRequest
    void
    delete(String customerId)
    Delete the identity and all his children, including potential merged identities, EXCEPT identity history.
    The purge consist of deleting, for the identity and all of its potential merged identities : the Identity object the IdentityAttribute objetcs the IdentityAttributeHistory objects the SuspiciousIdentity objects the ExcludedIdentities objects The identity's history is kept.
    void
    deleteRequest(String customerId, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author)
    request a deletion of identity .
    getCUIDsBatchForPotentialDuplicate(DuplicateRule rule, int batchSize, boolean includeSuspicions)
    Gets a list of qualified identities on which to search potential duplicates.
    Returned identities must have all attributes checked by the provided rule, and must also not be already merged nor be tagged as suspicious.
    The list is sorted by quality (higher quality identities first).
     
    org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>>
    merge(Identity primaryIdentity, Identity secondaryIdentity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identityForConsolidate, String duplicateRuleCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, String clientCode, boolean isResetFlagMonParisActive, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus> formatStatuses)
    Merges two existing Identity specified in the given IdentityMergeRequest and following the given rules:
    Both Identity must exist and not be merged or deleted in te database.
    List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto>
    search(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.IdentitySearchRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, ServiceContract serviceContract)
    Perform an identity research over a list of attributes (key and values) specified in the IdentitySearchRequest
    fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto
    search(String customerId)
    Performs a search of an IdentityDto, providing its customer id
    fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto
    search(String customerId, String connectionId, ServiceContract serviceContract, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author)
    Perform an identity research by customer or connection ID.
    List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto>
    search(List<String> customerIds, List<String> attributes)
    Performs a search of a list of IdentityDto, providing a list of customer ids
    org.apache.commons.lang3.tuple.Pair<List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto>,fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.Page>
    searchUpdatedIdentities(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.UpdatedIdentitySearchRequest request)
    Search for updated identities according to the provided request
    org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>>
    uncertifyIdentity(String strCustomerId, List<AttributeKey> requestedAttributesKeys, String strClientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author)
    Dé-certification d'une identité.
    org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>>
    update(String customerId, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, ServiceContract serviceContract, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus> formatStatuses)
    Updates an existing Identity according to the given IdentityChangeRequest and following the given rules:
    The Identity must exist in te database.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • IdentityService

      public IdentityService()
  • Method Details

    • instance

      public static IdentityService instance()
    • create

      public org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>> create(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, ServiceContract serviceContract, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus> formatStatuses) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Creates a new Identity according to the given IdentityChangeRequest
      Parameters:
      request - the IdentityChangeRequest holding the parameters of the identity change request
      author - the author of the request
      serviceContract - service contract of the client requesting the change
      formatStatuses - the attribute formatting statuses (only for history purposes)
      Returns:
      the created Identity along with a list of the AttributeStatus
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException - in case of error
    • update

      public org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>> update(String customerId, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, ServiceContract serviceContract, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus> formatStatuses) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Updates an existing Identity according to the given IdentityChangeRequest and following the given rules:
      • The Identity must exist in te database. If not, NOT_FOUND status is returned in the execution response
      • The Identity must not be merged or deleted. In case of merged/deleted identity, the update is not performed and the customer ID of the primary identity is returned in the execution response with a CONFLICT status
      • If the Identity can be updated, its IdentityAttribute list is updated following the given rule:
        • If the IdentityAttribute exists, it is updated if the value is different, and if the process level given in the request is higher than the existing one. If the value cannot be updated, the NOT_UPDATED status, associated with the attribute key, is returned in the execution response.
        • If the IdentityAttribute does not exist, it is created. The CREATED status, associated with the attribute key, is returned in the execution response.
        • CUID and GUID attributes cannot be modified.
      Parameters:
      customerId - the id of the updated Identity
      request - the IdentityChangeRequest holding the parameters of the identity change request
      author - the author of the request
      serviceContract - service contract of the client requesting the change
      formatStatuses - the attribute formatting statuses (only for history purposes)
      Returns:
      the updated Identity along with the attribute statuses
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException - in case of error
    • merge

      public org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>> merge(Identity primaryIdentity, Identity secondaryIdentity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identityForConsolidate, String duplicateRuleCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, String clientCode, boolean isResetFlagMonParisActive, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus> formatStatuses) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Merges two existing Identity specified in the given IdentityMergeRequest and following the given rules:
      • Both Identity must exist and not be merged or deleted in te database. If not, FAILURE status is returned in the execution response
      • The IdentityAttribute(s) of the secondary Identity are processed, according to the list of keys specified in the IdentityMergeRequest.
      Parameters:
      primaryIdentity - the primary identity (master)
      secondaryIdentity - the secondary identity (merged)
      identityForConsolidate - the identityDto holding the attributes for consolidation
      duplicateRuleCode - the duplicate rule code
      author - the author of the request
      clientCode - code of the ClientApplication requesting the change
      formatStatuses - the format statuses (only for history)
      Returns:
      the merged Identity
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException - in case of error
    • cancelMerge

      public org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>> cancelMerge(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.merge.IdentityMergeRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, String clientCode) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Detach a merged Identity from its master Identity
      Parameters:
      request - the unmerge request
      author - the author of the request
      clientCode - the client code of the calling application
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
    • search

      public List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto> search(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.IdentitySearchRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, ServiceContract serviceContract) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Perform an identity research over a list of attributes (key and values) specified in the IdentitySearchRequest
      Parameters:
      request - the IdentitySearchRequest holding the parameters of the research
      author - the author of the request
      serviceContract - service contract of the client requesting the change
      Returns:
      list of matching identities
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.ResourceNotFoundException - in case of AttributeKey management error
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException - in case of unpredicted error
    • search

      public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto search(String customerId, String connectionId, ServiceContract serviceContract, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Perform an identity research by customer or connection ID.
      Parameters:
      customerId -
      connectionId -
      serviceContract -
      author - the author of the request
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.ResourceNotFoundException
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
    • search

      public List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto> search(List<String> customerIds, List<String> attributes)
      Performs a search of a list of IdentityDto, providing a list of customer ids
      Parameters:
      customerIds - the customer ids to search for
      Returns:
      a list of IdentityDto
    • search

      public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto search(String customerId)
      Performs a search of an IdentityDto, providing its customer id
      Parameters:
      customerId - the customer id to search for
      Returns:
      an IdentityDto
    • getCUIDsBatchForPotentialDuplicate

      public Batch<String> getCUIDsBatchForPotentialDuplicate(DuplicateRule rule, int batchSize, boolean includeSuspicions)
      Gets a list of qualified identities on which to search potential duplicates.
      Returned identities must have all attributes checked by the provided rule, and must also not be already merged nor be tagged as suspicious.
      The list is sorted by quality (higher quality identities first).
      Parameters:
      rule - the rule used to get matching identities
      batchSize - the size of the batches
      includeSuspicions - filter CUIDs, to include or not, the CUIDs that are identified as suspicions
      Returns:
      the list of identities
    • deleteRequest

      public void deleteRequest(String customerId, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      request a deletion of identity .
      Parameters:
      customerId - the customer ID
      clientCode - the client code
      author - the author of the request
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
    • uncertifyIdentity

      public org.apache.commons.lang3.tuple.Pair<Identity,List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>> uncertifyIdentity(String strCustomerId, List<AttributeKey> requestedAttributesKeys, String strClientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Dé-certification d'une identité.
      Parameters:
      strCustomerId - customer ID
      Returns:
      the response
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      See Also:
    • delete

      public void delete(String customerId)
      Delete the identity and all his children, including potential merged identities, EXCEPT identity history.
      The purge consist of deleting, for the identity and all of its potential merged identities : The identity's history is kept.
      Parameters:
      customerId - the customerId of the identity to delete the customerId of the identity to delete
    • searchUpdatedIdentities

      public org.apache.commons.lang3.tuple.Pair<List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto>,fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.Page> searchUpdatedIdentities(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.UpdatedIdentitySearchRequest request) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Search for updated identities according to the provided request
      Parameters:
      request - the request
      Returns:
      the updated identities, along with the pagination (or null if none requested)
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException - in case of error