Fix checkstyle violations in test bundles 34/67834/6
authorTom Pantelis <tompantelis@gmail.com>
Thu, 1 Feb 2018 23:31:11 +0000 (18:31 -0500)
committerTom Pantelis <tompantelis@gmail.com>
Wed, 28 Feb 2018 16:43:40 +0000 (11:43 -0500)
Change-Id: Id8e05a621e56dadea15252498bf04505f920441d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
24 files changed:
drop-test-karaf/src/main/java/org/opendaylight/openflowplugin/droptestkaraf/DropAllPacketsCommandProvider.java
drop-test-karaf/src/main/java/org/opendaylight/openflowplugin/droptestkaraf/DropAllPacketsCompleter.java
drop-test-karaf/src/main/java/org/opendaylight/openflowplugin/droptestkaraf/DropAllPacketsRpcCommandProvider.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/AbstractDropTest.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestCommiter.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestDsProvider.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcProvider.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcSender.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestStats.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/FlowEventListenerLoggingImpl.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/NodeErrorListenerLoggingImpl.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestCommandProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestCommandProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginStatsTestCommandProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestCommandProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestCommandProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/TestProviderTransactionUtil.java

index 8dc089ab2a2174faf3f9e230ef7aef9c613889b1..16ed866ca0e0a714c79d5caa7312f9a036c9e3b4 100644 (file)
@@ -9,25 +9,21 @@
 package org.opendaylight.openflowplugin.droptestkaraf;
 
 import java.io.PrintStream;
-
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
 
