Class SHERPAv2JournalISSNDataProvider
- java.lang.Object
-
- org.dspace.external.provider.AbstractExternalDataProvider
-
- org.dspace.external.provider.impl.SHERPAv2JournalISSNDataProvider
-
- All Implemented Interfaces:
ExternalDataProvider
public class SHERPAv2JournalISSNDataProvider extends AbstractExternalDataProvider
This class is the implementation of the ExternalDataProvider interface that will deal with SherpaJournal External data lookups based on ISSN (to match functinoality offered by legacy SHERPASubmitService for policy lookups at the time of submission). This provider is a refactored version of SherpaJournalDataPublisher, rewritten to work with SHERPA v2 API- Author:
- Kim Shepherd
-
-
Constructor Summary
Constructors Constructor Description SHERPAv2JournalISSNDataProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<ExternalDataObject>getExternalDataObject(String issn)Get a single journal based on a "issn equals string" queryintgetNumberOfResults(String issn)Get number of results returned from a SHERPA v2 publication searchStringgetSourceIdentifier()This method will return the SourceIdentifier for the ExternalDataProvider that implements the interfacevoidinit()Initialise the provider - this no longer starts client since that is handled by SHERPAServiceList<ExternalDataObject>searchExternalDataObjects(String query, int start, int limit)Search SHERPA v2 API for journal results based on a 'contains word' queryvoidsetSherpaService(SHERPAService sherpaService)Generic setter for the SHERPA ServicevoidsetSourceIdentifier(String sourceIdentifier)Generic setter for the sourceIdentifierbooleansupports(String source)This method will return a boolean indicating whether this ExternalDataProvider can deal with the given source or not-
Methods inherited from class org.dspace.external.provider.AbstractExternalDataProvider
getSupportedEntityTypes, setSupportedEntityTypes, supportsEntityType
-
-
-
-
Method Detail
-
getSourceIdentifier
public String getSourceIdentifier()
Description copied from interface:ExternalDataProviderThis method will return the SourceIdentifier for the ExternalDataProvider that implements the interface- Returns:
- The source identifier as a String
-
init
public void init() throws IOExceptionInitialise the provider - this no longer starts client since that is handled by SHERPAService- Throws:
IOException- If something goes wrong
-
getExternalDataObject
public Optional<ExternalDataObject> getExternalDataObject(String issn)
Get a single journal based on a "issn equals string" query- Parameters:
issn- The ISSN which will be used as query string- Returns:
- external data object representing journal
-
searchExternalDataObjects
public List<ExternalDataObject> searchExternalDataObjects(String query, int start, int limit)
Search SHERPA v2 API for journal results based on a 'contains word' query- Parameters:
query- The term to query for the searchstart- The start of the searchlimit- The max amount of records to be returned by the search- Returns:
- a list of external data objects
-
supports
public boolean supports(String source)
Description copied from interface:ExternalDataProviderThis method will return a boolean indicating whether this ExternalDataProvider can deal with the given source or not- Parameters:
source- The source on which the check needs to be done- Returns:
- A boolean indicating whether this ExternalDataProvider can deal with this source or not
-
getNumberOfResults
public int getNumberOfResults(String issn)
Get number of results returned from a SHERPA v2 publication search- Parameters:
issn- The query to be search on and give the total amount of results- Returns:
- int representing number of journal results
-
setSourceIdentifier
public void setSourceIdentifier(String sourceIdentifier)
Generic setter for the sourceIdentifier- Parameters:
sourceIdentifier- The sourceIdentifier to be set on this SHERPAv2JournalISSNDataProvider
-
setSherpaService
public void setSherpaService(SHERPAService sherpaService)
Generic setter for the SHERPA Service- Parameters:
sherpaService- THe SHERPA service to be set on this SHERPAv2JournalISSNDataProvider
-
-