Class CachedUniprotGeneFetcher
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.uniprot.UniprotGeneFetcher
-
- psidev.psi.mi.jami.bridges.uniprot.CachedUniprotGeneFetcher
-
- All Implemented Interfaces:
CachedFetcher,GeneFetcher,InteractorFetcher<Gene>
public class CachedUniprotGeneFetcher extends UniprotGeneFetcher implements CachedFetcher
Created with IntelliJ IDEA.- Since:
- 14/05/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Field Summary
Fields Modifier and Type Field Description static StringCACHE_NAMEConstantCACHE_NAME="uniprot-gene-service-cache"static StringEHCACHE_CONFIG_FILEConstantEHCACHE_CONFIG_FILE="/service.ehcache.xml"
-
Constructor Summary
Constructors Constructor Description CachedUniprotGeneFetcher()Constructor for CachedUniprotGeneFetcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()clearCache.Collection<Gene>getByIdentifier(String identifier)getByIdentifier.Collection<Gene>getByIdentifier(String identifier, int taxID)getByIdentifier.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-
Methods inherited from class psidev.psi.mi.jami.bridges.uniprot.UniprotGeneFetcher
fetchByIdentifier, fetchByIdentifier, fetchByIdentifiers, fetchByIdentifiers
-
-
-
-
Field Detail
-
EHCACHE_CONFIG_FILE
public static final String EHCACHE_CONFIG_FILE
ConstantEHCACHE_CONFIG_FILE="/service.ehcache.xml"- See Also:
- Constant Field Values
-
CACHE_NAME
public static final String CACHE_NAME
ConstantCACHE_NAME="uniprot-gene-service-cache"- See Also:
- Constant Field Values
-
-
Method Detail
-
getByIdentifier
public Collection<Gene> getByIdentifier(String identifier) throws BridgeFailedException
getByIdentifier.
- Parameters:
identifier- aStringobject.- Returns:
- a
Collectionobject. - Throws:
BridgeFailedException- if any.
-
getByIdentifier
public Collection<Gene> getByIdentifier(String identifier, int taxID) throws BridgeFailedException
getByIdentifier.
- Parameters:
identifier- aStringobject.taxID- a int.- Returns:
- a
Collectionobject. - Throws:
BridgeFailedException- if any.
-
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.
-
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
-
clearCache
public void clearCache()
clearCache.
- Specified by:
clearCachein interfaceCachedFetcher
-
shutDownCache
public void shutDownCache()
shutDownCache.
- Specified by:
shutDownCachein interfaceCachedFetcher
-
-