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);
}