Class OrcidV2AuthorDataProvider

  • All Implemented Interfaces:
    ExternalDataProvider

    public class OrcidV2AuthorDataProvider
    extends Object
    implements ExternalDataProvider
    This class is the implementation of the ExternalDataProvider interface that will deal with the OrcidV2 External Data lookup
    • Method Detail

      • getSourceIdentifier

        public String getSourceIdentifier()
        Description copied from interface: ExternalDataProvider
        This method will return the SourceIdentifier for the ExternalDataProvider that implements the interface
        Specified by:
        getSourceIdentifier in interface ExternalDataProvider
        Returns:
        The source identifier as a String
      • init

        public void init()
                  throws IOException
        Initialize the accessToken that is required for all subsequent calls to ORCID.
        Throws:
        IOException - passed through from HTTPclient.
      • getExternalDataObject

        public Optional<ExternalDataObject> getExternalDataObject​(String id)
        Description copied from interface: ExternalDataProvider
        This method will take a String id as a parameter and it'll call the ExternalDataProvider's endpoint or data source to retrieve and build the ExternalDataObject
        Specified by:
        getExternalDataObject in interface ExternalDataProvider
        Parameters:
        id - The id on which will be searched
        Returns:
        An Optional object of ExternalDataObject. This is to indicate that this object may be null. This ExternalDataObject will return all the data returned by the ExternalDataProvider
      • convertToExternalDataObject

        protected ExternalDataObject convertToExternalDataObject​(org.orcid.jaxb.model.record_v2.Person person)
      • getBio

        public org.orcid.jaxb.model.record_v2.Person getBio​(String id)
        Retrieve a Person object based on a given orcid identifier
        Parameters:
        id - orcid identifier
        Returns:
        Person
      • searchExternalDataObjects

        public List<ExternalDataObject> searchExternalDataObjects​(String query,
                                                                  int start,
                                                                  int limit)
        Description copied from interface: ExternalDataProvider
        This method will query the ExternalDataProvider's endpoint or data source to retrieve and build a list of ExternalDataObjects through a search with the given parameters
        Specified by:
        searchExternalDataObjects in interface ExternalDataProvider
        Parameters:
        query - The query for the search
        start - The start of the search
        limit - The max amount of records to be returned by the search
        Returns:
        A list of ExternalDataObjects that were retrieved and built by this search
      • supports

        public boolean supports​(String source)
        Description copied from interface: ExternalDataProvider
        This method will return a boolean indicating whether this ExternalDataProvider can deal with the given source or not
        Specified by:
        supports in interface ExternalDataProvider
        Parameters:
        source - The source on which the check needs to be done
        Returns:
        A boolean indicating whether this ExternalDataProvider can deal with this source or not
      • getNumberOfResults

        public int getNumberOfResults​(String query)
        Description copied from interface: ExternalDataProvider
        Returns the total amount of results that this source can return for the given query
        Specified by:
        getNumberOfResults in interface ExternalDataProvider
        Parameters:
        query - The query to be search on and give the total amount of results
        Returns:
        The total amount of results that the source can return for the given query
      • setSourceIdentifier

        public void setSourceIdentifier​(String sourceIdentifier)
        Generic setter for the sourceIdentifier
        Parameters:
        sourceIdentifier - The sourceIdentifier to be set on this OrcidV2AuthorDataProvider
      • getOrcidUrl

        public String getOrcidUrl()
        Generic getter for the orcidUrl
        Returns:
        the orcidUrl value of this OrcidV2AuthorDataProvider
      • setOrcidUrl

        public void setOrcidUrl​(String orcidUrl)
        Generic setter for the orcidUrl
        Parameters:
        orcidUrl - The orcidUrl to be set on this OrcidV2AuthorDataProvider
      • setOAUTHUrl

        public void setOAUTHUrl​(String OAUTHUrl)
        Generic setter for the OAUTHUrl
        Parameters:
        OAUTHUrl - The OAUTHUrl to be set on this OrcidV2AuthorDataProvider
      • setClientId

        public void setClientId​(String clientId)
        Generic setter for the clientId
        Parameters:
        clientId - The clientId to be set on this OrcidV2AuthorDataProvider
      • setClientSecret

        public void setClientSecret​(String clientSecret)
        Generic setter for the clientSecret
        Parameters:
        clientSecret - The clientSecret to be set on this OrcidV2AuthorDataProvider