+
+ // Update the local cache
+ updateLocalEdgeMap(container, edge, UpdateType.ADDED, edgeProps.getRight());
+ logger.debug("Added edge {} to local cache in container {}", edge, container);
+
+ return edge;
+ }
+
+ private void addNodeConnector(String container,
+ NodeConnector nodeConnector) {
+ // Use the global edge map for the newly added port in a container
+ Map<NodeConnector, Pair<Edge, Set<Property>>> globalEdgeMap = edgeMap.get(GlobalConstants.DEFAULT
+ .toString());
+ if (globalEdgeMap == null) {
+ return;
+ }
+
+ // Get the edge and update local cache in the container
+ Edge edge1, edge2;
+ edge1 = addEdge(container, nodeConnector, globalEdgeMap);
+ if (edge1 == null) {
+ return;
+ }
+
+ // Get the edge in reverse direction and update local cache in the container
+ NodeConnector peerConnector = edge1.getHeadNodeConnector();
+ edge2 = addEdge(container, peerConnector, globalEdgeMap);
+
+ // Send notification upwards in one shot
+ List<TopoEdgeUpdate> teuList = new ArrayList<TopoEdgeUpdate>();
+ teuList.add(new TopoEdgeUpdate(edge1, null, UpdateType.ADDED));
+ logger.debug("Notify edge1: {} in container {}", edge1, container);
+ if (edge2 != null) {
+ teuList.add(new TopoEdgeUpdate(edge2, null, UpdateType.ADDED));
+ logger.debug("Notify edge2: {} in container {}", edge2, container);
+ }
+ notifyEdge(container, teuList);