private Status validatePortSharingInternal(List<NodeConnector> portList, List<ContainerFlow> flowSpecList) { for (NodeConnector port : portList) { List<String> slist = nodeConnectorToContainers.get(port); if (slist != null && !slist.isEmpty()) { for (String otherContainerName : slist) { String msg = null; ContainerData other = containerData.get(otherContainerName); if (flowSpecList.isEmpty()) { msg = String.format("Port %s is shared and flow spec is empty for this container", port); } else if (other.isFlowSpecEmpty()) { msg = String.format("Port %s is shared and flow spec is empty for the other container", port); } else if (!checkCommonContainerFlow(flowSpecList, other.getContainerFlowSpecs()).isSuccess()) { msg = String.format("Port %s is shared and other container has common flow spec", port); } if (msg != null) { logger.debug(msg); return new Status(StatusCode.BADREQUEST, msg); } } } } return new Status(StatusCode.SUCCESS); }