Merge "Fix checkstyle - api.openflow.md.queue" into stable/boron
authorAnil Vishnoi <vishnoianil@gmail.com>
Fri, 14 Apr 2017 23:02:13 +0000 (23:02 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 14 Apr 2017 23:02:13 +0000 (23:02 +0000)
25 files changed:
applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/BulkOMaticUtils.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/AbstractModelDrivenSwitchRegistration.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/ModelDrivenSwitch.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/ModelDrivenSwitchRegistration.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-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/SwitchConnectionDistinguisher.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/TranslatorKey.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/sal/BuildSwitchFeatures.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/sal/NotificationComposer.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/session/IMessageDispatchService.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/session/SessionContext.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/session/SessionListener.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/session/SessionManager.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/core/session/SwitchSessionKeyOF.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 37f9899546ca769683ab814a9c20a2b44fca7ef6..8c80b15b03653c6d7c03a5e22f1d4d0e0ccaab3b 100644 (file)
@@ -28,9 +28,7 @@ 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.yangtools.yang.binding.InstanceIdentifier;
 
-public class BulkOMaticUtils {
-
-    private BulkOMaticUtils () { }
+public final class BulkOMaticUtils {
 
     public static final int DEFUALT_STATUS = FlowCounter.OperationStatus.INIT.status();
     public static final int DEFAULT_FLOW_COUNT = 0;
@@ -38,11 +36,14 @@ public class BulkOMaticUtils {
     public static final String DEFAULT_UNITS = "ns";
     public static final String DEVICE_TYPE_PREFIX = "openflow:";
 
+    private BulkOMaticUtils() {
+    }
+
     public static String ipIntToStr (int k) {
-        return new StringBuilder().append(((k >> 24) & 0xFF)).append(".")
-                .append(((k >> 16) & 0xFF)).append(".")
-                .append(((k >> 8) & 0xFF)).append(".")
-                .append((k & 0xFF)).append("/32").toString();
+        return new StringBuilder().append(k >> 24 & 0xFF).append(".")
+                .append(k >> 16 & 0xFF).append(".")
+                .append(k >> 8 & 0xFF).append(".")
+                .append(k & 0xFF).append("/32").toString();
     }
 
     public static Match getMatch(final Integer sourceIp){
@@ -87,7 +88,6 @@ public class BulkOMaticUtils {
                 .augmentation(FlowCapableNode.class)
                 .child(Table.class, new TableKey(tableId))
                 .build();
-
     }
 
     public static InstanceIdentifier<Flow> getFlowId(final InstanceIdentifier<Table> tablePath, final String flowId) {
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 90270c6326ffa39317e73571a727e1fb255c3fba..9a3ef94f50fb1967e3a1d9dae4f9139b80097cc0 100644 (file)
@@ -30,7 +30,7 @@ import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
- * interface concatenating all md-sal services provided by OF-switch
+ * interface concatenating all md-sal services provided by OF-switch.
  */
 public interface ModelDrivenSwitch
         extends
@@ -42,32 +42,34 @@ public interface ModelDrivenSwitch
         Identifiable<InstanceIdentifier<Node>> {
 
     /**
-     * @param rpcProviderRegistry
+     * Register.
+     * @param rpcProviderRegistry rpc provider
      * @return wrapped list of {service provider + path} registration couples
      */
     ModelDrivenSwitchRegistration register(RpcProviderRegistry rpcProviderRegistry);
 
     /**
+     * Getter.
      * @return id of encapsulated node (served by this impl)
      */
     NodeId getNodeId();
 
     /**
-     * returnes the session context associated with this model-driven switch
+     * returnes the session context associated with this model-driven switch.
      *
      * @return session context object
      */
     SessionContext getSessionContext();
 
     /**
-     * Returns whether this *instance* is entity owner or not
+     * Returns whether this *instance* is entity owner or not.
      * @return true if it's entity owner, else false.
      */
     boolean isEntityOwner();
 
     /**
-     * Set entity ownership satus of this switch in *this* instance
-     * @param isOwner
+     * Set entity ownership satus of this switch in *this* instance.
+     * @param isOwner is owner
      */
     void setEntityOwnership(boolean isOwner);
 
@@ -80,7 +82,6 @@ public interface ModelDrivenSwitch
     /**
      * Method send port/desc multipart request to the switch to fetch the initial details.
      */
-
-    public abstract void requestSwitchDetails();
+    void requestSwitchDetails();
 
 }
index 9da85b390165c2dd710c3059e10fa357e7bb88de..3c159c465c601ec5d2ac6d2678cc30794d2f5dc4 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
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 e4e63bc88748e4e2b1573c8396b634b4f399afd5..6537711af99f3545c3b087b8b2f354f902992b58 100644 (file)
@@ -8,12 +8,10 @@
 
 package org.opendaylight.openflowplugin.api.openflow.md.core;
 
-/**
- * @author mirehak
- */
 public interface SwitchConnectionDistinguisher {
 
     /**
+     * Getter.
      * @return encoded switch session identifier
      */
     long getCookie();
index f82da7a017efd3b4b6e6617d72596a42dd093b29..5de9f7b533fd0de5053c621766990ec9ee097e2a 100644 (file)
@@ -7,17 +7,15 @@
  */
 package org.opendaylight.openflowplugin.api.openflow.md.core;
 
-/**
- * @author mirehak
- */
 public class TranslatorKey {
 
-    private int version;
-    private String messageClass;
+    private final int version;
+    private final String messageClass;
 
     /**
-     * @param version
-     * @param messageClass
+     * Constructor.
+     * @param version version
+     * @param messageClass message class
      */
     public TranslatorKey(int version, String messageClass) {
         this.version = version;
@@ -53,10 +51,7 @@ public class TranslatorKey {
         } else if (!messageClass.equals(other.messageClass)) {
             return false;
         }
-        if (version != other.version) {
-            return false;
-        }
-        return true;
+        return version == other.version;
     }
 
 }
index ffb5ccdffafad45b7c05c5abdba067e8cd0452be..c6c7db85b4b4e5c41fd2e5f442384f6fc9121292 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -11,16 +11,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.fl
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 
 /**
- * Common interface for SwitchFeatures builders for different OF versions
- *
- * @author jsebin
- *
+ * Common interface for SwitchFeatures builders for different OF versions.
  */
 public interface BuildSwitchFeatures {
 
     /**
-     *
-     * @param features {@link org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput}
+     * Getter.
+     * @param features
+     * {@link org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput}
      * @return {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures}
      */
     SwitchFeatures build(GetFeaturesOutput features);
index 72c7d38a5507560c4c1a2c6f8a63bacac391a52c..f3c92c8e23774bdbcff2aff0a361413ea9be140e 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
@@ -11,11 +11,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.
 import org.opendaylight.yangtools.yang.binding.Notification;
 
 /**
+ * Notification composer.
  * @param <N> type of notification
  */
 public interface NotificationComposer<N extends Notification> {
-    
+
     /**
+     * Compose.
      * @param xid corresponding OF transaction id
      * @return notification instance
      */
index 5272498d74daaa53943bb4fa2bb1cc48c80f8fbd..8c4ab49d200bd70b115947ec295fa0458fc87880 100644 (file)
@@ -40,17 +40,14 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 
 /**
  * Message Dispatch Service to send the message to switch.
- *
- * @author AnilGujele
- *
  */
 public interface IMessageDispatchService {
 
-    public static final String CONNECTION_ERROR_MESSAGE = "Session for the cookie is invalid. Reason: "
-    + "the switch has been recently disconnected OR inventory provides outdated information.";
+    String CONNECTION_ERROR_MESSAGE = "Session for the cookie is invalid. Reason: "
+            + "the switch has been recently disconnected OR inventory provides outdated information.";
 
     /**
-     * send barrier message to switch
+     * send barrier message to switch.
      *
      * @param input
      *            - message
@@ -62,7 +59,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<BarrierOutput>> barrier(BarrierInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send experimenter message to switch
+     * send experimenter message to switch.
      *
      * @param input
      *            - message
@@ -74,7 +71,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<java.lang.Void>> experimenter(ExperimenterInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send flow modification message to switch
+     * send flow modification message to switch.
      *
      * @param input
      *            - message
@@ -86,7 +83,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<UpdateFlowOutput>> flowMod(FlowModInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send get async message to switch
+     * send get async message to switch.
      *
      * @param input
      *            - message
@@ -98,7 +95,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send get config message to switch
+     * send get config message to switch.
      *
      * @param input
      *            - message
@@ -110,7 +107,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<GetConfigOutput>> getConfig(GetConfigInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send get features message to switch
+     * send get features message to switch.
      *
      * @param input
      *            - message
@@ -122,7 +119,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<GetFeaturesOutput>> getFeatures(GetFeaturesInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send get queue config message to switch
+     * send get queue config message to switch.
      *
      * @param input
      *            - message
@@ -135,7 +132,7 @@ public interface IMessageDispatchService {
             SwitchConnectionDistinguisher cookie);
 
     /**
-     * send group modification message to switch
+     * send group modification message to switch.
      *
      * @param input
      *            - message
@@ -147,7 +144,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<UpdateGroupOutput>> groupMod(GroupModInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send meter modification message to switch
+     * send meter modification message to switch.
      *
      * @param input
      *            - message
@@ -159,7 +156,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<UpdateMeterOutput>> meterMod(MeterModInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send multipart request message to switch
+     * send multipart request message to switch.
      *
      * @param input
      *            - multipart request message
@@ -168,10 +165,12 @@ public interface IMessageDispatchService {
      *            any connection
      * @return - the future
      */
-    Future<RpcResult<java.lang.Void>> multipartRequest(MultipartRequestInput input, SwitchConnectionDistinguisher cookie);
+    Future<RpcResult<java.lang.Void>> multipartRequest(
+            MultipartRequestInput input,
+            SwitchConnectionDistinguisher cookie);
 
     /**
-     * send packet out message to switch
+     * send packet out message to switch.
      *
      * @param input
      *            - message
@@ -183,7 +182,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<java.lang.Void>> packetOut(PacketOutInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send port modification message to switch
+     * send port modification message to switch.
      *
      * @param input
      *            - message
@@ -195,7 +194,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<UpdatePortOutput>> portMod(PortModInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send role request message to switch
+     * send role request message to switch.
      *
      * @param input
      *            - message
@@ -207,7 +206,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<RoleRequestOutput>> roleRequest(RoleRequestInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send set async message to switch
+     * send set async message to switch.
      *
      * @param input
      *            - message
@@ -219,7 +218,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<java.lang.Void>> setAsync(SetAsyncInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send set config message to switch
+     * send set config message to switch.
      *
      * @param input
      *            - message
@@ -231,7 +230,7 @@ public interface IMessageDispatchService {
     Future<RpcResult<java.lang.Void>> setConfig(SetConfigInput input, SwitchConnectionDistinguisher cookie);
 
     /**
-     * send table modification message to switch
+     * send table modification message to switch.
      *
      * @param input
      *            - message
index 9de1dd7ad4dab0f7594603b54ed8b5ac5039871b..6413bc9801a2fa361847da689990ff3f8b7a40e9 100644 (file)
@@ -21,22 +21,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
 
-/**
- * @author mirehak
- */
 public interface SessionContext {
 
     /**
-     * @return primary connection wrapper
+     * return primary connection wrapper.
      */
     ConnectionConductor getPrimaryConductor();
 
     /**
-     * @return the features of corresponding switch
+     * return the features of corresponding switch.
      */
     GetFeaturesOutput getFeatures();
 
     /**
+     * Auxiliary connections.
      * @param auxiliaryKey key under which the auxiliary conductor is stored
      * @return list of auxiliary connection wrappers
      */
@@ -44,38 +42,40 @@ public interface SessionContext {
             SwitchConnectionDistinguisher auxiliaryKey);
 
     /**
-     * @return entries of all auxiliary connections wrapped in conductors in this session
+     * return entries of all auxiliary connections wrapped in conductors in this session.
      */
     Set<Entry<SwitchConnectionDistinguisher, ConnectionConductor>> getAuxiliaryConductors();
 
     /**
-     * register new auxiliary connection wrapped in {@link ConnectionConductor}
+     * register new auxiliary connection wrapped in {@link ConnectionConductor}.
      *
-     * @param auxiliaryKey
-     * @param conductor
+     * @param auxiliaryKey key
+     * @param conductor connection conductor
      */
     void addAuxiliaryConductor(SwitchConnectionDistinguisher auxiliaryKey,
                                ConnectionConductor conductor);
 
     /**
-     * @param connectionCookie
+     * Remove conductor.
+     * @param connectionCookie cookie
      * @return removed connectionConductor
      */
     ConnectionConductor removeAuxiliaryConductor(
             SwitchConnectionDistinguisher connectionCookie);
 
     /**
-     * @return true if this session is valid
+     * return true if this session is valid.
      */
     boolean isValid();
 
     /**
+     * Setter.
      * @param valid the valid to set
      */
     void setValid(boolean valid);
 
     /**
-     * @return the sessionKey
+     * return the sessionKey.
      */
     SwitchSessionKeyOF getSessionKey();
 
@@ -120,9 +120,9 @@ public interface SessionContext {
     Boolean getPortBandwidth(Long portNumber);
 
     /**
-     * Returns True if the port is enabled,
+     * Returns True if the port is enabled.
      *
-     * @param portNumber
+     * @param portNumber port number
      * @return True if the port is enabled
      */
     boolean isPortEnabled(long portNumber);
@@ -130,7 +130,7 @@ public interface SessionContext {
     /**
      * Returns True if the port is enabled.
      *
-     * @param port
+     * @param port port
      * @return True if the port is enabled
      */
     boolean isPortEnabled(PortGrouping port);
@@ -145,44 +145,51 @@ public interface SessionContext {
     // TODO:: add listeners here, manager will set them and conductor use them
 
     /**
-     * get message dispatch service to send the message to switch
+     * get message dispatch service to send the message to switch.
      *
      * @return the message service
      */
     IMessageDispatchService getMessageDispatchService();
 
     /**
-     * @return the unique xid for this session
+     * return the unique xid for this session.
+     * @return  xid
      */
     Long getNextXid();
 
     /**
+     * Setter.
      * @param registration provider composite registration
      */
     void setProviderRegistration(ModelDrivenSwitchRegistration registration);
 
     /**
-     * @return provider composite registration
+     * return provider composite registration.
+     * @return ModelDrivenSwitchRegistration
      */
     ModelDrivenSwitchRegistration getProviderRegistration();
 
     /**
-     * @return seed value for random operations
+     * return seed value for random operations.
+     * @return int
      */
     int getSeed();
 
     /**
-     * @return (wrapped) notification enqueue service - {@link NotificationQueueWrapper}
+     * return (wrapped) notification enqueue service - {@link NotificationQueueWrapper}.
+     * @return NotificationEnqueuer
      */
     NotificationEnqueuer getNotificationEnqueuer();
 
     /**
-     * @param roleOnDevice
+     * Setter.
+     * @param roleOnDevice role
      */
     void setRoleOnDevice(ControllerRole roleOnDevice);
 
     /**
-     * @return actual role
+     * return actual role.
+     * @return role
      */
     ControllerRole getRoleOnDevice();
 }
index ea77e9fe4bd80a87495d64c7d7bd792834a212f2..9795a8a669c0a8a1660a238ae164fc13042c0363 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -10,22 +10,23 @@ package org.opendaylight.openflowplugin.api.openflow.md.core.session;
 import java.util.EventListener;
 
 /**
- * listens on session changes
+ * listens on session changes.
  */
 public interface SessionListener extends EventListener {
 
     /**
-     * fired upon session added
-     * @param sessionKey
-     * @param context
+     * fired upon session added.
+     * @param sessionKey session key
+     * @param context context
      */
     void onSessionAdded(SwitchSessionKeyOF sessionKey, SessionContext context);
 
     /**
-     * fired upon session removed
-     * @param context
+     * fired upon session removed.
+     * @param context context
      */
     void onSessionRemoved(SessionContext context);
+
     void setRole(SessionContext context);
 
 }
index c7685e56ea2ca0fb0b7660dfe025e24989dcbcbd..89456c1b745904b067fe5162debb27ae93e5e38c 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -26,116 +26,131 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 
-/**
- * @author mirehak
- */
 public interface SessionManager extends AutoCloseable {
 
     /**
-     * @param sessionKey
+     * primary connection.
+     * @param sessionKey session key
      * @return corresponding conductor, holding {@link ConnectionAdapter} to
-     * primary connection
      */
-    public SessionContext getSessionContext(SwitchSessionKeyOF sessionKey);
+    SessionContext getSessionContext(SwitchSessionKeyOF sessionKey);
 
     /**
-     * disconnect all underlying {@link ConnectionAdapter}s and notify listeners
+     * disconnect all underlying {@link ConnectionAdapter}s and notify listeners.
      *
-     * @param sessionKey
+     * @param sessionKey session key
      */
-    public void invalidateSessionContext(SwitchSessionKeyOF sessionKey);
+    void invalidateSessionContext(SwitchSessionKeyOF sessionKey);
 
     /**
-     * register session context
+     * register session context.
      *
-     * @param sessionKey
-     * @param context
+     * @param sessionKey session key
+     * @param context context
      */
-    public void addSessionContext(SwitchSessionKeyOF sessionKey, SessionContext context);
-    public void setRole(SessionContext context);
+    void addSessionContext(SwitchSessionKeyOF sessionKey, SessionContext context);
+
+    void setRole(SessionContext context);
 
     /**
      * disconnect particular auxiliary {@link ConnectionAdapter}, identified by
-     * sessionKey and connectionCookie
+     * sessionKey and connectionCookie.
      *
-     * @param sessionKey
-     * @param connectionCookie
+     * @param sessionKey  session key
+     * @param connectionCookie cookie
      */
-    public void invalidateAuxiliary(SwitchSessionKeyOF sessionKey,
+    void invalidateAuxiliary(SwitchSessionKeyOF sessionKey,
                                     SwitchConnectionDistinguisher connectionCookie);
 
     /**
-     * @param connectionConductor
+     * Invalidate on disconnect.
+     * @param connectionConductor connection conductor.
      */
-    public void invalidateOnDisconnect(ConnectionConductor connectionConductor);
+    void invalidateOnDisconnect(ConnectionConductor connectionConductor);
 
     /**
-     * @param translatorMapping
+     * Setter.
+     * @param translatorMapping translators
      */
-    public void setTranslatorMapping(Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> translatorMapping);
+    void setTranslatorMapping(
+            Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> translatorMapping);
 
     /**
+     * Getter.
      * @return translator mapping
      */
-    public Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> getTranslatorMapping();
+    Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> getTranslatorMapping();
 
     /**
-     * @param notificationProviderService
+     * Setter.
+     * @param notificationProviderService notofication provider
      */
-    public void setNotificationProviderService(NotificationProviderService notificationProviderService);
+    void setNotificationProviderService(NotificationProviderService notificationProviderService);
 
     /**
+     * Getter.
      * @return notificationServiceProvider
      */
-    public DataBroker getDataBroker();
+    DataBroker getDataBroker();
 
     /**
-     * @param dataBroker
+     * Setter.
+     * @param dataBroker databroker
      */
-    public void setDataBroker(DataBroker dataBroker);
+    void setDataBroker(DataBroker dataBroker);
 
     /**
+     * Gatter.
      * @return notificationServiceProvider
      */
-    public NotificationProviderService getNotificationProviderService();
+    NotificationProviderService getNotificationProviderService();
 
     /**
-     * @param listener
+     * Session listener registration.
+     * @param listener listener
      * @return registration
      */
-    public ListenerRegistration<SessionListener> registerSessionListener(SessionListener listener);
+    ListenerRegistration<SessionListener> registerSessionListener(SessionListener listener);
 
     /**
+     * Getter.
      * @return popListener mapping, key=message type; value=collection of listeners
      */
-    public Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> getPopListenerMapping();
+    Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> getPopListenerMapping();
 
     /**
+     * Setter.
      * @param popListenerMapping the popListenerMapping to set
      */
-    void setPopListenerMapping(Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> popListenerMapping);
+    void setPopListenerMapping(
+            Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> popListenerMapping);
 
     /**
-     * @param rpcPoolDelegator
+     * Setter.
+     * @param rpcPoolDelegator rpc pool delegator
      */
     void setRpcPool(ListeningExecutorService rpcPoolDelegator);
 
     /**
+     * Getter.
      * @return the rpcPool instance
      */
     ListeningExecutorService getRpcPool();
 
     /**
-     * @param messageSpy
+     * Setter.
+     * @param messageSpy message spy
      */
     void setMessageSpy(MessageSpy<DataContainer> messageSpy);
 
     /**
+     * Getter.
      * @return the messageSpy
      */
     MessageSpy<DataContainer> getMessageSpy();
 
     /**
+     * Getter.
      * @return collection of current sessions
      */
     Collection<SessionContext> getAllSessions();
index dc50c0edb72e5f5f9e38050f9bab9e053b15d014..2a54db0841ce48c404f2cd795ad67c229a9da7ac 100644 (file)
@@ -10,28 +10,27 @@ package org.opendaylight.openflowplugin.api.openflow.md.core.session;
 
 import java.math.BigInteger;
 
-/**
- * @author mirehak
- */
 public class SwitchSessionKeyOF {
 
     private BigInteger datapathId;
 
     /**
-     * default ctor
+     * default ctor.
      */
     public SwitchSessionKeyOF() {
         // NOOP
     }
-    
+
     /**
+     * Setter.
      * @param datapathId the datapathId to set
      */
     public void setDatapathId(BigInteger datapathId) {
         this.datapathId = datapathId;
     }
-    
+
     /**
+     * Getter.
      * @return the datapathId
      */
     public byte[] getId() {
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());