Class PubmedImportMetadataSourceServiceImpl

  • All Implemented Interfaces:
    MetadataSource

    public class PubmedImportMetadataSourceServiceImpl
    extends AbstractImportMetadataSourceService<org.apache.axiom.om.OMElement>
    Implements a data source for querying PubMed Central
    Author:
    Roeland Dillen (roeland at atmire dot com)
    • Constructor Detail

      • PubmedImportMetadataSourceServiceImpl

        public PubmedImportMetadataSourceServiceImpl()
    • Method Detail

      • getNbRecords

        public int getNbRecords​(String query)
                         throws MetadataSourceException
        Find the number of records matching a query;
        Parameters:
        query - a query string to base the search on.
        Returns:
        the sum of the matching records over this import source
        Throws:
        MetadataSourceException - if the underlying methods throw any exception.
      • getNbRecords

        public int getNbRecords​(Query query)
                         throws MetadataSourceException
        Find the number of records matching a query;
        Parameters:
        query - a query object to base the search on.
        Returns:
        the sum of the matching records over this import source
        Throws:
        MetadataSourceException - if the underlying methods throw any exception.
      • getRecords

        public Collection<ImportRecord> getRecords​(String query,
                                                   int start,
                                                   int count)
                                            throws MetadataSourceException
        Find the number of records matching a string query. Supports pagination
        Parameters:
        query - a query string to base the search on.
        start - offset to start at
        count - number of records to retrieve.
        Returns:
        a set of records. Fully transformed.
        Throws:
        MetadataSourceException - if the underlying methods throw any exception.
      • getImportSource

        public String getImportSource()
        The string that identifies this import implementation. Preferable a URI
        Returns:
        the identifying uri
      • findMatchingRecords

        public Collection<ImportRecord> findMatchingRecords​(Item item)
                                                     throws MetadataSourceException
        Finds records based on an item
        Parameters:
        item - an item to base the search on
        Returns:
        a collection of import records. Only the identifier of the found records may be put in the record.
        Throws:
        MetadataSourceException - if the underlying methods throw any exception.
      • findMatchingRecords

        public Collection<ImportRecord> findMatchingRecords​(Query query)
                                                     throws MetadataSourceException
        Finds records based on query object. Delegates to one or more MetadataSource implementations based on the uri. Results will be aggregated.
        Parameters:
        query - a query object to base the search on.
        Returns:
        a collection of import records. Only the identifier of the found records may be put in the record.
        Throws:
        MetadataSourceException - if the underlying methods throw any exception.
      • getBaseAddress

        public String getBaseAddress()
        Return the baseAddress set to this object
        Returns:
        The String object that represents the baseAddress of this object
      • setBaseAddress

        public void setBaseAddress​(String baseAddress)
        Set the baseAddress to this object
        Parameters:
        baseAddress - The String object that represents the baseAddress of this object