Package org.dspace.orcid.client
Interface OrcidClient
- All Known Implementing Classes:
OrcidClientImpl
public interface OrcidClient
Interface for classes that allow to contact ORCID.
- Author:
- Luca Giamminonni (luca.giamminonni at 4science.it)
-
Method Summary
Modifier and TypeMethodDescriptiondeleteByPutCode(String accessToken, String orcid, String putCode, String path) Delete the ORCID object with the given putCode on the given path.getAccessToken(String code) Exchange the authorization code for an ORCID iD and 3-legged access token.<T> Optional<T>Retrieves an object from ORCID with the given putCode related to the given orcid using the public API.<T> Optional<T>Retrieves an object from ORCID with the given putCode related to the given orcid.org.orcid.jaxb.model.v3.release.record.PersonRetrieves a summary of the ORCID person related to the given orcid.Retrieves an /read-public access token using a client-credentials OAuth flow, or 2-step OAuth.org.orcid.jaxb.model.v3.release.record.WorkBulkgetWorkBulk(String accessToken, String orcid, List<String> putCodes) Retrieves all the works with the given putCodes related to the given orcidorg.orcid.jaxb.model.v3.release.record.WorkBulkgetWorkBulk(String orcid, List<String> putCodes) Retrieves all the works with the given putCodes related to the given orcidorg.orcid.jaxb.model.v3.release.record.summary.WorksRetrieves all the works related to the given orcid.org.orcid.jaxb.model.v3.release.record.summary.WorksRetrieves all the works related to the given orcid.Push the given object to ORCID.voidrevokeToken(OrcidToken orcidToken) Revokes the given with a POST method.Update the object with the given putCode.
-
Method Details
-
getReadPublicAccessToken
OrcidTokenResponseDTO getReadPublicAccessToken()Retrieves an /read-public access token using a client-credentials OAuth flow, or 2-step OAuth.- Returns:
- the ORCID token
- Throws:
OrcidClientException- if some error occurs during the exchange
-
getAccessToken
Exchange the authorization code for an ORCID iD and 3-legged access token. The authorization code expires upon use.- Parameters:
code- the authorization code- Returns:
- the ORCID token
- Throws:
OrcidClientException- if some error occurs during the exchange
-
getPerson
Retrieves a summary of the ORCID person related to the given orcid.- Parameters:
accessToken- the access tokenorcid- the orcid id of the record to retrieve- Returns:
- the Person
- Throws:
OrcidClientException- if some error occurs during the search
-
getWorks
Retrieves all the works related to the given orcid.- Parameters:
accessToken- the access tokenorcid- the orcid id related to the works- Returns:
- the Works
- Throws:
OrcidClientException- if some error occurs during the search
-
getWorks
Retrieves all the works related to the given orcid.- Parameters:
orcid- the orcid id related to the works- Returns:
- the Works
- Throws:
OrcidClientException- if some error occurs during the search
-
getWorkBulk
org.orcid.jaxb.model.v3.release.record.WorkBulk getWorkBulk(String accessToken, String orcid, List<String> putCodes) Retrieves all the works with the given putCodes related to the given orcid- Parameters:
accessToken- the access tokenorcid- the orcid idputCodes- the putCodes of the works to retrieve- Returns:
- the Works
- Throws:
OrcidClientException- if some error occurs during the search
-
getWorkBulk
Retrieves all the works with the given putCodes related to the given orcid- Parameters:
orcid- the orcid idputCodes- the putCodes of the works to retrieve- Returns:
- the Works
- Throws:
OrcidClientException- if some error occurs during the search
-
getObject
Retrieves an object from ORCID with the given putCode related to the given orcid.- Parameters:
accessToken- the access tokenorcid- the orcid idputCode- the object's put codeclazz- the object's class- Returns:
- the Object, if any
- Throws:
OrcidClientException- if some error occurs during the searchIllegalArgumentException- if the given object class is not an valid ORCID object
-
getObject
Retrieves an object from ORCID with the given putCode related to the given orcid using the public API.- Parameters:
orcid- the orcid idputCode- the object's put codeclazz- the object's class- Returns:
- the Object, if any
- Throws:
OrcidClientException- if some error occurs during the searchIllegalArgumentException- if the given object class is not an valid ORCID object
-
push
Push the given object to ORCID.- Parameters:
accessToken- the access tokenorcid- the orcid idobject- the orcid object to push- Returns:
- the orcid response if no error occurs
- Throws:
OrcidClientException- if some error occurs during the pushIllegalArgumentException- if the given object is not an valid ORCID object
-
update
Update the object with the given putCode.- Parameters:
accessToken- the access tokenorcid- the orcid idobject- the orcid object to pushputCode- the put code of the resource to delete- Returns:
- the orcid response if no error occurs
- Throws:
OrcidClientException- if some error occurs during the pushIllegalArgumentException- if the given object is not an valid ORCID object
-
deleteByPutCode
Delete the ORCID object with the given putCode on the given path.- Parameters:
accessToken- the access tokenorcid- the orcid idputCode- the put code of the resource to deletepath- the path of the resource to delete- Returns:
- the orcid response if no error occurs
- Throws:
OrcidClientException- if some error occurs during the search
-
revokeToken
Revokes the given with a POST method.- Parameters:
orcidToken- the access token to revoke- Throws:
OrcidClientException- if some error occurs during the search
-