Search in sources :

Example 1 with SubStage

use of com.vmware.photon.controller.model.tasks.ProvisionComputeTaskService.ProvisionComputeTaskState.SubStage in project photon-model by vmware.

the class ProvisionComputeTaskService method createSubTask.

public void createSubTask(CompletionHandler c, ProvisionComputeTaskState.SubStage nextStage, ProvisionComputeTaskState 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(this, SubTaskService.FACTORY_LINK).setBody(subTaskInitState).setCompletion(c);
    sendRequest(startPost);
}
Also used : SubStage(com.vmware.photon.controller.model.tasks.ProvisionComputeTaskService.ProvisionComputeTaskState.SubStage) Operation(com.vmware.xenon.common.Operation)

Aggregations

SubStage (com.vmware.photon.controller.model.tasks.ProvisionComputeTaskService.ProvisionComputeTaskState.SubStage)1 Operation (com.vmware.xenon.common.Operation)1