use of org.kie.workbench.common.screens.server.management.model.ContainerRuntimeState in project kie-wb-common by kiegroup.
the class AsyncKieServerInstanceManager method produceContainerUpdateEvent.
protected void produceContainerUpdateEvent(ServerTemplate serverTemplate, ContainerSpec containerSpec, List<Container> containers, ContainerRuntimeOperation containerRuntimeOperation) {
List<ServerInstanceKey> failedServerInstances = new ArrayList<ServerInstanceKey>();
for (Container container : containers) {
if (hasIssues(container)) {
failedServerInstances.add(container.getServerInstanceKey());
}
}
ContainerRuntimeState containerRuntimeState = ContainerRuntimeState.ONLINE;
if (failedServerInstances.size() == containers.size()) {
containerRuntimeState = ContainerRuntimeState.OFFLINE;
} else if (!failedServerInstances.isEmpty()) {
containerRuntimeState = ContainerRuntimeState.PARTIAL_ONLINE;
}
ContainerUpdateEvent updateEvent = new ContainerUpdateEvent(serverTemplate, containerSpec, failedServerInstances, containerRuntimeState, containerRuntimeOperation);
containerUpdateEvent.fire(updateEvent);
}
Aggregations