Package org.dspace.external.service
Interface ExternalDataService
-
- All Known Implementing Classes:
ExternalDataServiceImpl
public interface ExternalDataServiceThis is an interface that will deal with all Service level calls for External Data
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description WorkspaceItemcreateWorkspaceItemFromExternalDataObject(Context context, ExternalDataObject externalDataObject, Collection collection)This method will create a WorkspaceItem in the given Collection based on the given ExternalDataObject.Optional<ExternalDataObject>getExternalDataObject(String source, String identifier)This method will return an Optional instance of ExternalDataObject for the given source and identifier It will try to retrieve one through an ExternalDataProvider as defined by the source with the given identifierExternalDataProvidergetExternalDataProvider(String sourceIdentifier)This method will return a single ExternalDataProvider which will support the given sourceIdentifier paramList<ExternalDataProvider>getExternalDataProviders()This method will return a list of ExternalDataProvider objects defined by all ExternalDataProvider spring beansList<ExternalDataProvider>getExternalDataProvidersForEntityType(String entityType)Return the ExternalDataProvider that supports a specific entity typeintgetNumberOfResults(String source, String query)This method wil return the total amount of results that will be found for the given query in the given sourceList<ExternalDataObject>searchExternalDataObjects(String source, String query, int start, int limit)This method will return a list of ExternalDataObjects as defined through the source in which they will be searched for, the given query start and limit parametersdefault booleansupportsEntityType(String entityType)Override this method to limit the external data provider to specific entity types (Publication, OrgUnit, etc.)
-
-
-
Method Detail
-
getExternalDataProviders
List<ExternalDataProvider> getExternalDataProviders()
This method will return a list of ExternalDataProvider objects defined by all ExternalDataProvider spring beans- Returns:
- A list of all ExternalDataProvider objects
-
getExternalDataProvider
ExternalDataProvider getExternalDataProvider(String sourceIdentifier)
This method will return a single ExternalDataProvider which will support the given sourceIdentifier param- Parameters:
sourceIdentifier- The source identifier that the ExternalDataProvider that will be returned by this method has to support- Returns:
- The ExternalDataProvider that supports the given source identifier
-
getExternalDataObject
Optional<ExternalDataObject> getExternalDataObject(String source, String identifier)
This method will return an Optional instance of ExternalDataObject for the given source and identifier It will try to retrieve one through an ExternalDataProvider as defined by the source with the given identifier- Parameters:
source- The source in which the lookup will be doneidentifier- The identifier which will be looked up- Returns:
- An Optional instance of ExternalDataObject
-
searchExternalDataObjects
List<ExternalDataObject> searchExternalDataObjects(String source, String query, int start, int limit)
This method will return a list of ExternalDataObjects as defined through the source in which they will be searched for, the given query start and limit parameters- Parameters:
source- The source that defines which ExternalDataProvider is to be usedquery- The query for which the search will be donestart- The start of the searchlimit- The maximum amount of records to be returned by the search- Returns:
- A list of ExternalDataObjects that obey the rules in the parameters
-
getNumberOfResults
int getNumberOfResults(String source, String query)
This method wil return the total amount of results that will be found for the given query in the given source- Parameters:
source- The source in which the query will happen to return the number of resultsquery- The query to be ran in this source to retrieve the total amount of results- Returns:
- The total amount of results that can be returned for this query in the given source
-
createWorkspaceItemFromExternalDataObject
WorkspaceItem createWorkspaceItemFromExternalDataObject(Context context, ExternalDataObject externalDataObject, Collection collection) throws AuthorizeException, SQLException
This method will create a WorkspaceItem in the given Collection based on the given ExternalDataObject.- Parameters:
context- The relevant DSpace contextexternalDataObject- The relevant ExternalDataObject to be usedcollection- The Collection in which the item will be present- Returns:
- The created Item
- Throws:
AuthorizeException- If something goes wrongSQLException- If something goes wrong
-
getExternalDataProvidersForEntityType
List<ExternalDataProvider> getExternalDataProvidersForEntityType(String entityType)
Return the ExternalDataProvider that supports a specific entity type- Parameters:
entityType-- Returns:
- list of ExternalDataProviders that supports a specific entity type
-
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
-
-