public interface RemoteConnector
| Modifier and Type | Method and Description |
|---|---|
void |
authorize(String verificationCode)
Authorizes the app.
|
String |
getAccessTokenSecret() |
String |
getAccessTokenValue() |
String |
getAuthorizationURL()
Gets a new authorization URL from the remote server.
|
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() |
void |
setAccessToken(String token,
String secret)
Authorizes the app.
|
String getAuthorizationURL() throws IOException
authorize(String)IOException - if the authorization URL could not be retrievedvoid authorize(String verificationCode) throws IOException
getAuthorizationURL(), this method has to be
called to finish authorizationverificationCode - the verification code the user received from
the authorization URLIOException - if authorization failedvoid setAccessToken(String token, String secret)
Authorizes the app. If you already know a valid OAuth access token
(for example if you cached it from previous sessions) you may call
this method instead of getAuthorizationURL() and
authorize(String).
This method just saves the provided access token. It does not act with the remote service in any way.
token - the access token valuesecret - the access token's secretgetAccessTokenValue(),
getAccessTokenSecret()String getAccessTokenValue()
setAccessToken(String, String)String getAccessTokenSecret()
setAccessToken(String, String)List<String> getItemIDs() throws IOException
UnauthorizedException - if the user is not authenticatedRequestException - if the server returns an error codeIOException - if the items could not be read from the serverCSLItemData getItem(String itemId) throws IOException
itemId - 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 serverMap<String,CSLItemData> getItems(List<String> itemIds) throws IOException
Requests 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 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 servergetMaxBulkItems()int getMaxBulkItems()
getItems(List)