Specialize RemoteDevice to NetconfSessionPreferences
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / client / stress / StressClient.java
index 6d02ba259a94585aa3c4fdedcfc763ce522f8967..ba09c0ff06c69abaf532a679390f6fa532cf2292 100644 (file)
@@ -174,12 +174,12 @@ public final class StressClient {
                 try {
                     future.get(4L, TimeUnit.MINUTES);
                 } catch (ExecutionException | TimeoutException e) {
-                    throw new RuntimeException(e);
+                    throw new IllegalStateException(e);
                 }
             }
             executorService.shutdownNow();
         } catch (final InterruptedException e) {
-            throw new RuntimeException("Unable to execute requests", e);
+            throw new IllegalStateException("Unable to execute requests", e);
         }
         started.stop();
 
@@ -238,12 +238,10 @@ public final class StressClient {
             } else {
                 netconfClientDispatcher = ConfigurableClientDispatcher.createChunkedExi(nioGroup, nioGroup, timer);
             }
+        } else if (params.legacyFraming) {
+            netconfClientDispatcher = ConfigurableClientDispatcher.createLegacy(nioGroup, nioGroup, timer);
         } else {
-            if (params.legacyFraming) {
-                netconfClientDispatcher = ConfigurableClientDispatcher.createLegacy(nioGroup, nioGroup, timer);
-            } else {
-                netconfClientDispatcher = ConfigurableClientDispatcher.createChunked(nioGroup, nioGroup, timer);
-            }
+            netconfClientDispatcher = ConfigurableClientDispatcher.createChunked(nioGroup, nioGroup, timer);
         }
         return netconfClientDispatcher;
     }
@@ -261,8 +259,7 @@ public final class StressClient {
         return null;
     }
 
-    static class LoggingRemoteDevice
-            implements RemoteDevice<NetconfSessionPreferences, NetconfMessage, NetconfDeviceCommunicator> {
+    static class LoggingRemoteDevice implements RemoteDevice<NetconfDeviceCommunicator> {
         @Override
         public void onRemoteSessionUp(final NetconfSessionPreferences remoteSessionCapabilities,
                                       final NetconfDeviceCommunicator netconfDeviceCommunicator) {
@@ -284,5 +281,4 @@ public final class StressClient {
             LOG.info("Notification received: {}", notification.toString());
         }
     }
-
 }