public class MendeleyConnector extends AbstractRemoteConnector
accessToken, auth, requestToken| Constructor and Description |
|---|
MendeleyConnector(String clientId,
String clientSecret,
String redirectUri)
Constructs a new connector
|
| Modifier and Type | Method and Description |
|---|---|
protected OAuth |
createOAuth(String consumerKey,
String consumerSecret,
String redirectUri)
Creates an OAuth object
|
CSLItemData |
getItem(String itemId)
Requests an item from the service.
|
List<String> |
getItemIDs()
Requests a list of item IDs from the server.
|
Map<String,CSLItemData> |
getItems(List<String> itemIds)
Requests several items from the service.
|
int |
getMaxBulkItems() |
protected OAuth.Method |
getOAuthAccessTokenMethod() |
protected String |
getOAuthAccessTokenURL() |
protected String |
getOAuthAuthorizationURL() |
protected String |
getOAuthRequestTokenURL() |
authorize, getAccessTokenSecret, getAccessTokenValue, getAuthorizationURL, parseResponseArray, parseResponseObject, performRequest, performRequestArray, performRequestObject, setAccessTokenpublic MendeleyConnector(String clientId, String clientSecret, String redirectUri)
clientId - the Mendeley app's client IDclientSecret - the app's client secretredirectUri - the location users are redirected to after
they granted the Mendeley app access to their libraryprotected String getOAuthRequestTokenURL()
getOAuthRequestTokenURL in class AbstractRemoteConnectorprotected String getOAuthAuthorizationURL()
getOAuthAuthorizationURL in class AbstractRemoteConnectorprotected String getOAuthAccessTokenURL()
getOAuthAccessTokenURL in class AbstractRemoteConnectorprotected OAuth.Method getOAuthAccessTokenMethod()
getOAuthAccessTokenMethod in class AbstractRemoteConnectorprotected OAuth createOAuth(String consumerKey, String consumerSecret, String redirectUri)
AbstractRemoteConnectorcreateOAuth in class AbstractRemoteConnectorconsumerKey - the app's consumer keyconsumerSecret - the app's consumer secretredirectUri - the location users are redirected to after
they granted the app accesspublic List<String> getItemIDs() throws IOException
RemoteConnectorUnauthorizedException - if the user is not authenticatedRequestException - if the server returns an error codeIOException - if the items could not be read from the serverpublic CSLItemData getItem(String itemId) throws IOException
RemoteConnectoritemId - the item's IDUnauthorizedException - if the user is not authenticatedRequestException - if the server returns an error codeIOException - if the item could not be read from the serverpublic Map<String,CSLItemData> getItems(List<String> itemIds) throws IOException
RemoteConnectorRequests several items from the service. The user has to be authenticated before this method can be called.
Some services support bulk loading. In this case, this method
makes as few requests as possible. The RemoteConnector.getMaxBulkItems()
method returns the maximum number of items that can be queried
within one request.
itemIds - the IDs of the items to requestUnauthorizedException - if the user is not authenticatedRequestException - if the server returns an error codeIOException - if one of the items could not be read from the serverRemoteConnector.getMaxBulkItems()public int getMaxBulkItems()
RemoteConnector.getItems(List)