Class IdentityDtoCache

java.lang.Object
fr.paris.lutece.portal.service.cache.AbstractCacheableService
fr.paris.lutece.plugins.identitystore.cache.IdentityDtoCache
All Implemented Interfaces:
fr.paris.lutece.portal.service.cache.CacheableService, fr.paris.lutece.portal.service.util.LuteceService, Cloneable, net.sf.ehcache.event.CacheEventListener

public class IdentityDtoCache extends fr.paris.lutece.portal.service.cache.AbstractCacheableService
Cache sur les requêtes d'identité (par ${customerId} ou ${connectionId}), qui cache :
  • Les attributs autorisés en lecture, définis dans le contrat de service
  • Le score de qualité
  • Le score de couverture
  • Les données de suspicions de doublons si l'identité est marquée comme suspecte
  • Les données d'exclusion si l'identité a été exclue d'une ou plusieurs suspicions de doublon avec d'autres identités

L'identité elle-même sera récupérée de la DB à chaque fois, afin de vérifier la date de dernière modification :
  • Si la date est la même dans l'objet caché et en DB, l'objet caché est retourné
  • Sinon, on supprime l'objet caché du cache, on récupère toutes les infos de la DB et on recache.
La clé de cache est calculée comme suit: ${customerId}|${serviceContractId}|${timestamp}
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto
    getFromDatabaseAndEnrich(String customerId, ServiceContract serviceContract)
    Get the master identity from the database and enrich it with quality information.
    fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto
    getIdentityByCustomerId(String customerId, ServiceContract serviceContract)
    Get the identity from a given customerId, even if the identity is merged.
    fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto
    getMasterIdentityByConnectionId(String connectionId, ServiceContract serviceContract)
    Get the master identity from a given connectionId.
    fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto
    Get the master identity from a given customerId.
     
    void
     

    Methods inherited from class fr.paris.lutece.portal.service.cache.AbstractCacheableService

    clone, dispose, enableCache, getCache, getCacheSize, getFromCache, getInfos, getKeys, getMaxElements, getMemorySize, getStatistics, getTimeToLive, initCache, initCache, isCacheEnable, notifyElementEvicted, notifyElementExpired, notifyElementPut, notifyElementRemoved, notifyElementUpdated, notifyRemoveAll, putInCache, removeKey, resetCache

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • IdentityDtoCache

      public IdentityDtoCache()
  • Method Details

    • refresh

      public void refresh()
    • getMasterIdentityByConnectionId

      public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto getMasterIdentityByConnectionId(String connectionId, ServiceContract serviceContract)
      Get the master identity from a given connectionId. The master identity is search recursively over the masterIdentityId. It means that id identity A is merged into identity B, if A is found with the given connectionId, it will return B.
      Parameters:
      connectionId - the connection ID to search for
      serviceContract - the client service contract
      Returns:
      the master @IdentityDto found or null if no match
    • getMasterIdentityByCustomerId

      public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto getMasterIdentityByCustomerId(String customerId, ServiceContract serviceContract)
      Get the master identity from a given customerId. The master identity is search recursively over the masterIdentityId. It means that id identity A is merged into identity B, if A is found with the given customerId, it will return B.
      Parameters:
      customerId - the customerId ID to search for
      serviceContract - the client service contract
      Returns:
      the master @IdentityDto found or null if no match
    • getIdentityByCustomerId

      public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto getIdentityByCustomerId(String customerId, ServiceContract serviceContract)
      Get the identity from a given customerId, even if the identity is merged.
      Parameters:
      customerId - the customerId ID to search for
      serviceContract - the client service contract
      Returns:
      the @IdentityDto found or null if no match
    • getFromDatabaseAndEnrich

      public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto getFromDatabaseAndEnrich(String customerId, ServiceContract serviceContract)
      Get the master identity from the database and enrich it with quality information.
      Parameters:
      customerId - the customerId ID to search for
      serviceContract - the client service contract
      Returns:
      the @IdentityDto found or null if no match
    • getName

      public String getName()