public interface AsyncService
All transactions are done within the context of a customer, which is the account entity of the API. On initiation, the customer context is set based on which customer the authenticated user is linked to on the server. If the user has access to multiple accounts, a list is available from the ServiceSpec object, and the customer context can be changed with setCustomerContext.
Modifier and Type | Interface and Description |
---|---|
static interface |
AsyncService.AccountCallback
Defines callback methods for transactions establishing the
customer account context for the API service.
|
static interface |
AsyncService.DataRetrieveCallback
Callback interface for GetTransaction.
|
static interface |
AsyncService.TransactionCallback
Generic transaction callback interface.
|
Modifier and Type | Method and Description |
---|---|
void |
abortTransaction()
Cancels any transaction currently in progress.
|
void |
doDataRetrieve(GetTransaction trans,
AsyncService.DataRetrieveCallback drc)
Asynchronous execution of a GET transaction, retrieving resource objects.
|
void |
doTransaction(ResourceTransaction trans,
AsyncService.TransactionCallback tc)
Asynchronous execution of an API transaction.
|
ServiceSpec |
getServiceSpec()
The ServiceSpec object has account information for the current client
session, such as user and customer entities and access rights, once
the service has been initiated.
|
void |
initiate(java.lang.String authenticationToken,
AsyncService.AccountCallback ac)
Initiate the service, authenticating the client with an authentication
token.
|
void |
initiate(java.lang.String username,
java.lang.String password,
AsyncService.AccountCallback ac)
Initiate the service, authenticating the client with user name and
password.
|
boolean |
isInitiated() |
boolean |
isInProgress() |
void |
setCustomerContext(long customerId,
AsyncService.AccountCallback ac)
If the currently authenticated user has access to multiple customer
accounts, it is possible to switch between them, to target a different
account.
|
void initiate(java.lang.String username, java.lang.String password, AsyncService.AccountCallback ac)
username
- password
- ac
- called on transaction completionvoid initiate(java.lang.String authenticationToken, AsyncService.AccountCallback ac)
authenticationToken
- ac
- called on transaction completionboolean isInitiated()
void setCustomerContext(long customerId, AsyncService.AccountCallback ac)
customerId
- account to switch toac
- called on transaction completionServiceSpec getServiceSpec()
void doTransaction(ResourceTransaction trans, AsyncService.TransactionCallback tc)
trans
- specifies the transactiontc
- called on transaction completionvoid doDataRetrieve(GetTransaction trans, AsyncService.DataRetrieveCallback drc)
trans
- specifies the transactiondrc
- called on transaction completionboolean isInProgress()
void abortTransaction()