Class AbstractCachedFetcher
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.fetcher.AbstractCachedFetcher
-
- All Implemented Interfaces:
CachedFetcher
- Direct Known Subclasses:
CachedChebiFetcher,CachedEuroPubmedCentralFetcher,CachedOlsFetcher,CachedUniprotProteinFetcher,CachedUniprotTaxonomyFetcher,CachedUnisaveClient
public abstract class AbstractCachedFetcher extends Object implements CachedFetcher
Abstract class for fetchers- Since:
09/09/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
Fields Modifier and Type Field Description static StringEHCACHE_CONFIG_FILEConstantEHCACHE_CONFIG_FILE="/service.ehcache.xml"
-
Constructor Summary
Constructors Constructor Description AbstractCachedFetcher(String cacheName)Constructor for AbstractCachedFetcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()clearCache.ObjectgetFromCache(String key)Fetch an element from the cache with a given keyvoidinitialiseCache()initialiseCache.voidinitialiseCache(String settingsFile)Initialises the cache with the settings in the file at the location.voidshutDownCache()shutDownCache.voidstoreInCache(String key, Object data)Stores a given object in the cache with a key
-
-
-
Field Detail
-
EHCACHE_CONFIG_FILE
public static final String EHCACHE_CONFIG_FILE
ConstantEHCACHE_CONFIG_FILE="/service.ehcache.xml"- See Also:
- Constant Field Values
-
-
Method Detail
-
initialiseCache
public void initialiseCache()
initialiseCache.
- Specified by:
initialiseCachein interfaceCachedFetcher
-
initialiseCache
public void initialiseCache(String settingsFile)
Initialises the cache with the settings in the file at the location.- Specified by:
initialiseCachein interfaceCachedFetcher- Parameters:
settingsFile- The path of a file with the settings for an EHCache
-
getFromCache
public Object getFromCache(String key)
Fetch an element from the cache with a given key- Specified by:
getFromCachein interfaceCachedFetcher- Parameters:
key- aStringobject.- Returns:
- a
Objectobject.
-
storeInCache
public void storeInCache(String key, Object data)
Stores a given object in the cache with a key- Specified by:
storeInCachein interfaceCachedFetcher- Parameters:
key- aStringobject.data- aObjectobject.
-
clearCache
public void clearCache()
clearCache.
- Specified by:
clearCachein interfaceCachedFetcher
-
shutDownCache
public void shutDownCache()
shutDownCache.
- Specified by:
shutDownCachein interfaceCachedFetcher
-
-