Class IdentityService
- java.lang.Object
-
- fr.paris.lutece.plugins.identitystore.service.identity.IdentityService
-
public class IdentityService extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCANCEL_CONSOLIDATE_IDENTITY_EVENT_CODEstatic StringCANCEL_MERGE_IDENTITY_EVENT_CODEstatic StringCONSOLIDATE_IDENTITY_EVENT_CODEstatic StringCREATE_IDENTITY_EVENT_CODEstatic StringDECERTIFY_IDENTITY_EVENT_CODEstatic StringDELETE_IDENTITY_EVENT_CODEstatic StringGET_IDENTITY_EVENT_CODEstatic StringMERGE_IDENTITY_EVENT_CODEstatic StringSEARCH_IDENTITY_EVENT_CODEstatic StringSPECIFIC_ORIGINstatic 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 voidcancelMerge(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, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.merge.IdentityMergeResponse response)Identitycreate(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response)Creates a newIdentityaccording to the givenIdentityChangeRequestvoiddelete(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(String customerId, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response)request a deletion of identity .Batch<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto>getIdentitiesBatchForPotentialDuplicate(DuplicateRule rule, int batchSize)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).fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtogetQualifiedIdentity(String customerId)IdentityimportIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeRequest identityChangeRequest, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response)Imports anIdentityaccording to the givenIdentityChangeRequeststatic IdentityServiceinstance()Identitymerge(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, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.merge.IdentityMergeResponse response)voidsearch(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.IdentitySearchRequest request, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.IdentitySearchResponse response, String clientCode)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(String customerId)Performs a search of anIdentityDto, providing its customer idvoidsearch(String customerId, String connectionId, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.IdentitySearchResponse response, String clientCode, 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)Performs a search of a list ofIdentityDto, providing a list of customer idsfr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponseuncertifyIdentity(String strCustomerId, String strClientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author)Dé-certification d'une identité.Identityupdate(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, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response)
-
-
-
Field Detail
-
CREATE_IDENTITY_EVENT_CODE
public static final String CREATE_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
UPDATE_IDENTITY_EVENT_CODE
public static final String UPDATE_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
DECERTIFY_IDENTITY_EVENT_CODE
public static final String DECERTIFY_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
GET_IDENTITY_EVENT_CODE
public static final String GET_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
SEARCH_IDENTITY_EVENT_CODE
public static final String SEARCH_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
DELETE_IDENTITY_EVENT_CODE
public static final String DELETE_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
CONSOLIDATE_IDENTITY_EVENT_CODE
public static final String CONSOLIDATE_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
MERGE_IDENTITY_EVENT_CODE
public static final String MERGE_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
CANCEL_MERGE_IDENTITY_EVENT_CODE
public static final String CANCEL_MERGE_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
CANCEL_CONSOLIDATE_IDENTITY_EVENT_CODE
public static final String CANCEL_CONSOLIDATE_IDENTITY_EVENT_CODE
- See Also:
- Constant Field Values
-
SPECIFIC_ORIGIN
public static final String SPECIFIC_ORIGIN
- See Also:
- Constant Field Values
-
-
Method Detail
-
instance
public static IdentityService instance()
-
create
public Identity 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, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response) 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 requestclientCode- code of theClientApplicationrequesting the changeresponse- theIdentityChangeResponseholding the status of the execution of the request- Returns:
- the created
Identity - Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- in case of error
-
update
public Identity 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, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response) 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 requestclientCode- code of theClientApplicationrequesting the changeresponse- theIdentityChangeResponseholding the status of the execution of the request- Returns:
- the updated
Identity - Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- in case of error
- The
-
merge
public Identity merge(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, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.merge.IdentityMergeResponse response)
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:
request- theIdentityMergeRequestholding the parameters of the requestauthor- the author of the requestclientCode- code of theClientApplicationrequesting the changeresponse- theIdentityMergeResponseholding the status of the execution of the request- Returns:
- the merged
Identity - Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- in case of error
- Both
-
cancelMerge
public void 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, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.merge.IdentityMergeResponse response)- Parameters:
request- the unmerge requestauthor- the author of the requestclientCode- the client code of the calling applicationresponse- the status of the execution
-
importIdentity
public Identity importIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeRequest identityChangeRequest, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
Imports anIdentityaccording to the givenIdentityChangeRequest- Parameters:
identityChangeRequest- theIdentityChangeRequestholding the parameters of the identity change requestauthor- the author of the requestclientCode- code of theClientApplicationrequesting the changeresponse- theIdentityChangeResponseholding the status of the execution of the request- Returns:
- the imported
Identity - Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- in case of error
-
getQualifiedIdentity
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto getQualifiedIdentity(String customerId) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
search
public void 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, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.IdentitySearchResponse response, String clientCode) 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 requestresponse- theIdentitySearchResponseholding the status of the execution status and the results of the requestclientCode- code of theClientApplicationrequesting the change- Throws:
ServiceContractNotFoundException- in case ofServiceContractmanagement errorIdentityAttributeNotFoundException- in case ofAttributeKeymanagement errorfr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
search
public void search(String customerId, String connectionId, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.IdentitySearchResponse response, String clientCode, 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-response-clientCode-author- the author of the request- Throws:
IdentityAttributeNotFoundExceptionServiceContractNotFoundExceptionfr.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)
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
-
getIdentitiesBatchForPotentialDuplicate
public Batch<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto> getIdentitiesBatchForPotentialDuplicate(DuplicateRule rule, int batchSize)
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- 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, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse response) 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 fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.IdentityChangeResponse uncertifyIdentity(String strCustomerId, String strClientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor author)
Dé-certification d'une identité.- Parameters:
strCustomerId- customer ID- Returns:
- the response
- See Also:
IdentityAttributeService.uncertifyAttribute(fr.paris.lutece.plugins.identitystore.business.identity.IdentityAttribute)
-
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
Identityobject - the
IdentityAttributeobjetcs - the IdentityAttributeHistory objects
- the
SuspiciousIdentityobjects - the
ExcludedIdentitiesobjects
- Parameters:
customerId- the customerId of the identity to delete
- the
-
-