private void createContainerNetworkAllocationTask(RequestBrokerState state) {
ContainerNetworkAllocationTaskState allocationTask =
new ContainerNetworkAllocationTaskState();
allocationTask.documentSelfLink = getSelfId();
allocationTask.serviceTaskCallback = ServiceTaskCallback.create(
getSelfLink(), TaskStage.STARTED, SubStage.ALLOCATED,
TaskStage.STARTED, SubStage.ERROR);
allocationTask.customProperties = state.customProperties;
allocationTask.resourceDescriptionLink = state.resourceDescriptionLink;
allocationTask.tenantLinks = state.tenantLinks;
allocationTask.requestTrackerLink = state.requestTrackerLink;
allocationTask.resourceLinks = state.resourceLinks;
allocationTask.resourceCount = state.actualResourceCount;
sendRequest(Operation
.createPost(this, ContainerNetworkAllocationTaskService.FACTORY_LINK)
.setBodyNoCloning(allocationTask)
.setContextId(getSelfId())
.setCompletion((o, e) -> {
if (e != null) {
failTask("Failure creating resource allocation task", e);
return;
}
proceedTo(SubStage.ALLOCATING);
}));
}