-import com.google.common.base.Preconditions;
-
-@Command(scope = "drop-test", name = "dropAllPackets", description="drop packet responder involving dataStore and FRM")
+@Command(scope = "drop-test", name = "dropAllPackets",
+         description = "drop packet responder involving dataStore and FRM")
 public class DropAllPacketsCommandProvider extends OsgiCommandSupport {
 
-    @Argument(index = 0, name = "on-off", 
-            description = "target state of drop responder", 
+    @Argument(index = 0, name = "on-off",
+            description = "target state of drop responder",
             required = true, multiValued = false)
     String targetStateArg = null;
-    
-    
+
+
     @Override
     protected Object doExecute() throws Exception {
         PrintStream out = session.getConsole();
index 1a4bc47687f36c85467719d4cf7b38e0e7c2b6f3..7ccfa33b57d00ef87f80bbdd6254fca1ef831ad5 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -8,15 +8,14 @@
 package org.opendaylight.openflowplugin.droptestkaraf;
 
 import java.util.List;
-
 import org.apache.karaf.shell.console.Completer;
 import org.apache.karaf.shell.console.completer.StringsCompleter;
 
 /**
- * general dropAllPackets on/off argument completer
+ * General dropAllPackets on/off argument completer.
  */
 public class DropAllPacketsCompleter implements Completer {
-    
+
     @Override
     public int complete(String buffer, int cursor, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
index e5bce4f69aed18bdef26dae0584eb83711c0b75c..80f7ce1c428469666791f952285636d9b5e23398 100644 (file)
@@ -9,29 +9,25 @@
 package org.opendaylight.openflowplugin.droptestkaraf;
 
 import java.io.PrintStream;
-
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-
-import com.google.common.base.Preconditions;
 
-@Command(scope = "drop-test", name = "dropAllPacketsRpc", description="drop packet responder involving SalFlowService")
+@Command(scope = "drop-test", name = "dropAllPacketsRpc",
+         description = "drop packet responder involving SalFlowService")
 public class DropAllPacketsRpcCommandProvider extends OsgiCommandSupport {
 
-    @Argument(index = 0, name = "on-off", 
-            description = "target state of drop responder", 
+    @Argument(index = 0, name = "on-off",
+            description = "target state of drop responder",
             required = true, multiValued = false)
     String targetStateArg = null;
-    
+
     @Override
     protected Object doExecute() throws Exception {
         PrintStream out = session.getConsole();
         final DropTestRpcProvider provider = DropTestProviderImpl.getDropRpcProvider();
-        
+
         if ("on".equalsIgnoreCase(targetStateArg)) {
             if (! provider.isActive()) {
                 provider.start();
@@ -71,5 +67,5 @@ public class DropAllPacketsRpcCommandProvider extends OsgiCommandSupport {
 //            ci.println("Session not initiated, try again in a few seconds");
 //        }
 //    }
-   
+
 }
index 89fca3264a38bcdd1b184963abbfc5c027a08ff6..8590e6654853dcd85603ee17459b7dd528e5d7a0 100644 (file)
@@ -8,13 +8,13 @@
 package org.opendaylight.openflowplugin.testcommon;
 
 import static org.opendaylight.openflowjava.util.ByteBufUtils.macAddressToString;
+
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.RejectedExecutionHandler;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
@@ -56,49 +56,54 @@ abstract class AbstractDropTest implements PacketProcessingListener, AutoCloseab
     static final int STARTUP_LOOP_MAX_RETRIES = 8;
     private static final int PROCESSING_POOL_SIZE = 10000;
 
-    private final int POOL_THREAD_AMOUNT = 8;
+    private static final int POOL_THREAD_AMOUNT = 8;
     private final ExecutorService executorService;
 
 
-    private static final AtomicIntegerFieldUpdater<AbstractDropTest> SENT_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "sent");
+    private static final AtomicIntegerFieldUpdater<AbstractDropTest> SENT_UPDATER = AtomicIntegerFieldUpdater
+            .newUpdater(AbstractDropTest.class, "sent");
     private volatile int sent;
 
-    private static final AtomicIntegerFieldUpdater<AbstractDropTest> RCVD_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "rcvd");
+    private static final AtomicIntegerFieldUpdater<AbstractDropTest> RCVD_UPDATER = AtomicIntegerFieldUpdater
+            .newUpdater(AbstractDropTest.class, "rcvd");
     private volatile int rcvd;
 
-    private static final AtomicIntegerFieldUpdater<AbstractDropTest> EXCS_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "excs");
+    private static final AtomicIntegerFieldUpdater<AbstractDropTest> EXCS_UPDATER = AtomicIntegerFieldUpdater
+            .newUpdater(AbstractDropTest.class, "excs");
     private volatile int excs;
 
-    protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RPC_FUTURE_SUCCESS_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "ftrSuccess");
+    protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RPC_FUTURE_SUCCESS_UPDATER =
+            AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "ftrSuccess");
     protected volatile int ftrSuccess;
 
-    protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RPC_FUTURE_FAIL_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "ftrFailed");
+    protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RPC_FUTURE_FAIL_UPDATER =
+            AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "ftrFailed");
     protected volatile int ftrFailed;
 
-    protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RUNABLES_EXECUTED = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "runablesExecuted");
+    protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RUNABLES_EXECUTED = AtomicIntegerFieldUpdater
+            .newUpdater(AbstractDropTest.class, "runablesExecuted");
     protected volatile int runablesExecuted;
 
-    protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RUNABLES_REJECTED = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "runablesRejected");
+    protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RUNABLES_REJECTED = AtomicIntegerFieldUpdater
+            .newUpdater(AbstractDropTest.class, "runablesRejected");
     protected volatile int runablesRejected;
 
     public final DropTestStats getStats() {
-        return new DropTestStats(this.sent, this.rcvd, this.excs, this.ftrFailed, this.ftrSuccess, this.runablesExecuted, this.runablesRejected);
+        return new DropTestStats(this.sent, this.rcvd, this.excs, this.ftrFailed, this.ftrSuccess,
+                this.runablesExecuted, this.runablesRejected);
     }
 
-    public AbstractDropTest() {
-        final ArrayBlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<Runnable>(PROCESSING_POOL_SIZE);
+    AbstractDropTest() {
+        final ArrayBlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<>(PROCESSING_POOL_SIZE);
         final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(POOL_THREAD_AMOUNT, POOL_THREAD_AMOUNT, 0,
                 TimeUnit.MILLISECONDS,
                 workQueue);
         threadPool.setThreadFactory(new ThreadFactoryBuilder().setNameFormat("dropTest-%d").build());
-        threadPool.setRejectedExecutionHandler(new RejectedExecutionHandler() {
-            @Override
-            public void rejectedExecution(final Runnable r, final ThreadPoolExecutor executor) {
-                try {
-                    workQueue.put(r);
-                } catch (final InterruptedException e) {
-                    throw new RejectedExecutionException("Interrupted while waiting on queue", e);
-                }
+        threadPool.setRejectedExecutionHandler((rejected, executor) -> {
+            try {
+                workQueue.put(rejected);
+            } catch (final InterruptedException e) {
+                throw new RejectedExecutionException("Interrupted while waiting on queue", e);
             }
         });
 
@@ -115,11 +120,11 @@ abstract class AbstractDropTest implements PacketProcessingListener, AutoCloseab
         this.runablesRejected = 0;
     }
 
-    private final void incrementRunableExecuted() {
+    private void incrementRunableExecuted() {
         RUNABLES_EXECUTED.incrementAndGet(this);
     }
 
-    private final void incrementRunableRejected() {
+    private void incrementRunableRejected() {
         RUNABLES_REJECTED.incrementAndGet(this);
     }
 
@@ -130,14 +135,11 @@ abstract class AbstractDropTest implements PacketProcessingListener, AutoCloseab
         RCVD_UPDATER.incrementAndGet(this);
 
         try {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    incrementRunableExecuted();
-                    processPacket(notification);
-                }
+            executorService.execute(() -> {
+                incrementRunableExecuted();
+                processPacket(notification);
             });
-        } catch (final Exception e) {
+        } catch (RejectedExecutionException e) {
             incrementRunableRejected();
         }
         LOG.debug("onPacketReceived - Leaving", notification);
@@ -147,7 +149,8 @@ abstract class AbstractDropTest implements PacketProcessingListener, AutoCloseab
 
     private static Instructions makeStaticDropActionInstructions() {
         // Create an DropAction
-        final DropActionCase dropAction = new DropActionCaseBuilder().setDropAction(new DropActionBuilder().build()).build();
+        final DropActionCase dropAction = new DropActionCaseBuilder().setDropAction(
+                new DropActionBuilder().build()).build();
         // Create an Action
         final Action ab = new ActionBuilder().setOrder(0).setAction(dropAction).build();
         // Create an Apply Action
@@ -159,6 +162,7 @@ abstract class AbstractDropTest implements PacketProcessingListener, AutoCloseab
         return new InstructionsBuilder().setInstruction(Collections.singletonList(ib)).build();
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     private void processPacket(final PacketReceived notification) {
         try {
             final byte[] rawPacket = notification.getPayload();
@@ -184,7 +188,7 @@ abstract class AbstractDropTest implements PacketProcessingListener, AutoCloseab
             processPacket(ncri.firstIdentifierOf(Node.class), match.build(), DROP_INSTRUCTIONS);
 
             SENT_UPDATER.incrementAndGet(this);
-        } catch (final Exception e) {
+        } catch (RuntimeException e) {
             LOG.warn("Failed to process packet: {}", e.getMessage());
             LOG.debug("Failed to process packet.. ", e);
             EXCS_UPDATER.incrementAndGet(this);
index 3c3d521fb7438b9836d1fb1534be9ec8791c804c..a9d199590ba43feac725bab7e32847a2080dac3a 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.testcommon;
 
 import java.math.BigInteger;
-import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
@@ -33,8 +32,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * provides cbench responder behavior: upon packetIn arrival addFlow action is sent out to
- * device using dataStore strategy (FRM involved)
+ * Provides cbench responder behavior: upon packetIn arrival addFlow action is sent out to
+ * device using dataStore strategy (FRM involved).
  */
 public class DropTestCommiter extends AbstractDropTest {
     private static final Logger LOG = LoggerFactory.getLogger(DropTestCommiter.class);
@@ -67,34 +66,29 @@ public class DropTestCommiter extends AbstractDropTest {
     private ListenerRegistration<DropTestCommiter> notificationRegistration;
 
     /**
-     * start listening on packetIn
+     * start listening on packetIn.
      */
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void start() {
         final SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
                 STARTUP_LOOP_MAX_RETRIES);
         try {
-            notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<DropTestCommiter>>() {
-                @Override
-                public ListenerRegistration<DropTestCommiter> call() throws Exception {
-                    return notificationService.registerNotificationListener(DropTestCommiter.this);
-                }
-            });
-        } catch (final Exception e) {
+            notificationRegistration = looper.loopUntilNoException(() ->
+                notificationService.registerNotificationListener(DropTestCommiter.this));
+        } catch (Exception e) {
             LOG.warn("DropTest committer notification listener registration fail!");
             LOG.debug("DropTest committer notification listener registration fail! ..", e);
             throw new IllegalStateException("DropTest startup fail! Try again later.", e);
         }
     }
 
-    /**
-     * @param dataService the dataService to set
-     */
     public void setDataService(final DataBroker dataService) {
         this.dataService = dataService;
     }
 
     @Override
-    protected void processPacket(final InstanceIdentifier<Node> node, final Match match, final Instructions instructions) {
+    protected void processPacket(final InstanceIdentifier<Node> node, final Match match,
+            final Instructions instructions) {
 
         // Finally build our flow
         final FlowBuilder fb = BUILDER.get();
@@ -124,6 +118,7 @@ public class DropTestCommiter extends AbstractDropTest {
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void close() {
         super.close();
         try {
@@ -131,15 +126,12 @@ public class DropTestCommiter extends AbstractDropTest {
             if (notificationRegistration != null) {
                 notificationRegistration.close();
             }
-        } catch (final Exception e) {
+        } catch (RuntimeException e) {
             LOG.warn("unregistration of notification listener failed: {}", e.getMessage());
             LOG.debug("unregistration of notification listener failed.. ", e);
         }
     }
 
-    /**
-     * @param notificationService
-     */
     public void setNotificationService(final NotificationService notificationService) {
         this.notificationService = notificationService;
     }
index ad74e8b7944f7806b7c3d4e0bca757e9c6b2eac6..9efdf4b346072a7811419c296993a1a3c588adef 100644 (file)
@@ -13,7 +13,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * provides activation and deactivation of drop responder service - responds on packetIn
+ * Provides activation and deactivation of drop responder service - responds on packetIn.
  */
 public class DropTestDsProvider implements AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(DropTestDsProvider.class);
@@ -24,36 +24,29 @@ public class DropTestDsProvider implements AutoCloseable {
     private boolean active = false;
 
     /**
-     * @return message counts
+     * Returns the message counts.
      */
     public DropTestStats getStats() {
         return commiter.getStats();
     }
 
     /**
-     * reset message counts
+     * Reset message counts.
      */
     public void clearStats() {
         commiter.clearStats();
     }
 
-    /**
-     * @param dataService value for setter
-     */
     public void setDataService(final DataBroker dataService) {
         this.dataService = dataService;
     }
 
-
-    /**
-     * @param notificationService value for setter
-     */
     public void setNotificationService(final NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 
     /**
-     * activates the drop responder
+     * Activates the drop responder.
      */
     public void start() {
         commiter.setDataService(dataService);
@@ -73,7 +66,7 @@ public class DropTestDsProvider implements AutoCloseable {
     }
 
     /**
-     * @return the active
+     * Returns the active state.
      */
     public boolean isActive() {
         return active;
index 348d653fe4ab4085d4a51ebb57d10068bb7efb1c..0b181b7f0fc1d50d2ffed2409bd6291cd1add1cf 100644 (file)
@@ -13,32 +13,26 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * provides activation and deactivation of drop responder service - responds on packetIn
+ * Provides activation and deactivation of drop responder service - responds on packetIn.
  */
 public class DropTestRpcProvider implements AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(DropTestRpcProvider.class);
 
     private SalFlowService flowService;
     private NotificationService notificationService;
-    private DropTestRpcSender commiter = new DropTestRpcSender();
+    private final DropTestRpcSender commiter = new DropTestRpcSender();
     private boolean active = false;
 
-    /**
-     * @param flowService value for setter
-     */
     public void setFlowService(final SalFlowService flowService) {
         this.flowService = flowService;
     }
 
-    /**
-     * @param notificationService value for setter
-     */
     public void setNotificationService(final NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 
     /**
-     * activates drop responder
+     * Activates drop responder.
      */
     public void start() {
         commiter.setFlowService(flowService);
@@ -49,7 +43,7 @@ public class DropTestRpcProvider implements AutoCloseable {
     }
 
     /**
-     * @return message counts
+     * Returns the message counts.
      */
     public DropTestStats getStats() {
         if (this.commiter != null) {
@@ -60,7 +54,7 @@ public class DropTestRpcProvider implements AutoCloseable {
     }
 
     /**
-     * reset message counts
+     * Reset message counts.
      */
     public void clearStats() {
         if (commiter != null) {
@@ -78,7 +72,7 @@ public class DropTestRpcProvider implements AutoCloseable {
     }
 
     /**
-     * @return the active
+     * Returns the active state.
      */
     public boolean isActive() {
         return active;
index 3e91cd419148a104a0c7666e2c0606eb6e406a41..9e28ffad75583a57587622a12e9084598b2a3ca9 100644 (file)
@@ -13,7 +13,6 @@ import com.google.common.util.concurrent.JdkFutureAdapters;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.math.BigInteger;
-import java.util.concurrent.Callable;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.openflowplugin.common.wait.SimpleTaskRetryLooper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
@@ -33,17 +32,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * provides cbench responder behavior: upon packetIn arrival addFlow action is sent out to
- * device using {@link SalFlowService} strategy
+ * Provides cbench responder behavior: upon packetIn arrival addFlow action is sent out to
+ * device using {@link SalFlowService} strategy.
  */
 public class DropTestRpcSender extends AbstractDropTest {
     private static final Logger LOG = LoggerFactory.getLogger(DropTestRpcSender.class);
 
     private SalFlowService flowService;
 
-    /**
-     * @param flowService the flowService to set
-     */
     public void setFlowService(final SalFlowService flowService) {
         this.flowService = flowService;
     }
@@ -73,19 +69,16 @@ public class DropTestRpcSender extends AbstractDropTest {
     private ListenerRegistration<DropTestRpcSender> notificationRegistration;
 
     /**
-     * start listening on packetIn
+     * Start listening on packetIn.
      */
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void start() {
         final SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
                 STARTUP_LOOP_MAX_RETRIES);
         try {
-            notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<DropTestRpcSender>>() {
-                @Override
-                public ListenerRegistration<DropTestRpcSender> call() throws Exception {
-                    return notificationService.registerNotificationListener(DropTestRpcSender.this);
-                }
-            });
-        } catch (final Exception e) {
+            notificationRegistration = looper.loopUntilNoException(
+                () -> notificationService.registerNotificationListener(DropTestRpcSender.this));
+        } catch (Exception e) {
             LOG.warn("DropTest sender notification listener registration fail!");
             LOG.debug("DropTest sender notification listener registration fail! ..", e);
             throw new IllegalStateException("DropTest startup fail! Try again later.", e);
@@ -93,7 +86,8 @@ public class DropTestRpcSender extends AbstractDropTest {
     }
 
     @Override
-    protected void processPacket(final InstanceIdentifier<Node> node, final Match match, final Instructions instructions) {
+    protected void processPacket(final InstanceIdentifier<Node> node, final Match match,
+            final Instructions instructions) {
         final AddFlowInputBuilder fb = BUILDER.get();
 
         // Finally build our flow
@@ -109,10 +103,11 @@ public class DropTestRpcSender extends AbstractDropTest {
         if (LOG.isDebugEnabled()) {
             LOG.debug("onPacketReceived - About to write flow (via SalFlowService) {}", flow);
         }
-        ListenableFuture<RpcResult<AddFlowOutput>> result = JdkFutureAdapters.listenInPoolThread(flowService.addFlow(flow));
+        ListenableFuture<RpcResult<AddFlowOutput>> result =
+                JdkFutureAdapters.listenInPoolThread(flowService.addFlow(flow));
         Futures.addCallback(result, new FutureCallback<RpcResult<AddFlowOutput>>() {
             @Override
-            public void onSuccess(final RpcResult<AddFlowOutput> o) {
+            public void onSuccess(final RpcResult<AddFlowOutput> result) {
                 countFutureSuccess();
             }
 
@@ -123,14 +118,12 @@ public class DropTestRpcSender extends AbstractDropTest {
         }, MoreExecutors.directExecutor());
     }
 
-    /**
-     * @param notificationService
-     */
     public void setNotificationService(final NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void close() {
         super.close();
         try {
@@ -138,7 +131,7 @@ public class DropTestRpcSender extends AbstractDropTest {
             if (notificationRegistration != null) {
                 notificationRegistration.close();
             }
-        } catch (final Exception e) {
+        } catch (RuntimeException e) {
             LOG.warn("unregistration of notification listener failed: {}", e.getMessage());
             LOG.debug("unregistration of notification listener failed.. ", e);
         }
index f3e73de028463baedd91fa9624f3853feefad707..866b773fdd515627fea667405d9c09b9a8dc23d7 100644 (file)
@@ -37,7 +37,8 @@ public class DropTestStats {
         runablesRejected = 0;
     }
 
-    public DropTestStats(int sent, int rcvd, int excs, int ftrFailed, int ftrSuccess, int runablesExecuted, int runablesRejected) {
+    public DropTestStats(int sent, int rcvd, int excs, int ftrFailed, int ftrSuccess,
+            int runablesExecuted, int runablesRejected) {
         this.sent = sent;
         this.rcvd = rcvd;
         this.excs = excs;
index 7fcfab351180d723acd75119603c6d63a8c1912e..ae2f8d6b3aa1dd15b70a0543fc92cef05b437b45 100644 (file)
@@ -18,7 +18,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * dummy implementation flushing events into log
+ * Dummy implementation flushing events into log.
  */
 public class FlowEventListenerLoggingImpl implements SalFlowListener {
 
index e6e9cac7508facf8b3231dad61ed8b1aad4313c7..1a70b6abac3610c6637969c61fec80497b5d97fc 100644 (file)
@@ -30,8 +30,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * dummy implementation flushing events into log
- *  @author kramesha
+ * Dummy implementation flushing events into log.
+ *
+ * @author kramesha
  */
 public class NodeErrorListenerLoggingImpl implements NodeErrorListener {
 
@@ -39,80 +40,95 @@ public class NodeErrorListenerLoggingImpl implements NodeErrorListener {
 
     @Override
     public void onBadActionErrorNotification(BadActionErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onBadInstructionErrorNotification(BadInstructionErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onBadMatchErrorNotification(BadMatchErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onBadRequestErrorNotification(BadRequestErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onExperimenterErrorNotification(ExperimenterErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onFlowModErrorNotification(FlowModErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onGroupModErrorNotification(GroupModErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onHelloFailedErrorNotification(HelloFailedErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onMeterModErrorNotification(MeterModErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onPortModErrorNotification(PortModErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onQueueOpErrorNotification(QueueOpErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onRoleRequestErrorNotification(RoleRequestErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onSwitchConfigErrorNotification(SwitchConfigErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onTableFeaturesErrorNotification(TableFeaturesErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     @Override
     public void onTableModErrorNotification(TableModErrorNotification notification) {
-        LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+        LOG.error("Error notification ----"
+                + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
     }
 
     private String toStr(ErrorType type, int code, BigInteger xid) {
-        return "[Type="+type+", Code="+ code +", Xid ="+xid+"]";
+        return "[Type=" + type + ", Code=" + code + ", Xid =" + xid + "]";
     }
 }
index c313f52778e598ee43f9c0e42da2f5b718bb239c..1df23c3b9737539edd4e22bd35ae2667a177b220 100644 (file)
@@ -107,6 +107,7 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@SuppressWarnings("checkstyle:MethodName")
 public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvider {
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkGroupTransactionProvider.class);
     private NodeBuilder testNode;
@@ -149,6 +150,14 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         return builder;
     }
 
+    private void createTestNode() {
+        NodeRef nodeOne = createNodeRef(OpenflowpluginTestActivator.NODE_ID);
+        NodeBuilder builder = new NodeBuilder();
+        builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
+        builder.setKey(new NodeKey(builder.getId()));
+        testNode12 = builder.build();
+    }
+
     private static NodeRef createNodeRef(String string) {
         NodeKey key = new NodeKey(new NodeId(string));
         InstanceIdentifier<Node> path = InstanceIdentifier.create(Nodes.class).child(Node.class, key);
@@ -160,9 +169,6 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         return "No help";
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMatch1() {
         MatchBuilder match = new MatchBuilder();
         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
@@ -179,9 +185,6 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         return match;
     }
 
-    /**
-     * @return
-     */
     private static InstructionsBuilder createDecNwTtlInstructions() {
         DecNwTtlBuilder ta = new DecNwTtlBuilder();
         DecNwTtl decNwTtl = ta.build();
@@ -189,7 +192,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
 
         // Add our drop action to a list
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
 
         // Create an Apply Action
@@ -204,15 +207,12 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMatch2() {
         MatchBuilder match = new MatchBuilder();
         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
@@ -229,9 +229,6 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMatch3() {
         MatchBuilder match = new MatchBuilder();
         EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
@@ -250,7 +247,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
 
         // Add our drop action to a list
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
 
         // Create an Apply Action
@@ -263,18 +260,13 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
     private static MatchBuilder createEthernetMatch() {
-        MatchBuilder match = new MatchBuilder();
-
-        byte[] mask1 = new byte[]{(byte) -1, (byte) -1, 0, 0, 0, 0};
-        byte[] mask2 = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0};
-
         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder(); // ethernettype
         // match
         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
@@ -296,14 +288,12 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         // ethsrc.setMask(mask2);
 
         ethmatch.setEthernetSource(ethsrc.build());
+        MatchBuilder match = new MatchBuilder();
         match.setEthernetMatch(ethmatch.build());
         return match;
 
     }
 
-    /**
-     * @return
-     */
     private static InstructionsBuilder createMeterInstructions() {
 
         MeterBuilder aab = new MeterBuilder();
@@ -314,7 +304,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -322,7 +312,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
     private static InstructionsBuilder createAppyActionInstruction() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
         ControllerActionBuilder controller = new ControllerActionBuilder();
         controller.setMaxLength(5);
@@ -338,7 +328,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -346,12 +336,12 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
     private static InstructionsBuilder createAppyActionInstruction7() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
-        VlanId a = new VlanId(4012);
-        vl.setVlanId(a);
+        VlanId vlanId = new VlanId(4012);
+        vl.setVlanId(vlanId);
         ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
         actionList.add(ab.build());
         // Create an Apply Action
@@ -364,7 +354,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -372,7 +362,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
     private static InstructionsBuilder createAppyActionInstruction21() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
@@ -389,7 +379,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -397,7 +387,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
     private static InstructionsBuilder createAppyActionInstruction2() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         PushMplsActionBuilder push = new PushMplsActionBuilder();
@@ -414,7 +404,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -422,7 +412,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
     private static InstructionsBuilder createAppyActionInstruction3() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         PushPbbActionBuilder pbb = new PushPbbActionBuilder();
@@ -439,7 +429,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -455,7 +445,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -542,7 +532,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
                 LOG.warn("flow type not understood: {}", flowType);
         }
 
-        FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
+        final FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
         if (null == flow.isBarrier()) {
             flow.setBarrier(Boolean.FALSE);
         }
@@ -575,7 +565,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         short table = 2;
         try {
             table = Short.parseShort(tableId);
-        } catch (Exception ex) {
+        } catch (NumberFormatException ex) {
             // ignore exception and continue with default value
         }
 
@@ -616,9 +606,9 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
                 GroupBuilder group7 = createTestGroup("a3", "g1", "add", "6");
                 writeGroup(ci, group6.build(), group7.build());
                 break;
-
+            default:
+                break;
         }
-
     }
 
     private void createUserNode(String nodeRef) {
@@ -662,6 +652,8 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
                 GroupBuilder group7 = createTestGroup("a29", "g1", "modify", "6");
                 writeGroup(ci, group6.build(), group7.build());
                 break;
+            default:
+                break;
         }
     }
 
@@ -669,14 +661,6 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
     }
 
-    private void createTestNode() {
-        NodeRef nodeOne = createNodeRef(OpenflowpluginTestActivator.NODE_ID);
-        NodeBuilder builder = new NodeBuilder();
-        builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
-        builder.setKey(new NodeKey(builder.getId()));
-        testNode12 = builder.build();
-    }
-
     public void _removeGroups(CommandInterpreter ci) {
         String nref = ci.nextArgument();
 
@@ -731,9 +715,9 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
                 GroupBuilder group15 = createTestGroup("a29", "g1", "modify", "6");
                 writeGroup(ci, group14.build(), group15.build());
                 break;
-
+            default:
+                break;
         }
-
     }
 
     private void writeGroup(final CommandInterpreter ci, Group group, Group group1) {
@@ -753,7 +737,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -779,7 +763,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -790,28 +774,22 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         }, MoreExecutors.directExecutor());
     }
 
-    private GroupBuilder createTestGroup(String actiontype, String type, String mod, String iD) {
+    private GroupBuilder createTestGroup(String actionType, String groupType, String groupmod, String strId) {
         // Sample data , committing to DataStore
 
-        String GroupType = type;
-        String ActionType = actiontype;
-        String Groupmod = mod;
-
-        long id = Long.parseLong(iD);
-        GroupKey key = new GroupKey(new GroupId(id));
         GroupBuilder group = new GroupBuilder();
         BucketBuilder bucket = new BucketBuilder();
         bucket.setBucketId(new BucketId((long) 12));
         bucket.setKey(new BucketKey(new BucketId((long) 12)));
 
-        if (GroupType == null) {
-            GroupType = "g1";
+        if (groupType == null) {
+            groupType = "g1";
         }
-        if (ActionType == null) {
-            ActionType = "a1";
+        if (actionType == null) {
+            actionType = "a1";
         }
 
-        switch (GroupType) {
+        switch (groupType) {
             case "g1":
                 group.setGroupType(GroupTypes.GroupSelect);
                 break;
@@ -824,9 +802,11 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
             case "g4":
                 group.setGroupType(GroupTypes.GroupFf);
                 break;
+            default:
+                break;
         }
 
-        switch (ActionType) {
+        switch (actionType) {
             case "a1":
                 bucket.setAction(createPopVlanAction());
                 break;
@@ -863,10 +843,11 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
             case "a29":
                 bucket.setAction(createNonAppyPushVlanAction());
                 break;
-
+            default:
+                break;
         }
 
-        if (Groupmod == "add") {
+        if (groupmod == "add") {
             bucket.setWatchGroup((long) 14);
             bucket.setWatchPort((long) 1234);
             bucket.setWeight(50);
@@ -875,13 +856,16 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
             bucket.setWatchPort((long) 134);
             bucket.setWeight(30);
         }
+
+        long id = Long.parseLong(strId);
+        GroupKey key = new GroupKey(new GroupId(id));
         group.setKey(key);
         // group.setInstall(false);
         group.setGroupId(new GroupId(id));
         group.setGroupName(originalGroupName);
         group.setBarrier(false);
         BucketsBuilder value = new BucketsBuilder();
-        List<Bucket> value1 = new ArrayList<Bucket>();
+        List<Bucket> value1 = new ArrayList<>();
         value1.add(bucket.build());
         value.setBucket(value1);
         group.setBuckets(value.build());
@@ -894,7 +878,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(vlanAction.build()).build());
         action.setKey(new ActionKey(0));
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -902,11 +886,11 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
     private List<Action> createPushVlanAction() {
         PushVlanActionBuilder vlan = new PushVlanActionBuilder();
         vlan.setEthernetType(0x8100);
-        VlanId v = new VlanId(2);
-        vlan.setVlanId(v);
+        VlanId vlanId = new VlanId(2);
+        vlan.setVlanId(vlanId);
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -916,7 +900,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         push.setEthernetType(0x8847);
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -926,7 +910,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         popMplsActionBuilder.setEthernetType(0XB);
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsActionBuilder.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -935,7 +919,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PopPbbActionCaseBuilder().setPopPbbAction(popPbbActionBuilder.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -945,7 +929,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         pbb.setEthernetType(0x88E7);
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -954,7 +938,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
         ActionBuilder action = new ActionBuilder();
         action.setAction(new CopyTtlInCaseBuilder().setCopyTtlIn(ttlin.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -963,7 +947,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
         ActionBuilder action = new ActionBuilder();
         action.setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(ttlout.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -972,7 +956,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
         ActionBuilder action = new ActionBuilder();
         action.setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(mpls.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -985,23 +969,23 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         ActionBuilder action = new ActionBuilder();
         action.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
         action.setKey(new ActionKey(0));
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
 
     private static List<Action> createNonAppyPushVlanAction() {
 
-        List<Action> actionList = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
 
         GroupActionBuilder groupActionB = new GroupActionBuilder();
         groupActionB.setGroupId(1L);
         groupActionB.setGroup("0");
         ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
+
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
 
         return actionList;
     }
-
 }
index 2123b8d4556e88598673c9b0370abab9df1c5b9f..58b9cd40eaf52f7e618bd6031d859a09e10bc232 100644 (file)
@@ -112,26 +112,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener;
-import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@SuppressWarnings("checkstyle:MethodName")
 public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkTransactionProvider.class);
     private DataBroker dataBroker;
     private final BundleContext ctx;
-    private NodeBuilder testNode;
     private ProviderContext pc;
-    private FlowBuilder testFlow;
     private final String originalFlowName = "Foo";
     private final NodeErrorListener nodeErrorListener = new NodeErrorListenerLoggingImpl();
-    private Registration listener1Reg;
-    private Registration listener2Reg;
-    private Node testNode12;
-    private final String originalGroupName = "Foo";
     private static NotificationService notificationService;
 
     public OpenflowPluginBulkTransactionProvider(BundleContext ctx) {
@@ -141,7 +135,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
     public void onSessionInitiated(ProviderContext session) {
         pc = session;
         notificationService = session.getSALService(NotificationService.class);
-        listener2Reg = notificationService.registerNotificationListener(nodeErrorListener);
+        notificationService.registerNotificationListener(nodeErrorListener);
         dataBroker = session.getSALService(DataBroker.class);
         ctx.registerService(CommandProvider.class.getName(), this, null);
         createTestFlow(createTestNode(null), null, null);
@@ -155,7 +149,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         NodeBuilder builder = new NodeBuilder();
         builder.setId(new NodeId(nodeId));
         builder.setKey(new NodeKey(builder.getId()));
-        testNode = builder;
         return builder;
     }
 
@@ -412,7 +405,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
                 LOG.warn("flow type not understood: {}", flowType);
         }
 
-        FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
         if (null == flow.isBarrier()) {
             flow.setBarrier(Boolean.FALSE);
         }
@@ -434,10 +426,10 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         // flow
         flow.setOutPort(outputPort);
 
+        FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
         flow.setKey(key);
         flow.setPriority(2);
         flow.setFlowName(originalFlowName + "X" + flowType);
-        testFlow = flow;
         return flow;
     }
 
@@ -445,7 +437,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         short table = 2;
         try {
             table = Short.parseShort(tableId);
-        } catch (Exception ex) {
+        } catch (NumberFormatException ex) {
             // ignore exception and continue with default value
         }
 
@@ -453,14 +445,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     }
 
-    private void createTestNode() {
-        NodeRef nodeOne = createNodeRef(OpenflowpluginTestActivator.NODE_ID);
-        NodeBuilder builder = new NodeBuilder();
-        builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
-        builder.setKey(new NodeKey(builder.getId()));
-        testNode12 = builder.build();
-    }
-
     public void _addFlows(CommandInterpreter ci) {
         NodeBuilder tn = createTestNode(ci.nextArgument());
         String flowtype = ci.nextArgument();
@@ -647,6 +631,8 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
                 tf2 = createTestFlow(tn, "f900", "9");
                 tf3 = createTestFlow(tn, "f1000", "10");
                 break;
+            default:
+                break;
         }
 
         InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey())
@@ -677,7 +663,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -696,37 +682,45 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
                 .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey());
-        modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
+                true);
         modification.merge(LogicalDatastoreType.OPERATIONAL, path1, flow.build(), true);
-        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder),
+                nodeBuilder.build(), true);
         modification.merge(LogicalDatastoreType.CONFIGURATION, path1, flow.build(), true);
         InstanceIdentifier<Flow> path2 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
                 .child(Table.class, new TableKey(flow1.getTableId())).child(Flow.class, flow1.getKey());
-        modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
+                true);
         modification.merge(LogicalDatastoreType.OPERATIONAL, path2, flow1.build(), true);
-        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder),
+                nodeBuilder.build(), true);
         modification.merge(LogicalDatastoreType.CONFIGURATION, path2, flow1.build(), true);
 
         InstanceIdentifier<Flow> path3 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
                 .child(Table.class, new TableKey(flow2.getTableId())).child(Flow.class, flow2.getKey());
-        modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
+                true);
         modification.merge(LogicalDatastoreType.OPERATIONAL, path3, flow2.build(), true);
-        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder),
+                nodeBuilder.build(), true);
         modification.merge(LogicalDatastoreType.CONFIGURATION, path3, flow2.build(), true);
 
         InstanceIdentifier<Flow> path4 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
                 .child(Table.class, new TableKey(flow3.getTableId())).child(Flow.class, flow3.getKey());
-        modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
+                true);
         modification.merge(LogicalDatastoreType.OPERATIONAL, path4, flow3.build(), true);
-        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder),
+                nodeBuilder.build(), true);
         modification.merge(LogicalDatastoreType.CONFIGURATION, path4, flow3.build(), true);
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -738,9 +732,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         }, MoreExecutors.directExecutor());
     }
 
-    /**
-     * @return
-     */
     private static InstructionsBuilder createDecNwTtlInstructions() {
         DecNwTtlBuilder ta = new DecNwTtlBuilder();
         DecNwTtl decNwTtl = ta.build();
@@ -748,7 +739,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
 
         // Add our drop action to a list
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
 
         // Create an Apply Action
@@ -763,15 +754,12 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
-    /**
-     * @return
-     */
     private static InstructionsBuilder createMeterInstructions() {
 
         MeterBuilder aab = new MeterBuilder();
@@ -782,7 +770,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -798,7 +786,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -811,7 +799,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
 
         // Add our drop action to a list
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
 
         // Create an Apply Action
@@ -824,7 +812,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -832,7 +820,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
         ControllerActionBuilder controller = new ControllerActionBuilder();
         controller.setMaxLength(5);
@@ -848,14 +836,13 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
     private static InstructionsBuilder createSentToControllerInstructions() {
-        List<Action> actionList = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
 
         OutputActionBuilder output = new OutputActionBuilder();
@@ -865,6 +852,8 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setOrder(0);
         ab.setKey(new ActionKey(0));
+
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
         // Create an Apply Action
         ApplyActionsBuilder aab = new ApplyActionsBuilder();
@@ -878,7 +867,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -886,7 +875,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction2() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         PushMplsActionBuilder push = new PushMplsActionBuilder();
@@ -903,7 +892,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -911,7 +900,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction3() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         PushPbbActionBuilder pbb = new PushPbbActionBuilder();
@@ -928,7 +917,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -936,7 +925,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction6() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         SetDlSrcActionBuilder src = new SetDlSrcActionBuilder();
@@ -954,7 +943,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -962,12 +951,12 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction7() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
-        VlanId a = new VlanId(4012);
-        vl.setVlanId(a);
+        VlanId vlanId = new VlanId(4012);
+        vl.setVlanId(vlanId);
         ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
         actionList.add(ab.build());
         // Create an Apply Action
@@ -980,7 +969,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -988,7 +977,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction8() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
@@ -1006,7 +995,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -1014,7 +1003,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction9() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
@@ -1030,21 +1019,21 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
     private static InstructionsBuilder createAppyActionInstruction16() {
-
-        List<Action> actionList = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
 
         GroupActionBuilder groupActionB = new GroupActionBuilder();
         groupActionB.setGroupId(1L);
         groupActionB.setGroup("0");
         ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
+
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
 
         // Create an Apply Action
@@ -1057,7 +1046,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -1065,7 +1054,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction160() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         FloodAllActionBuilder fldall = new FloodAllActionBuilder();
@@ -1081,15 +1070,13 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
     private static InstructionsBuilder createAppyActionInstruction26() {
-
-        List<Action> actionList = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
 
         SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder();
@@ -1098,6 +1085,8 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         ipdst.setIpv4Address(prefixdst);
         setNwDstActionBuilder.setAddress(ipdst.build());
         ab.setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilder.build()).build());
+
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
 
         // Create an Apply Action
@@ -1110,15 +1099,13 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
     private static InstructionsBuilder createAppyActionInstruction27() {
-
-        List<Action> actionList = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
 
         SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
@@ -1127,6 +1114,8 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         ipsrc.setIpv4Address(prefixsrc);
         setNwsrcActionBuilder.setAddress(ipsrc.build());
         ab.setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwsrcActionBuilder.build()).build());
+
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
 
         // Create an Apply Action
@@ -1139,7 +1128,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -1147,7 +1136,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction28() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
@@ -1164,7 +1153,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -1172,7 +1161,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction34() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         SwPathActionBuilder swPathAction = new SwPathActionBuilder();
@@ -1189,7 +1178,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
+        List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -1205,9 +1194,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMatch1() {
         MatchBuilder match = new MatchBuilder();
         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
@@ -1240,9 +1226,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMatch2() {
         MatchBuilder match = new MatchBuilder();
         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
@@ -1259,9 +1242,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMatch3() {
         MatchBuilder match = new MatchBuilder();
         EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
@@ -1298,11 +1278,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
     }
 
     private static MatchBuilder createEthernetMatch() {
-        MatchBuilder match = new MatchBuilder();
-
-        byte[] mask1 = new byte[]{(byte) -1, (byte) -1, 0, 0, 0, 0};
-        byte[] mask2 = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0};
-
         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder(); // ethernettype
         // match
         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
@@ -1324,14 +1299,13 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         // ethsrc.setMask(mask2);
 
         ethmatch.setEthernetSource(ethsrc.build());
+
+        MatchBuilder match = new MatchBuilder();
         match.setEthernetMatch(ethmatch.build());
         return match;
 
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createL3IPv6Match() {
         MatchBuilder match = new MatchBuilder();
 
@@ -1344,8 +1318,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         Ipv6Prefix dstip6 = new Ipv6Prefix("2002::2/64");
         Ipv6Prefix srcip6 = new Ipv6Prefix("2001:0:0:0:0:0:0:1/56");
         Ipv6Address ndtarget = new Ipv6Address("2001:db8:0:1:fd97:f9f0:a810:782e");
-        MacAddress ndsll = new MacAddress("c2:00:54:f5:00:00");
-        MacAddress ndtll = new MacAddress("00:0c:29:0e:4c:67");
         Ipv6ExtHeaderBuilder nextheader = new Ipv6ExtHeaderBuilder();
         nextheader.setIpv6Exthdr(58);
         Ipv6LabelBuilder ipv6label = new Ipv6LabelBuilder();
@@ -1363,8 +1335,9 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         // ipv6match.setIpv6Source(srcip6);
         // ipv6match.setIpv6Destination(dstip6);
         // ipv6match.setIpv6ExtHeader(nextheader.build());
-        ipv6match.setIpv6NdSll(ndsll);
-        ipv6match.setIpv6NdTll(ndtll);
+
+        ipv6match.setIpv6NdSll(new MacAddress("c2:00:54:f5:00:00"));
+        ipv6match.setIpv6NdTll(new MacAddress("00:0c:29:0e:4c:67"));
         // ipv6match.setIpv6NdTarget(ndtarget);
         ipv6match.setIpv6Label(ipv6label.build());
 
@@ -1373,9 +1346,6 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createICMPv6Match() {
 
         MatchBuilder match = new MatchBuilder();
@@ -1398,12 +1368,8 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMetadataMatch() {
         MatchBuilder match = new MatchBuilder();
-        byte[] metamask = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1};
         MetadataBuilder metadata = new MetadataBuilder(); // metadata match
         metadata.setMetadata(BigInteger.valueOf(500L));
         // metadata.setMetadataMask(metamask);
@@ -1411,5 +1377,4 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
         return match;
     }
-
 }
index 868f27bd6b10dbc461c03ba426af4a97fe6b7d69..7adb3b582641eaf98b60a4ecdf7a093d8c26e09d 100644 (file)
@@ -76,16 +76,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.osgi.framework.BundleContext;
 
+@SuppressWarnings("checkstyle:MethodName")
 public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
 
     private DataBroker dataBroker;
     private ProviderContext pc;
     private final BundleContext ctx;
     private Group testGroup;
-    private Group testGroup2;
     private Node testNode;
     private final String originalGroupName = "Foo";
-    private final String updatedGroupName = "Bar";
 
     public OpenflowpluginGroupTestCommandProvider(BundleContext ctx) {
         this.ctx = ctx;
@@ -118,28 +117,22 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
     }
 
-    private GroupBuilder createTestGroup(String actiontype, String type, String mod) {
+    private GroupBuilder createTestGroup(String actionType, String groupType, String groupMod) {
         // Sample data , committing to DataStore
 
-        String GroupType = type;
-        String ActionType = actiontype;
-        String Groupmod = mod;
-
-        long id = 1;
-        GroupKey key = new GroupKey(new GroupId(id));
         GroupBuilder group = new GroupBuilder();
         BucketBuilder bucket = new BucketBuilder();
         bucket.setBucketId(new BucketId((long) 12));
         bucket.setKey(new BucketKey(new BucketId((long) 12)));
 
-        if (GroupType == null) {
-            GroupType = "g1";
+        if (groupType == null) {
+            groupType = "g1";
         }
-        if (ActionType == null) {
-            ActionType = "a1";
+        if (actionType == null) {
+            actionType = "a1";
         }
 
-        switch (GroupType) {
+        switch (groupType) {
             case "g1":
                 group.setGroupType(GroupTypes.GroupSelect);
                 break;
@@ -152,9 +145,11 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
             case "g4":
                 group.setGroupType(GroupTypes.GroupFf);
                 break;
+            default:
+                break;
         }
 
-        switch (ActionType) {
+        switch (actionType) {
             case "a1":
                 bucket.setAction(createPopVlanAction());
                 break;
@@ -239,10 +234,11 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
             case "a28":
                 bucket.setAction(createNonAppyPushVlanAction());
                 break;
-
+            default:
+                break;
         }
 
-        if (Groupmod == "add") {
+        if (groupMod == "add") {
             bucket.setWatchGroup((long) 14);
             bucket.setWatchPort((long) 1234);
             bucket.setWeight(50);
@@ -251,13 +247,16 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
             bucket.setWatchPort((long) 134);
             bucket.setWeight(30);
         }
+
+        long id = 1;
+        GroupKey key = new GroupKey(new GroupId(id));
         group.setKey(key);
         // group.setInstall(false);
         group.setGroupId(new GroupId(id));
         group.setGroupName(originalGroupName);
         group.setBarrier(false);
         BucketsBuilder value = new BucketsBuilder();
-        List<Bucket> value1 = new ArrayList<Bucket>();
+        List<Bucket> value1 = new ArrayList<>();
         value1.add(bucket.build());
         value.setBucket(value1);
         group.setBuckets(value.build());
@@ -271,7 +270,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(vlanAction.build()).build());
         action.setKey(new ActionKey(0));
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -281,7 +280,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         vlan.setEthernetType(0x8100);
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -291,7 +290,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         push.setEthernetType(0x8847);
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -301,7 +300,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         popMplsActionBuilder.setEthernetType(0XB);
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsActionBuilder.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -310,7 +309,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PopPbbActionCaseBuilder().setPopPbbAction(popPbbActionBuilder.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -320,7 +319,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         pbb.setEthernetType(0x88E7);
         ActionBuilder action = new ActionBuilder();
         action.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -329,8 +328,9 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
         setMplsTtlActionBuilder.setMplsTtl((short) 0X1);
         ActionBuilder action = new ActionBuilder();
-        action.setAction(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(setMplsTtlActionBuilder.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        action.setAction(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(
+                setMplsTtlActionBuilder.build()).build());
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -340,7 +340,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         setNwTtlActionBuilder.setNwTtl((short) 1);
         ActionBuilder action = new ActionBuilder();
         action.setAction(new SetNwTtlActionCaseBuilder().setSetNwTtlAction(setNwTtlActionBuilder.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -351,7 +351,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         ActionBuilder action = new ActionBuilder();
         action.setAction(new SetQueueActionCaseBuilder().setSetQueueAction(setQueueActionBuilder.build()).build());
         action.setKey(new ActionKey(0));
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -361,7 +361,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
         ActionBuilder action = new ActionBuilder();
         action.setAction(new CopyTtlInCaseBuilder().setCopyTtlIn(ttlin.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -370,7 +370,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
         ActionBuilder action = new ActionBuilder();
         action.setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(ttlout.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -379,7 +379,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
         ActionBuilder action = new ActionBuilder();
         action.setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(mpls.build()).build());
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
@@ -388,7 +388,6 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         DecNwTtlBuilder nwttl = new DecNwTtlBuilder();
         ActionBuilder action = new ActionBuilder();
         action.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(nwttl.build()).build());
-        List<Action> actions = new ArrayList<Action>();
 
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
@@ -398,14 +397,14 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setKey(new ActionKey(0));
         ab.setOrder(0);
+
+        List<Action> actions = new ArrayList<>();
         actions.add(ab.build());
         actions.add(action.build());
         return actions;
     }
 
     private List<Action> createFloodOutputAction() {
-
-        List<Action> actions = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
         output.setMaxLength(30);
@@ -413,13 +412,13 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setKey(new ActionKey(0));
+
+        List<Action> actions = new ArrayList<>();
         actions.add(ab.build());
         return actions;
     }
 
     private List<Action> createAllOutputAction() {
-
-        List<Action> actions = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
         output.setMaxLength(30);
@@ -427,13 +426,13 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setKey(new ActionKey(0));
+
+        List<Action> actions = new ArrayList<>();
         actions.add(ab.build());
         return actions;
     }
 
     private List<Action> createAnyOutputAction() {
-
-        List<Action> actions = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
         output.setMaxLength(30);
@@ -441,13 +440,13 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setKey(new ActionKey(0));
+
+        List<Action> actions = new ArrayList<>();
         actions.add(ab.build());
         return actions;
     }
 
     private List<Action> createNormalOutputAction() {
-
-        List<Action> actions = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
         output.setMaxLength(30);
@@ -455,13 +454,13 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setKey(new ActionKey(0));
+
+        List<Action> actions = new ArrayList<>();
         actions.add(ab.build());
         return actions;
     }
 
     private List<Action> createInportOutputAction() {
-
-        List<Action> actions = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
         output.setMaxLength(30);
@@ -469,13 +468,13 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setKey(new ActionKey(0));
+
+        List<Action> actions = new ArrayList<>();
         actions.add(ab.build());
         return actions;
     }
 
     private List<Action> creatTableOutputAction() {
-
-        List<Action> actions = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
         output.setMaxLength(30);
@@ -483,13 +482,13 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setKey(new ActionKey(0));
+
+        List<Action> actions = new ArrayList<>();
         actions.add(ab.build());
         return actions;
     }
 
     private List<Action> createControllerAction() {
-
-        List<Action> actions = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
         output.setMaxLength(30);
@@ -497,13 +496,13 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setKey(new ActionKey(0));
+
+        List<Action> actions = new ArrayList<>();
         actions.add(ab.build());
         return actions;
     }
 
     private List<Action> createLocalOutputAction() {
-
-        List<Action> actions = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
         output.setMaxLength(30);
@@ -511,26 +510,25 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setKey(new ActionKey(0));
+
+        List<Action> actions = new ArrayList<>();
         actions.add(ab.build());
         return actions;
     }
 
     private List<Action> createGroupAction() {
-
         GroupActionBuilder groupActionB = new GroupActionBuilder();
         groupActionB.setGroupId(1L);
         groupActionB.setGroup("0");
         ActionBuilder action = new ActionBuilder();
         action.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
         action.setKey(new ActionKey(0));
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         actions.add(action.build());
         return actions;
     }
 
     private static List<Action> createNonAppyOutputAction() {
-
-        List<Action> actionList = new ArrayList<Action>();
         ActionBuilder ab = new ActionBuilder();
         OutputActionBuilder output = new OutputActionBuilder();
         Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
@@ -538,25 +536,26 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         //output.setMaxLength(null);
         output.setMaxLength(66000);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
+
+        List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
         return actionList;
     }
 
     private static List<Action> createNonAppyPushMplsAction() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
         PushMplsActionBuilder push = new PushMplsActionBuilder();
         push.setEthernetType(0x8849);
         ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
         actionList.add(ab.build());
         return actionList;
-
     }
 
     private static List<Action> createNonAppyPushPbbAction() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
         PushPbbActionBuilder pbb = new PushPbbActionBuilder();
         pbb.setEthernetType(0x88E8);
@@ -569,17 +568,15 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
 
     private static List<Action> createNonAppyPushVlanAction() {
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
         PushVlanActionBuilder vlan = new PushVlanActionBuilder();
         vlan.setEthernetType(0x8101);
         ab.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
         actionList.add(ab.build());
         return actionList;
-
     }
 
-
     private GroupBuilder createTestRemoveGroup() {
         long id = 123;
         GroupKey key = new GroupKey(new GroupId(id));
@@ -608,11 +605,9 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         //    value1.add(bucket.build());
         //   value.setBucket(value1);
         //  group.setBuckets(value.build());
-        testGroup2 = group.build();
         return group;
     }
 
-
     public void _removeGroup(final CommandInterpreter ci) {
         String nref = ci.nextArgument();
 
@@ -631,7 +626,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -666,7 +661,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
index fb75736a36a0a4ac67ac9005dc97dd05f8771dc8..1f0e647442d54dbb5a4b277079d2c6ff7431a836 100644 (file)
@@ -41,7 +41,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
     private NotificationProviderService notificationService;
 
     /**
-     * get group registration
+     * Get group registration.
      *
      * @return {@link #groupRegistration}
      */
@@ -50,9 +50,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #groupRegistration}
-     *
-     * @param groupRegistration
+     * Set {@link #groupRegistration}.
      */
     public void setGroupRegistration(
             final RoutedRpcRegistration<SalGroupService> groupRegistration) {
@@ -60,7 +58,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * get notification service
+     * Get notification service.
      *
      * @return {@link #notificationService}
      */
@@ -69,9 +67,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #notificationService}
-     *
-     * @param notificationService
+     * Set {@link #notificationService}.
      */
     public void setNotificationService(
             final NotificationProviderService notificationService) {
@@ -106,7 +102,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
      */
     @Override
     public Future<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
-        String plus = ("addGroup - " + input);
+        String plus = "addGroup - " + input;
         OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
         return null;
     }
@@ -123,7 +119,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
     @Override
     public Future<RpcResult<RemoveGroupOutput>> removeGroup(
             RemoveGroupInput input) {
-        String plus = ("removeGroup - " + input);
+        String plus = "removeGroup - " + input;
         OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
         return null;
     }
@@ -140,30 +136,26 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
     @Override
     public Future<RpcResult<UpdateGroupOutput>> updateGroup(
             UpdateGroupInput input) {
-        String plus = ("updateGroup - " + input);
+        String plus = "updateGroup - " + input;
         OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
         return null;
     }
 
-    /**
-     * @param ctx
-     * @return {@link ObjectRegistration}
-     */
     public ObjectRegistration<OpenflowpluginGroupTestServiceProvider> register(
             final ProviderContext ctx) {
         RoutedRpcRegistration<SalGroupService> addRoutedRpcImplementation = ctx
-                .<SalGroupService> addRoutedRpcImplementation(
+                .<SalGroupService>addRoutedRpcImplementation(
                         SalGroupService.class, this);
         setGroupRegistration(addRoutedRpcImplementation);
 
         InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
-                .<Nodes> builder(Nodes.class);
+                .<Nodes>builder(Nodes.class);
 
         NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
         NodeKey nodeKey = new NodeKey(nodeId);
 
         InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
-                .<Node, NodeKey> child(Node.class, nodeKey);
+                .<Node, NodeKey>child(Node.class, nodeKey);
         InstanceIdentifier<Node> instance = nodeIndentifier.build();
         groupRegistration.registerPath(NodeContext.class, instance);
         RoutedRpcRegistration<SalGroupService> groupRegistration1 = this
@@ -175,5 +167,4 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
             }
         };
     }
-
 }
index 35a34a6ba7b27b6c2dd06a65064a51bba1883ffa..9617cda37066e03565dd2e84fd1c7f88c86b25df 100644 (file)
@@ -50,6 +50,7 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@SuppressWarnings("checkstyle:MethodName")
 public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestCommandProvider.class);
@@ -136,8 +137,6 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
         meter.setMeterId(new MeterId(9L));
         meter.setMeterName(originalMeterName);
         meter.setFlags(new MeterFlags(true, false, false, false));
-        MeterBandHeadersBuilder bandHeaders = new MeterBandHeadersBuilder();
-        List<MeterBandHeader> bandHdr = new ArrayList<MeterBandHeader>();
         MeterBandHeaderBuilder bandHeader = new MeterBandHeaderBuilder();
         bandHeader.setBandRate((long) 234);
         bandHeader.setBandBurstSize((long) 444);
@@ -151,7 +150,11 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
         bandTypes.setFlags(bandType);
         bandHeader.setMeterBandTypes(bandTypes.build());
         bandHeader.setBandId(new BandId(0L));
+
+        List<MeterBandHeader> bandHdr = new ArrayList<>();
         bandHdr.add(bandHeader.build());
+
+        MeterBandHeadersBuilder bandHeaders = new MeterBandHeadersBuilder();
         bandHeaders.setMeterBandHeader(bandHdr);
         meter.setMeterBandHeaders(bandHeaders.build());
 
@@ -176,8 +179,6 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
             bandHeader.setBandRate((long) 123);
         }
         meter.setFlags(new MeterFlags(true, false, false, false));
-        MeterBandHeadersBuilder bandHeaders = new MeterBandHeadersBuilder();
-        List<MeterBandHeader> bandHdr = new ArrayList<MeterBandHeader>();
 
         bandHeader.setBandBurstSize((long) 444);
         DscpRemarkBuilder dscpRemark = new DscpRemarkBuilder();
@@ -190,7 +191,11 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
         bandTypes.setFlags(bandType);
         bandHeader.setMeterBandTypes(bandTypes.build());
         bandHeader.setBandId(new BandId(0L));
+
+        List<MeterBandHeader> bandHdr = new ArrayList<>();
         bandHdr.add(bandHeader.build());
+
+        MeterBandHeadersBuilder bandHeaders = new MeterBandHeadersBuilder();
         bandHeaders.setMeterBandHeader(bandHdr);
         meter.setMeterBandHeaders(bandHeaders.build());
 
@@ -225,7 +230,7 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
             ci.println("User node added" + nref);
             createUserNode(nref);
         }
-        MeterBuilder mBuilder = createTestMeter();
+        createTestMeter();
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
         InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.getKey())
                 .augmentation(FlowCapableNode.class).child(Meter.class, new MeterKey(testMeter.getMeterId()));
@@ -233,7 +238,7 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -260,12 +265,12 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
         switch (count) {
             case 1:
-                MeterBuilder mBuilder = createTestMeters("1", "remove");
+                createTestMeters("1", "remove");
                 InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class)
                         .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
                         .child(Meter.class, new MeterKey(testMeter1.getMeterId()));
                 modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
-                MeterBuilder mBuilder1 = createTestMeters("2", "remove");
+                createTestMeters("2", "remove");
                 InstanceIdentifier<Meter> path2 = InstanceIdentifier.create(Nodes.class)
                         .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
                         .child(Meter.class, new MeterKey(testMeter2.getMeterId()));
@@ -273,48 +278,49 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
 
                 break;
             case 2:
-                MeterBuilder mBuilder2 = createTestMeters("3", "remove");
+                createTestMeters("3", "remove");
                 InstanceIdentifier<Meter> path3 = InstanceIdentifier.create(Nodes.class)
                         .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
                         .child(Meter.class, new MeterKey(testMeter1.getMeterId()));
                 modification.delete(LogicalDatastoreType.CONFIGURATION, path3);
-                MeterBuilder mBuilder22 = createTestMeters("4", "remove");
+                createTestMeters("4", "remove");
                 InstanceIdentifier<Meter> path4 = InstanceIdentifier.create(Nodes.class)
                         .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
                         .child(Meter.class, new MeterKey(testMeter2.getMeterId()));
                 modification.delete(LogicalDatastoreType.CONFIGURATION, path4);
                 break;
             case 3:
-                MeterBuilder mBuilder3 = createTestMeters("5", "remove");
+                createTestMeters("5", "remove");
                 InstanceIdentifier<Meter> path5 = InstanceIdentifier.create(Nodes.class)
                         .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
                         .child(Meter.class, new MeterKey(testMeter1.getMeterId()));
                 modification.delete(LogicalDatastoreType.CONFIGURATION, path5);
-                MeterBuilder mBuilder4 = createTestMeters("6", "remove");
+                createTestMeters("6", "remove");
                 InstanceIdentifier<Meter> path6 = InstanceIdentifier.create(Nodes.class)
                         .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
                         .child(Meter.class, new MeterKey(testMeter2.getMeterId()));
                 modification.delete(LogicalDatastoreType.CONFIGURATION, path6);
                 break;
             case 4:
-                MeterBuilder mBuilder5 = createTestMeters("7", "remove");
+                createTestMeters("7", "remove");
                 InstanceIdentifier<Meter> path7 = InstanceIdentifier.create(Nodes.class)
                         .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
                         .child(Meter.class, new MeterKey(testMeter1.getMeterId()));
                 modification.delete(LogicalDatastoreType.CONFIGURATION, path7);
-                MeterBuilder mBuilder6 = createTestMeters("8", "remove");
+                createTestMeters("8", "remove");
                 InstanceIdentifier<Meter> path8 = InstanceIdentifier.create(Nodes.class)
                         .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
                         .child(Meter.class, new MeterKey(testMeter2.getMeterId()));
                 modification.delete(LogicalDatastoreType.CONFIGURATION, path8);
                 break;
-
+            default:
+                break;
         }
 
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -371,7 +377,8 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
                 createTestMeters("8", "add");
                 writeMeter(ci, testMeter1, testMeter2);
                 break;
-
+            default:
+                break;
         }
         // createTestMeters();
         // writeMeter(ci, testMeter);
@@ -386,7 +393,7 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -411,7 +418,7 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -462,6 +469,8 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
                 createTestMeters("4", "modify");
                 writeMeter(ci, testMeter1, testMeter2);
                 break;
+            default:
+                break;
         }
     }
 
index b4b5438efaf206b7916c92120961529c66557597..053cae7447831dc97e5f7d9288a3247b71e6d1d8 100644 (file)
@@ -42,7 +42,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     private NotificationProviderService notificationService;
 
     /**
-     * get data service
+     * Gets the data service.
      *
      * @return {@link #dataService}
      */
@@ -51,16 +51,14 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #dataService}
-     *
-     * @param dataService
+     * Sets the {@link #dataService}.
      */
     public void setDataService(final DataBroker dataService) {
         this.dataService = dataService;
     }
 
     /**
-     * get meter registration
+     * Gets the meter registration.
      *
      * @return {@link #meterRegistration}
      */
@@ -69,9 +67,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #meterRegistration}
-     *
-     * @param meterRegistration
+     * Sets the {@link #meterRegistration}.
      */
     public void setMeterRegistration(
             final RoutedRpcRegistration<SalMeterService> meterRegistration) {
@@ -79,7 +75,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * get notification service
+     * Gets the notification service.
      *
      * @return {@link #notificationService}
      */
@@ -88,9 +84,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #notificationService}
-     *
-     * @param notificationService
+     * Sets the {@link #notificationService}.
      */
     public void setNotificationService(
             final NotificationProviderService notificationService) {
@@ -107,6 +101,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      *
      * @see java.lang.AutoCloseable#close()
      */
+    @Override
     public void close() {
         OpenflowpluginMeterTestServiceProvider.LOG
                 .info("SalMeterServiceProvide stopped.");
@@ -122,8 +117,9 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      * #addMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.meter
      * .service.rev130918.AddMeterInput)
      */
+    @Override
     public Future<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
-        String plus = ("addMeter - " + input);
+        String plus = "addMeter - " + input;
         OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
         return null;
     }
@@ -137,9 +133,10 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      * #removeMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
      * .meter.service.rev130918.RemoveMeterInput)
      */
+    @Override
     public Future<RpcResult<RemoveMeterOutput>> removeMeter(
             final RemoveMeterInput input) {
-        String plus = ("removeMeter - " + input);
+        String plus = "removeMeter - " + input;
         OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
         return null;
     }
@@ -153,34 +150,31 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      * #updateMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
      * .meter.service.rev130918.UpdateMeterInput)
      */
+    @Override
     public Future<RpcResult<UpdateMeterOutput>> updateMeter(
             final UpdateMeterInput input) {
-        String plus = ("updateMeter - " + input);
+        String plus = "updateMeter - " + input;
         OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
         return null;
     }
 
-    /**
-     * @param ctx
-     * @return {@link ObjectRegistration}
-     */
     public ObjectRegistration<OpenflowpluginMeterTestServiceProvider> register(
             final ProviderContext ctx) {
 
         RoutedRpcRegistration<SalMeterService> addRoutedRpcImplementation = ctx
-                .<SalMeterService> addRoutedRpcImplementation(
+                .<SalMeterService>addRoutedRpcImplementation(
                         SalMeterService.class, this);
 
         setMeterRegistration(addRoutedRpcImplementation);
 
         InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
-                .<Nodes> builder(Nodes.class);
+                .<Nodes>builder(Nodes.class);
 
         NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
         NodeKey nodeKey = new NodeKey(nodeId);
 
         InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
-                .<Node, NodeKey> child(Node.class, nodeKey);
+                .<Node, NodeKey>child(Node.class, nodeKey);
 
         InstanceIdentifier<Node> instance = nodeIndentifier.build();
 
@@ -197,5 +191,4 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
             }
         };
     }
-
 }
index f88053808dd32dc4ad769cd28da9a910e7f0e328..dd6eb4bc64e69791b2846fe1542c75697db19c40 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.openflowplugin.test;
 
-import java.util.Iterator;
 import java.util.List;
 import org.eclipse.osgi.framework.console.CommandInterpreter;
 import org.eclipse.osgi.framework.console.CommandProvider;
@@ -43,516 +42,448 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@SuppressWarnings("checkstyle:MethodName")
 public class OpenflowpluginStatsTestCommandProvider implements CommandProvider {
 
- private static final Logger LOG = LoggerFactory
-   .getLogger(OpenflowpluginStatsTestCommandProvider.class);
- private DataBroker dataProviderService;
- private final BundleContext ctx;
-
- public OpenflowpluginStatsTestCommandProvider(BundleContext ctx) {
-  this.ctx = ctx;
- }
-
- public void onSessionInitiated(ProviderContext session) {
-  dataProviderService = session.getSALService(DataBroker.class);
-  ctx.registerService(CommandProvider.class.getName(), this, null);
-
- }
-
- public void _portStats(CommandInterpreter ci) {
-  int nodeConnectorCount = 0;
-  int nodeConnectorStatsCount = 0;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class)
-     .child(Node.class, nodeKey);
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
-     nodeRef);
-   if (node != null) {
-    if (node.getNodeConnector() != null) {
-     List<NodeConnector> ports = node.getNodeConnector();
-
-     for (Iterator<NodeConnector> iterator2 = ports.iterator(); iterator2
-       .hasNext();) {
-      nodeConnectorCount++;
-      NodeConnectorKey nodeConnectorKey = iterator2.next().getKey();
-      InstanceIdentifier<NodeConnector> connectorRef = InstanceIdentifier
-        .create(Nodes.class).child(Node.class, nodeKey)
-        .child(NodeConnector.class, nodeConnectorKey);
-      NodeConnector nodeConnector = TestProviderTransactionUtil.getDataObject(
-        readOnlyTransaction, connectorRef);
-      if (nodeConnector != null) {
-       FlowCapableNodeConnectorStatisticsData data = nodeConnector
-         .getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
-       if (null != data) {
-        nodeConnectorStatsCount++;
-       }
-      }
-     }
+    private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginStatsTestCommandProvider.class);
+    private DataBroker dataProviderService;
+    private final BundleContext ctx;
+
+    public OpenflowpluginStatsTestCommandProvider(BundleContext ctx) {
+        this.ctx = ctx;
+    }
+
+    public void onSessionInitiated(ProviderContext session) {
+        dataProviderService = session.getSALService(DataBroker.class);
+        ctx.registerService(CommandProvider.class.getName(), this, null);
+
+    }
+
+    public void _portStats(CommandInterpreter ci) {
+        int nodeConnectorCount = 0;
+        int nodeConnectorStatsCount = 0;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey);
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+            if (node != null) {
+                if (node.getNodeConnector() != null) {
+                    List<NodeConnector> ports = node.getNodeConnector();
+
+                    for (NodeConnector nodeConnector2 : ports) {
+                        nodeConnectorCount++;
+                        NodeConnectorKey nodeConnectorKey = nodeConnector2.getKey();
+                        InstanceIdentifier<NodeConnector> connectorRef = InstanceIdentifier.create(Nodes.class)
+                                .child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey);
+                        NodeConnector nodeConnector = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
+                                connectorRef);
+                        if (nodeConnector != null) {
+                            FlowCapableNodeConnectorStatisticsData data = nodeConnector
+                                    .getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
+                            if (null != data) {
+                                nodeConnectorStatsCount++;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        if (nodeConnectorCount == nodeConnectorStatsCount) {
+            LOG.debug("portStats - Success");
+        } else {
+            LOG.debug("portStats - Failed");
+            LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+        }
+
+    }
+
+    public void _portDescStats(CommandInterpreter ci) {
+        int nodeConnectorCount = 0;
+        int nodeConnectorDescStatsCount = 0;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey);
+
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+            if (node != null) {
+                if (node.getNodeConnector() != null) {
+                    List<NodeConnector> ports = node.getNodeConnector();
+                    for (NodeConnector nodeConnector2 : ports) {
+                        nodeConnectorCount++;
+                        NodeConnectorKey nodeConnectorKey = nodeConnector2.getKey();
+                        InstanceIdentifier<FlowCapableNodeConnector> connectorRef = InstanceIdentifier
+                                .create(Nodes.class).child(Node.class, nodeKey)
+                                .child(NodeConnector.class, nodeConnectorKey)
+                                .augmentation(FlowCapableNodeConnector.class);
+                        FlowCapableNodeConnector nodeConnector = TestProviderTransactionUtil
+                                .getDataObject(readOnlyTransaction, connectorRef);
+                        if (nodeConnector != null) {
+                            if (null != nodeConnector.getName() && null != nodeConnector.getCurrentFeature()
+                                    && null != nodeConnector.getState() && null != nodeConnector.getHardwareAddress()
+                                    && null != nodeConnector.getPortNumber()) {
+                                nodeConnectorDescStatsCount++;
+                            }
+                        }
+                    }
+                }
+
+            }
+        }
+
+        if (nodeConnectorCount == nodeConnectorDescStatsCount) {
+            LOG.debug("portDescStats - Success");
+        } else {
+            LOG.debug("portDescStats - Failed");
+            LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+        }
+
+    }
+
+    public void _flowStats(CommandInterpreter ci) {
+        int flowCount = 0;
+        int flowStatsCount = 0;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+                    .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+
+            if (node != null) {
+                List<Table> tables = node.getTable();
+                for (Table table2 : tables) {
+                    TableKey tableKey = table2.getKey();
+                    InstanceIdentifier<Table> tableRef = InstanceIdentifier.create(Nodes.class)
+                            .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+                            .child(Table.class, tableKey);
+                    Table table = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, tableRef);
+                    if (table != null) {
+                        if (table.getFlow() != null) {
+                            List<Flow> flows = table.getFlow();
+                            for (Flow flow2 : flows) {
+                                flowCount++;
+                                FlowKey flowKey = flow2.getKey();
+                                InstanceIdentifier<Flow> flowRef = InstanceIdentifier.create(Nodes.class)
+                                        .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+                                        .child(Table.class, tableKey).child(Flow.class, flowKey);
+                                Flow flow = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, flowRef);
+                                if (flow != null) {
+                                    FlowStatisticsData data = flow.getAugmentation(FlowStatisticsData.class);
+                                    if (null != data) {
+                                        flowStatsCount++;
+                                        LOG.debug("--------------------------------------------");
+                                        ci.print(data);
+                                    }
+                                }
+
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        if (flowCount == flowStatsCount) {
+            LOG.debug("flowStats - Success");
+        } else {
+            LOG.debug("flowStats - Failed");
+            LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+        }
+
     }
-   }
-  }
-
-  if (nodeConnectorCount == nodeConnectorStatsCount) {
-   LOG.debug("portStats - Success");
-  } else {
-   LOG.debug("portStats - Failed");
-   LOG
-     .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
-  }
-
- }
-
- public void _portDescStats(CommandInterpreter ci) {
-  int nodeConnectorCount = 0;
-  int nodeConnectorDescStatsCount = 0;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class)
-     .child(Node.class, nodeKey);
-
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
-     nodeRef);
-   if (node != null) {
-    if (node.getNodeConnector() != null) {
-     List<NodeConnector> ports = node.getNodeConnector();
-     for (Iterator<NodeConnector> iterator2 = ports.iterator(); iterator2
-       .hasNext();) {
-      nodeConnectorCount++;
-      NodeConnectorKey nodeConnectorKey = iterator2.next().getKey();
-      InstanceIdentifier<FlowCapableNodeConnector> connectorRef = InstanceIdentifier
-        .create(Nodes.class).child(Node.class, nodeKey)
-        .child(NodeConnector.class, nodeConnectorKey)
-        .augmentation(FlowCapableNodeConnector.class);
-      FlowCapableNodeConnector nodeConnector = TestProviderTransactionUtil
-        .getDataObject(readOnlyTransaction, connectorRef);
-      if (nodeConnector != null) {
-       if (null != nodeConnector.getName()
-         && null != nodeConnector.getCurrentFeature()
-         && null != nodeConnector.getState()
-         && null != nodeConnector.getHardwareAddress()
-         && null != nodeConnector.getPortNumber()) {
-        nodeConnectorDescStatsCount++;
-       }
-      }
-     }
+
+    public void _tableStats(CommandInterpreter ci) {
+        int tableCount = 0;
+        int tableStatsCount = 0;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+                    .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+            if (node != null) {
+                List<Table> tables = node.getTable();
+                for (Table table2 : tables) {
+                    tableCount++;
+                    TableKey tableKey = table2.getKey();
+                    InstanceIdentifier<Table> tableRef = InstanceIdentifier.create(Nodes.class)
+                            .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+                            .child(Table.class, tableKey);
+                    Table table = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, tableRef);
+                    if (table != null) {
+                        FlowTableStatisticsData data = table.getAugmentation(FlowTableStatisticsData.class);
+                        if (null != data) {
+                            tableStatsCount++;
+                        }
+                    }
+                }
+            }
+        }
+
+        if (tableCount == tableStatsCount) {
+            LOG.debug("tableStats - Success");
+        } else {
+            LOG.debug("tableStats - Failed");
+            LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+        }
+
     }
 
-   }
-  }
-
-  if (nodeConnectorCount == nodeConnectorDescStatsCount) {
-   LOG.debug("portDescStats - Success");
-  } else {
-   LOG.debug("portDescStats - Failed");
-   LOG
-     .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
-  }
-
- }
-
- public void _flowStats(CommandInterpreter ci) {
-  int flowCount = 0;
-  int flowStatsCount = 0;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
-     .create(Nodes.class).child(Node.class, nodeKey)
-     .augmentation(FlowCapableNode.class);
-
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
-     readOnlyTransaction, nodeRef);
-
-   if (node != null) {
-    List<Table> tables = node.getTable();
-    for (Iterator<Table> iterator2 = tables.iterator(); iterator2.hasNext();) {
-     TableKey tableKey = iterator2.next().getKey();
-     InstanceIdentifier<Table> tableRef = InstanceIdentifier
-       .create(Nodes.class).child(Node.class, nodeKey)
-       .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
-     Table table = TestProviderTransactionUtil.getDataObject(
-       readOnlyTransaction, tableRef);
-     if (table != null) {
-      if (table.getFlow() != null) {
-       List<Flow> flows = table.getFlow();
-       for (Iterator<Flow> iterator3 = flows.iterator(); iterator3.hasNext();) {
-        flowCount++;
-        FlowKey flowKey = iterator3.next().getKey();
-        InstanceIdentifier<Flow> flowRef = InstanceIdentifier
-          .create(Nodes.class).child(Node.class, nodeKey)
-          .augmentation(FlowCapableNode.class).child(Table.class, tableKey)
-          .child(Flow.class, flowKey);
-        Flow flow = TestProviderTransactionUtil.getDataObject(
-          readOnlyTransaction, flowRef);
-        if (flow != null) {
-         FlowStatisticsData data = flow
-           .getAugmentation(FlowStatisticsData.class);
-         if (null != data) {
-          flowStatsCount++;
-          LOG.debug("--------------------------------------------");
-          ci.print(data);
-         }
+    public void _groupStats(CommandInterpreter ci) {
+        int groupCount = 0;
+        int groupStatsCount = 0;
+        NodeGroupStatistics data = null;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+                    .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+            if (node != null) {
+                if (node.getGroup() != null) {
+                    List<Group> groups = node.getGroup();
+                    for (Group group2 : groups) {
+                        groupCount++;
+                        GroupKey groupKey = group2.getKey();
+                        InstanceIdentifier<Group> groupRef = InstanceIdentifier.create(Nodes.class)
+                                .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+                                .child(Group.class, groupKey);
+                        Group group = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, groupRef);
+                        if (group != null) {
+                            data = group.getAugmentation(NodeGroupStatistics.class);
+                            if (null != data) {
+                                groupStatsCount++;
+                            }
+                        }
+                    }
+                }
+
+            }
         }
 
-       }
-      }
-     }
+        if (groupCount == groupStatsCount) {
+            LOG.debug("---------------------groupStats - Success-------------------------------");
+        } else {
+            LOG.debug("------------------------------groupStats - Failed--------------------------");
+            LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+        }
     }
-   }
-  }
-
-  if (flowCount == flowStatsCount) {
-   LOG.debug("flowStats - Success");
-  } else {
-   LOG.debug("flowStats - Failed");
-   LOG
-     .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
-  }
-
- }
-
- public void _tableStats(CommandInterpreter ci) {
-  int tableCount = 0;
-  int tableStatsCount = 0;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
-     .create(Nodes.class).child(Node.class, nodeKey)
-     .augmentation(FlowCapableNode.class);
-
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
-     readOnlyTransaction, nodeRef);
-   if (node != null) {
-    List<Table> tables = node.getTable();
-    for (Iterator<Table> iterator2 = tables.iterator(); iterator2.hasNext();) {
-     tableCount++;
-     TableKey tableKey = iterator2.next().getKey();
-     InstanceIdentifier<Table> tableRef = InstanceIdentifier
-       .create(Nodes.class).child(Node.class, nodeKey)
-       .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
-     Table table = TestProviderTransactionUtil.getDataObject(
-       readOnlyTransaction, tableRef);
-     if (table != null) {
-      FlowTableStatisticsData data = table
-        .getAugmentation(FlowTableStatisticsData.class);
-      if (null != data) {
-       tableStatsCount++;
-      }
-     }
+
+    public void _groupDescStats(CommandInterpreter ci) {
+        int groupCount = 0;
+        int groupDescStatsCount = 0;
+        NodeGroupDescStats data = null;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+                    .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+
+            if (node != null) {
+                if (node.getGroup() != null) {
+                    List<Group> groups = node.getGroup();
+                    for (Group group2 : groups) {
+                        groupCount++;
+                        GroupKey groupKey = group2.getKey();
+                        InstanceIdentifier<Group> groupRef = InstanceIdentifier.create(Nodes.class)
+                                .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+                                .child(Group.class, groupKey);
+                        Group group = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, groupRef);
+                        if (group != null) {
+                            data = group.getAugmentation(NodeGroupDescStats.class);
+                            if (null != data) {
+                                groupDescStatsCount++;
+                            }
+                        }
+
+                    }
+                }
+            }
+
+            if (groupCount == groupDescStatsCount) {
+                LOG.debug("---------------------groupDescStats - Success-------------------------------");
+            } else {
+                LOG.debug("------------------------------groupDescStats - Failed--------------------------");
+                LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+            }
+        }
     }
-   }
-  }
-
-  if (tableCount == tableStatsCount) {
-   LOG.debug("tableStats - Success");
-  } else {
-   LOG.debug("tableStats - Failed");
-   LOG
-     .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
-  }
-
- }
-
- public void _groupStats(CommandInterpreter ci) {
-  int groupCount = 0;
-  int groupStatsCount = 0;
-  NodeGroupStatistics data = null;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
-     .create(Nodes.class).child(Node.class, nodeKey)
-     .augmentation(FlowCapableNode.class);
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
-     readOnlyTransaction, nodeRef);
-   if (node != null) {
-    if (node.getGroup() != null) {
-     List<Group> groups = node.getGroup();
-     for (Iterator<Group> iterator2 = groups.iterator(); iterator2.hasNext();) {
-      groupCount++;
-      GroupKey groupKey = iterator2.next().getKey();
-      InstanceIdentifier<Group> groupRef = InstanceIdentifier
-        .create(Nodes.class).child(Node.class, nodeKey)
-        .augmentation(FlowCapableNode.class).child(Group.class, groupKey);
-      Group group = TestProviderTransactionUtil.getDataObject(
-        readOnlyTransaction, groupRef);
-      if (group != null) {
-       data = group.getAugmentation(NodeGroupStatistics.class);
-       if (null != data) {
-        groupStatsCount++;
-       }
-      }
-     }
+
+    public void _meterStats(CommandInterpreter ci) {
+        int meterCount = 0;
+        int meterStatsCount = 0;
+        NodeMeterStatistics data = null;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+                    .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+            if (node != null) {
+                if (node.getMeter() != null) {
+                    List<Meter> meters = node.getMeter();
+                    for (Meter meter2 : meters) {
+                        meterCount++;
+                        MeterKey meterKey = meter2.getKey();
+                        InstanceIdentifier<Meter> meterRef = InstanceIdentifier.create(Nodes.class)
+                                .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+                                .child(Meter.class, meterKey);
+                        Meter meter = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, meterRef);
+                        if (meter != null) {
+                            data = meter.getAugmentation(NodeMeterStatistics.class);
+                            if (null != data) {
+                                meterStatsCount++;
+                            }
+                        }
+                    }
+
+                }
+            }
+        }
+
+        if (meterCount == meterStatsCount) {
+            LOG.debug("---------------------------meterStats - Success-------------------------------------");
+        } else {
+            LOG.debug("----------------------------meterStats - Failed-------------------------------------");
+            LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+        }
     }
 
-   }
-  }
-
-  if (groupCount == groupStatsCount) {
-   LOG
-     .debug("---------------------groupStats - Success-------------------------------");
-  } else {
-   LOG
-     .debug("------------------------------groupStats - Failed--------------------------");
-   LOG
-     .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
-  }
- }
-
- public void _groupDescStats(CommandInterpreter ci) {
-  int groupCount = 0;
-  int groupDescStatsCount = 0;
-  NodeGroupDescStats data = null;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
-     .create(Nodes.class).child(Node.class, nodeKey)
-     .augmentation(FlowCapableNode.class);
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
-     readOnlyTransaction, nodeRef);
-
-   if (node != null) {
-    if (node.getGroup() != null) {
-     List<Group> groups = node.getGroup();
-     for (Iterator<Group> iterator2 = groups.iterator(); iterator2.hasNext();) {
-      groupCount++;
-      GroupKey groupKey = iterator2.next().getKey();
-      InstanceIdentifier<Group> groupRef = InstanceIdentifier
-        .create(Nodes.class).child(Node.class, nodeKey)
-        .augmentation(FlowCapableNode.class).child(Group.class, groupKey);
-      Group group = TestProviderTransactionUtil.getDataObject(
-        readOnlyTransaction, groupRef);
-      if (group != null) {
-       data = group.getAugmentation(NodeGroupDescStats.class);
-       if (null != data) {
-        groupDescStatsCount++;
-       }
-      }
-
-     }
+    public void _meterConfigStats(CommandInterpreter ci) {
+        int meterCount = 0;
+        int meterConfigStatsCount = 0;
+        NodeMeterConfigStats data = null;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+                    .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+            if (node != null) {
+                if (node.getMeter() != null) {
+                    List<Meter> meters = node.getMeter();
+                    for (Meter meter2 : meters) {
+                        meterCount++;
+                        MeterKey meterKey = meter2.getKey();
+                        InstanceIdentifier<Meter> meterRef = InstanceIdentifier.create(Nodes.class)
+                                .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+                                .child(Meter.class, meterKey);
+                        Meter meter = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, meterRef);
+                        if (meter != null) {
+                            data = meter.getAugmentation(NodeMeterConfigStats.class);
+                            if (null != data) {
+                                meterConfigStatsCount++;
+                            }
+                        }
+                    }
+
+                }
+            }
+        }
+
+        if (meterCount == meterConfigStatsCount) {
+            LOG.debug("---------------------------meterConfigStats - Success-------------------------------------");
+            ci.print(data);
+        } else {
+            LOG.debug("----------------------------meterConfigStats - Failed-------------------------------------");
+            LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+        }
     }
-   }
-
-   if (groupCount == groupDescStatsCount) {
-    LOG
-      .debug("---------------------groupDescStats - Success-------------------------------");
-   } else {
-    LOG
-      .debug("------------------------------groupDescStats - Failed--------------------------");
-    LOG
-      .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
-   }
-  }
- }
-
- public void _meterStats(CommandInterpreter ci) {
-  int meterCount = 0;
-  int meterStatsCount = 0;
-  NodeMeterStatistics data = null;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
-     .create(Nodes.class).child(Node.class, nodeKey)
-     .augmentation(FlowCapableNode.class);
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
-     readOnlyTransaction, nodeRef);
-   if (node != null) {
-    if (node.getMeter() != null) {
-     List<Meter> meters = node.getMeter();
-     for (Iterator<Meter> iterator2 = meters.iterator(); iterator2.hasNext();) {
-      meterCount++;
-      MeterKey meterKey = iterator2.next().getKey();
-      InstanceIdentifier<Meter> meterRef = InstanceIdentifier
-        .create(Nodes.class).child(Node.class, nodeKey)
-        .augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
-      Meter meter = TestProviderTransactionUtil.getDataObject(
-        readOnlyTransaction, meterRef);
-      if (meter != null) {
-       data = meter.getAugmentation(NodeMeterStatistics.class);
-       if (null != data) {
-        meterStatsCount++;
-       }
-      }
-     }
+
+    public void _aggregateStats(CommandInterpreter ci) {
+        int aggregateFlowCount = 0;
+        int aggerateFlowStatsCount = 0;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+                    .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+            if (node != null) {
+                List<Table> tables = node.getTable();
+                for (Table table2 : tables) {
+                    aggregateFlowCount++;
+                    TableKey tableKey = table2.getKey();
+                    InstanceIdentifier<Table> tableRef = InstanceIdentifier.create(Nodes.class)
+                            .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+                            .child(Table.class, tableKey);
+                    Table table = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, tableRef);
+                    if (table != null) {
+                        AggregateFlowStatisticsData data = table.getAugmentation(AggregateFlowStatisticsData.class);
+                        if (null != data) {
+                            aggerateFlowStatsCount++;
+                        }
+                    }
+                }
+            }
+        }
+
+        if (aggregateFlowCount == aggerateFlowStatsCount) {
+            LOG.debug("aggregateStats - Success");
+        } else {
+            LOG.debug("aggregateStats - Failed");
+            LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+        }
 
     }
-   }
-  }
-
-  if (meterCount == meterStatsCount) {
-   LOG
-     .debug("---------------------------meterStats - Success-------------------------------------");
-  } else {
-   LOG
-     .debug("----------------------------meterStats - Failed-------------------------------------");
-   LOG
-     .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
-  }
- }
-
- public void _meterConfigStats(CommandInterpreter ci) {
-  int meterCount = 0;
-  int meterConfigStatsCount = 0;
-  NodeMeterConfigStats data = null;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
-     .create(Nodes.class).child(Node.class, nodeKey)
-     .augmentation(FlowCapableNode.class);
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
-     readOnlyTransaction, nodeRef);
-   if (node != null) {
-    if (node.getMeter() != null) {
-     List<Meter> meters = node.getMeter();
-     for (Iterator<Meter> iterator2 = meters.iterator(); iterator2.hasNext();) {
-      meterCount++;
-      MeterKey meterKey = iterator2.next().getKey();
-      InstanceIdentifier<Meter> meterRef = InstanceIdentifier
-        .create(Nodes.class).child(Node.class, nodeKey)
-        .augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
-      Meter meter = TestProviderTransactionUtil.getDataObject(
-        readOnlyTransaction, meterRef);
-      if (meter != null) {
-       data = meter.getAugmentation(NodeMeterConfigStats.class);
-       if (null != data) {
-        meterConfigStatsCount++;
-       }
-      }
-     }
+
+    public void _descStats(CommandInterpreter ci) {
+        int descCount = 0;
+        int descStatsCount = 0;
+        List<Node> nodes = getNodes();
+        for (Node node2 : nodes) {
+            descCount++;
+            NodeKey nodeKey = node2.getKey();
+            InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+                    .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+            ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+            FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+            if (node != null) {
+                if (null != node.getHardware() && null != node.getManufacturer() && null != node.getSoftware()) {
+                    descStatsCount++;
+                }
+            }
+        }
+
+        if (descCount == descStatsCount) {
+            LOG.debug("descStats - Success");
+        } else {
+            LOG.debug("descStats - Failed");
+            LOG.debug("System fetches stats data in 50 seconds interval, so please wait and try again.");
+        }
 
     }
-   }
-  }
-
-  if (meterCount == meterConfigStatsCount) {
-   LOG
-     .debug("---------------------------meterConfigStats - Success-------------------------------------");
-   ci.print(data);
-  } else {
-   LOG
-     .debug("----------------------------meterConfigStats - Failed-------------------------------------");
-   LOG
-     .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
-  }
- }
-
- public void _aggregateStats(CommandInterpreter ci) {
-  int aggregateFlowCount = 0;
-  int aggerateFlowStatsCount = 0;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
-     .create(Nodes.class).child(Node.class, nodeKey)
-     .augmentation(FlowCapableNode.class);
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
-     readOnlyTransaction, nodeRef);
-   if (node != null) {
-    List<Table> tables = node.getTable();
-    for (Iterator<Table> iterator2 = tables.iterator(); iterator2.hasNext();) {
-     aggregateFlowCount++;
-     TableKey tableKey = iterator2.next().getKey();
-     InstanceIdentifier<Table> tableRef = InstanceIdentifier
-       .create(Nodes.class).child(Node.class, nodeKey)
-       .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
-     Table table = TestProviderTransactionUtil.getDataObject(
-       readOnlyTransaction, tableRef);
-     if (table != null) {
-      AggregateFlowStatisticsData data = table
-        .getAugmentation(AggregateFlowStatisticsData.class);
-      if (null != data) {
-       aggerateFlowStatsCount++;
-      }
-     }
+
+    private List<Node> getNodes() {
+        ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+        InstanceIdentifier<Nodes> nodesID = InstanceIdentifier.create(Nodes.class);
+        Nodes nodes = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodesID);
+        if (nodes == null) {
+            throw new RuntimeException("nodes are not found, pls add the node.");
+        }
+        return nodes.getNode();
     }
-   }
-  }
-
-  if (aggregateFlowCount == aggerateFlowStatsCount) {
-   LOG.debug("aggregateStats - Success");
-  } else {
-   LOG.debug("aggregateStats - Failed");
-   LOG
-     .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
-  }
-
- }
-
- public void _descStats(CommandInterpreter ci) {
-  int descCount = 0;
-  int descStatsCount = 0;
-  List<Node> nodes = getNodes();
-  for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
-   descCount++;
-   NodeKey nodeKey = iterator.next().getKey();
-   InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
-     .create(Nodes.class).child(Node.class, nodeKey)
-     .augmentation(FlowCapableNode.class);
-   ReadOnlyTransaction readOnlyTransaction = dataProviderService
-     .newReadOnlyTransaction();
-   FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
-     readOnlyTransaction, nodeRef);
-   if (node != null) {
-    if (null != node.getHardware() && null != node.getManufacturer()
-      && null != node.getSoftware()) {
-     descStatsCount++;
+
+    @Override
+    public String getHelp() {
+        StringBuilder help = new StringBuilder();
+        help.append("---MD-SAL Stats test module---\n");
+        return help.toString();
     }
-   }
-  }
-
-  if (descCount == descStatsCount) {
-   LOG.debug("descStats - Success");
-  } else {
-   LOG.debug("descStats - Failed");
-   LOG
-     .debug("System fetches stats data in 50 seconds interval, so please wait and try again.");
-  }
-
- }
-
- private List<Node> getNodes() {
-  ReadOnlyTransaction readOnlyTransaction = dataProviderService
-    .newReadOnlyTransaction();
-  InstanceIdentifier<Nodes> nodesID = InstanceIdentifier.create(Nodes.class);
-  Nodes nodes = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
-    nodesID);
-  if (nodes == null) {
-   throw new RuntimeException("nodes are not found, pls add the node.");
-  }
-  return nodes.getNode();
- }
-
- @Override
- public String getHelp() {
-  StringBuilder help = new StringBuilder();
-  help.append("---MD-SAL Stats test module---\n");
-  return help.toString();
- }
 
 }
index 847c95f3d328943551c9fd3c180d4c1a2eabb963..192e08fc003dbbb66ab07c98a0017d1f13707aee 100644 (file)
@@ -73,23 +73,18 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.osgi.framework.BundleContext;
 
-
+@SuppressWarnings("checkstyle:MethodName")
 public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandProvider {
 
     private DataBroker dataBroker;
-    private ProviderContext pc;
     private final BundleContext ctx;
-    private TableFeatures testTable;
     private Node testNode;
-    private final String originalTableName = "Foo";
-    private final String updatedTableName = "Bar";
 
     public OpenflowpluginTableFeaturesTestCommandProvider(BundleContext ctx) {
         this.ctx = ctx;
     }
 
     public void onSessionInitiated(ProviderContext session) {
-        pc = session;
         dataBroker = session.getSALService(DataBroker.class);
         ctx.registerService(CommandProvider.class.getName(), this, null);
         // createTestNode();
@@ -136,7 +131,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
             tableFeature.setConfig(new TableConfig(false));
 
-            List<TableFeatureProperties> properties = new ArrayList<TableFeatureProperties>();
+            List<TableFeatureProperties> properties = new ArrayList<>();
 
 
             switch (tableFeatureType) {
@@ -196,6 +191,8 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
                     // To set the wildcards set field match
                     properties.add(createWildCardsTblFeatureProp().build());
                     break;
+                default:
+                    break;
             }
 
 
@@ -203,7 +200,6 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
             propertyBld.setTableFeatureProperties(properties);
             tableFeature.setTableProperties(propertyBld.build());
         }
-        testTable = tableFeature.build();
         return tableFeature;
     }
 
@@ -211,14 +207,15 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
 
         //To set the ApplyActionsMiss
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
         ActionBuilder ab = new ActionBuilder();
 
         ab.setAction(new PopMplsActionCaseBuilder().build());
         actionList.add(ab.build());
 
         tableFeatureProperty.setTableFeaturePropType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                .feature.prop.type.ApplyActionsMissBuilder()
                         .setApplyActionsMiss(new ApplyActionsMissBuilder().setAction(actionList).build()).build());
 
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
@@ -231,14 +228,15 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createApplyActionsTblFeatureProp() {
         TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-        List<Action> actionListt5 = new ArrayList<Action>();
+        List<Action> actionListt5 = new ArrayList<>();
         ActionBuilder abt5 = new ActionBuilder();
 
         abt5.setAction(new PopMplsActionCaseBuilder().build());
         actionListt5.add(abt5.build());
 
         tableFeatureProperty.setTableFeaturePropType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                .feature.prop.type.ApplyActionsBuilder()
                         .setApplyActions(new ApplyActionsBuilder().setAction(actionListt5).build()).build());
 
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
@@ -280,17 +278,20 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
 
     private TableFeaturePropertiesBuilder createInstructionsTblFeatureProp() {
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-
-        List<Instruction> instLst = new ArrayList<Instruction>();
         InstructionBuilder ib = new InstructionBuilder();
         ib.setOrder(1);
-        ib.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder().build());
+        ib.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+                .instruction.ApplyActionsCaseBuilder().build());
         ib.setKey(new InstructionKey(1));
 
+        List<Instruction> instLst = new ArrayList<>();
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder().setInstructions(
-                        new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.InstructionsBuilder().setInstruction(instLst).build()).build());
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                .feature.prop.type.InstructionsBuilder().setInstructions(
+                    new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type
+                        .table.feature.prop.type.instructions.InstructionsBuilder().setInstruction(instLst).build())
+                            .build());
 
 
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
@@ -302,22 +303,27 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createInstructionsMissTblFeatureProp() {
         // To set the instructions miss -- "t7"
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
 
-        List<Instruction> instLst = new ArrayList<Instruction>();
         InstructionBuilder ib1 = new InstructionBuilder();
         ib1.setOrder(1);
-        ib1.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteMetadataCaseBuilder().build());
+        ib1.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+                .instruction.WriteMetadataCaseBuilder().build());
         ib1.setKey(new InstructionKey(1));
 
         InstructionBuilder ib2 = new InstructionBuilder();
         ib2.setOrder(2);
-        ib2.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.MeterCaseBuilder().build());
+        ib2.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+                .instruction.MeterCaseBuilder().build());
         ib2.setKey(new InstructionKey(2));
 
+        List<Instruction> instLst = new ArrayList<>();
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder().setInstructionsMiss(
-                        new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss.InstructionsMissBuilder().setInstruction(instLst).build()).build());
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                .feature.prop.type.InstructionsMissBuilder().setInstructionsMiss(
+                    new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type
+                        .table.feature.prop.type.instructions.miss.InstructionsMissBuilder().setInstruction(instLst)
+                            .build()).build());
 
 
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
@@ -329,9 +335,8 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createWriteActionsTblFeatureProp() {
         // t8
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
 
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
 
         ActionBuilder abt1 = new ActionBuilder();
         abt1.setAction(new CopyTtlOutCaseBuilder().build());
@@ -341,9 +346,12 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         abt2.setAction(new PopVlanActionCaseBuilder().build());
         actionList.add(abt2.build());
 
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder()
-                        .setWriteActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.WriteActionsBuilder().setAction(actionList).build()).build());
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                .feature.prop.type.WriteActionsBuilder().setWriteActions(new org.opendaylight.yang.gen.v1.urn
+                    .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions
+                        .WriteActionsBuilder().setAction(actionList).build()).build());
 
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
         tableFeatureProperty.setKey(keyValue);
@@ -354,9 +362,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createWriteActionsMissTblFeatureProp() {
         // t9
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-
-        List<Action> actionList = new ArrayList<Action>();
+        List<Action> actionList = new ArrayList<>();
 
         ActionBuilder abt1 = new ActionBuilder();
         abt1.setAction(new CopyTtlInCaseBuilder().build());
@@ -366,9 +372,12 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         abt2.setAction(new PushPbbActionCaseBuilder().build());
         actionList.add(abt2.build());
 
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder()
-                        .setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss.WriteActionsMissBuilder().setAction(actionList).build()).build());
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                .feature.prop.type.WriteActionsMissBuilder().setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn
+                    .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions
+                        .miss.WriteActionsMissBuilder().setAction(actionList).build()).build());
 
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
         tableFeatureProperty.setKey(keyValue);
@@ -379,10 +388,8 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createMatchFieldTblFeatureProp() {
         //t10
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-
 
-        List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
+        List<SetFieldMatch> setFieldMatch = new ArrayList<>();
         SetFieldMatchBuilder setFieldMatchBld = new SetFieldMatchBuilder();
         setFieldMatchBld.setHasMask(false);
         setFieldMatchBld.setMatchType(MplsLabel.class);
@@ -394,6 +401,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         matchSetfieldBld.setSetFieldMatch(setFieldMatch);
         matchBld.setMatchSetfield(matchSetfieldBld.build());
 
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(matchBld.build());
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
         tableFeatureProperty.setKey(keyValue);
@@ -405,9 +413,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createWriteSetFieldTblFeatureProp() {
         //t11
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
 
-        List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
         SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
         setFieldMatchBld1.setHasMask(false);
         setFieldMatchBld1.setMatchType(MplsLabel.class);
@@ -420,17 +426,20 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         setFieldMatchBld3.setHasMask(true);
         setFieldMatchBld3.setMatchType(EthDst.class);
 
+        List<SetFieldMatch> setFieldMatch = new ArrayList<>();
         setFieldMatch.add(setFieldMatchBld1.build());
         setFieldMatch.add(setFieldMatchBld2.build());
         setFieldMatch.add(setFieldMatchBld3.build());
 
         WriteSetfieldBuilder writeSetfieldBld = new WriteSetfieldBuilder();
-        org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder writeSetfieldBuilder =
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+            .type.write.setfield.WriteSetfieldBuilder writeSetfieldBuilder =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                    .feature.prop.type.write.setfield.WriteSetfieldBuilder();
         writeSetfieldBuilder.setSetFieldMatch(setFieldMatch);
         writeSetfieldBld.setWriteSetfield(writeSetfieldBuilder.build());
 
-
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.build());
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
         tableFeatureProperty.setKey(keyValue);
@@ -441,9 +450,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createWriteSetFieldMissTblFeatureProp() {
         // t12
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
 
-        List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
         SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
         setFieldMatchBld1.setHasMask(false);
         setFieldMatchBld1.setMatchType(EthSrc.class);
@@ -456,16 +463,20 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         setFieldMatchBld3.setHasMask(true);
         setFieldMatchBld3.setMatchType(Ipv4Dst.class);
 
+        List<SetFieldMatch> setFieldMatch = new ArrayList<>();
         setFieldMatch.add(setFieldMatchBld1.build());
         setFieldMatch.add(setFieldMatchBld2.build());
         setFieldMatch.add(setFieldMatchBld3.build());
 
         WriteSetfieldMissBuilder writeSetfieldBld = new WriteSetfieldMissBuilder();
-        org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder writeSetfieldMissBuilder =
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+            .type.write.setfield.miss.WriteSetfieldMissBuilder writeSetfieldMissBuilder =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                    .feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder();
         writeSetfieldMissBuilder.setSetFieldMatch(setFieldMatch);
         writeSetfieldBld.setWriteSetfieldMiss(writeSetfieldMissBuilder.build());
 
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.build());
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
         tableFeatureProperty.setKey(keyValue);
@@ -476,9 +487,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createApplySetFieldTblFeatureProp() {
         //t13
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
 
-        List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
         SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
         setFieldMatchBld1.setHasMask(false);
         setFieldMatchBld1.setMatchType(ArpOp.class);
@@ -491,16 +500,20 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         setFieldMatchBld3.setHasMask(true);
         setFieldMatchBld3.setMatchType(Ipv4Dst.class);
 
+        List<SetFieldMatch> setFieldMatch = new ArrayList<>();
         setFieldMatch.add(setFieldMatchBld1.build());
         setFieldMatch.add(setFieldMatchBld2.build());
         setFieldMatch.add(setFieldMatchBld3.build());
 
         ApplySetfieldBuilder applySetfieldBld = new ApplySetfieldBuilder();
-        org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder applySetfieldBuilder =
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+            .type.apply.setfield.ApplySetfieldBuilder applySetfieldBuilder =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                    .feature.prop.type.apply.setfield.ApplySetfieldBuilder();
         applySetfieldBuilder.setSetFieldMatch(setFieldMatch);
         applySetfieldBld.setApplySetfield(applySetfieldBuilder.build());
 
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(applySetfieldBld.build());
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
         tableFeatureProperty.setKey(keyValue);
@@ -511,9 +524,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createApplySetFieldMissTblFeatureProp() {
         //t14
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
 
-        List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
         SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
         setFieldMatchBld1.setHasMask(false);
         setFieldMatchBld1.setMatchType(ArpOp.class);
@@ -526,16 +537,20 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         setFieldMatchBld3.setHasMask(true);
         setFieldMatchBld3.setMatchType(Ipv4Dst.class);
 
+        List<SetFieldMatch> setFieldMatch = new ArrayList<>();
         setFieldMatch.add(setFieldMatchBld1.build());
         setFieldMatch.add(setFieldMatchBld2.build());
         setFieldMatch.add(setFieldMatchBld3.build());
 
         ApplySetfieldMissBuilder applySetfieldMissBld = new ApplySetfieldMissBuilder();
-        org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder applySetfieldMissBuilder =
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+            .type.apply.setfield.miss.ApplySetfieldMissBuilder applySetfieldMissBuilder =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+                    .feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder();
         applySetfieldMissBuilder.setSetFieldMatch(setFieldMatch);
         applySetfieldMissBld.setApplySetfieldMiss(applySetfieldMissBuilder.build());
 
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(applySetfieldMissBld.build());
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
         tableFeatureProperty.setKey(keyValue);
@@ -546,9 +561,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
     private TableFeaturePropertiesBuilder createWildCardsTblFeatureProp() {
         //t15
-        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
 
-        List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
         SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
         setFieldMatchBld1.setHasMask(false);
         setFieldMatchBld1.setMatchType(ArpOp.class);
@@ -557,7 +570,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         setFieldMatchBld2.setHasMask(true);
         setFieldMatchBld2.setMatchType(InPort.class);
 
-
+        List<SetFieldMatch> setFieldMatch = new ArrayList<>();
         setFieldMatch.add(setFieldMatchBld1.build());
         setFieldMatch.add(setFieldMatchBld2.build());
 
@@ -567,6 +580,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         wildcardsBuilder.setSetFieldMatch(setFieldMatch);
         wildCardsBld.setWildcardSetfield(wildcardsBuilder.build());
 
+        TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
         tableFeatureProperty.setTableFeaturePropType(wildCardsBld.build());
         TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
         tableFeatureProperty.setKey(keyValue);
@@ -575,14 +589,12 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         return tableFeatureProperty;
     }
 
-
     private void writeTableFeatures(final CommandInterpreter ci, TableFeatures tableFeatures) {
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
 
         KeyedInstanceIdentifier<TableFeatures, TableFeaturesKey> path1 = InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class).
-                        child(TableFeatures.class, new TableFeaturesKey(tableFeatures.getTableId()));
-
+                .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+                        .child(TableFeatures.class, new TableFeaturesKey(tableFeatures.getTableId()));
 
         modification.merge(LogicalDatastoreType.OPERATIONAL, nodeToInstanceId(testNode), testNode, true);
         modification.merge(LogicalDatastoreType.OPERATIONAL, path1, tableFeatures, true);
@@ -591,7 +603,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void aVoid) {
+            public void onSuccess(Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -627,6 +639,5 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
 
         return help.toString();
     }
-
 }
 
index 9a0e554b6c746be8569fe917035ec0540afa0340..8150887a7dd13961c90210e763fc28c7a295c58a 100644 (file)
@@ -37,7 +37,7 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements
     private NotificationProviderService notificationService;
 
     /**
-     * get table registration
+     * Get table registration.
      *
      * @return {@link #tableRegistration}
      */
@@ -46,9 +46,7 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements
     }
 
     /**
-     * set {@link #tableRegistration}
-     *
-     * @param tableRegistration
+     * Set {@link #tableRegistration}.
      */
     public void setTableRegistration(
             final RoutedRpcRegistration<SalTableService> tableRegistration) {
@@ -56,7 +54,7 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements
     }
 
     /**
-     * get notification service
+     * Get notification service.
      *
      * @return {@link #notificationService}
      */
@@ -65,9 +63,7 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements
     }
 
     /**
-     * set {@link #notificationService}
-     *
-     * @param notificationService
+     * Set {@link #notificationService}.
      */
     public void setNotificationService(
             final NotificationProviderService notificationService) {
@@ -103,31 +99,27 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements
     @Override
     public Future<RpcResult<UpdateTableOutput>> updateTable(
             UpdateTableInput input) {
-        String plus = ("updateTable - " + input);
+        String plus = "updateTable - " + input;
         OpenflowpluginTableFeaturesTestServiceProvider.LOG.info(plus);
         return null;
     }
 
-    /**
-     * @param ctx
-     * @return {@link ObjectRegistration}
-     */
     public ObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register(
             final ProviderContext ctx) {
         RoutedRpcRegistration<SalTableService> addRoutedRpcImplementation = ctx
-                .<SalTableService> addRoutedRpcImplementation(
+                .<SalTableService>addRoutedRpcImplementation(
                         SalTableService.class, this);
 
         setTableRegistration(addRoutedRpcImplementation);
 
         InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
-                .<Nodes> builder(Nodes.class);
+                .<Nodes>builder(Nodes.class);
 
         NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
         NodeKey nodeKey = new NodeKey(nodeId);
 
         InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
-                .<Node, NodeKey> child(Node.class, nodeKey);
+                .<Node, NodeKey>child(Node.class, nodeKey);
 
         InstanceIdentifier<Node> instance = nodeIndentifier.build();
 
@@ -143,5 +135,4 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements
             }
         };
     }
-
 }
index df5b943b530e97b08196cd7343d91e0c2feea025..d565f5fa6407a189ecc4cd096e627cb3aaf796d3 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -19,11 +19,12 @@ import org.slf4j.LoggerFactory;
 public class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
     private static final Logger LOG = LoggerFactory
             .getLogger(OpenflowpluginTestActivator.class);
-    
+
     private static OpenflowpluginTestServiceProvider provider = new OpenflowpluginTestServiceProvider();
     private static OpenflowpluginGroupTestServiceProvider groupProvider = new OpenflowpluginGroupTestServiceProvider();
     private static OpenflowpluginMeterTestServiceProvider meterProvider = new OpenflowpluginMeterTestServiceProvider();
-    private static OpenflowpluginTableFeaturesTestServiceProvider tableProvider = new OpenflowpluginTableFeaturesTestServiceProvider();
+    private static OpenflowpluginTableFeaturesTestServiceProvider tableProvider =
+            new OpenflowpluginTableFeaturesTestServiceProvider();
 
     private OpenflowpluginTestCommandProvider cmdProvider;
 
@@ -47,7 +48,7 @@ public class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.controller.sal.binding.api.BindingAwareProvider#
      * onSessionInitiated
      * (org.opendaylight.controller.sal.binding.api.BindingAwareBroker
@@ -56,11 +57,11 @@ public class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
     @Override
     public void onSessionInitiated(ProviderContext session) {
         DataBroker salService = session
-                .<DataBroker> getSALService(DataBroker.class);
+                .<DataBroker>getSALService(DataBroker.class);
         OpenflowpluginTestActivator.provider.setDataService(salService);
 
         NotificationProviderService salService1 = session
-                .<NotificationProviderService> getSALService(NotificationProviderService.class);
+                .<NotificationProviderService>getSALService(NotificationProviderService.class);
 
         OpenflowpluginTestActivator.provider
                 .setNotificationService(salService1);
@@ -84,50 +85,53 @@ public class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.controller.sal.binding.api.AbstractBrokerAwareActivator
      * #startImpl(org.osgi.framework.BundleContext)
      */
+    @Override
     public void startImpl(final BundleContext ctx) {
         super.startImpl(ctx);
 
         OpenflowpluginTestCommandProvider openflowpluginTestCommandProvider = new OpenflowpluginTestCommandProvider(
                 ctx);
         this.cmdProvider = openflowpluginTestCommandProvider;
-        OpenflowpluginGroupTestCommandProvider openflowpluginGroupTestCommandProvider = new OpenflowpluginGroupTestCommandProvider(
-                ctx);
+        OpenflowpluginGroupTestCommandProvider openflowpluginGroupTestCommandProvider =
+                new OpenflowpluginGroupTestCommandProvider(ctx);
         this.cmdGroupProvider = openflowpluginGroupTestCommandProvider;
-        OpenflowpluginMeterTestCommandProvider openflowpluginMeterTestCommandProvider = new OpenflowpluginMeterTestCommandProvider(
-                ctx);
+        OpenflowpluginMeterTestCommandProvider openflowpluginMeterTestCommandProvider =
+                new OpenflowpluginMeterTestCommandProvider(ctx);
         this.cmdMeterProvider = openflowpluginMeterTestCommandProvider;
-        OpenflowpluginTableFeaturesTestCommandProvider openflowpluginTableFeaturesTestCommandProvider = new OpenflowpluginTableFeaturesTestCommandProvider(
-                ctx);
+        OpenflowpluginTableFeaturesTestCommandProvider openflowpluginTableFeaturesTestCommandProvider =
+                new OpenflowpluginTableFeaturesTestCommandProvider(ctx);
         this.cmdTableProvider = openflowpluginTableFeaturesTestCommandProvider;
-        OpenflowpluginStatsTestCommandProvider openflowpluginStatsTestCommandProvider = new OpenflowpluginStatsTestCommandProvider(
-                ctx);
+        OpenflowpluginStatsTestCommandProvider openflowpluginStatsTestCommandProvider =
+                new OpenflowpluginStatsTestCommandProvider(ctx);
         this.cmdStatsProvider = openflowpluginStatsTestCommandProvider;
-        OpenflowpluginTestNodeConnectorNotification openflowpluginTestNodeConnectorNotification = new OpenflowpluginTestNodeConnectorNotification(
-                ctx);
+        OpenflowpluginTestNodeConnectorNotification openflowpluginTestNodeConnectorNotification =
+                new OpenflowpluginTestNodeConnectorNotification(ctx);
         this.cmdNodeConnectorNotification = openflowpluginTestNodeConnectorNotification;
-        OpenflowpluginTestTopologyNotification openflowpluginTestTopologyNotification = new OpenflowpluginTestTopologyNotification(
-                ctx);
+        OpenflowpluginTestTopologyNotification openflowpluginTestTopologyNotification =
+                new OpenflowpluginTestTopologyNotification(ctx);
         this.cmdTopologyNotification = openflowpluginTestTopologyNotification;
-        OpenflowPluginBulkTransactionProvider openflowPluginBulkTransactionProvider = new OpenflowPluginBulkTransactionProvider(
-                ctx);
+        OpenflowPluginBulkTransactionProvider openflowPluginBulkTransactionProvider =
+                new OpenflowPluginBulkTransactionProvider(ctx);
         this.bulkCmdProvider = openflowPluginBulkTransactionProvider;
-        OpenflowPluginBulkGroupTransactionProvider openflowPluginBulkGroupTransactionProvider = new OpenflowPluginBulkGroupTransactionProvider(
-                ctx);
+        OpenflowPluginBulkGroupTransactionProvider openflowPluginBulkGroupTransactionProvider =
+                new OpenflowPluginBulkGroupTransactionProvider(ctx);
         this.groupCmdProvider = openflowPluginBulkGroupTransactionProvider;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.controller.sal.binding.api.AbstractBrokerAwareActivator
      * #stopImpl(org.osgi.framework.BundleContext)
      */
+    @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     protected void stopImpl(final BundleContext context) {
 
         try {
@@ -137,5 +141,4 @@ public class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
             LOG.error("Stopping bundle OpenflowpluginTestActivator failed.", e);
         }
     }
-
 }
index 5a13a7b6270185b602772f2682f0c709779b7321..8f6161cf2d95ecaf9cd211915b5fde1455923ad9 100644 (file)
@@ -181,6 +181,7 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@SuppressWarnings("checkstyle:MethodName")
 public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestCommandProvider.class);
@@ -773,16 +774,13 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         short table = TABLE_ID;
         try {
             table = Short.parseShort(tableId);
-        } catch (final Exception ex) {
+        } catch (NumberFormatException ex) {
             LOG.info("Parsing String tableId {} failed. Continuing with default tableId {}.",
                     tableId, table);
         }
         return table;
     }
 
-    /**
-     * @return
-     */
     private static InstructionsBuilder createDecNwTtlInstructions() {
         final DecNwTtlBuilder ta = new DecNwTtlBuilder();
         final DecNwTtl decNwTtl = ta.build();
@@ -790,7 +788,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
         ab.setKey(new ActionKey(0));
         // Add our drop action to a list
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
 
         // Create an Apply Action
@@ -805,16 +803,13 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         ib.setKey(new InstructionKey(0));
         isb.setInstruction(instructions);
         return isb;
     }
 
-    /**
-     * @return
-     */
     private static InstructionsBuilder createMeterInstructions() {
 
         final MeterBuilder aab = new MeterBuilder();
@@ -825,7 +820,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -843,7 +838,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -860,7 +855,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -874,7 +869,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
         ab.setKey(new ActionKey(0));
         // Add our drop action to a list
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         actionList.add(ab.build());
         ab.setKey(new ActionKey(0));
         // Create an Apply Action
@@ -887,7 +882,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -896,7 +891,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ControllerActionBuilder controller = new ControllerActionBuilder();
         controller.setMaxLength(5);
@@ -913,7 +908,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -922,7 +917,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction1() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final OutputActionBuilder output = new OutputActionBuilder();
@@ -942,7 +937,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -954,7 +949,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         // test case for Output Port works if the particular port exists
         // this particular test-case is for Port : 1
         // tested as (addMDFlow openflow:<dpid> f82)
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final OutputActionBuilder output = new OutputActionBuilder();
 
@@ -976,19 +971,19 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
-    private static InstructionsBuilder createSentToControllerInstructions() {
-        final List<Action> actionList = new ArrayList<Action>();
+    private static InstructionsBuilder createOutputInstructions(final String outputType, final int outputValue) {
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final OutputActionBuilder output = new OutputActionBuilder();
-        output.setMaxLength(Integer.valueOf(0xffff));
-        final Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
+        output.setMaxLength(outputValue);
+        final Uri value = new Uri(outputType);
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setOrder(0);
@@ -1006,19 +1001,19 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
-    private static InstructionsBuilder createOutputInstructions(final String outputType, final int outputValue) {
-        final List<Action> actionList = new ArrayList<Action>();
+    private static InstructionsBuilder createSentToControllerInstructions() {
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final OutputActionBuilder output = new OutputActionBuilder();
-        output.setMaxLength(outputValue);
-        final Uri value = new Uri(outputType);
+        output.setMaxLength(Integer.valueOf(0xffff));
+        final Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
         ab.setOrder(0);
@@ -1036,14 +1031,15 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
     }
 
+
     private static InstructionsBuilder createStripVlanInstructions() {
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final StripVlanActionBuilder stripActionBuilder = new StripVlanActionBuilder();
@@ -1063,7 +1059,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -1071,7 +1067,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction2() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final PushMplsActionBuilder push = new PushMplsActionBuilder();
@@ -1089,7 +1085,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1098,7 +1094,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction3() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final PushPbbActionBuilder pbb = new PushPbbActionBuilder();
@@ -1116,7 +1112,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1125,7 +1121,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction4() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final PushVlanActionBuilder vlan = new PushVlanActionBuilder();
@@ -1144,7 +1140,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1153,7 +1149,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction5() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetDlDstActionBuilder setdl = new SetDlDstActionBuilder();
@@ -1171,7 +1167,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1180,7 +1176,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction6() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetDlSrcActionBuilder src = new SetDlSrcActionBuilder();
@@ -1199,7 +1195,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1208,7 +1204,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction7() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
@@ -1227,7 +1223,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1236,7 +1232,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction8() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
@@ -1255,7 +1251,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1264,7 +1260,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction88() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
@@ -1284,7 +1280,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1293,7 +1289,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction9() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
@@ -1310,7 +1306,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1319,7 +1315,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction10() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
@@ -1336,7 +1332,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1345,7 +1341,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction11() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
@@ -1364,7 +1360,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instruction
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -1372,7 +1368,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction12() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final DecNwTtlBuilder nwttl = new DecNwTtlBuilder();
@@ -1390,7 +1386,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1399,7 +1395,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction13() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final DropActionBuilder drop = new DropActionBuilder();
@@ -1417,7 +1413,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1426,7 +1422,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction14() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final FloodActionBuilder fld = new FloodActionBuilder();
@@ -1443,7 +1439,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1452,7 +1448,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction15() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final FloodAllActionBuilder fldall = new FloodAllActionBuilder();
@@ -1469,7 +1465,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1478,7 +1474,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction16() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final GroupActionBuilder groupActionB = new GroupActionBuilder();
@@ -1498,7 +1494,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1507,7 +1503,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction17() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final HwPathActionBuilder hwPathB = new HwPathActionBuilder();
@@ -1524,7 +1520,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1533,7 +1529,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction18() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final LoopbackActionBuilder loopbackActionBuilder = new LoopbackActionBuilder();
@@ -1551,7 +1547,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1560,7 +1556,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction19() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final PopMplsActionBuilder popMplsActionBuilder = new PopMplsActionBuilder();
@@ -1578,7 +1574,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1587,7 +1583,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction20() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
@@ -1604,7 +1600,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1613,7 +1609,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction21() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
@@ -1631,7 +1627,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1640,7 +1636,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction22() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
@@ -1659,7 +1655,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1668,7 +1664,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction23(final NodeId nodeId) {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
@@ -1686,7 +1682,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1695,7 +1691,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction24() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
@@ -1714,7 +1710,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1723,7 +1719,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction25() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetNextHopActionBuilder setNextHopActionBuilder = new SetNextHopActionBuilder();
@@ -1745,7 +1741,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1754,7 +1750,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction26() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder();
@@ -1776,7 +1772,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1785,7 +1781,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction27() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
@@ -1807,7 +1803,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1816,7 +1812,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction28() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
@@ -1834,7 +1830,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1843,7 +1839,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction29() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetNwTtlActionBuilder setNwTtlActionBuilder = new SetNwTtlActionBuilder();
@@ -1862,7 +1858,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1871,7 +1867,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction30() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetQueueActionBuilder setQueueActionBuilder = new SetQueueActionBuilder();
@@ -1889,7 +1885,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1898,7 +1894,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction31() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetTpDstActionBuilder setTpDstActionBuilder = new SetTpDstActionBuilder();
@@ -1917,7 +1913,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1926,7 +1922,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction32() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
@@ -1945,7 +1941,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1954,7 +1950,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction33() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
@@ -1973,7 +1969,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -1982,7 +1978,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction34() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
 
         final SwPathActionBuilder swPathAction = new SwPathActionBuilder();
@@ -2000,7 +1996,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -2009,7 +2005,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction35() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
         final ActionBuilder ab2 = new ActionBuilder();
@@ -2056,7 +2052,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         ib.setKey(new InstructionKey(0));
         instructions.add(ib.build());
         isb.setInstruction(instructions);
@@ -2065,7 +2061,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction36() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
 
@@ -2098,7 +2094,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2106,7 +2102,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction37() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
         final ActionBuilder ab2 = new ActionBuilder();
@@ -2146,7 +2142,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2154,7 +2150,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction38() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
 
@@ -2186,7 +2182,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2194,7 +2190,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction39() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
 
@@ -2227,7 +2223,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2235,7 +2231,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction40() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
 
@@ -2268,7 +2264,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2276,7 +2272,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction41() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
 
@@ -2309,7 +2305,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2317,7 +2313,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction42() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
         final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
@@ -2347,7 +2343,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2355,7 +2351,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction43() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
         final ActionBuilder ab2 = new ActionBuilder();
@@ -2422,7 +2418,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2430,7 +2426,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction44() {
 
-        final List<Action> actionLists = new ArrayList<Action>();
+        final List<Action> actionLists = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
@@ -2488,7 +2484,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2496,7 +2492,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction45() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
@@ -2526,7 +2522,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2534,7 +2530,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction46() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
         final ActionBuilder ab1 = new ActionBuilder();
@@ -2573,7 +2569,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2581,12 +2577,13 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction47() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
         // PBB
         final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
-        protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask((new BigInteger(new byte[]{0, 1, 0, 0}).longValue())).build());
+        protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(
+                new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
         setFieldBuilder.setProtocolMatchFields(protomatch.build());
         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
         actionList.add(ab.build());
@@ -2600,7 +2597,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2608,7 +2605,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createAppyActionInstruction48() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
         // Tunnel
@@ -2628,7 +2625,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2636,7 +2633,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createTunnelIpv4DstInstructions() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         // Build the tunnel endpoint destination IPv4 address
         final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
@@ -2660,7 +2657,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
         // Add the Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2668,7 +2665,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static InstructionsBuilder createTunnelIpv4SrcInstructions() {
 
-        final List<Action> actionList = new ArrayList<Action>();
+        final List<Action> actionList = new ArrayList<>();
         final ActionBuilder ab = new ActionBuilder();
         // Build the tunnel endpoint source IPv4 address
         final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
@@ -2692,7 +2689,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
         // Put our Instruction in a list of Instructions
         final InstructionsBuilder isb = new InstructionsBuilder();
-        final List<Instruction> instructions = new ArrayList<Instruction>();
+        final List<Instruction> instructions = new ArrayList<>();
         instructions.add(ib.build());
         isb.setInstruction(instructions);
         return isb;
@@ -2708,13 +2705,10 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMatch1() {
         final MatchBuilder match = new MatchBuilder();
         final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        final Ipv4Prefix prefix = new Ipv4Prefix(IPV4_PREFIX);;
+        final Ipv4Prefix prefix = new Ipv4Prefix(IPV4_PREFIX);
         ipv4Match.setIpv4Destination(prefix);
         final Ipv4Match i4m = ipv4Match.build();
         match.setLayer3Match(i4m);
@@ -2727,10 +2721,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-
-    /**
-     * @return
-     */
     private static MatchBuilder createMatch2() {
         final MatchBuilder match = new MatchBuilder();
         final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
@@ -2747,9 +2737,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMatch3() {
         final MatchBuilder match = new MatchBuilder();
         final EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
@@ -2761,9 +2748,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createICMPv6Match1() {
 
         final MatchBuilder match = new MatchBuilder();
@@ -2841,10 +2825,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     }
 
-    /**
-     * @return
-     */
-
     private static MatchBuilder createVlanMatch() {
         final MatchBuilder match = new MatchBuilder();
         // vlan match
@@ -2860,9 +2840,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createArpMatch() {
         final MatchBuilder match = new MatchBuilder();
 
@@ -2898,10 +2875,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-
-    /**
-     * @return
-     */
     private static MatchBuilder createL3IPv4Match() {
         final MatchBuilder match = new MatchBuilder();
 
@@ -2924,9 +2897,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createL3IPv6Match() {
         final MatchBuilder match = new MatchBuilder();
 
@@ -2968,10 +2938,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
-
     private static MatchBuilder createICMPv4Match() {
         final MatchBuilder match = new MatchBuilder();
         final EthernetMatchBuilder eth = new EthernetMatchBuilder();
@@ -2992,9 +2958,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createICMPv6Match() {
 
         final MatchBuilder match = new MatchBuilder();
@@ -3017,9 +2980,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createToSMatch() {
         final MatchBuilder match = new MatchBuilder();
         final EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
@@ -3036,10 +2996,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
-
     private static MatchBuilder createL4TCPMatch() {
         final MatchBuilder match = new MatchBuilder();
 
@@ -3063,9 +3019,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createL4UDPMatch() {
         final MatchBuilder match = new MatchBuilder();
 
@@ -3089,9 +3042,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createL4SCTPMatch() {
         final MatchBuilder match = new MatchBuilder();
 
@@ -3115,9 +3065,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMetadataMatch() {
         final MatchBuilder match = new MatchBuilder();
         final byte[] metamask = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1};
@@ -3129,9 +3076,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createMplsMatch() {
         final MatchBuilder match = new MatchBuilder();
 
@@ -3152,9 +3096,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createPbbMatch() {
         final MatchBuilder match = new MatchBuilder();
 
@@ -3166,16 +3107,14 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder(); // mpls
         // match
-        protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
+        protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(
+                new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
         match.setProtocolMatchFields(protomatch.build());
 
         return match;
 
     }
 
-    /**
-     * @return
-     */
     private static MatchBuilder createTunnelIDMatch() {
         final MatchBuilder match = new MatchBuilder();
         final TunnelBuilder tunnel = new TunnelBuilder(); // tunnel id match
@@ -3188,7 +3127,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
     }
 
     /**
-     * Test match for TCP_Flags
+     * Test match for TCP_Flags.
      *
      * @return match containing Ethertype (0x0800), IP Protocol (TCP), TCP_Flag (SYN)
      */
@@ -3243,7 +3182,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         final CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(final Void aVoid) {
+            public void onSuccess(final Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -3256,11 +3195,9 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
     }
 
     /**
-     * @param ci arguments: switchId flowType tableNum
-     *           <p>
-     *           <pre>
-     *                     e.g.: addMDFlow openflow:1 f1 42
-     *                     </pre>
+     * Adds a flow.
+     *
+     * @param ci arguments: switchId flowType tableNum, e.g.: addMDFlow openflow:1 f1 42
      */
     public void _addMDFlow(final CommandInterpreter ci) {
         final NodeBuilder tn = createTestNode(ci.nextArgument());
@@ -3279,12 +3216,13 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         final InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
                 .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey());
-        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.CONFIGURATION,
+                nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
         modification.merge(LogicalDatastoreType.CONFIGURATION, path1, flow.build(), true);
         final CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
         Futures.addCallback(commitFuture, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(final Void aVoid) {
+            public void onSuccess(final Void notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
@@ -3331,7 +3269,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         Collection<String> testResults = null;
         if (testResults == null) {
-            testResults = new ArrayList<String>();
+            testResults = new ArrayList<>();
         }
 
         int numberOfSwtiches = 0;
@@ -3404,7 +3342,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
             }
             executor.shutdown();
             executor.awaitTermination(1, TimeUnit.SECONDS);
-        } catch (final Exception e) {
+        } catch (InterruptedException e) {
             ci.println("Exception:" + e.getMessage());
         }
     }
@@ -3420,11 +3358,12 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         Collection<String> testResults = null;
         int tableID = 0;
 
-        TestFlowThread(final int numberOfSwtiches, final int numberOfFlows, final CommandInterpreter ci, final int t, final int tableID) {
+        TestFlowThread(final int numberOfSwtiches, final int numberOfFlows, final CommandInterpreter ci,
+                final int threadNumber, final int tableID) {
             this.numberOfSwitches = numberOfSwtiches;
             this.numberOfFlows = numberOfFlows;
             this.ci = ci;
-            this.theadNumber = t;
+            this.theadNumber = threadNumber;
             this.tableID = tableID;
         }
 
@@ -3457,7 +3396,8 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
             final long endTime = System.currentTimeMillis();
             final long timeInSeconds = Math.round((endTime - startTime) / 1000);
             if (timeInSeconds > 0) {
-                ci.println("Total flows added in Thread:" + this.theadNumber + ": Flows/Sec::" + Math.round(totalNumberOfFlows / timeInSeconds));
+                ci.println("Total flows added in Thread:" + this.theadNumber + ": Flows/Sec::"
+                    + Math.round(totalNumberOfFlows / timeInSeconds));
             } else {
                 ci.println("Total flows added in Thread:" + this.theadNumber + ": Flows/Sec::" + totalNumberOfFlows);
             }
@@ -3469,13 +3409,14 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
      * usage testAllFlows <dp>
      * ex: _perfFlowTest 1
      */
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void _testAllFlows(final CommandInterpreter ci) {
         String dataPathID = ci.nextArgument();
         final int numberOfFlows = 82;
         if (dataPathID == null || dataPathID.trim().equals("")) {
             dataPathID = "1";
         }
-        ci.println("*     Test All Flows       *");
+        ci.println("*     Test All Flows    *");
         ci.println("*     dataPathID:::" + dataPathID + "");
         final String dataPath = "openflow:" + dataPathID;
         final String tableId = "0";
@@ -3486,7 +3427,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
             try {
                 tf = createTestFlow(tn, flowID, tableId);
                 writeFlow(ci, tf, tn);
-            } catch (final Exception e) {
+            } catch (RuntimeException e) {
                 ci.println("--Test Failed--Issue found while adding flow" + flow);
                 break;
             }
index 1464509c06d7af4566394f1f4eb83b9b8dcf87e6..25016c14c46a8cc6be9d30c08b26c09486e922cb 100644 (file)
@@ -44,7 +44,7 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
     private NotificationProviderService notificationProviderService;
 
     /**
-     * get data service
+     * Get data service.
      *
      * @return {@link #dataService}
      */
@@ -53,16 +53,14 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #dataService}
-     *
-     * @param dataService
+     * Set {@link #dataService}.
      */
     public void setDataService(final DataBroker dataService) {
         this.dataService = dataService;
     }
 
     /**
-     * get flow registration
+     * Get flow registration.
      *
      * @return {@link #flowRegistration}
      */
@@ -71,9 +69,7 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #flowRegistration}
-     *
-     * @param flowRegistration
+     * Set {@link #flowRegistration}.
      */
     public void setFlowRegistration(
             final RoutedRpcRegistration<SalFlowService> flowRegistration) {
@@ -81,7 +77,7 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * get notification service
+     * Get notification service.
      *
      * @return {@link #notificationProviderService}
      */
@@ -90,13 +86,10 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #notificationProviderService}
-     *
-     * @param notificationProviderService
+     * Set {@link #notificationProviderService}.
      */
-    public void setNotificationService(
-            final NotificationProviderService notificationProviderService) {
-        this.notificationProviderService = notificationProviderService;
+    public void setNotificationService(final NotificationProviderService service) {
+        this.notificationProviderService = service;
     }
 
     public void start() {
@@ -127,7 +120,7 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
      */
     @Override
     public Future<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
-        String plus = ("addFlow - " + input);
+        String plus = "addFlow - " + input;
         OpenflowpluginTestServiceProvider.LOG.info(plus);
         return null;
     }
@@ -143,7 +136,7 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
      */
     @Override
     public Future<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
-        String plus = ("removeFlow - " + input);
+        String plus = "removeFlow - " + input;
         OpenflowpluginTestServiceProvider.LOG.info(plus);
         return null;
     }
@@ -159,31 +152,27 @@ public class OpenflowpluginTestServiceProvider implements AutoCloseable,
      */
     @Override
     public Future<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
-        String plus = ("updateFlow - " + input);
+        String plus = "updateFlow - " + input;
         OpenflowpluginTestServiceProvider.LOG.info(plus);
         return null;
     }
 
-    /**
-     * @param ctx
-     * @return {@link ObjectRegistration}
-     */
     public ObjectRegistration<OpenflowpluginTestServiceProvider> register(
             final ProviderContext ctx) {
         RoutedRpcRegistration<SalFlowService> addRoutedRpcImplementation = ctx
-                .<SalFlowService> addRoutedRpcImplementation(
+                .<SalFlowService>addRoutedRpcImplementation(
                         SalFlowService.class, this);
 
         setFlowRegistration(addRoutedRpcImplementation);
 
         InstanceIdentifierBuilder<Nodes> builderII = InstanceIdentifier
-                .<Nodes> builder(Nodes.class);
+                .<Nodes>builder(Nodes.class);
 
         NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
         NodeKey nodeKey = new NodeKey(nodeId);
 
         InstanceIdentifierBuilder<Node> nodeIdentifier = builderII
-                .<Node, NodeKey> child(Node.class, nodeKey);
+                .<Node, NodeKey>child(Node.class, nodeKey);
 
         InstanceIdentifier<Node> instance = nodeIdentifier.build();
 
index fa0c167856f4ab5e4532b1327d1c53da210753d6..faa82b6b1cab8db7a691301e416f09033359661c 100644 (file)
@@ -28,7 +28,8 @@ public final class TestProviderTransactionUtil {
         throw new AssertionError("TestProviderTransactionUtil was not meant to be instantiated.");
     }
 
-    public static <T extends DataObject> T getDataObject(ReadTransaction readOnlyTransaction, InstanceIdentifier<T> identifier) {
+    public static <T extends DataObject> T getDataObject(ReadTransaction readOnlyTransaction,
+            InstanceIdentifier<T> identifier) {
         Optional<T> optionalData = null;
         try {
             optionalData = readOnlyTransaction.read(LogicalDatastoreType.OPERATIONAL, identifier).get();
@@ -40,5 +41,4 @@ public final class TestProviderTransactionUtil {
         }
         return null;
     }
-
 }