Class IdentityService


  • public class IdentityService
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      IdentityService()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.commons.lang3.tuple.Pair<Identity,​java.util.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, java.lang.String clientCode)
      Detach a merged Identity from its master Identity
      org.apache.commons.lang3.tuple.Pair<Identity,​java.util.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, java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus> formatStatuses)
      Creates a new Identity according to the given IdentityChangeRequest
      void delete​(java.lang.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​(java.lang.String customerId, java.lang.String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author)
      request a deletion of identity .
      Batch<java.lang.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).
      static IdentityService instance()  
      org.apache.commons.lang3.tuple.Pair<Identity,​java.util.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, java.lang.String duplicateRuleCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, java.lang.String clientCode, boolean isResetFlagMonParisActive, java.util.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.
      java.util.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​(java.lang.String customerId)
      Performs a search of an IdentityDto, providing its customer id
      fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto search​(java.lang.String customerId, java.lang.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.
      java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto> search​(java.util.List<java.lang.String> customerIds, java.util.List<java.lang.String> attributes)
      Performs a search of a list of IdentityDto, providing a list of customer ids
      org.apache.commons.lang3.tuple.Pair<java.util.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,​java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>> uncertifyIdentity​(java.lang.String strCustomerId, java.util.List<AttributeKey> requestedAttributesKeys, java.lang.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,​java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>> update​(java.lang.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, java.util.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 Detail

      • CREATE_IDENTITY_EVENT_CODE

        public static final java.lang.String CREATE_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
      • UPDATE_IDENTITY_EVENT_CODE

        public static final java.lang.String UPDATE_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
      • DECERTIFY_IDENTITY_EVENT_CODE

        public static final java.lang.String DECERTIFY_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
      • GET_IDENTITY_EVENT_CODE

        public static final java.lang.String GET_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
      • SEARCH_IDENTITY_EVENT_CODE

        public static final java.lang.String SEARCH_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
      • DELETE_IDENTITY_EVENT_CODE

        public static final java.lang.String DELETE_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
      • CONSOLIDATE_IDENTITY_EVENT_CODE

        public static final java.lang.String CONSOLIDATE_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
      • MERGE_IDENTITY_EVENT_CODE

        public static final java.lang.String MERGE_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
      • CANCEL_MERGE_IDENTITY_EVENT_CODE

        public static final java.lang.String CANCEL_MERGE_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
      • CANCEL_CONSOLIDATE_IDENTITY_EVENT_CODE

        public static final java.lang.String CANCEL_CONSOLIDATE_IDENTITY_EVENT_CODE
        See Also:
        Constant Field Values
    • Constructor Detail

      • IdentityService

        public IdentityService()
    • Method Detail

      • create

        public org.apache.commons.lang3.tuple.Pair<Identity,​java.util.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,
                                                                                                                                                                     java.util.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,​java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>> update​(java.lang.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,
                                                                                                                                                                     java.util.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,​java.util.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,
                                                                                                                                                                    java.lang.String duplicateRuleCode,
                                                                                                                                                                    fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author,
                                                                                                                                                                    java.lang.String clientCode,
                                                                                                                                                                    boolean isResetFlagMonParisActive,
                                                                                                                                                                    java.util.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,​java.util.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,
                                                                                                                                                                          java.lang.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 java.util.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​(java.lang.String customerId,
                                                                                             java.lang.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 java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto> search​(java.util.List<java.lang.String> customerIds,
                                                                                                             java.util.List<java.lang.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​(java.lang.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<java.lang.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​(java.lang.String customerId,
                                  java.lang.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,​java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.AttributeStatus>> uncertifyIdentity​(java.lang.String strCustomerId,
                                                                                                                                                                                java.util.List<AttributeKey> requestedAttributesKeys,
                                                                                                                                                                                java.lang.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:
        IdentityAttributeService.uncertifyAttribute(fr.paris.lutece.plugins.identitystore.business.identity.IdentityAttribute)
      • delete

        public void delete​(java.lang.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<java.util.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