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 String
CACHE_NAME
ConstantCACHE_NAME="uniprot-gene-service-cache"
static String
EHCACHE_CONFIG_FILE
ConstantEHCACHE_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 void
clearCache()
clearCache.Collection<Gene>
getByIdentifier(String identifier)
getByIdentifier.Collection<Gene>
getByIdentifier(String identifier, int taxID)
getByIdentifier.Object
getFromCache(String key)
Fetch an element from the cache with a given keyvoid
initialiseCache()
initialiseCache.void
initialiseCache(String settingsFile)
Initialises the cache with the settings in the file at the location.void
shutDownCache()
shutDownCache.void
storeInCache(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
- aString
object.- Returns:
- a
Collection
object. - Throws:
BridgeFailedException
- if any.
-
getByIdentifier
public Collection<Gene> getByIdentifier(String identifier, int taxID) throws BridgeFailedException
getByIdentifier.
- Parameters:
identifier
- aString
object.taxID
- a int.- Returns:
- a
Collection
object. - Throws:
BridgeFailedException
- if any.
-
getFromCache
public Object getFromCache(String key)
Fetch an element from the cache with a given key- Specified by:
getFromCache
in interfaceCachedFetcher
- Parameters:
key
- aString
object.- Returns:
- a
Object
object.
-
storeInCache
public void storeInCache(String key, Object data)
Stores a given object in the cache with a key- Specified by:
storeInCache
in interfaceCachedFetcher
- Parameters:
key
- aString
object.data
- aObject
object.
-
initialiseCache
public void initialiseCache()
initialiseCache.
- Specified by:
initialiseCache
in interfaceCachedFetcher
-
initialiseCache
public void initialiseCache(String settingsFile)
Initialises the cache with the settings in the file at the location.- Specified by:
initialiseCache
in interfaceCachedFetcher
- Parameters:
settingsFile
- The path of a file with the settings for an EHCache
-
clearCache
public void clearCache()
clearCache.
- Specified by:
clearCache
in interfaceCachedFetcher
-
shutDownCache
public void shutDownCache()
shutDownCache.
- Specified by:
shutDownCache
in interfaceCachedFetcher
-
-