Search in sources :

Example 1 with SubStage

use of com.vmware.photon.controller.model.tasks.ProvisionDiskTaskService.ProvisionDiskTaskState.SubStage in project photon-model by vmware.

the class ProvisionDiskTaskService method createSubTask.

public void createSubTask(CompletionHandler c, ProvisionDiskTaskState.SubStage nextStage, ProvisionDiskTaskState currentState) {
    ServiceTaskCallback<SubStage> callback = ServiceTaskCallback.create(UriUtils.buildPublicUri(getHost(), getSelfLink()));
    callback.onSuccessTo(nextStage);
    SubTaskService.SubTaskState<SubStage> subTaskInitState = new SubTaskService.SubTaskState<>();
    subTaskInitState.errorThreshold = 0;
    subTaskInitState.serviceTaskCallback = callback;
    subTaskInitState.tenantLinks = currentState.tenantLinks;
    subTaskInitState.documentExpirationTimeMicros = currentState.documentExpirationTimeMicros;
    Operation startPost = Operation.createPost(createInventoryUri(this.getHost(), SubTaskService.FACTORY_LINK)).setBody(subTaskInitState).setCompletion(c);
    sendRequest(startPost);
}
Also used : SubStage(com.vmware.photon.controller.model.tasks.ProvisionDiskTaskService.ProvisionDiskTaskState.SubStage) Operation(com.vmware.xenon.common.Operation)

Aggregations

SubStage (com.vmware.photon.controller.model.tasks.ProvisionDiskTaskService.ProvisionDiskTaskState.SubStage)1 Operation (com.vmware.xenon.common.Operation)1