Allow to configure number of threads used by Netty's EventLoopGroups
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / yang / gen / v1 / urn / opendaylight / params / xml / ns / yang / openflow / _switch / connection / provider / impl / rev140328 / SwitchConnectionProviderModule.java
index bf8c600f1ec689cefe24297f993390e7ef1cc8e8..1a22723a037b70f2941df5bef9979761228a4e18 100644 (file)
@@ -13,6 +13,7 @@ import java.net.InetAddress;
 import java.net.UnknownHostException;
 
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
+import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration;
 import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration;
 import org.opendaylight.openflowjava.protocol.impl.connection.SwitchConnectionProviderImpl;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
@@ -77,6 +78,7 @@ public final class SwitchConnectionProviderModule extends org.opendaylight.yang.
         final Integer port = getPort();
         final long switchIdleTimeout = getSwitchIdleTimeout();
         final Tls tlsConfig = getTls();
+        final Threads threads = getThreads();
         
         return new ConnectionConfiguration() {
             @Override
@@ -122,6 +124,18 @@ public final class SwitchConnectionProviderModule extends org.opendaylight.yang.
                     public org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType getTlsTruststorePathType() {
                         return Objects.firstNonNull(tlsConfig.getTruststorePathType(), null);
                     }
+                    @Override
+                    public String getKeystorePassword() {
+                        return Objects.firstNonNull(tlsConfig.getKeystorePassword(), null);
+                    }
+                    @Override
+                    public String getCertificatePassword() {
+                        return Objects.firstNonNull(tlsConfig.getCertificatePassword(), null);
+                    }
+                    @Override
+                    public String getTruststorePassword() {
+                        return Objects.firstNonNull(tlsConfig.getTruststorePassword(), null);
+                    }
                 };
             }
             @Override
@@ -133,6 +147,24 @@ public final class SwitchConnectionProviderModule extends org.opendaylight.yang.
                 // TODO Auto-generated method stub
                 return null;
             }
+            @Override
+            public ThreadConfiguration getThreadConfiguration() {
+                if (threads == null) {
+                    return null;
+                }
+                return new ThreadConfiguration() {
+                    
+                    @Override
+                    public int getWorkerThreadCount() {
+                        return threads.getWorkerThreads();
+                    }
+                    
+                    @Override
+                    public int getBossThreadCount() {
+                        return threads.getBossThreads();
+                    }
+                };
+            }
         };
     }