Class ExternalDataServiceImpl

java.lang.Object
org.dspace.external.service.impl.ExternalDataServiceImpl
All Implemented Interfaces:
ExternalDataService

public class ExternalDataServiceImpl extends Object implements ExternalDataService
Implementation of ExternalDataService
  • Constructor Details

    • ExternalDataServiceImpl

      public ExternalDataServiceImpl()
  • Method Details

    • getExternalDataObject

      public Optional<ExternalDataObject> getExternalDataObject(String source, String id)
      Description copied from interface: ExternalDataService
      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
      Specified by:
      getExternalDataObject in interface ExternalDataService
      Parameters:
      source - The source in which the lookup will be done
      id - 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: ExternalDataService
      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
      Specified by:
      searchExternalDataObjects in interface ExternalDataService
      Parameters:
      source - The source that defines which ExternalDataProvider is to be used
      query - The query for which the search will be done
      start - The start of the search
      limit - 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: ExternalDataService
      This method will return a list of ExternalDataProvider objects defined by all ExternalDataProvider spring beans
      Specified by:
      getExternalDataProviders in interface ExternalDataService
      Returns:
      A list of all ExternalDataProvider objects
    • getExternalDataProvider

      public ExternalDataProvider getExternalDataProvider(String sourceIdentifier)
      Description copied from interface: ExternalDataService
      This method will return a single ExternalDataProvider which will support the given sourceIdentifier param
      Specified by:
      getExternalDataProvider in interface ExternalDataService
      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: ExternalDataService
      This method will return the total amount of results that will be found for the given query in the given source
      Specified by:
      getNumberOfResults in interface ExternalDataService
      Parameters:
      source - The source in which the query will happen to return the number of results
      query - 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: ExternalDataService
      This method will create a WorkspaceItem in the given Collection based on the given ExternalDataObject.
      Specified by:
      createWorkspaceItemFromExternalDataObject in interface ExternalDataService
      Parameters:
      context - The relevant DSpace context
      externalDataObject - The relevant ExternalDataObject to be used
      collection - The Collection in which the item will be present
      Returns:
      The created Item
      Throws:
      AuthorizeException - If something goes wrong
      SQLException - If something goes wrong
    • getExternalDataProvidersForEntityType

      public List<ExternalDataProvider> getExternalDataProvidersForEntityType(String entityType)
      Description copied from interface: ExternalDataService
      Return the ExternalDataProvider that supports a specific entity type
      Specified by:
      getExternalDataProvidersForEntityType in interface ExternalDataService
      Returns:
      list of ExternalDataProviders that supports a specific entity type