Class IdentityDAO
- java.lang.Object
-
- fr.paris.lutece.plugins.identitystore.business.identity.IdentityDAO
-
- All Implemented Interfaces:
IIdentityDAO
public final class IdentityDAO extends Object implements IIdentityDAO
This class provides Data Access methods for Identity objects
-
-
Field Summary
-
Fields inherited from interface fr.paris.lutece.plugins.identitystore.business.identity.IIdentityDAO
BEAN_NAME
-
-
Constructor Summary
Constructors Constructor Description IdentityDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChangeHistory(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange identityChange, fr.paris.lutece.portal.service.plugin.Plugin plugin)log changesvoidaddOrUpdateChangeHistory(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange identityChange, fr.paris.lutece.portal.service.plugin.Plugin plugin)voidcancelMerge(Identity identity, fr.paris.lutece.portal.service.plugin.Plugin plugin)Cancel identity mergevoiddeleteAttributeHistory(int identityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete all attribute history of the identity's provided id.TimestampgetIdentityLastUpdateDate(String customerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the identity last update date coresponding to the given customer IDvoidhardDelete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete a record from the tablevoidinsert(Identity identity, int dataRetentionPeriodInMonth, fr.paris.lutece.portal.service.plugin.Plugin plugin)Insert a new record in the table.Identityload(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Load the data from the tablevoidmerge(Identity identity, fr.paris.lutece.portal.service.plugin.Plugin plugin)Merge identityStringnewCustomerIdKey()Generates a new customerId key using Java UUIDList<Identity>selectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)List<String>selectByAttributeExisting(List<Integer> idAttributeList, int nbFilledAttributes, boolean notMerged, boolean notSuspicious, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find all identities that have all attributes specified in the list in parameters.
Identities MUST have all those attributes in order to be returned.List<Identity>selectByAttributesValueForApiSearch(Map<String,List<String>> mapAttributes, int nMaxNbIdentityReturned, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find by a combination of Attribute values.IdentityselectByConnectionId(String strConnectionId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find by connection IDIdentityselectByCustomerId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find by customer IDList<Identity>selectExpiredNotMergedAndNotConnectedIdentities(int limit, fr.paris.lutece.portal.service.plugin.Plugin plugin)Search for identities that are not connected, and have a past expirationDate.intselectIdByCustomerId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find an identity ID from the specified customer IDList<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange>selectIdentityHistoryByCustomerId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)get identity historyList<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange>selectIdentityHistoryBySearchParameters(String customerId, String clientCode, String authorName, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType changeType, Map<String,String> metadata, Integer nbDaysFrom, fr.paris.lutece.portal.service.plugin.Plugin plugin)Search for history entries that matches the following parametersList<Identity>selectMergedIdentities(int identityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Search for identities that are merged to the provided identity ID.IdentityselectNotMergedByConnectionId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)IdentityselectNotMergedByCustomerId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto>selectUpdated(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, fr.paris.lutece.portal.service.plugin.Plugin plugin)get identities that have been updated during the previous `days`.List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto>selectUpdatedFromIds(List<Integer> identityIds, fr.paris.lutece.portal.service.plugin.Plugin plugin)select updated identities from their IDs.List<Integer>selectUpdatedIds(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, fr.paris.lutece.portal.service.plugin.Plugin plugin)get identity IDs that have been updated during the previous `days`.voidsoftDelete(String strCuid, fr.paris.lutece.portal.service.plugin.Plugin plugin)Modify the columuns is_deleted and date_delete and connection_id to nullvoidstore(Identity identity, fr.paris.lutece.portal.service.plugin.Plugin plugin)Update the record in the table
-
-
-
Method Detail
-
newCustomerIdKey
public String newCustomerIdKey()
Generates a new customerId key using Java UUID- Returns:
- The new customerID
-
insert
public void insert(Identity identity, int dataRetentionPeriodInMonth, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.- Specified by:
insertin interfaceIIdentityDAO- Parameters:
identity- instance of the Identity object to insertplugin- the Plugin
-
load
public Identity load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data from the table- Specified by:
loadin interfaceIIdentityDAO- Parameters:
nKey- The identifier of the identityplugin- the Plugin- Returns:
- The instance of the identity
-
hardDelete
public void hardDelete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete a record from the table- Specified by:
hardDeletein interfaceIIdentityDAO- Parameters:
nKey- The identifier of the Identity to deleteplugin- the Plugin
-
softDelete
public void softDelete(String strCuid, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Modify the columuns is_deleted and date_delete and connection_id to null- Specified by:
softDeletein interfaceIIdentityDAO- Parameters:
strCuid- The id of the Identity to deleteplugin- the Plugin
-
merge
public void merge(Identity identity, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Merge identity- Specified by:
mergein interfaceIIdentityDAO
-
cancelMerge
public void cancelMerge(Identity identity, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Description copied from interface:IIdentityDAOCancel identity merge- Specified by:
cancelMergein interfaceIIdentityDAO
-
store
public void store(Identity identity, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the record in the table- Specified by:
storein interfaceIIdentityDAO- Parameters:
identity- the reference of the Identityplugin- the Plugin
-
selectAll
public List<Identity> selectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
- Specified by:
selectAllin interfaceIIdentityDAO
-
selectByConnectionId
public Identity selectByConnectionId(String strConnectionId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Description copied from interface:IIdentityDAOFind by connection ID- Specified by:
selectByConnectionIdin interfaceIIdentityDAO- Parameters:
strConnectionId- The connection IDplugin- The plugin- Returns:
- The identity
-
selectByCustomerId
public Identity selectByCustomerId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Description copied from interface:IIdentityDAOFind by customer ID- Specified by:
selectByCustomerIdin interfaceIIdentityDAO- Parameters:
strCustomerId- The customerIDplugin- The plugin- Returns:
- The identity
-
selectNotMergedByCustomerId
public Identity selectNotMergedByCustomerId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
- Specified by:
selectNotMergedByCustomerIdin interfaceIIdentityDAO
-
selectNotMergedByConnectionId
public Identity selectNotMergedByConnectionId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
- Specified by:
selectNotMergedByConnectionIdin interfaceIIdentityDAO
-
selectIdByCustomerId
public int selectIdByCustomerId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Description copied from interface:IIdentityDAOFind an identity ID from the specified customer ID- Specified by:
selectIdByCustomerIdin interfaceIIdentityDAO- Parameters:
strCustomerId- the customer IDplugin- the plugin- Returns:
- The identity ID
-
selectByAttributesValueForApiSearch
public List<Identity> selectByAttributesValueForApiSearch(Map<String,List<String>> mapAttributes, int nMaxNbIdentityReturned, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find by a combination of Attribute values. Search for identities that match the conditions defined for each of the selected attributes, that is on each of these attributes the exact value is in a list of expected values (no wildcards).- Specified by:
selectByAttributesValueForApiSearchin interfaceIIdentityDAO- Parameters:
mapAttributes- A map that associates the id of each attributes selected with the list of valuesnMaxNbIdentityReturned- The maximum number of Identity returned in the listplugin- The plugin- Returns:
- The identity
-
selectByAttributeExisting
public List<String> selectByAttributeExisting(List<Integer> idAttributeList, int nbFilledAttributes, boolean notMerged, boolean notSuspicious, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find all identities that have all attributes specified in the list in parameters.
Identities MUST have all those attributes in order to be returned.- Specified by:
selectByAttributeExistingin interfaceIIdentityDAO- Parameters:
idAttributeList- the attributes idnbFilledAttributes- minimum number of filled attributes over idAttributeListnotMerged- if the returned identities have to be not mergednotSuspicious- if the returned identities have to not be suspiciousplugin- the plugin- Returns:
- A list of matching identities
-
addChangeHistory
public void addChangeHistory(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange identityChange, fr.paris.lutece.portal.service.plugin.Plugin plugin) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreExceptionDescription copied from interface:IIdentityDAOlog changes- Specified by:
addChangeHistoryin interfaceIIdentityDAO- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
addOrUpdateChangeHistory
public void addOrUpdateChangeHistory(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange identityChange, fr.paris.lutece.portal.service.plugin.Plugin plugin) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException- Specified by:
addOrUpdateChangeHistoryin interfaceIIdentityDAO- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
selectIdentityHistoryByCustomerId
public List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange> selectIdentityHistoryByCustomerId(String strCustomerId, fr.paris.lutece.portal.service.plugin.Plugin plugin) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
get identity history- Specified by:
selectIdentityHistoryByCustomerIdin interfaceIIdentityDAO- Returns:
- the list of identity changes
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
selectUpdated
public List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto> selectUpdated(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, fr.paris.lutece.portal.service.plugin.Plugin plugin)
get identities that have been updated during the previous `days`.- Specified by:
selectUpdatedin interfaceIIdentityDAO- 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
-
selectUpdatedIds
public List<Integer> selectUpdatedIds(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, fr.paris.lutece.portal.service.plugin.Plugin plugin)
get identity IDs that have been updated during the previous `days`.- Specified by:
selectUpdatedIdsin interfaceIIdentityDAO- 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
-
selectUpdatedFromIds
public List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.crud.UpdatedIdentityDto> selectUpdatedFromIds(List<Integer> identityIds, fr.paris.lutece.portal.service.plugin.Plugin plugin)
select updated identities from their IDs.- Specified by:
selectUpdatedFromIdsin interfaceIIdentityDAO- Parameters:
identityIds- list of desired identity IDsplugin- the plugin- Returns:
- the list of identities
-
selectIdentityHistoryBySearchParameters
public List<fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChange> selectIdentityHistoryBySearchParameters(String customerId, String clientCode, String authorName, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.history.IdentityChangeType changeType, Map<String,String> metadata, Integer nbDaysFrom, fr.paris.lutece.portal.service.plugin.Plugin plugin) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
Description copied from interface:IIdentityDAOSearch for history entries that matches the following parameters- Specified by:
selectIdentityHistoryBySearchParametersin interfaceIIdentityDAO- Parameters:
customerId- customer id of the identityclientCode- client code that modified the identityauthorName- name of the author that modified the identitychangeType- the type of identity changemetadata- metadata of the identity changenbDaysFrom- number of day from the current date- Returns:
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-
selectExpiredNotMergedAndNotConnectedIdentities
public List<Identity> selectExpiredNotMergedAndNotConnectedIdentities(int limit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Search for identities that are not connected, and have a past expirationDate.- Specified by:
selectExpiredNotMergedAndNotConnectedIdentitiesin interfaceIIdentityDAO- Parameters:
limit- the max number of resultsplugin- the plugin- Returns:
- a list of
Identity
-
selectMergedIdentities
public List<Identity> selectMergedIdentities(int identityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Search for identities that are merged to the provided identity ID.- Specified by:
selectMergedIdentitiesin interfaceIIdentityDAO- Parameters:
identityId- the 'master' identity IDplugin- the plugin- Returns:
- a list of
Identity
-
deleteAttributeHistory
public void deleteAttributeHistory(int identityId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete all attribute history of the identity's provided id.- Specified by:
deleteAttributeHistoryin interfaceIIdentityDAO- Parameters:
identityId- the identity's idplugin- the plugin
-
getIdentityLastUpdateDate
public Timestamp getIdentityLastUpdateDate(String customerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the identity last update date coresponding to the given customer ID- Specified by:
getIdentityLastUpdateDatein interfaceIIdentityDAO- Parameters:
customerId- the customer IDplugin- the plugin- Returns:
- the last update date or null if the identity doesn't exist for the provided CUID
-
-