Fix checkstyle warnings 68/55068/1
authorJozef Bacigal <jozef.bacigal@pantheon.tech>
Thu, 2 Mar 2017 13:50:17 +0000 (14:50 +0100)
committerAnil Vishnoi <vishnoianil@gmail.com>
Fri, 14 Apr 2017 22:02:27 +0000 (22:02 +0000)
- org.opendaylight.openflowplugin.api.openflow.md.core

Change-Id: I98490f3a4054bcfdb1339ac490d432ece0539097
Signed-off-by: Jozef Bacigal <jozef.bacigal@pantheon.tech>
(cherry picked from commit b1723fcc1e90149c95159e553a1084a046cf25c3)

13 files changed:
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/AbstractModelDrivenSwitchRegistration.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/ConnectionConductor.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/ErrorHandler.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/HandshakeListener.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/HandshakeManager.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/IMDMessageTranslator.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/NotificationEnqueuer.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/NotificationQueueWrapper.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImpl.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/ConnectionConductorImpl.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/HandshakeManagerImpl.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/HandshakeManagerImplTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/MessageFactoryTest.java

index e710c608aa54f47f9260bf3c256367d2c0751c24..2672c08f210bfb1b572029a62f8289be47e2eebc 100644 (file)
@@ -9,8 +9,9 @@ package org.opendaylight.openflowplugin.api.openflow.md;
 
 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
 
