BUG 4930: Make keepalive executor definition actually non-mandatory 34/32434/4
authorTomas Cere <tcere@cisco.com>
Tue, 12 Jan 2016 16:14:03 +0000 (17:14 +0100)
committerTomas Cere <tcere@cisco.com>
Fri, 15 Jan 2016 09:49:41 +0000 (10:49 +0100)
Yangtools started enforcing mandatory statements and keepalive
executor was not actually non-mandatory since name still inherited
mandatory true from the config model.

While we're here cleanup netconf connector module from leftovers
of the old topology-netconf connector design.

Change-Id: Ia2872f557f3cbc61df3130c7e55135148d29fde3
Signed-off-by: Tomas Cere <tcere@cisco.com>
opendaylight/netconf/sal-netconf-connector/src/main/java/org/opendaylight/controller/config/yang/md/sal/connector/netconf/NetconfConnectorModule.java
opendaylight/netconf/sal-netconf-connector/src/main/yang/odl-sal-netconf-connector-cfg.yang

index 64fce50cc0a435ccc0c86fc106170fddbccf33a2..9df4ad42efefcd71fdebb277d3599aa112e27d17 100644 (file)
@@ -107,13 +107,6 @@ public final class NetconfConnectorModule extends org.opendaylight.controller.co
         checkNotNull(getBetweenAttemptsTimeoutMillis(), betweenAttemptsTimeoutMillisJmxAttribute);
         checkCondition(getBetweenAttemptsTimeoutMillis() > 0, "must be > 0", betweenAttemptsTimeoutMillisJmxAttribute);
 
-//        if (getNetconfTopology() == null) {
-//            checkNotNull(getDomRegistry(), domRegistryJmxAttribute);
-//            checkNotNull(getClientDispatcher(), clientDispatcherJmxAttribute);
-//            checkNotNull(getBindingRegistry(), bindingRegistryJmxAttribute);
-//            checkNotNull(getProcessingExecutor(), processingExecutorJmxAttribute);
-//        }
-
         // Check username + password in case of ssh
         if(getTcpOnly() == false) {
             checkNotNull(getUsername(), usernameJmxAttribute);
@@ -133,7 +126,7 @@ public final class NetconfConnectorModule extends org.opendaylight.controller.co
 
     @Override
     public java.lang.AutoCloseable createInstance() {
-        initDependenciesFromTopology();
+        initDependencies();
         final RemoteDeviceId id = new RemoteDeviceId(getIdentifier(), getSocketAddress());
 
         final ExecutorService globalProcessingExecutor = processingExecutor.getExecutor();
@@ -168,18 +161,7 @@ public final class NetconfConnectorModule extends org.opendaylight.controller.co
         return new SalConnectorCloseable(listener, salFacade);
     }
 
-    private void initDependenciesFromTopology() {
-//            topology = getNetconfTopologyDependency();
-
-//            domRegistry = topology.getDomRegistryDependency();
-//            clientDispatcher = topology.getNetconfClientDispatcherDependency();
-//            bindingRegistry = topology.getBindingAwareBroker();
-//            processingExecutor = topology.getProcessingExecutorDependency();
-//            keepaliveExecutor = topology.getKeepaliveExecutorDependency();
-//            sharedSchemaRepository = topology.getSharedSchemaRepository().getSharedSchemaRepository();
-//            eventExecutor = topology.getEventExecutorDependency();
-
-//            initFilesystemSchemaSourceCache(sharedSchemaRepository);
+    private void initDependencies() {
         domRegistry = getDomRegistryDependency();
         clientDispatcher = getClientDispatcherDependency();
         bindingRegistry = getBindingRegistryDependency();
@@ -205,7 +187,6 @@ public final class NetconfConnectorModule extends org.opendaylight.controller.co
             keepaliveExecutor = getKeepaliveExecutorDependency();
         }
 
-        LOG.warn("No topology defined in config, using default-shared-schema-repo");
         if (DEFAULT_SCHEMA_REPOSITORY == null) {
             DEFAULT_SCHEMA_REPOSITORY = new SharedSchemaRepository("default shared schema repo");
         }
index d903ccfa248f0a0409d2ae20c1a57b76fdf9ed49..da197e31cf318fdf225dfe8b67e43358fb0a86b0 100644 (file)
@@ -12,12 +12,11 @@ module odl-sal-netconf-connector-cfg {
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
 
     description
-        "Service definition for Binding Aware MD-SAL.";
+        "Config definition for Netconf Connector modules";
 
     revision "2015-08-03" {
         description
-            "Add netconf topology from which dependencies are inherited, change
-            existing dependencies to non-mandatory to preserve backwards compatibility";
+            "Non-mandatory keepalive executor";
     }
 
     revision "2013-10-28" {
@@ -91,7 +90,7 @@ module odl-sal-netconf-connector-cfg {
             container binding-registry {
                 uses config:service-ref {
                     refine type {
-                        mandatory false;
+                        mandatory true;
                         config:required-identity md-sal-binding:binding-broker-osgi-registry;
                     }
                 }
@@ -100,7 +99,7 @@ module odl-sal-netconf-connector-cfg {
             container event-executor {
                 uses config:service-ref {
                     refine type {
-                        mandatory false;
+                        mandatory true;
                         config:required-identity netty:netty-event-executor;
                     }
                 }
@@ -109,7 +108,7 @@ module odl-sal-netconf-connector-cfg {
             container processing-executor {
                 uses config:service-ref {
                     refine type {
-                        mandatory false;
+                        mandatory true;
                         config:required-identity th:threadpool;
                     }
                 }
@@ -171,6 +170,9 @@ module odl-sal-netconf-connector-cfg {
                         mandatory false;
                         config:required-identity th:scheduled-threadpool;
                     }
+                    refine name {
+                        mandatory false;
+                    }
                 }
 
                 description "Dedicated solely to keepalive execution";