Package org.dspace.external.provider
Interface ExternalDataProvider
-
- All Known Implementing Classes:
AbstractExternalDataProvider,LiveImportDataProvider,OpenAIREFundingDataProvider,OrcidV3AuthorDataProvider,SHERPAv2JournalDataProvider,SHERPAv2JournalISSNDataProvider,SHERPAv2PublisherDataProvider
public interface ExternalDataProviderThis interface should be implemented by all providers that will deal with external data
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Optional<ExternalDataObject>getExternalDataObject(String id)This method will take a String id as a parameter and it'll call the ExternalDataProvider's endpoint or data source to retrieve and build the ExternalDataObjectintgetNumberOfResults(String query)Returns the total amount of results that this source can return for the given queryStringgetSourceIdentifier()This method will return the SourceIdentifier for the ExternalDataProvider that implements the interfaceList<ExternalDataObject>searchExternalDataObjects(String query, int start, int limit)This method will query the ExternalDataProvider's endpoint or data source to retrieve and build a list of ExternalDataObjects through a search with the given parametersbooleansupports(String source)This method will return a boolean indicating whether this ExternalDataProvider can deal with the given source or notdefault booleansupportsEntityType(String entityType)Override this method to limit the external data provider to specific entity types (Publication, OrgUnit, etc.)
-
-
-
Method Detail
-
getSourceIdentifier
String getSourceIdentifier()
This method will return the SourceIdentifier for the ExternalDataProvider that implements the interface- Returns:
- The source identifier as a String
-
getExternalDataObject
Optional<ExternalDataObject> getExternalDataObject(String id)
This method will take a String id as a parameter and it'll call the ExternalDataProvider's endpoint or data source to retrieve and build the ExternalDataObject- Parameters:
id- The id on which will be searched- Returns:
- An Optional object of ExternalDataObject. This is to indicate that this object may be null. This ExternalDataObject will return all the data returned by the ExternalDataProvider
-
searchExternalDataObjects
List<ExternalDataObject> searchExternalDataObjects(String query, int start, int limit)
This method will query the ExternalDataProvider's endpoint or data source to retrieve and build a list of ExternalDataObjects through a search with the given parameters- Parameters:
query- The query for the searchstart- The start of the searchlimit- The max amount of records to be returned by the search- Returns:
- A list of ExternalDataObjects that were retrieved and built by this search
-
supports
boolean supports(String source)
This 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
int getNumberOfResults(String query)
Returns the total amount of results that this source can return for the given query- Parameters:
query- The query to be search on and give the total amount of results- Returns:
- The total amount of results that the source can return for the given query
-
supportsEntityType
default boolean supportsEntityType(String entityType)
Override this method to limit the external data provider to specific entity types (Publication, OrgUnit, etc.)- Parameters:
entityType- the entity type to check- Returns:
- true if the external provider can be used to search for items of the specified type
-
-