Class IdentityHome
- java.lang.Object
-
- fr.paris.lutece.plugins.identitystore.business.identity.IdentityHome
-
public final class IdentityHome extends java.lang.ObjectThis class provides instances management methods (create, find, ...) for Identity objects
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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(Identity identity, int dataRetentionPeriodInMonth)Create an instance of the identity classstatic voiddeleteAttributeHistory(int identityId)Delete all attribute history of the identity's provided id.static java.util.List<Identity>findAll()Select AllIdentitystatic java.util.List<java.lang.String>findByAttributeExisting(java.util.List<java.lang.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.static java.util.List<Identity>findByAttributesValueForApiSearch(java.util.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(java.lang.String strConnectionId)Find by connection IDstatic IdentityfindByCustomerId(java.lang.String strCustomerId)Find by customer IDstatic IdentityfindByCustomerIdNoAttributes(java.lang.String strCustomerId)Find by customer ID.static IdentityfindByPrimaryKey(int nKey)Returns an instance of a identity whose identifier is specified in parameterstatic java.util.List<Identity>findExpiredNotMergedAndNotConnectedIdentities(int limit, boolean withGuidOnly)Search for identities that are not connected, and have a past expirationDate.static java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange>findHistoryByCustomerId(java.lang.String strCustomerId)Find history by customer IDstatic java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange>findHistoryBySearchParameters(java.lang.String strCustomerId, java.lang.String clientCode, java.lang.String authorName, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType changeType, java.lang.String changeStatus, java.lang.String authorType, java.util.Date modificationDate, java.util.Map<java.lang.String,java.lang.String> metadata, java.lang.Integer nbDaysFrom, org.apache.commons.lang3.tuple.Pair<java.util.Date,java.util.Date> modificationDateInterval, int max)Find history by customer search parametersstatic intfindIdByCustomerId(java.lang.String strCustomerId)Find an identity ID from the specified customer IDstatic IdentityfindMasterIdentityByConnectionId(java.lang.String strConnectionId)Find by connection IDstatic IdentityfindMasterIdentityByCustomerId(java.lang.String strCustomerId)Find by customer IDstatic java.util.List<Identity>findMergedIdentities(int identityId)Search for identities that are merged to the provided identity ID.static java.util.List<java.lang.String>findNotMergedNotConnectedWithNonCertifiedAttributeCustomerIds(java.lang.String attributeKey, java.lang.String certProcess, int limit)Search for identity customer IDs that are not connected, not merged, and have the specified attribute non-certified.static java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto>findUpdatedIdentities(java.lang.Integer days, java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType> identityChangeTypes, java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchUpdatedAttribute> updatedAttributes, java.lang.Integer max)get identities that have been updated during the previous `days`.static java.util.List<java.lang.Integer>findUpdatedIdentityIds(java.lang.Integer days, java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType> identityChangeTypes, java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchUpdatedAttribute> updatedAttributes, java.lang.Integer max)get identity IDs that have been updated during the previous `days`.static java.util.List<IndicatorsActionsType>getActionsTypesDuringInterval(int interval)static java.lang.IntegergetCountActiveMonParisdentities(boolean monParisActive)Count All identities that has been connected or not.static java.util.Map<java.lang.Integer,java.lang.Integer>getCountAttributesByIdentities()Count how many attributes each entity has.static java.lang.IntegergetCountDeletedIdentities(boolean deleted)Count All identities that has been deleted or not.static java.lang.IntegergetCountIdentities()Count All Identities.static java.lang.IntegergetCountIndexEligibleIdentities()static java.lang.IntegergetCountIndexNotEligibleIdentities()static java.lang.IntegergetCountMergedIdentities(boolean merged)Count All identities that has been merged or not.static java.lang.IntegergetCountUnmergedIdentitiesWithoutAttributes()Count how many attributes has no attribute and isn't merged.static java.util.List<java.lang.String>getHistoryStatusList()static java.sql.TimestampgetMasterIdentityLastUpdateDate(java.lang.String customerId)Get the master identity last update date coresponding to the given customer IDstatic IdentitygetMasterIdentityNoAttributesByConnectionId(java.lang.String connectionId)Get the master identity without attributes coresponding to the given connection IDstatic java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto>getUpdatedIdentitiesFromIds(java.util.List<java.lang.Integer> identityIds)get updated identities from their IDs.static voidhardRemove(int nIdentityId)Remove the identity whose identifier is specified in parameterstatic Identitymerge(Identity identity)Archive identities which have been merge as secondarystatic voidsoftRemove(java.lang.String strCuid)static Identityupdate(Identity identity)Update of the identity which is specified in parameter
-
-
-
Method Detail
-
create
public static Identity create(Identity identity, int dataRetentionPeriodInMonth)
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
public static Identity update(Identity identity)
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
-
merge
public static Identity merge(Identity identity)
Archive identities which have been merge as secondary- Parameters:
identity-- Returns:
-
cancelMerge
public static void cancelMerge(Identity identity)
-
hardRemove
public static void hardRemove(int nIdentityId)
Remove the identity whose identifier is specified in parameter- Parameters:
nIdentityId- The identity Id
-
softRemove
public static void softRemove(java.lang.String strCuid)
-
findIdByCustomerId
public static int findIdByCustomerId(java.lang.String strCustomerId)
Find an identity ID from the specified customer ID- Parameters:
strCustomerId- the customer ID- Returns:
- the identity ID
-
findByPrimaryKey
public static Identity findByPrimaryKey(int nKey)
Returns an instance of a identity whose identifier is specified in parameter- Parameters:
nKey- The identity primary key- Returns:
- an instance of Identity
-
findByConnectionId
public static Identity findByConnectionId(java.lang.String strConnectionId)
Find by connection ID- Parameters:
strConnectionId- The connection ID- Returns:
- The Identity
-
findHistoryByCustomerId
public static java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange> findHistoryByCustomerId(java.lang.String strCustomerId) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreExceptionFind history by customer ID- Parameters:
strCustomerId- The customer ID- Returns:
- The Identity
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
findHistoryBySearchParameters
public static java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange> findHistoryBySearchParameters(java.lang.String strCustomerId, java.lang.String clientCode, java.lang.String authorName, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType changeType, java.lang.String changeStatus, java.lang.String authorType, java.util.Date modificationDate, java.util.Map<java.lang.String,java.lang.String> metadata, java.lang.Integer nbDaysFrom, org.apache.commons.lang3.tuple.Pair<java.util.Date,java.util.Date> modificationDateInterval, int max) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreExceptionFind history by customer search parameters- Parameters:
strCustomerId- The customer ID- Returns:
- The Identity
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
findByCustomerId
public static Identity findByCustomerId(java.lang.String strCustomerId)
Find by customer ID- Parameters:
strCustomerId- The customer ID- Returns:
- The Identity
-
findByCustomerIdNoAttributes
public static Identity findByCustomerIdNoAttributes(java.lang.String strCustomerId)
Find by customer ID. Does not load the attributes.- Parameters:
strCustomerId- The customer ID- Returns:
- The Identity without attributes
-
findMasterIdentityByCustomerId
public static Identity findMasterIdentityByCustomerId(java.lang.String strCustomerId)
Find by customer ID- Parameters:
strCustomerId- The customer ID- Returns:
- The Identity
-
getMasterIdentityLastUpdateDate
public static java.sql.Timestamp getMasterIdentityLastUpdateDate(java.lang.String customerId)
Get the master identity last update date coresponding to the given customer ID- Parameters:
customerId- the customer ID- Returns:
- the last update date or null if the identity doesn't exist for the provided CUID
-
findMasterIdentityByConnectionId
public static Identity findMasterIdentityByConnectionId(java.lang.String strConnectionId)
Find by connection ID- Parameters:
strConnectionId- The customer ID- Returns:
- The Identity
-
getMasterIdentityNoAttributesByConnectionId
public static Identity getMasterIdentityNoAttributesByConnectionId(java.lang.String connectionId)
Get the master identity without attributes coresponding to the given connection ID- Parameters:
connectionId- the connection ID- Returns:
- the identity or null if the identity doesn't exist for the provided connection ID
-
findByAttributesValueForApiSearch
public static java.util.List<Identity> findByAttributesValueForApiSearch(java.util.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:
mapAttributes- A map that associates the id of each attributes selected with the list of values- Returns:
- list of Identity
-
findByAttributeExisting
public static java.util.List<java.lang.String> findByAttributeExisting(java.util.List<java.lang.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.IdentityStoreExceptionadd an identity change event in history table- Parameters:
identityChange- identity change event- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
findUpdatedIdentities
public static java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto> findUpdatedIdentities(java.lang.Integer days, java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType> identityChangeTypes, java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchUpdatedAttribute> updatedAttributes, java.lang.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 java.util.List<java.lang.Integer> findUpdatedIdentityIds(java.lang.Integer days, java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType> identityChangeTypes, java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.search.SearchUpdatedAttribute> updatedAttributes, java.lang.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 java.util.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto> getUpdatedIdentitiesFromIds(java.util.List<java.lang.Integer> identityIds)
get updated identities from their IDs.- Parameters:
identityIds- list of desired identity IDs- Returns:
- the list of identities
-
findExpiredNotMergedAndNotConnectedIdentities
public static java.util.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 java.util.List<java.lang.String> findNotMergedNotConnectedWithNonCertifiedAttributeCustomerIds(java.lang.String attributeKey, java.lang.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
public static java.util.List<Identity> findMergedIdentities(int identityId)
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
public static java.lang.Integer getCountIdentities()
Count All Identities.
-
getCountDeletedIdentities
public static java.lang.Integer getCountDeletedIdentities(boolean deleted)
Count All identities that has been deleted or not.- Parameters:
deleted- define if the dao count deleted or not deleted identities
-
getCountMergedIdentities
public static java.lang.Integer getCountMergedIdentities(boolean merged)
Count All identities that has been merged or not.- Parameters:
merged- define if the dao count merged or not merged identities
-
getCountActiveMonParisdentities
public static java.lang.Integer getCountActiveMonParisdentities(boolean monParisActive)
Count All identities that has been connected or not.- Parameters:
monParisActive- define if the dao count connected or not connected identities
-
getCountAttributesByIdentities
public static java.util.Map<java.lang.Integer,java.lang.Integer> getCountAttributesByIdentities()
Count how many attributes each entity has.
-
getCountUnmergedIdentitiesWithoutAttributes
public static java.lang.Integer getCountUnmergedIdentitiesWithoutAttributes()
Count how many attributes has no attribute and isn't merged.
-
getCountIndexEligibleIdentities
public static java.lang.Integer getCountIndexEligibleIdentities()
-
getCountIndexNotEligibleIdentities
public static java.lang.Integer getCountIndexNotEligibleIdentities()
-
getActionsTypesDuringInterval
public static java.util.List<IndicatorsActionsType> getActionsTypesDuringInterval(int interval)
-
getHistoryStatusList
public static java.util.List<java.lang.String> getHistoryStatusList()
-
-