Interface ExternalDataService

  • All Known Implementing Classes:
    ExternalDataServiceImpl

    public interface ExternalDataService
    This is an interface that will deal with all Service level calls for External Data
    • 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 done
        identifier - 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 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
      • 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 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

        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 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