Search in sources :

Example 1 with ServiceTaskCallbackResponse

use of com.vmware.photon.controller.model.tasks.ServiceTaskCallback.ServiceTaskCallbackResponse in project photon-model by vmware.

the class ResourceIPDeallocationTaskService method sendCallbackResponse.

private void sendCallbackResponse(ResourceIPDeallocationTaskState state) {
    ServiceTaskCallbackResponse result;
    if (state.taskInfo.stage == TaskState.TaskStage.FAILED) {
        result = state.serviceTaskCallback.getFailedResponse(state.taskInfo.failure);
    } else {
        result = state.serviceTaskCallback.getFinishedResponse();
    }
    logInfo("Calling back at the end of dealloaction of IP addresses for resource [%s]", state.resourceLink);
    sendRequest(Operation.createPatch(state.serviceTaskCallback.serviceURI).setBody(result));
}
Also used : ServiceTaskCallbackResponse(com.vmware.photon.controller.model.tasks.ServiceTaskCallback.ServiceTaskCallbackResponse)

Aggregations

ServiceTaskCallbackResponse (com.vmware.photon.controller.model.tasks.ServiceTaskCallback.ServiceTaskCallbackResponse)1