-public abstract class AbstractModelDrivenSwitchRegistration extends AbstractObjectRegistration<ModelDrivenSwitch>
-    implements ModelDrivenSwitchRegistration {
+public abstract class AbstractModelDrivenSwitchRegistration
+        extends AbstractObjectRegistration<ModelDrivenSwitch>
+        implements ModelDrivenSwitchRegistration {
 
     protected AbstractModelDrivenSwitchRegistration(final ModelDrivenSwitch instance) {
         super(instance);
index e1ea51f563f2db37dec124dfd9ef0bd2c50fed86..6d517eb73ef90e3ab058827e0133537d48a577f2 100644 (file)
@@ -18,93 +18,94 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yangtools.yang.binding.DataObject;
 
 
-/**
- * @author mirehak
- */
 public interface ConnectionConductor {
 
-    /** distinguished connection states */
-    public enum CONDUCTOR_STATE {
-        /** initial phase of talking to switch */
+    /** distinguished connection states. */
+    @SuppressWarnings({"checkstyle:abbreviationaswordinname", "checkstyle:typename"})
+    enum CONDUCTOR_STATE {
+        /** initial phase of talking to switch. */
         HANDSHAKING,
-        /** standard phase - interacting with switch */
+        /** standard phase - interacting with switch. */
         WORKING,
-        /** connection is idle, waiting for echo reply from switch */
+        /** connection is idle, waiting for echo reply from switch. */
         TIMEOUTING,
-        /** talking to switch is over - resting in pieces */
+        /** talking to switch is over - resting in pieces. */
         RIP
     }
 
-    /** supported version ordered by height (highest version is at the beginning) */
-    List<Short> versionOrder = Lists.newArrayList((short) 0x04, (short) 0x01);
+    /** supported version ordered by height (highest version is at the beginning). */
+    List<Short> VERSION_ORDER = Lists.newArrayList((short) 0x04, (short) 0x01);
 
     /**
-     * initialize wiring around {@link ConnectionAdapter}
+     * initialize wiring around {@link ConnectionAdapter}.
      */
     void init();
 
     /**
-     * @return the negotiated version
+     * return the negotiated version.
      */
     Short getVersion();
 
     /**
-     * @return the state of conductor
+     * return the state of conductor.
      */
     CONDUCTOR_STATE getConductorState();
 
     /**
-     * @param conductorState
+     * Setter.
+     * @param conductorState state
      */
     void setConductorState(CONDUCTOR_STATE conductorState);
 
     /**
-     * terminates owned connection
+     * terminates owned connection.
      * @return future result of disconnect action
      */
     Future<Boolean> disconnect();
 
     /**
-     * assign corresponding {@link SessionContext} to this conductor (to handle disconnect caused by switch)
-     * @param context
+     * assign corresponding {@link SessionContext} to this conductor (to handle disconnect caused by switch).
+     * @param context session context
      */
     void setSessionContext(SessionContext context);
 
     /**
-     * assign corresponding {@link org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher} to this conductor
-     * to handle disconnect caused by switch. This involves auxiliary conductors only.
-     * @param auxiliaryKey
+     * assign corresponding {@link org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher}
+     * to this conductor to handle disconnect caused by switch. This involves auxiliary conductors only.
+     * @param auxiliaryKey key
      */
     void setConnectionCookie(SwitchConnectionDistinguisher auxiliaryKey);
 
     /**
-     * @return the sessionContext
+     * return the sessionContext.
      */
     SessionContext getSessionContext();
 
     /**
-     * @return the auxiliaryKey (null if this is a primary connection)
+     * return the auxiliaryKey (null if this is a primary connection).
      */
     SwitchConnectionDistinguisher getAuxiliaryKey();
 
     /**
-     * @return the connectionAdapter
+     * return the connectionAdapter.
      */
     ConnectionAdapter getConnectionAdapter();
 
     /**
-     * assign global queueKeeper
-     * @param queueKeeper
+     * assign global queueKeeper.
+     * @param queueKeeper keeper
      */
     void setQueueProcessor(QueueProcessor<OfHeader, DataObject> queueKeeper);
 
     /**
+     * Setter.
      * @param errorHandler for internal exception handling
      */
     void setErrorHandler(ErrorHandler errorHandler);
 
     /**
-     * @param conductorId
+     * Setter.
+     * @param conductorId id
      */
     void setId(int conductorId);
 
index 282dfc603cbe662cfda66f0faf275a35ef3e332c..6f930d7cc2a2b47f66e8985eed0964f51446cd07 100644 (file)
@@ -9,16 +9,13 @@ package org.opendaylight.openflowplugin.api.openflow.md.core;
 
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
 
-/**
- * @author mirehak
- *
- */
 public interface ErrorHandler {
 
     /**
-     * @param e cause
+     * Exception handler.
+     * @param throwable cause
      * @param sessionContext of source
      */
-    void handleException(Throwable e, SessionContext sessionContext);
+    void handleException(Throwable throwable, SessionContext sessionContext);
 
 }
index 5140977e4feadaa388c7f32bd68c134f9a5b5f8d..ae7bfc40849643acdee258e893b31d8a3ba8f840 100644 (file)
@@ -10,13 +10,10 @@ package org.opendaylight.openflowplugin.api.openflow.md.core;
 import org.opendaylight.openflowplugin.api.openflow.connection.HandshakeContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 
-/**
- * @author mirehak
- *
- */
 public interface HandshakeListener {
 
     /**
+     * Handshake successfull.
      * @param featureOutput obtained
      * @param version negotiated
      */
@@ -29,7 +26,8 @@ public interface HandshakeListener {
     void onHandshakeFailure();
 
     /**
-     * @param handshakeContext
+     * Setter.
+     * @param handshakeContext context
      */
     void setHandshakeContext(HandshakeContext handshakeContext);
 }
index 5b7b70ac3606801a651ca442242428cfef659807..80e2af6943b6af589cc9d5bd6af7af820cf476d1 100644 (file)
@@ -9,34 +9,34 @@ package org.opendaylight.openflowplugin.api.openflow.md.core;
 
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;
 
-/**
- * @author mirehak
- */
 public interface HandshakeManager {
 
     /**
-     * @return negotiated version
+     * return negotiated version.
      */
     Short getVersion();
 
     /**
+     * Setter.
      * @param errorHandler the errorHandler to set
      */
     void setErrorHandler(ErrorHandler errorHandler);
 
     /**
+     * Setter.
      * @param handshakeListener the handshakeListener to set
      */
     void setHandshakeListener(HandshakeListener handshakeListener);
 
     /**
-     * @param isBitmapNegotiationEnable
+     * should use negotiation bit map.
+     * @param isBitmapNegotiationEnable yes/no
      */
     void setUseVersionBitmap(boolean isBitmapNegotiationEnable);
 
     /**
+     * process current handshake step.
      * @param receivedHello message from device we need to act upon
-     * process current handshake step
      */
     void shake(HelloMessage receivedHello);
 }
index d91014e4943dbbbd3c5f2736e8c9e4a4ae7110bb..d03f20d1c9a2e496d4b6059f47aba231a5c3e39c 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.openflowplugin.api.openflow.md.core;
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
 
 /**
- * translates between messages
+ * translates between messages.
  * @param <I> source message type (IN)
  * @param <O> result message type (OUT)
  */
@@ -18,14 +18,9 @@ public interface IMDMessageTranslator<I, O> {
 
     /**
      * This method is called in order to translate message to MD-SAL or from MD-SAL.
-     *
-     * @param cookie
-     *            auxiliary connection identifier
-     * @param sc
-     *            The SessionContext which sent the OF message
-     * @param msg
-     *            The OF message
-     *
+     * @param cookie auxiliary connection identifier
+     * @param sc The SessionContext which sent the OF message
+     * @param msg The OF message
      * @return translated message
      */
     O translate(SwitchConnectionDistinguisher cookie, SessionContext sc, I msg);
index f312a41aa38e2e590477e80c7e98488cc1a1f08c..69a83e0e77f6102c0d0c5716b023147ba9acc285 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,14 +8,13 @@
 package org.opendaylight.openflowplugin.api.openflow.md.core;
 
 /**
- * provider of wrapped notification enqueue
+ * provider of wrapped notification enqueue.
  */
 public interface NotificationEnqueuer {
 
     /**
-     * enqueue given notification into standard message processing queue
-     * 
-     * @param notification
+     * enqueue given notification into standard message processing queue.
+     * @param notification notification
      */
     void enqueueNotification(NotificationQueueWrapper notification);
 
index 81d740fea96c6320730b575e73a45ec83c60489d..6d50a22859dd6276d288dfbe5661749b8036e3a6 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
@@ -12,24 +12,22 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 import org.opendaylight.yangtools.yang.binding.Notification;
 
-/**
- * 
- */
 public class NotificationQueueWrapper implements OfHeader {
-    
+
     private final Notification notification;
     private final Short version;
     private Long xid = -1L;
 
-    
+
     /**
-     * @param notification
-     * @param version 
+     * Notofication queue wrapper.
+     * @param notification notofication
+     * @param version version
      */
     public NotificationQueueWrapper(final Notification notification, final Short version) {
         Preconditions.checkArgument(notification != null, "wrapped notification must not be null");
         Preconditions.checkArgument(version != null, "message version of wrapped notification must not be null");
-        this.notification = notification; 
+        this.notification = notification;
         this.version = version;
     }
 
@@ -49,13 +47,14 @@ public class NotificationQueueWrapper implements OfHeader {
     }
 
     /**
-     * @return the notification
+     * return the notification.
      */
     public Notification getNotification() {
         return notification;
     }
 
     /**
+     * Setter.
      * @param xid the xid to set
      */
     public void setXid(Long xid) {
index f9bc7d4c603a947656a1a0c22a958ccb956ee534..d954f0b24e6f4a6bf502eae420090473460731c8 100644 (file)
@@ -82,8 +82,8 @@ public class ConnectionManagerImpl implements ConnectionManager {
     private HandshakeManager createHandshakeManager(final ConnectionAdapter connectionAdapter,
                                                     final HandshakeListener handshakeListener) {
         HandshakeManagerImpl handshakeManager = new HandshakeManagerImpl(connectionAdapter,
-                ConnectionConductor.versionOrder.get(0),
-                ConnectionConductor.versionOrder);
+                ConnectionConductor.VERSION_ORDER.get(0),
+                ConnectionConductor.VERSION_ORDER);
         handshakeManager.setUseVersionBitmap(BITMAP_NEGOTIATION_ENABLED);
         handshakeManager.setHandshakeListener(handshakeListener);
         handshakeManager.setErrorHandler(new ErrorHandlerSimpleImpl());
index 8c3f2901f01d8ec488eb5b68654d2380155953df..3b4d6bafbdef04a1e9514306b9ba149afc645bca 100644 (file)
@@ -124,8 +124,8 @@ public class ConnectionConductorImpl implements OpenflowProtocolListener,
         conductorState = CONDUCTOR_STATE.HANDSHAKING;
         firstHelloProcessed = false;
         handshakeManager = new HandshakeManagerImpl(connectionAdapter,
-                ConnectionConductor.versionOrder.get(0),
-                ConnectionConductor.versionOrder);
+                ConnectionConductor.VERSION_ORDER.get(0),
+                ConnectionConductor.VERSION_ORDER);
         handshakeManager.setUseVersionBitmap(isBitmapNegotiationEnable);
         handshakeManager.setHandshakeListener(this);
         portFeaturesUtils = PortFeaturesUtil.getInstance();
index 78997ef27cc79f90db13a7a2f1ab0fea9dc7bcf1..785a568b4ac38a65ec1a6cf80fcd556c57db9f10 100644 (file)
@@ -267,7 +267,7 @@ public class HandshakeManagerImpl implements HandshakeManager {
             for(Elements element : list) {
                 List<Boolean> bitmap = element.getVersionBitmap();
                 // check for version bitmap
-                for(short bitPos : ConnectionConductor.versionOrder) {
+                for(short bitPos : ConnectionConductor.VERSION_ORDER) {
                     // with all the version it should work.
                     if(bitmap.get(bitPos % Integer.SIZE)) {
                         supportedHighestVersion = bitPos;
index 2b1210bdfce2eefd5a01ffbd3edc818e6e3e6ed4..6db520e4b03c2c4e624513b3dd5689752b47cb40 100644 (file)
@@ -69,7 +69,7 @@ public class HandshakeManagerImplTest {
     @Before
     public void setUp() {
         handshakeManager = new HandshakeManagerImpl(adapter, OFConstants.OFP_VERSION_1_3,
-                ConnectionConductor.versionOrder);
+                ConnectionConductor.VERSION_ORDER);
         handshakeManager.setErrorHandler(errorHandler);
         handshakeManager.setHandshakeListener(handshakeListener);
         handshakeManager.setUseVersionBitmap(false);
index 0169cc71d9146cd555cf644ba98442d7b70486f2..773b161deb1b71e5d70561c1428b582b1159dde3 100644 (file)
@@ -15,15 +15,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.hello.Elements;
 
-/**
- * @author mirehak
- *
- */
 public class MessageFactoryTest {
 
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.openflow.md.core.MessageFactory#createHelloInputWoElements(java.lang.Short, java.lang.Long)}.
-     */
     @Test
     public void testCreateHelloInputWoElements() {
         short highestVersion = (short) 0x04;
@@ -35,9 +28,6 @@ public class MessageFactoryTest {
         Assert.assertNull(helloMsg.getElements());
     }
 
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.openflow.md.core.MessageFactory#createHelloInputWithElements(java.lang.Short, java.lang.Long, java.util.List)}.
-     */
     @Test
     public void testCreateHelloInputWithElements() {
         short highestVersion = (short) 0x04;
@@ -46,7 +36,7 @@ public class MessageFactoryTest {
                 false, true, false, false, true};
         
         HelloInput helloMsg = MessageFactory.createHelloInput(highestVersion, xid, 
-                ConnectionConductor.versionOrder);
+                ConnectionConductor.VERSION_ORDER);
         Assert.assertEquals(highestVersion, helloMsg.getVersion().shortValue());
         Assert.assertEquals(xid, helloMsg.getXid().longValue());
         Assert.assertEquals(1, helloMsg.getElements().size());