Class IdentityService
- java.lang.Object
-
- fr.paris.lutece.plugins.identitystore.service.identity.IdentityService
-
public class IdentityService extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCANCEL_CONSOLIDATE_IDENTITY_EVENT_CODEstatic java.lang.StringCANCEL_MERGE_IDENTITY_EVENT_CODEstatic java.lang.StringCONSOLIDATE_IDENTITY_EVENT_CODEstatic java.lang.StringCREATE_IDENTITY_EVENT_CODEstatic java.lang.StringDECERTIFY_IDENTITY_EVENT_CODEstatic java.lang.StringDELETE_IDENTITY_EVENT_CODEstatic java.lang.StringGET_IDENTITY_EVENT_CODEstatic java.lang.StringMERGE_IDENTITY_EVENT_CODEstatic java.lang.StringSEARCH_IDENTITY_EVENT_CODEstatic java.lang.StringSPECIFIC_ORIGINstatic java.lang.StringUPDATE_IDENTITY_EVENT_CODE
-
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)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 newIdentityaccording to the givenIdentityChangeRequestvoiddelete(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 : theIdentityobject theIdentityAttributeobjetcs the IdentityAttributeHistory objects theSuspiciousIdentityobjects theExcludedIdentitiesobjects The identity's history is kept.voiddeleteRequest(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 IdentityServiceinstance()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)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 theIdentitySearchRequestfr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtosearch(java.lang.String customerId)Performs a search of anIdentityDto, providing its customer idfr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtosearch(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 ofIdentityDto, providing a list of customer idsorg.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 requestorg.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)
-
-
-
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
-
SPECIFIC_ORIGIN
public static final java.lang.String SPECIFIC_ORIGIN
- See Also:
- Constant Field Values
-
-
Method Detail
-
instance
public static IdentityService instance()
-
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 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,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 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,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 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,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
- 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 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.IdentityStoreExceptionPerform 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(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.IdentityStoreExceptionPerform 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 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 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(java.lang.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<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 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(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.IdentityStoreExceptionrequest 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,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
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<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.IdentityStoreExceptionSearch 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
-
-