X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconnectionmanager%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconnectionmanager%2Finternal%2FConnectionManager.java;h=e5bf5258c5faa86fff78f5959692494f0049052f;hp=1beb7fe0bb609860865ed52347f27bfe126aeb2e;hb=99050b4a43221f1e82f2fb61bc4ea162c2c7e283;hpb=2468eb402ab9e5151d0b4127b12a1b29ed1fa3c4 diff --git a/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/internal/ConnectionManager.java b/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/internal/ConnectionManager.java index 1beb7fe0bb..e5bf5258c5 100644 --- a/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/internal/ConnectionManager.java +++ b/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/internal/ConnectionManager.java @@ -235,19 +235,31 @@ public class ConnectionManager implements IConnectionManager, IConnectionListene @Override public Node connect(String connectionIdentifier, Map params) { if (connectionService == null) return null; - return connectionService.connect(connectionIdentifier, params); + Node node = connectionService.connect(connectionIdentifier, params); + AbstractScheme scheme = schemes.get(activeScheme); + if (scheme != null && node != null) scheme.addNode(node); + return node; } @Override public Node connect(String type, String connectionIdentifier, Map params) { if (connectionService == null) return null; - return connectionService.connect(type, connectionIdentifier, params); + Node node = connectionService.connect(connectionIdentifier, params); + AbstractScheme scheme = schemes.get(activeScheme); + if (scheme != null && node != null) scheme.addNode(node); + return node; } @Override public Status disconnect (Node node) { + if (node == null) return new Status(StatusCode.BADREQUEST); if (connectionService == null) return new Status(StatusCode.NOSERVICE); - return connectionService.disconnect(node); + Status status = connectionService.disconnect(node); + if (status.isSuccess()) { + AbstractScheme scheme = schemes.get(activeScheme); + if (scheme != null) scheme.removeNode(node); + } + return status; } @Override