Package org.dspace.external.service.impl
Class ExternalDataServiceImpl
- java.lang.Object
-
- org.dspace.external.service.impl.ExternalDataServiceImpl
-
- All Implemented Interfaces:
ExternalDataService
public class ExternalDataServiceImpl extends Object implements ExternalDataService
Implementation ofExternalDataService
-
-
Constructor Summary
Constructors Constructor Description ExternalDataServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete 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 id)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 parameters-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.external.service.ExternalDataService
supportsEntityType
-
-
-
-
Method Detail
-
getExternalDataObject
public Optional<ExternalDataObject> getExternalDataObject(String source, String id)
Description copied from interface:ExternalDataServiceThis 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- Specified by:
getExternalDataObjectin interfaceExternalDataService- Parameters:
source- The source in which the lookup will be doneid- The identifier which will be looked up- Returns:
- An Optional instance of ExternalDataObject
-
searchExternalDataObjects
public List<ExternalDataObject> searchExternalDataObjects(String source, String query, int start, int limit)
Description copied from interface:ExternalDataServiceThis 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- Specified by:
searchExternalDataObjectsin interfaceExternalDataService- 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
-
getExternalDataProviders
public List<ExternalDataProvider> getExternalDataProviders()
Description copied from interface:ExternalDataServiceThis method will return a list of ExternalDataProvider objects defined by all ExternalDataProvider spring beans- Specified by:
getExternalDataProvidersin interfaceExternalDataService- Returns:
- A list of all ExternalDataProvider objects
-
getExternalDataProvider
public ExternalDataProvider getExternalDataProvider(String sourceIdentifier)
Description copied from interface:ExternalDataServiceThis method will return a single ExternalDataProvider which will support the given sourceIdentifier param- Specified by:
getExternalDataProviderin interfaceExternalDataService- 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
-
getNumberOfResults
public int getNumberOfResults(String source, String query)
Description copied from interface:ExternalDataServiceThis method wil return the total amount of results that will be found for the given query in the given source- Specified by:
getNumberOfResultsin interfaceExternalDataService- 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
public WorkspaceItem createWorkspaceItemFromExternalDataObject(Context context, ExternalDataObject externalDataObject, Collection collection) throws AuthorizeException, SQLException
Description copied from interface:ExternalDataServiceThis method will create a WorkspaceItem in the given Collection based on the given ExternalDataObject.- Specified by:
createWorkspaceItemFromExternalDataObjectin interfaceExternalDataService- 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
public List<ExternalDataProvider> getExternalDataProvidersForEntityType(String entityType)
Description copied from interface:ExternalDataServiceReturn the ExternalDataProvider that supports a specific entity type- Specified by:
getExternalDataProvidersForEntityTypein interfaceExternalDataService- Returns:
- list of ExternalDataProviders that supports a specific entity type
-
-