Package org.dspace.orcid.client
Interface OrcidClient
-
- All Known Implementing Classes:
OrcidClientImpl
public interface OrcidClientInterface for classes that allow to contact ORCID.- Author:
- Luca Giamminonni (luca.giamminonni at 4science.it)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OrcidResponsedeleteByPutCode(String accessToken, String orcid, String putCode, String path)Delete the ORCID object with the given putCode on the given path.OrcidTokenResponseDTOgetAccessToken(String code)Exchange the authorization code for an ORCID iD and 3-legged access token.<T> Optional<T>getObject(String orcid, String putCode, Class<T> clazz)Retrieves an object from ORCID with the given putCode related to the given orcid using the public API.<T> Optional<T>getObject(String accessToken, String orcid, String putCode, Class<T> clazz)Retrieves an object from ORCID with the given putCode related to the given orcid.org.orcid.jaxb.model.v3.release.record.PersongetPerson(String accessToken, String orcid)Retrieves a summary of the ORCID person related to the given orcid.OrcidTokenResponseDTOgetReadPublicAccessToken()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.WorksgetWorks(String orcid)Retrieves all the works related to the given orcid.org.orcid.jaxb.model.v3.release.record.summary.WorksgetWorks(String accessToken, String orcid)Retrieves all the works related to the given orcid.OrcidResponsepush(String accessToken, String orcid, Object object)Push the given object to ORCID.OrcidResponseupdate(String accessToken, String orcid, Object object, String putCode)Update the object with the given putCode.
-
-
-
Method Detail
-
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
OrcidTokenResponseDTO getAccessToken(String code)
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
org.orcid.jaxb.model.v3.release.record.Person getPerson(String accessToken, String orcid)
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
org.orcid.jaxb.model.v3.release.record.summary.Works getWorks(String accessToken, String orcid)
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
org.orcid.jaxb.model.v3.release.record.summary.Works getWorks(String orcid)
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
org.orcid.jaxb.model.v3.release.record.WorkBulk getWorkBulk(String orcid, List<String> putCodes)
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
<T> Optional<T> getObject(String accessToken, String orcid, String putCode, Class<T> clazz)
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
<T> Optional<T> getObject(String orcid, String putCode, Class<T> clazz)
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
OrcidResponse push(String accessToken, String orcid, Object object)
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
OrcidResponse update(String accessToken, String orcid, Object object, String putCode)
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
OrcidResponse deleteByPutCode(String accessToken, String orcid, String putCode, String path)
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
-
-