private Status updateContainerFlow(String containerName, List<ContainerFlowConfig> confList, boolean delete) {
ContainerData container = getContainerByName(containerName);
if (container == null) {
return new Status(StatusCode.GONE, "Container not present");
}
for (ContainerFlowConfig conf : confList) {
for (Match match : conf.getMatches()) {
ContainerFlow cFlow = new ContainerFlow(match);
if (delete) {
logger.trace("Removing Flow Spec {} from Container {}", conf.getName(), containerName);
container.deleteFlowSpec(cFlow);
} else {
logger.trace("Adding Flow Spec {} to Container {}", conf.getName(), containerName);
container.addFlowSpec(cFlow);
}
putContainerDataByName(containerName, container);
}
}
return new Status(StatusCode.SUCCESS);
}