Class FailingOrganismFetcher
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher<T>
-
- psidev.psi.mi.jami.bridges.fetcher.mock.AbstractFailingFetcher<Organism>
-
- psidev.psi.mi.jami.bridges.fetcher.mock.FailingOrganismFetcher
-
- All Implemented Interfaces:
MockFetcher<Organism>
,OrganismFetcher
public class FailingOrganismFetcher extends AbstractFailingFetcher<Organism> implements OrganismFetcher
A mock fetcher for testing exceptions. It extends the functionality of the mock fetcher but can also throw exceptions. Upon initialisation, an integer is given which sets how many times a query is made before returning the result. If the current query matches the last query and the counter of the number of times is less than the maxQuery set at initialisation, then an exception will be thrown. Additionally, if the maxQuery is set to -1, the fetcher will always throw an exception.- Since:
- 01/07/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Field Summary
-
Fields inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
localMap
-
-
Constructor Summary
Constructors Constructor Description FailingOrganismFetcher(int maxQuery)
Constructor for FailingOrganismFetcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Organism
fetchByTaxID(int taxID)
Finds the complete organism record matching the provided TaxID number.Collection<Organism>
fetchByTaxIDs(Collection<Integer> taxIDs)
Finds the complete organism records matching the provided TaxID numbers.-
Methods inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractFailingFetcher
getEntries, getEntry
-
Methods inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
addEntry, clearEntries, removeEntry
-
-
-
-
Method Detail
-
fetchByTaxID
public Organism fetchByTaxID(int taxID) throws BridgeFailedException
Finds the complete organism record matching the provided TaxID number.- Specified by:
fetchByTaxID
in interfaceOrganismFetcher
- Parameters:
taxID
- The taxID to search for- Returns:
- A matching organism, or null if one could not be found.
- Throws:
BridgeFailedException
- if any.
-
fetchByTaxIDs
public Collection<Organism> fetchByTaxIDs(Collection<Integer> taxIDs) throws BridgeFailedException
Finds the complete organism records matching the provided TaxID numbers.- Specified by:
fetchByTaxIDs
in interfaceOrganismFetcher
- Parameters:
taxIDs
- A collection of taxIDs to search for.- Returns:
- A collection of the matching organisms.
- Throws:
BridgeFailedException
- if any.
-
-