public class ORCIDClientImpl extends java.lang.Object implements ORCIDClient
Degois client
.
Besides the tokens to use the ORCID Member API, it also store the tokens
to access a particular ORCID user profile.ORCIDClient
Constructor and Description |
---|
ORCIDClientImpl(java.lang.String loginUri,
java.lang.String apiUri,
java.lang.String clientId,
java.lang.String clientSecret,
java.lang.String redirectUri,
org.um.dsi.gavea.orcid.client.OrcidAccessToken orcidToken)
Instantiates an ORCID client to communicate with the ORCID API.
|
ORCIDClientImpl(java.lang.String loginUri,
java.lang.String apiUri,
java.lang.String clientId,
java.lang.String clientSecret,
java.lang.String redirectUri,
org.um.dsi.gavea.orcid.client.OrcidAccessToken orcidToken,
int threads)
Instantiates an ORCID client to communicate with the ORCID API.
|
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
addWork(org.um.dsi.gavea.orcid.model.work.Work work)
Adds a new work to the ORCID profile.
|
void |
deleteWork(java.math.BigInteger putcode)
Deletes a work from the ORCID profile.
|
org.um.dsi.gavea.orcid.model.activities.ActivitiesSummary |
getActivitiesSummary()
Retrieves every activity summary from the ORCID profile.
|
java.lang.String |
getClientId()
Returns the Member API client id that will commit the changes (i.e., the
works' source).
|
org.um.dsi.gavea.orcid.model.work.Work |
getWork(java.math.BigInteger putcode)
Retrieves a complete work from the ORCID profile (as opposed to only its
summary).
|
int |
threads()
The number of worker threads that will be used to communicate with the
ORCID API.
|
void |
updateWork(java.math.BigInteger putcode,
org.um.dsi.gavea.orcid.model.work.Work work)
Updates a work in the ORCID profile.
|
public ORCIDClientImpl(java.lang.String loginUri, java.lang.String apiUri, java.lang.String clientId, java.lang.String clientSecret, java.lang.String redirectUri, org.um.dsi.gavea.orcid.client.OrcidAccessToken orcidToken, int threads)
loginUri
- the login URI of the ORCID serviceapiUri
- the URI of the ORCID APIclientId
- the id of the ORCID Member API clientclientSecret
- the secret of the ORCID Member API clientredirectUri
- the redirect URI for requesting the access tokenorcidToken
- the access token to the user ORCID profilethreads
- the number of ORCID worker threadspublic ORCIDClientImpl(java.lang.String loginUri, java.lang.String apiUri, java.lang.String clientId, java.lang.String clientSecret, java.lang.String redirectUri, org.um.dsi.gavea.orcid.client.OrcidAccessToken orcidToken)
loginUri
- the login URI of the ORCID serviceapiUri
- the URI of the ORCID APIclientId
- the id of the ORCID Member API clientclientSecret
- the secret of the ORCID Member API clientredirectUri
- the redirect URI for requesting the access tokenorcidToken
- the access token to the user ORCID profilepublic java.lang.String getClientId()
getClientId
in interface ORCIDClient
public org.um.dsi.gavea.orcid.model.work.Work getWork(java.math.BigInteger putcode) throws org.um.dsi.gavea.orcid.client.exception.OrcidClientException
getWork
in interface ORCIDClient
putcode
- the put-code of the workorg.um.dsi.gavea.orcid.client.exception.OrcidClientException
- if the communication with ORCID failspublic java.math.BigInteger addWork(org.um.dsi.gavea.orcid.model.work.Work work) throws org.um.dsi.gavea.orcid.client.exception.OrcidClientException
addWork
in interface ORCIDClient
work
- the work to be added to the ORCID profileorg.um.dsi.gavea.orcid.client.exception.OrcidClientException
- if the communication with ORCID failspublic void deleteWork(java.math.BigInteger putcode) throws org.um.dsi.gavea.orcid.client.exception.OrcidClientException
deleteWork
in interface ORCIDClient
putcode
- the put-code of the work to be deletedorg.um.dsi.gavea.orcid.client.exception.OrcidClientException
- if the communication with ORCID failspublic void updateWork(java.math.BigInteger putcode, org.um.dsi.gavea.orcid.model.work.Work work) throws org.um.dsi.gavea.orcid.client.exception.OrcidClientException
updateWork
in interface ORCIDClient
putcode
- the put-code of the work to be updatedwork
- the new state of the workorg.um.dsi.gavea.orcid.client.exception.OrcidClientException
- if the communication with ORCID failspublic org.um.dsi.gavea.orcid.model.activities.ActivitiesSummary getActivitiesSummary() throws org.um.dsi.gavea.orcid.client.exception.OrcidClientException
getActivitiesSummary
in interface ORCIDClient
org.um.dsi.gavea.orcid.client.exception.OrcidClientException
- if the communication with ORCID failspublic int threads()
threads
in interface ORCIDClient