Class NameIdCache<T>
- java.lang.Object
 - 
- com.ibm.fhir.persistence.jdbc.cache.NameIdCache<T>
 
 
- 
- Type Parameters:
 T- the type of the identity value held by the cache
- All Implemented Interfaces:
 INameIdCache<T>
public class NameIdCache<T> extends Object implements INameIdCache<T>
 
- 
- 
Constructor Summary
Constructors Constructor Description NameIdCache()Public constructor 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntry(String resourceType, T resourceTypeId)Add the resource type to the local cachevoidclearLocalMaps()Clear anything cached in thread-local (after transaction rollback, for example)Collection<T>getAllIds()Get all resource type identifiers in the cacheTgetId(String key)Get the resource type identifier for the given resourceType namevoidprefill(Map<String,T> 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:INameIdCacheCalled after a transaction commit() to transfer all the staged (thread-local) data over to the shared cache.- Specified by:
 updateSharedMapsin interfaceINameIdCache<T>
 
- 
getId
public T getId(String key)
Description copied from interface:INameIdCacheGet the resource type identifier for the given resourceType name- Specified by:
 getIdin interfaceINameIdCache<T>- Returns:
 
 
- 
getAllIds
public Collection<T> getAllIds()
Description copied from interface:INameIdCacheGet all resource type identifiers in the cache- Specified by:
 getAllIdsin interfaceINameIdCache<T>- Returns:
 
 
- 
addEntry
public void addEntry(String resourceType, T resourceTypeId)
Description copied from interface:INameIdCacheAdd the resource type to the local cache- Specified by:
 addEntryin interfaceINameIdCache<T>
 
- 
reset
public void reset()
Description copied from interface:INameIdCacheClear both local shared caches - useful for unit tests- Specified by:
 resetin interfaceINameIdCache<T>
 
- 
clearLocalMaps
public void clearLocalMaps()
Description copied from interface:INameIdCacheClear anything cached in thread-local (after transaction rollback, for example)- Specified by:
 clearLocalMapsin interfaceINameIdCache<T>
 
- 
prefill
public void prefill(Map<String,T> content)
Description copied from interface:INameIdCachePrefill the shared map with the given content (must come data already committed in the database)- Specified by:
 prefillin interfaceINameIdCache<T>
 
 - 
 
 -