Class IdNameCache<T>
- java.lang.Object
 - 
- com.ibm.fhir.persistence.jdbc.cache.IdNameCache<T>
 
 
- 
- Type Parameters:
 T- the type of the key value held by the cache
- All Implemented Interfaces:
 IIdNameCache<T>
public class IdNameCache<T> extends Object implements IIdNameCache<T>
 
- 
- 
Constructor Summary
Constructors Constructor Description IdNameCache()Public constructor 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntry(T id, String name)Add the entry to the local cachevoidclearLocalMaps()Clear anything cached in thread-local (after transaction rollback, for example)Collection<String>getAllNames()Get all names in the cacheStringgetName(T key)Get the name for the given idvoidprefill(Map<T,String> content)Prefill the shared map with the given content (must come data already committed in the database)voidreset()Clear both local shared caches - useful for unit testsvoidupdateSharedMaps()Called after a transaction commit() to transfer all the staged (thread-local) data over to the shared cache. 
 - 
 
- 
- 
Method Detail
- 
updateSharedMaps
public void updateSharedMaps()
Description copied from interface:IIdNameCacheCalled after a transaction commit() to transfer all the staged (thread-local) data over to the shared cache.- Specified by:
 updateSharedMapsin interfaceIIdNameCache<T>
 
- 
getName
public String getName(T key)
Description copied from interface:IIdNameCacheGet the name for the given id- Specified by:
 getNamein interfaceIIdNameCache<T>- Returns:
 
 
- 
getAllNames
public Collection<String> getAllNames()
Description copied from interface:IIdNameCacheGet all names in the cache- Specified by:
 getAllNamesin interfaceIIdNameCache<T>- Returns:
 
 
- 
addEntry
public void addEntry(T id, String name)
Description copied from interface:IIdNameCacheAdd the entry to the local cache- Specified by:
 addEntryin interfaceIIdNameCache<T>
 
- 
reset
public void reset()
Description copied from interface:IIdNameCacheClear both local shared caches - useful for unit tests- Specified by:
 resetin interfaceIIdNameCache<T>
 
- 
clearLocalMaps
public void clearLocalMaps()
Description copied from interface:IIdNameCacheClear anything cached in thread-local (after transaction rollback, for example)- Specified by:
 clearLocalMapsin interfaceIIdNameCache<T>
 
- 
prefill
public void prefill(Map<T,String> content)
Description copied from interface:IIdNameCachePrefill the shared map with the given content (must come data already committed in the database)- Specified by:
 prefillin interfaceIIdNameCache<T>
 
 - 
 
 -