Class IdentityHome
java.lang.Object
fr.paris.lutece.plugins.identitystore.business.identity.IdentityHome
This class provides instances management methods (create, find, ...) for Identity objects
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddIdentityChangeHistory(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange identityChange) add an identity change event in history tablestatic voidcancelMerge(Identity identity) static IdentityCreate an instance of the identity classstatic voiddeleteAttributeHistory(int identityId) Delete all attribute history of the identity's provided id.findAll()Select AllIdentityfindByAttributeExisting(List<Integer> idAttributeList, int nbFilledAttributes, boolean notMerged, boolean notSuspicious, int rulePriority) Find all identities that have all attributes specified in the list in parameters.
Identities MUST have all those attributes in order to be returned.findByAttributesValueForApiSearch(List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchAttribute> searchAttributes, int max) Find all identities matching one of the values defined on each of the selected Attributes.static IdentityfindByConnectionId(String strConnectionId) Find by connection IDstatic IdentityfindByCustomerId(String strCustomerId) Find by customer IDstatic IdentityfindByCustomerId(String strCustomerId, boolean loadAttributes) Find by customer IDstatic IdentityfindByPrimaryKey(int nKey) Returns an instance of a identity whose identifier is specified in parameterfindExpiredNotMergedAndNotConnectedIdentities(int limit, boolean withGuidOnly) Search for identities that are not connected, and have a past expirationDate.static List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange>findHistoryByCustomerId(String strCustomerId) Find history by customer IDstatic List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange>findHistoryBySearchParameters(String strCustomerId, String clientCode, String authorName, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType changeType, String changeStatus, String authorType, Date modificationDate, Map<String, String> metadata, Integer nbDaysFrom, org.apache.commons.lang3.tuple.Pair<Date, Date> modificationDateInterval, int max) Find history by customer search parametersstatic intfindIdByCustomerId(String strCustomerId) Find an identity ID from the specified customer IDstatic IdentityfindMasterIdentityByConnectionId(String strConnectionId, boolean loadAttributes) Get the master identity from a givenconnectionId.static IdentityfindMasterIdentityByCustomerId(String strCustomerId, boolean loadAttributes) Get the master identity from a givencustomerId.findMergedIdentities(int identityId) Search for identities that are merged to the provided identity ID.findNotMergedNotConnectedWithNonCertifiedAttributeCustomerIds(String attributeKey, String certProcess, int limit) Search for identity customer IDs that are not connected, not merged, and have the specified attribute non-certified.static List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto>findUpdatedIdentities(Integer days, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType> identityChangeTypes, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchUpdatedAttribute> updatedAttributes, Integer max) get identities that have been updated during the previous `days`.findUpdatedIdentityIds(Integer days, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType> identityChangeTypes, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchUpdatedAttribute> updatedAttributes, Integer max) get identity IDs that have been updated during the previous `days`.static List<IndicatorsActionsType>getActionsTypesDuringInterval(int interval) static IntegergetCountActiveMonParisdentities(boolean monParisActive) Count All identities that has been connected or not.Count how many attributes each entity has.static IntegergetCountDeletedIdentities(boolean deleted) Count All identities that has been deleted or not.static IntegerCount All Identities.static Integerstatic Integerstatic IntegergetCountMergedIdentities(boolean merged) Count All identities that has been merged or not.static IntegerCount how many attributes has no attribute and isn't merged.static List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto>getUpdatedIdentitiesFromIds(List<Integer> identityIds) get updated identities from their IDs.static voidhardRemove(int nIdentityId) Remove the identity whose identifier is specified in parameterstatic IdentityArchive identities which have been merge as secondarystatic IdentityresetUnicityHashCode(Identity identity) Reset unicityHashCode to random valuestatic voidsoftRemove(String strCuid) static IdentityUpdate of the identity which is specified in parameter
-
Method Details
-
create
Create an instance of the identity class- Parameters:
identity- The instance of the Identity which contains the informations to store- Returns:
- The instance of identity which has been created with its primary key.
-
update
Update of the identity which is specified in parameter- Parameters:
identity- The instance of the Identity which contains the data to store- Returns:
- The instance of the identity which has been updated
-
resetUnicityHashCode
Reset unicityHashCode to random value- Parameters:
identity- The instance of the Identity which contains the data to store- Returns:
- The instance of the identity which has been updated
-
merge
Archive identities which have been merge as secondary- Parameters:
identity-- Returns:
-
cancelMerge
-
hardRemove
public static void hardRemove(int nIdentityId) Remove the identity whose identifier is specified in parameter- Parameters:
nIdentityId- The identity Id
-
softRemove
-
findIdByCustomerId
Find an identity ID from the specified customer ID- Parameters:
strCustomerId- the customer ID- Returns:
- the identity ID
-
findByPrimaryKey
Returns an instance of a identity whose identifier is specified in parameter- Parameters:
nKey- The identity primary key- Returns:
- an instance of Identity
-
findAll
Select AllIdentity- Returns:
- The Identity
-
findByConnectionId
Find by connection ID- Parameters:
strConnectionId- The connection ID- Returns:
- The Identity
-
findHistoryByCustomerId
public static List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange> findHistoryByCustomerId(String strCustomerId) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException Find history by customer ID- Parameters:
strCustomerId- The customer ID- Returns:
- The Identity
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
findHistoryBySearchParameters
public static List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange> findHistoryBySearchParameters(String strCustomerId, String clientCode, String authorName, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType changeType, String changeStatus, String authorType, Date modificationDate, Map<String, String> metadata, Integer nbDaysFrom, org.apache.commons.lang3.tuple.Pair<Date, throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreExceptionDate> modificationDateInterval, int max) Find history by customer search parameters- Parameters:
strCustomerId- The customer ID- Returns:
- The Identity
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
findByCustomerId
Find by customer ID- Parameters:
strCustomerId- The customer ID- Returns:
- The Identity
-
findByCustomerId
Find by customer ID- Parameters:
strCustomerId- The customer IDloadAttributes- if true, return identity with its attributes- Returns:
- The Identity
-
findMasterIdentityByCustomerId
Get the master identity from a givencustomerId. The master identity is search recursively over themasterIdentityId. It means that id identity A is merged into identity B, if A is found with the givencustomerId, it will return B.- Parameters:
strCustomerId- The customer IDloadAttributes- if true, return identity with its attributes- Returns:
- The Identity
-
findMasterIdentityByConnectionId
public static Identity findMasterIdentityByConnectionId(String strConnectionId, boolean loadAttributes) Get the master identity from a givenconnectionId. The master identity is search recursively over themasterIdentityId. It means that id identity A is merged into identity B, if A is found with the givenconnectionId, it will return B.- Parameters:
strConnectionId- The connection IDloadAttributes- if true, return identity with its attributes- Returns:
- The Identity
-
findByAttributesValueForApiSearch
public static List<Identity> findByAttributesValueForApiSearch(List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchAttribute> searchAttributes, int max) Find all identities matching one of the values defined on each of the selected Attributes. One value must be found for all selected attributes. Always performs an exact search.- Parameters:
searchAttributes- A map that associates the id of each attribute selected with the list of values- Returns:
- list of Identity
-
findByAttributeExisting
public static List<String> findByAttributeExisting(List<Integer> idAttributeList, int nbFilledAttributes, boolean notMerged, boolean notSuspicious, int rulePriority) Find all identities that have all attributes specified in the list in parameters.
Identities MUST have all those attributes in order to be returned.- Parameters:
idAttributeList- the attributes idnotMerged- if the returned identities have to be not mergednotSuspicious- if the returned identities have to not be suspiciousnbFilledAttributes- minimum number of filled attributes over idAttributeList- Returns:
- A list of matching customer IDs
-
addIdentityChangeHistory
public static void addIdentityChangeHistory(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange identityChange) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException add an identity change event in history table- Parameters:
identityChange- identity change event- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
findUpdatedIdentities
public static List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto> findUpdatedIdentities(Integer days, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType> identityChangeTypes, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchUpdatedAttribute> updatedAttributes, Integer max) get identities that have been updated during the previous `days`.- Parameters:
days- max number of days since the last updateidentityChangeTypes- filters on specific change typesupdatedAttributes- filters on specific updated attributes- Returns:
- the list of identities
-
findUpdatedIdentityIds
public static List<Integer> findUpdatedIdentityIds(Integer days, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType> identityChangeTypes, List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchUpdatedAttribute> updatedAttributes, Integer max) get identity IDs that have been updated during the previous `days`.- Parameters:
days- max number of days since the last updateidentityChangeTypes- filters on specific change typesupdatedAttributes- filters on specific updated attributes- Returns:
- the list of identities
-
getUpdatedIdentitiesFromIds
public static List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto> getUpdatedIdentitiesFromIds(List<Integer> identityIds) get updated identities from their IDs.- Parameters:
identityIds- list of desired identity IDs- Returns:
- the list of identities
-
findExpiredNotMergedAndNotConnectedIdentities
public static List<Identity> findExpiredNotMergedAndNotConnectedIdentities(int limit, boolean withGuidOnly) Search for identities that are not connected, and have a past expirationDate.- Parameters:
limit- the max number of returned results- Returns:
- a list of expired
Identity
-
findNotMergedNotConnectedWithNonCertifiedAttributeCustomerIds
public static List<String> findNotMergedNotConnectedWithNonCertifiedAttributeCustomerIds(String attributeKey, String certProcess, int limit) Search for identity customer IDs that are not connected, not merged, and have the specified attribute non-certified.- Parameters:
attributeKey- the attribute key to be present and non-certifiedlimit- the max number of returned identities- Returns:
- a list of customer IDs
-
findMergedIdentities
Search for identities that are merged to the provided identity ID.- Parameters:
identityId- the 'master' identity ID- Returns:
- a list of
Identity
-
deleteAttributeHistory
public static void deleteAttributeHistory(int identityId) Delete all attribute history of the identity's provided id.- Parameters:
identityId- the identity id
-
getCountIdentities
Count All Identities. -
getCountDeletedIdentities
Count All identities that has been deleted or not.- Parameters:
deleted- define if the dao count deleted or not deleted identities
-
getCountMergedIdentities
Count All identities that has been merged or not.- Parameters:
merged- define if the dao count merged or not merged identities
-
getCountActiveMonParisdentities
Count All identities that has been connected or not.- Parameters:
monParisActive- define if the dao count connected or not connected identities
-
getCountAttributesByIdentities
Count how many attributes each entity has. -
getCountUnmergedIdentitiesWithoutAttributes
Count how many attributes has no attribute and isn't merged. -
getCountIndexEligibleIdentities
-
getCountIndexNotEligibleIdentities
-
getActionsTypesDuringInterval
-
getHistoryStatusList
-