Class IdentityService
java.lang.Object
fr.paris.lutece.plugins.identitystore.service.identity.IdentityService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.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) 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 newIdentityaccording to the givenIdentityChangeRequestvoidDelete 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 : theIdentityobject theIdentityAttributeobjetcs the IdentityAttributeHistory objects theSuspiciousIdentityobjects theExcludedIdentitiesobjects The identity's history is kept.voiddeleteRequest(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).static IdentityServiceinstance()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) 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 theIdentitySearchRequestfr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtoPerforms a search of anIdentityDto, providing its customer idfr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtosearch(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>Performs a search of a list ofIdentityDto, providing a list of customer idsorg.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 requestorg.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)
-
Field Details
-
CREATE_IDENTITY_EVENT_CODE
- See Also:
-
UPDATE_IDENTITY_EVENT_CODE
- See Also:
-
DECERTIFY_IDENTITY_EVENT_CODE
- See Also:
-
GET_IDENTITY_EVENT_CODE
- See Also:
-
SEARCH_IDENTITY_EVENT_CODE
- See Also:
-
DELETE_IDENTITY_EVENT_CODE
- See Also:
-
CONSOLIDATE_IDENTITY_EVENT_CODE
- See Also:
-
MERGE_IDENTITY_EVENT_CODE
- See Also:
-
CANCEL_MERGE_IDENTITY_EVENT_CODE
- See Also:
-
CANCEL_CONSOLIDATE_IDENTITY_EVENT_CODE
- See Also:
-
SPECIFIC_ORIGIN
- See Also:
-
-
Constructor Details
-
IdentityService
public IdentityService()
-
-
Method Details
-
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 newIdentityaccording to the givenIdentityChangeRequest- Parameters:
request- theIdentityChangeRequestholding the parameters of the identity change requestauthor- the author of the requestserviceContract- service contract of the client requesting the changeformatStatuses- the attribute formatting statuses (only for history purposes)- Returns:
- the created
Identityalong with a list of theAttributeStatus - 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 existingIdentityaccording to the givenIdentityChangeRequestand following the given rules:
- The
Identitymust exist in te database. If not, NOT_FOUND status is returned in the execution response - The
Identitymust 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
Identitycan be updated, itsIdentityAttributelist is updated following the given rule:- If the
IdentityAttributeexists, 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
IdentityAttributedoes 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.
- If the
- Parameters:
customerId- the id of the updatedIdentityrequest- theIdentityChangeRequestholding the parameters of the identity change requestauthor- the author of the requestserviceContract- service contract of the client requesting the changeformatStatuses- the attribute formatting statuses (only for history purposes)- Returns:
- the updated
Identityalong with the attribute statuses - Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- in case of error
- The
-
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 existingIdentityspecified in the givenIdentityMergeRequestand following the given rules:
- Both
Identitymust 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 secondaryIdentityare processed, according to the list of keys specified in theIdentityMergeRequest.- If the
IdentityAttributeis not present in the primaryIdentity, it is created. - If the
IdentityAttributeis present in the primaryIdentity, it is updated if the certification process is higher and the value is different.
- If the
- Parameters:
primaryIdentity- the primary identity (master)secondaryIdentity- the secondary identity (merged)identityForConsolidate- the identityDto holding the attributes for consolidationduplicateRuleCode- the duplicate rule codeauthor- the author of the requestclientCode- code of theClientApplicationrequesting the changeformatStatuses- the format statuses (only for history)- Returns:
- the merged
Identity - Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- in case of error
- Both
-
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 - Parameters:
request- the unmerge requestauthor- the author of the requestclientCode- 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 theIdentitySearchRequest- Parameters:
request- theIdentitySearchRequestholding the parameters of the researchauthor- the author of the requestserviceContract- service contract of the client requesting the change- Returns:
- list of matching identities
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.ResourceNotFoundException- in case ofAttributeKeymanagement errorfr.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.ResourceNotFoundExceptionfr.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 ofIdentityDto, 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 anIdentityDto, 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 identitiesbatchSize- the size of the batchesincludeSuspicions- 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 IDclientCode- the client codeauthor- 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
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
Identityobject - the
IdentityAttributeobjetcs - the IdentityAttributeHistory objects
- the
SuspiciousIdentityobjects - the
ExcludedIdentitiesobjects
- Parameters:
customerId- the customerId of the identity to delete the customerId of the identity to delete
- the
-
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
-