This is a generic interface that is used by other platform services that expose asynchronous operations and their results to applications.
Example of services that implement this interface can be found in IToiAssetManagerService::GetAssetOperationManager() and IToiStorageService::GetStorageOperationManager().
import "IToiOperationManager.idl";
Public Member Functions | |
void | CreateOperation (in IToiApplicationService::TToiApplicationId applicationId, in string userData, out TToiOperationId operationId) raises (TToiNotEnoughResourcesException) |
void | CancelOperation (in TToiOperationId operationId) raises (TToiInvalidArgumentException) |
void | ReleaseOperation (in TToiOperationId operationId) raises (TToiInvalidArgumentException) |
void | GetOperationInfo (in TToiOperationId operationId, out TToiOperationInfo operationInfo) raises (TToiInvalidArgumentException) |
void | RegisterObserver (in IToiApplicationService::TToiApplicationId applicationId, in string address) raises (TToiInvalidArgumentException) |
void | ReleaseObserver (in string address) raises (TToiInvalidArgumentException) |
Public Attributes | |
Operation error codes | |
const TToiOperationError | OP_ERROR_FAILED = -1 |
const TToiOperationError | OP_ERROR_CANCELLED = -2 |
Operation results | |
const TToiOperationResult | OP_RESULT_NONE = 0 |
Classes | |
struct | TToiOperationInfo |
struct | TToiProperty |
Public Types | |
enum | TToiOperationState { OPERATION_PENDING, OPERATION_COMPLETED, OPERATION_FAILED } |
typedef long | TToiOperationId |
typedef long | TToiOperationResult |
typedef long | TToiOperationError |
typedef long | TToiPropertyId |
typedef string | TToiPropertyValue |
typedef sequence< TToiProperty > | TToiPropertySequence |
typedef long IToiOperationManager::TToiOperationError |
Type for operation errors.
typedef long IToiOperationManager::TToiOperationId |
Type for operation identifier.
typedef long IToiOperationManager::TToiOperationResult |
Type for operation results.
typedef long IToiOperationManager::TToiPropertyId |
Identifier for a metadata property. This with TToiPropertyValue forms a key-value pair that is used by the TToiOperationInfo to provide additional information about operation informaiton .
typedef sequence< TToiProperty > IToiOperationManager::TToiPropertySequence |
Sequence of property tags.
typedef string IToiOperationManager::TToiPropertyValue |
Value for a metadata property. This with TToiPropertyId forms a key-value pair that is used by the TToiOperationInfo toprovide additional information about operation informaiton .
void IToiOperationManager::CancelOperation | ( | in TToiOperationId | operationId | ) | raises (TToiInvalidArgumentException) |
Requests an operation to stop execution.
operationId | Operation identifier. |
TToiInvalidArgumentException | Raised if any of the parameters to the call are invalid. |
void IToiOperationManager::CreateOperation | ( | in IToiApplicationService::TToiApplicationId | applicationId, | |
in string | userData, | |||
out TToiOperationId | operationId | |||
) | raises (TToiNotEnoughResourcesException) |
Creates a new operation. The operation identifier is used when starting a asynchronous request. When the operation is completed the operation shall either be released by calling ReleaseOperation() or reused for another request.
applicationId | The identifier of the application. | |
userData | The user defined data to be passed as parameter for identification in all operation callbacks. |
operationId | Operation identifier. |
TToiNotEnoughResourcesException | Raised if too many operations are active and the system cannot create another operation. |
void IToiOperationManager::GetOperationInfo | ( | in TToiOperationId | operationId, | |
out TToiOperationInfo | operationInfo | |||
) | raises (TToiInvalidArgumentException) |
Returns information about given operation. This method is normally not useful for an application that is listening to operation events since the same information is provided in the callback.
In some circumstances it may still be relevant to use this method and that is when the application is using a polled approach to handle operation results instead of callbacks. But also if the application do not handle an incoming callback directly and want to get the latest updated operation information.
operationId | Operation identifier. |
operationInfo | The current operation information. |
TToiInvalidArgumentException | Raised if any of the parameters to the call are invalid. |
void IToiOperationManager::RegisterObserver | ( | in IToiApplicationService::TToiApplicationId | applicationId, | |
in string | address | |||
) | raises (TToiInvalidArgumentException) |
Register an observer of type IToiOperationObserver. The observer will receive events sent by this IToiOperationManager instance.
applicationId | The identifier of the observing application. | |
address | The address where the IToiOperationManager can find an IToiOperationObserver interface. |
TToiInvalidArgumentException | Raised if the specified address is invalid or if the application has already registered itself as an observer with the same address. |
void IToiOperationManager::ReleaseObserver | ( | in string | address | ) | raises (TToiInvalidArgumentException) |
Release an observer previously registered with RegisterObserver.
address | The address where the IToiOperationManager can find the registered IToiOperationObserver interface. |
TToiInvalidArgumentException | Raised if the specified address is invalid. |
void IToiOperationManager::ReleaseOperation | ( | in TToiOperationId | operationId | ) | raises (TToiInvalidArgumentException) |
Releases any system resources associated with the operation and if needed cancels the operation as well. This method shall be called when the application is done with the operation and will use it no more.
operationId | Operation identifier. |
TToiInvalidArgumentException | Raised if any of the parameters to the call are invalid. |
Operation was canceled by user.
This constant can also be accessed from toi.consts.IToiOperationManager.OP_ERROR_CANCELLED.
Operation failed for unknown reason.
This constant can also be accessed from toi.consts.IToiOperationManager.OP_ERROR_FAILED.
The operation has no result. Can be used for operations that perform some action and only indicate progress, success and failure.
This constant can also be accessed from toi.consts.IToiOperationManager.OP_RESULT_NONE.