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