Class MockPublicationFetcher
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher<Publication>
-
- psidev.psi.mi.jami.bridges.fetcher.mock.MockPublicationFetcher
-
- All Implemented Interfaces:
MockFetcher<Publication>
,PublicationFetcher
public class MockPublicationFetcher extends AbstractMockFetcher<Publication> implements PublicationFetcher
A mock fetcher for testing. It extends all the methods of the true fetcher, but does not access an external service. Instead, it holds a map which can be loaded with objects and keys. which are then returned. It attempts to replicate the responses of the fetcher in most scenarios.- Since:
- 31/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 MockPublicationFetcher()
Constructor for MockPublicationFetcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Publication
fetchByIdentifier(String pubmedID, String source)
Uses the identifier to search for a publication and return a completed record.Collection<Publication>
fetchByIdentifiers(Map<String,Collection<String>> identifiers)
Uses the identifiers to search for publications and return completed records.-
Methods inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
addEntry, clearEntries, getEntry, removeEntry
-
-
-
-
Method Detail
-
fetchByIdentifier
public Publication fetchByIdentifier(String pubmedID, String source) throws BridgeFailedException
Uses the identifier to search for a publication and return a completed record.- Specified by:
fetchByIdentifier
in interfacePublicationFetcher
- Parameters:
pubmedID
- The identifier of the publication to search for.source
- The database that the identifier is from (pubmed, doi, ...).- Returns:
- A completed record for the publication or null if no publication could be found.
- Throws:
BridgeFailedException
- if any.
-
fetchByIdentifiers
public Collection<Publication> fetchByIdentifiers(Map<String,Collection<String>> identifiers) throws BridgeFailedException
Uses the identifiers to search for publications and return completed records.- Specified by:
fetchByIdentifiers
in interfacePublicationFetcher
- Parameters:
identifiers
- The identifiers of the publications to search for per publication identifier source (pubmed, doi, ...).- Returns:
- Completed records for the publications.
- Throws:
BridgeFailedException
- if any.
-
-