Fix checkstyle violations in openflow-protocol-impl - part 5 86/67386/2
authorTom Pantelis <tompantelis@gmail.com>
Sat, 20 Jan 2018 22:11:16 +0000 (17:11 -0500)
committerTom Pantelis <tompantelis@gmail.com>
Sat, 27 Jan 2018 02:29:55 +0000 (21:29 -0500)
Many violations - more to follow

Change-Id: I19ea3b92b66c0121946e88699af5e7c2742ea54d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
49 files changed:
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoOutputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoReplyInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoRequestMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ErrorMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ExperimenterInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ExperimenterMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowRemovedMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetAsyncReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetAsyncRequestMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetConfigInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetConfigReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetFeaturesInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetFeaturesOutputFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartRequestInputFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10BarrierInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10BarrierReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FeaturesReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowRemovedMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10HelloInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketInMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketOutInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortStatusMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketInMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/QueueGetConfigReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleReplyMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetConfigMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/VendorInputMessageFactory.java

index 157dcc9a29c266d49db91991a6197680b8322ad4..d173cf836feb6ebc0fc80ba0ced2148e288d2707 100644 (file)
@@ -9,20 +9,20 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
 
 /**
- * Translates BarrierRequest messages
+ * Translates BarrierRequest messages.
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  */
 public class BarrierInputMessageFactory implements OFSerializer<BarrierInput> {
 
-    /** Code type of BarrierRequest message */
+    /** Code type of BarrierRequest message. */
     private static final byte MESSAGE_TYPE = 20;
 
     @Override
index 3212f7849de627f11ae759e0eed7299993bfee26..f18ff03e769fa713d1ce34e3aebe446e33287d62 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates BarrierReply messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class BarrierReplyMessageFactory implements OFSerializer<BarrierOutput> {
 
index 23c0c03168f57d5863f683e3ba13b44db2c71d66..974df4c9ad9bdc2630d8e1868d0d11850356836c 100644 (file)
@@ -9,20 +9,20 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInput;
 
 /**
- * Translates EchoRequest messages (both OpenFlow v1.0 and OpenFlow v1.3)
+ * Translates EchoInput messages (both OpenFlow v1.0 and OpenFlow v1.3).
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  */
 public class EchoInputMessageFactory implements OFSerializer<EchoInput> {
 
-    /** Code type of EchoRequest message */
+    /** Code type of EchoRequest message. */
     private static final byte MESSAGE_TYPE = 2;
 
     @Override
index 3a244db3fb3e94641c90b6f3cb27d6a3cdb1a837..6e6cb0302cede1d0cb92d8984279585172988534 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutput;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates EchoOutput messages (both OpenFlow v1.0 and OpenFlow v1.3).
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class EchoOutputMessageFactory implements OFSerializer<EchoOutput> {
 
index 8b9bf8ae70f11d1dfa9993c9d98689c1060254f2..c791300b7c30579c46281bad5e2f665bae7a6e09 100644 (file)
@@ -9,20 +9,20 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;
 
 /**
- * Translates EchoReply messages (both OpenFlow v1.0 and OpenFlow v1.3)
+ * Translates EchoReply messages (both OpenFlow v1.0 and OpenFlow v1.3).
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  */
-public class EchoReplyInputMessageFactory implements OFSerializer<EchoReplyInput>{
+public class EchoReplyInputMessageFactory implements OFSerializer<EchoReplyInput> {
 
-    /** Code type of EchoReply message */
+    /** Code type of EchoReply message. */
     private static final byte MESSAGE_TYPE = 3;
 
     @Override
index 9f5076cd20ca3d671447d5512492b590bf97e0cf..2298dcacabcf78ee7ae49554fa70e335c0f04676 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessage;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates EchoRequest messages (both OpenFlow v1.0 and OpenFlow v1.3).
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class EchoRequestMessageFactory implements OFSerializer<EchoRequestMessage> {
     private static final byte MESSAGE_TYPE = 2;
index 2eeaf76eeecaed8e9b1754be65064723da21d68f..161422e6f05dc7eddee99095bd066d9e50e5ee82 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates ErrorMessage messages (both OpenFlow v1.0 and OpenFlow v1.3).
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class ErrorMessageFactory implements OFSerializer<ErrorMessage> {
 
index b544a8ffd1ad2795e92ea3a39d521066402aa00c..fa39181747c3f3f55fb7502fe99f324546818f61 100644 (file)
@@ -19,7 +19,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
 
 /**
- * Translates Experimenter messages (both: symmetric request and single reply)
+ * Translates Experimenter messages (both: symmetric request and single reply).
+ *
  * @author michal.polkorab
  */
 public class ExperimenterInputMessageFactory implements OFSerializer<ExperimenterOfMessage>,
@@ -27,13 +28,13 @@ public class ExperimenterInputMessageFactory implements OFSerializer<Experimente
 
     private SerializerRegistry registry;
 
-    /** Code type of symmetric Experimenter message */
+    /** Code type of symmetric Experimenter message. */
     private static final byte MESSAGE_TYPE = 4;
 
     @Override
     public void serialize(ExperimenterOfMessage message, ByteBuf outBuffer) {
         long expId = message.getExperimenter().getValue();
-        OFSerializer<ExperimenterDataOfChoice> serializer = registry.getSerializer(
+        final OFSerializer<ExperimenterDataOfChoice> serializer = registry.getSerializer(
                 ExperimenterSerializerKeyFactory.createExperimenterMessageSerializerKey(
                         EncodeConstants.OF13_VERSION_ID, expId, message.getExpType().longValue()));
         ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
@@ -50,4 +51,4 @@ public class ExperimenterInputMessageFactory implements OFSerializer<Experimente
     public void injectSerializerRegistry(SerializerRegistry serializerRegistry) {
         this.registry = serializerRegistry;
     }
-}
\ No newline at end of file
+}
index dc6e66c81ef3d5075d3e63a9594a10ed0c36ebad..ddc06d5082091344c0700f5b64250d102ebeaec3 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates ExperimenterMessages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class ExperimenterMessageFactory implements OFSerializer<ExperimenterMessage> {
 
index 336b3d0347f192f5aac155145c4bd230a21908af..4a50e19c69795b2789a21dbc557de8b8d75fc6aa 100644 (file)
@@ -24,8 +24,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowMod;
 
 /**
- * Translates FlowMod messages.
- * OF protocol versions: 1.3.
+ * Translates FlowMod messages. OF protocol versions: 1.3.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -38,7 +38,7 @@ public class FlowModInputMessageFactory implements OFSerializer<FlowMod>, Serial
 
     @Override
     public void serialize(final FlowMod message, final ByteBuf outBuffer) {
-        int index = outBuffer.writerIndex();
+        final int index = outBuffer.writerIndex();
         ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
         outBuffer.writeLong(message.getCookie().longValue());
         outBuffer.writeLong(message.getCookieMask().longValue());
index 11c2948bbd3ae2ba7af3ea6c2dfbda7d57598183..3fc32b1e9bf5664d25233b8a03c09c2fa30d1bb0 100644 (file)
@@ -18,8 +18,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessage;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates FlowRemoved messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class FlowRemovedMessageFactory implements OFSerializer<FlowRemovedMessage>, SerializerRegistryInjector {
 
@@ -33,7 +34,7 @@ public class FlowRemovedMessageFactory implements OFSerializer<FlowRemovedMessag
 
     @Override
     public void serialize(FlowRemovedMessage message, ByteBuf outBuffer) {
-        int index = outBuffer.writerIndex();
+        final int index = outBuffer.writerIndex();
         ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
         outBuffer.writeLong(message.getCookie().longValue());
         outBuffer.writeShort(message.getPriority());
@@ -45,8 +46,8 @@ public class FlowRemovedMessageFactory implements OFSerializer<FlowRemovedMessag
         outBuffer.writeShort(message.getHardTimeout());
         outBuffer.writeLong(message.getPacketCount().longValue());
         outBuffer.writeLong(message.getByteCount().longValue());
-        OFSerializer<Match> matchSerializer = registry
-                .<Match, OFSerializer<Match>> getSerializer(new MessageTypeKey<>(message.getVersion(), Match.class));
+        OFSerializer<Match> matchSerializer = registry.<Match, OFSerializer<Match>>getSerializer(
+                new MessageTypeKey<>(message.getVersion(), Match.class));
         matchSerializer.serialize(message.getMatch(), outBuffer);
         ByteBufUtils.updateOFHeaderLength(outBuffer, index);
     }
index 4ba876c46186cf51a3bc70411b10b11df630f354..fe025cd15ae15c1e84fe5f15c1caa7b9797239ea 100644 (file)
@@ -23,10 +23,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PortStatusMask;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates GetAsyncOutput messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
-
 public class GetAsyncReplyMessageFactory implements OFSerializer<GetAsyncOutput> {
     private static final byte MESSAGE_TYPE = 27;
 
index dd6c922f4f918bdf9c37054c8dfb20c8c6b4123d..73418c1a49f6e2a1bdd97a1a6c073b0d257a2333 100644 (file)
@@ -9,14 +9,14 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInput;
 
 /**
- * Translates GetAsyncRequest messages
+ * Translates GetAsyncRequest messages.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
index 2686abc820481cdf4351afcc9643840a3cb96171..b06ab55aefd61dcbf9ae5738de0fd56ae36ecf24 100644 (file)
@@ -9,20 +9,20 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInput;
 
 /**
- * Translates GetConfigRequest messages (both OpenFlow v1.0 and OpenFlow v1.3)
+ * Translates GetConfigRequest messages (both OpenFlow v1.0 and OpenFlow v1.3).
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  */
 public class GetConfigInputMessageFactory implements OFSerializer<GetConfigInput> {
 
-    /** Code type of GetConfigRequest message */
+    /** Code type of GetConfigRequest message. */
     private static final byte MESSAGE_TYPE = 7;
 
     @Override
index d711b864edfb48713816985887a609fe2d59c7cc..3d9bc14fc7eea92850e086049e86e5c481b32d70 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutput;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates GetConfigOutput messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class GetConfigReplyMessageFactory implements OFSerializer<GetConfigOutput> {
 
index 515bb8a0204103126a94605a41dd4d96f5484201..967d737be84e9b4ee83007d2663b70a410dc5f41 100644 (file)
@@ -9,20 +9,20 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesInput;
 
 /**
- * Translates FeaturesRequest messages (both OpenFlow v1.0 and OpenFlow v1.3)
+ * Translates FeaturesRequest messages (both OpenFlow v1.0 and OpenFlow v1.3).
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  */
-public class GetFeaturesInputMessageFactory implements OFSerializer<GetFeaturesInput>{
+public class GetFeaturesInputMessageFactory implements OFSerializer<GetFeaturesInput> {
 
-    /** Code type of FeaturesRequest message */
+    /** Code type of FeaturesRequest message. */
     private static final byte MESSAGE_TYPE = 5;
 
     @Override
index 2a2fdc2a848503e9c010375ad4ab6eda702ebcea..6eb7c6f7bed9875fefd8f0e5f456269482fbb31c 100644 (file)
@@ -19,8 +19,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates FeaturesReply messages (both OpenFlow v1.0 and OpenFlow v1.3).
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class GetFeaturesOutputFactory implements OFSerializer<GetFeaturesOutput>, SerializerRegistryInjector {
 
index f8ac9f7c736978234aa777b46f5bd1e8a90277f1..e026f24ac71e44d2ca1ebba5ed6f0840ad7dc72a 100644 (file)
@@ -9,14 +9,14 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
 
 /**
- * Translates QueueGetConfigRequest messages
+ * Translates QueueGetConfigRequest messages.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
index 2a67c999e09dabdbaca8246d59414d5e486ae043..eda35364aa5be276c2139d5e39c12db8d91a48c6 100644 (file)
@@ -22,8 +22,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
 
 /**
- * Translates GroupMod messages.
- * OF protocol versions: 1.3.
+ * Translates GroupMod messages. OF protocol versions: 1.3.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -41,7 +41,7 @@ public class GroupModInputMessageFactory implements OFSerializer<GroupMod>, Seri
 
     @Override
     public void serialize(GroupMod message, ByteBuf outBuffer) {
-        int index = outBuffer.writerIndex();
+        final int index = outBuffer.writerIndex();
         ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
         if (isGroupAddModEnaled) {
             if (message.getCommand().equals(GroupModCommand.OFPGCADD)
@@ -63,7 +63,7 @@ public class GroupModInputMessageFactory implements OFSerializer<GroupMod>, Seri
     private void serializerBuckets(List<BucketsList> buckets, ByteBuf outBuffer) {
         if (buckets != null) {
             for (BucketsList currentBucket : buckets) {
-                int bucketLengthIndex = outBuffer.writerIndex();
+                final int bucketLengthIndex = outBuffer.writerIndex();
                 outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);
                 outBuffer.writeShort(currentBucket.getWeight().shortValue());
                 outBuffer.writeInt(currentBucket.getWatchPort().getValue().intValue());
index bd87e16f67e26a50717f0bbfd8eceaf690a3680d..3f267124e6db25927c439067ca8915d60f5c8bec 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -18,13 +17,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.hello.Elements;
 
 /**
- * Translates Hello messages
+ * Translates Hello messages.
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  */
-public class HelloInputMessageFactory implements OFSerializer<HelloInput>{
+public class HelloInputMessageFactory implements OFSerializer<HelloInput> {
 
-    /** Code type of Hello message */
+    /** Code type of Hello message. */
     private static final byte MESSAGE_TYPE = 0;
     private static final byte HELLO_ELEMENT_HEADER_SIZE = 4;
 
@@ -35,11 +35,11 @@ public class HelloInputMessageFactory implements OFSerializer<HelloInput>{
                 int elementStartIndex = output.writerIndex();
                 output.writeShort(currElement.getType().getIntValue());
                 if (currElement.getType().equals(HelloElementType.VERSIONBITMAP)) {
-                    int elementLengthIndex = output.writerIndex();
+                    final int elementLengthIndex = output.writerIndex();
                     output.writeShort(EncodeConstants.EMPTY_LENGTH);
                     versionBitmap = ByteBufUtils.fillBitMaskFromList(currElement.getVersionBitmap());
-                    for (int i = 0; i < versionBitmap.length; i++) {
-                        output.writeInt(versionBitmap[i]);
+                    for (int element : versionBitmap) {
+                        output.writeInt(element);
                     }
                     int length = output.writerIndex() - elementStartIndex;
                     int padding = length - versionBitmap.length * 4 - HELLO_ELEMENT_HEADER_SIZE;
index b3ccbbe70af3aeaa75df962a1a43ab0968a1e98f..64575e53ac357d55ca7d936c034440570a340ecb 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates Hello messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class HelloMessageFactory implements OFSerializer<HelloMessage> {
     private static final byte MESSAGE_TYPE = 0;
index 36eb64f5f2229fa5d02804e14255937c36f7b0f5..edf379aa2eafa43feb0b3fa9aea6f586bbf5880c 100755 (executable)
@@ -9,6 +9,7 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
+import java.util.List;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
@@ -31,10 +32,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
-
 /**
- * Translates MeterMod messages
+ * Translates MeterMod messages.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -85,7 +85,8 @@ public class MeterModInputMessageFactory implements OFSerializer<MeterModInput>,
                 } else if (meterBand instanceof MeterBandExperimenterCase) {
                     MeterBandExperimenterCase experimenterBandCase = (MeterBandExperimenterCase) meterBand;
                     MeterBandExperimenter experimenterBand = experimenterBandCase.getMeterBandExperimenter();
-                    ExperimenterIdMeterBand expIdMeterBand = experimenterBand.getAugmentation(ExperimenterIdMeterBand.class);
+                    ExperimenterIdMeterBand expIdMeterBand =
+                            experimenterBand.getAugmentation(ExperimenterIdMeterBand.class);
                     if (expIdMeterBand != null) {
                         long expId = expIdMeterBand.getExperimenter().getValue();
                         Class<? extends ExperimenterMeterBandSubType> meterBandSubType = expIdMeterBand.getSubType();
@@ -95,7 +96,8 @@ public class MeterModInputMessageFactory implements OFSerializer<MeterModInput>,
                                             EncodeConstants.OF13_VERSION_ID, expId, meterBandSubType));
                             serializer.serialize(experimenterBandCase, outBuffer);
                         } catch (final IllegalStateException e) {
-                            LOG.warn("Serializer for key: {} wasn't found, exception {}", ExperimenterSerializerKeyFactory.createMeterBandSerializerKey(
+                            LOG.warn("Serializer for key: {} wasn't found, exception {}",
+                                    ExperimenterSerializerKeyFactory.createMeterBandSerializerKey(
                                     EncodeConstants.OF13_VERSION_ID, expId, meterBandSubType), e);
                         }
                     }
@@ -115,4 +117,4 @@ public class MeterModInputMessageFactory implements OFSerializer<MeterModInput>,
     public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
         registry = serializerRegistry;
     }
-}
\ No newline at end of file
+}
index 4c5bd83a173854982606d89d9802a5879706522a..53dee4b3d6e915678e17aa2a15df5ce5e27d1f00 100644 (file)
@@ -100,8 +100,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates MultipartReply messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class MultipartReplyMessageFactory implements OFSerializer<MultipartReplyMessage>, SerializerRegistryInjector {
 
@@ -157,51 +158,53 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
         writeFlags(message.getFlags(), outBuffer);
         outBuffer.writeZero(PADDING);
         switch (message.getType()) {
-        case OFPMPDESC:
-            serializeDescBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPFLOW:
-            serializeFlowBody(message.getMultipartReplyBody(), outBuffer, message);
-            break;
-        case OFPMPAGGREGATE:
-            serializeAggregateBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPTABLE:
-            serializeTableBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPPORTSTATS:
-            serializePortStatsBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPQUEUE:
-            serializeQueueBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPGROUP:
-            serializeGroupBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPGROUPDESC:
-            serializeGroupDescBody(message.getMultipartReplyBody(), outBuffer, message);
-            break;
-        case OFPMPGROUPFEATURES:
-            serializeGroupFeaturesBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPMETER:
-            serializeMeterBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPMETERCONFIG:
-            serializeMeterConfigBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPMETERFEATURES:
-            serializeMeterFeaturesBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPTABLEFEATURES:
-            serializeTableFeaturesBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPPORTDESC:
-            serializePortDescBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPEXPERIMENTER:
-            serializeExperimenterBody(message.getMultipartReplyBody(), outBuffer);
-            break;
+            case OFPMPDESC:
+                serializeDescBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPFLOW:
+                serializeFlowBody(message.getMultipartReplyBody(), outBuffer, message);
+                break;
+            case OFPMPAGGREGATE:
+                serializeAggregateBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPTABLE:
+                serializeTableBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPPORTSTATS:
+                serializePortStatsBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPQUEUE:
+                serializeQueueBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPGROUP:
+                serializeGroupBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPGROUPDESC:
+                serializeGroupDescBody(message.getMultipartReplyBody(), outBuffer, message);
+                break;
+            case OFPMPGROUPFEATURES:
+                serializeGroupFeaturesBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPMETER:
+                serializeMeterBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPMETERCONFIG:
+                serializeMeterConfigBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPMETERFEATURES:
+                serializeMeterFeaturesBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPTABLEFEATURES:
+                serializeTableFeaturesBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPPORTDESC:
+                serializePortDescBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPEXPERIMENTER:
+                serializeExperimenterBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            default:
+                break;
         }
         ByteBufUtils.updateOFHeaderLength(outBuffer);
     }
@@ -236,54 +239,57 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
             tableFeatureBuff.writeInt(tableFeature.getMaxEntries().intValue());
             for (TableFeatureProperties tableFeatureProp : tableFeature.getTableFeatureProperties()) {
                 switch (tableFeatureProp.getType()) {
-                case OFPTFPTINSTRUCTIONS:
-                    writeInstructionRelatedTableProperty(tableFeatureBuff, tableFeatureProp, INSTRUCTIONS_CODE);
-                    break;
-                case OFPTFPTINSTRUCTIONSMISS:
-                    writeInstructionRelatedTableProperty(tableFeatureBuff, tableFeatureProp, INSTRUCTIONS_MISS_CODE);
-                    break;
-                case OFPTFPTNEXTTABLES:
-                    writeNextTableRelatedTableProperty(tableFeatureBuff, tableFeatureProp, NEXT_TABLE_CODE);
-                    break;
-                case OFPTFPTNEXTTABLESMISS:
-                    writeNextTableRelatedTableProperty(tableFeatureBuff, tableFeatureProp, NEXT_TABLE_MISS_CODE);
-                    break;
-                case OFPTFPTWRITEACTIONS:
-                    writeActionsRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WRITE_ACTIONS_CODE);
-                    break;
-                case OFPTFPTWRITEACTIONSMISS:
-                    writeActionsRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WRITE_ACTIONS_MISS_CODE);
-                    break;
-                case OFPTFPTAPPLYACTIONS:
-                    writeActionsRelatedTableProperty(tableFeatureBuff, tableFeatureProp, APPLY_ACTIONS_CODE);
-                    break;
-                case OFPTFPTAPPLYACTIONSMISS:
-                    writeActionsRelatedTableProperty(tableFeatureBuff, tableFeatureProp, APPLY_ACTIONS_MISS_CODE);
-                    break;
-                case OFPTFPTMATCH:
-                    writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, MATCH_CODE);
-                    break;
-                case OFPTFPTWILDCARDS:
-                    writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WILDCARDS_CODE);
-                    break;
-                case OFPTFPTWRITESETFIELD:
-                    writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WRITE_SETFIELD_CODE);
-                    break;
-                case OFPTFPTWRITESETFIELDMISS:
-                    writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WRITE_SETFIELD_MISS_CODE);
-                    break;
-                case OFPTFPTAPPLYSETFIELD:
-                    writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, APPLY_SETFIELD_CODE);
-                    break;
-                case OFPTFPTAPPLYSETFIELDMISS:
-                    writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, APPLY_SETFIELD_MISS_CODE);
-                    break;
-                case OFPTFPTEXPERIMENTER:
-                    writeExperimenterRelatedTableProperty(tableFeatureBuff, tableFeatureProp);
-                    break;
-                case OFPTFPTEXPERIMENTERMISS:
-                    writeExperimenterRelatedTableProperty(tableFeatureBuff, tableFeatureProp);
-                    break;
+                    case OFPTFPTINSTRUCTIONS:
+                        writeInstructionRelatedTableProperty(tableFeatureBuff, tableFeatureProp, INSTRUCTIONS_CODE);
+                        break;
+                    case OFPTFPTINSTRUCTIONSMISS:
+                        writeInstructionRelatedTableProperty(tableFeatureBuff, tableFeatureProp,
+                                INSTRUCTIONS_MISS_CODE);
+                        break;
+                    case OFPTFPTNEXTTABLES:
+                        writeNextTableRelatedTableProperty(tableFeatureBuff, tableFeatureProp, NEXT_TABLE_CODE);
+                        break;
+                    case OFPTFPTNEXTTABLESMISS:
+                        writeNextTableRelatedTableProperty(tableFeatureBuff, tableFeatureProp, NEXT_TABLE_MISS_CODE);
+                        break;
+                    case OFPTFPTWRITEACTIONS:
+                        writeActionsRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WRITE_ACTIONS_CODE);
+                        break;
+                    case OFPTFPTWRITEACTIONSMISS:
+                        writeActionsRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WRITE_ACTIONS_MISS_CODE);
+                        break;
+                    case OFPTFPTAPPLYACTIONS:
+                        writeActionsRelatedTableProperty(tableFeatureBuff, tableFeatureProp, APPLY_ACTIONS_CODE);
+                        break;
+                    case OFPTFPTAPPLYACTIONSMISS:
+                        writeActionsRelatedTableProperty(tableFeatureBuff, tableFeatureProp, APPLY_ACTIONS_MISS_CODE);
+                        break;
+                    case OFPTFPTMATCH:
+                        writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, MATCH_CODE);
+                        break;
+                    case OFPTFPTWILDCARDS:
+                        writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WILDCARDS_CODE);
+                        break;
+                    case OFPTFPTWRITESETFIELD:
+                        writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WRITE_SETFIELD_CODE);
+                        break;
+                    case OFPTFPTWRITESETFIELDMISS:
+                        writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, WRITE_SETFIELD_MISS_CODE);
+                        break;
+                    case OFPTFPTAPPLYSETFIELD:
+                        writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, APPLY_SETFIELD_CODE);
+                        break;
+                    case OFPTFPTAPPLYSETFIELDMISS:
+                        writeOxmRelatedTableProperty(tableFeatureBuff, tableFeatureProp, APPLY_SETFIELD_MISS_CODE);
+                        break;
+                    case OFPTFPTEXPERIMENTER:
+                        writeExperimenterRelatedTableProperty(tableFeatureBuff, tableFeatureProp);
+                        break;
+                    case OFPTFPTEXPERIMENTERMISS:
+                        writeExperimenterRelatedTableProperty(tableFeatureBuff, tableFeatureProp);
+                        break;
+                    default:
+                        break;
                 }
             }
             tableFeatureBuff.setShort(TABLE_FEATURES_LENGTH_INDEX, tableFeatureBuff.readableBytes());
@@ -300,7 +306,7 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
 
     private void writeOxmRelatedTableProperty(final ByteBuf output, final TableFeatureProperties property,
             final byte code) {
-        int startIndex = output.writerIndex();
+        final int startIndex = output.writerIndex();
         output.writeShort(code);
         int lengthIndex = output.writerIndex();
         output.writeShort(EncodeConstants.EMPTY_LENGTH);
@@ -317,7 +323,7 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
 
     private void writeActionsRelatedTableProperty(final ByteBuf output, final TableFeatureProperties property,
             final byte code) {
-        int startIndex = output.writerIndex();
+        final int startIndex = output.writerIndex();
         output.writeShort(code);
         int lengthIndex = output.writerIndex();
         output.writeShort(EncodeConstants.EMPTY_LENGTH);
@@ -333,7 +339,7 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
 
     private static void writeNextTableRelatedTableProperty(final ByteBuf output, final TableFeatureProperties property,
             final byte code) {
-        int startIndex = output.writerIndex();
+        final int startIndex = output.writerIndex();
         output.writeShort(code);
         int lengthIndex = output.writerIndex();
         output.writeShort(EncodeConstants.EMPTY_LENGTH);
@@ -351,7 +357,7 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
 
     private void writeInstructionRelatedTableProperty(final ByteBuf output, final TableFeatureProperties property,
             final byte code) {
-        int startIndex = output.writerIndex();
+        final int startIndex = output.writerIndex();
         output.writeShort(code);
         int lengthIndex = output.writerIndex();
         output.writeShort(EncodeConstants.EMPTY_LENGTH);
@@ -526,7 +532,8 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
         outBuffer.writeInt(bitmap);
     }
 
-    private void serializeGroupDescBody(final MultipartReplyBody body, final ByteBuf outBuffer, final MultipartReplyMessage message) {
+    private void serializeGroupDescBody(final MultipartReplyBody body, final ByteBuf outBuffer,
+            final MultipartReplyMessage message) {
         MultipartReplyGroupDescCase groupDescCase = (MultipartReplyGroupDescCase) body;
         MultipartReplyGroupDesc group = groupDescCase.getMultipartReplyGroupDesc();
         for (GroupDesc groupDesc : group.getGroupDesc()) {
@@ -633,7 +640,8 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
         outBuffer.writeZero(AGGREGATE_PADDING);
     }
 
-    private void serializeFlowBody(final MultipartReplyBody body, final ByteBuf outBuffer, final MultipartReplyMessage message) {
+    private void serializeFlowBody(final MultipartReplyBody body, final ByteBuf outBuffer,
+            final MultipartReplyMessage message) {
         MultipartReplyFlowCase flowCase = (MultipartReplyFlowCase) body;
         MultipartReplyFlow flow = flowCase.getMultipartReplyFlow();
         for (FlowStats flowStats : flow.getFlowStats()) {
@@ -650,7 +658,7 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
             flowStatsBuff.writeLong(flowStats.getCookie().longValue());
             flowStatsBuff.writeLong(flowStats.getPacketCount().longValue());
             flowStatsBuff.writeLong(flowStats.getByteCount().longValue());
-            OFSerializer<Match> matchSerializer = registry.<Match, OFSerializer<Match>> getSerializer(
+            OFSerializer<Match> matchSerializer = registry.<Match, OFSerializer<Match>>getSerializer(
                     new MessageTypeKey<>(message.getVersion(), Match.class));
             matchSerializer.serialize(flowStats.getMatch(), flowStatsBuff);
             ListSerializer.serializeList(flowStats.getInstruction(),
@@ -675,13 +683,13 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
         byte[] nameBytes = toWrite.getBytes();
         if (nameBytes.length < 256) {
             byte[] nameBytesPadding = new byte[256];
-            int i = 0;
+            int index = 0;
             for (byte b : nameBytes) {
-                nameBytesPadding[i] = b;
-                i++;
+                nameBytesPadding[index] = b;
+                index++;
             }
-            for (; i < 256; i++) {
-                nameBytesPadding[i] = 0x0;
+            for (; index < 256; index++) {
+                nameBytesPadding[index] = 0x0;
             }
             outBuffer.writeBytes(nameBytesPadding);
         } else {
@@ -693,13 +701,13 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
         byte[] nameBytes = toWrite.getBytes();
         if (nameBytes.length < 32) {
             byte[] nameBytesPadding = new byte[32];
-            int i = 0;
+            int index = 0;
             for (byte b : nameBytes) {
-                nameBytesPadding[i] = b;
-                i++;
+                nameBytesPadding[index] = b;
+                index++;
             }
-            for (; i < 32; i++) {
-                nameBytesPadding[i] = 0x0;
+            for (; index < 32; index++) {
+                nameBytesPadding[index] = 0x0;
             }
             outBuffer.writeBytes(nameBytesPadding);
         } else {
@@ -732,13 +740,13 @@ public class MultipartReplyMessageFactory implements OFSerializer<MultipartReply
         byte[] nameBytes = name.getBytes();
         if (nameBytes.length < 16) {
             byte[] nameBytesPadding = new byte[16];
-            int i = 0;
+            int index = 0;
             for (byte b : nameBytes) {
-                nameBytesPadding[i] = b;
-                i++;
+                nameBytesPadding[index] = b;
+                index++;
             }
-            for (; i < 16; i++) {
-                nameBytesPadding[i] = 0x0;
+            for (; index < 16; index++) {
+                nameBytesPadding[index] = 0x0;
             }
             outBuffer.writeBytes(nameBytesPadding);
         } else {
index daa208d530344982cdabd0f0342ad86ba12f3d82..acfdb157f02f02f0aad2853c8579b212cfc08da7 100644 (file)
@@ -65,6 +65,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 
 /**
  * Translates MultipartRequest messages.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -103,7 +104,7 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
         outBuffer.writeShort(createMultipartRequestFlagsBitmask(message.getFlags()));
         outBuffer.writeZero(PADDING_IN_MULTIPART_REQUEST_MESSAGE);
 
-        if (message.getMultipartRequestBody() instanceof MultipartRequestDescCase){
+        if (message.getMultipartRequestBody() instanceof MultipartRequestDescCase) {
             serializeDescBody();
         } else if (message.getMultipartRequestBody() instanceof MultipartRequestFlowCase) {
             serializeFlowBody(message.getMultipartRequestBody(), outBuffer);
@@ -132,7 +133,7 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
         } else if (message.getMultipartRequestBody() instanceof MultipartRequestPortDescCase) {
             serializePortDescBody();
         } else if (message.getMultipartRequestBody() instanceof MultipartRequestExperimenterCase) {
-               serializeExperimenterBody(message, outBuffer);
+            serializeExperimenterBody(message, outBuffer);
         }
         ByteBufUtils.updateOFHeaderLength(outBuffer);
     }
@@ -228,7 +229,8 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
         output.writeInt(queue.getQueueId().intValue());
     }
 
-    private static void serializeeGroupStatsBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
+    private static void serializeeGroupStatsBody(final MultipartRequestBody multipartRequestBody,
+            final ByteBuf output) {
         MultipartRequestGroupCase groupStatsCase = (MultipartRequestGroupCase) multipartRequestBody;
         MultipartRequestGroup groupStats = groupStatsCase.getMultipartRequestGroup();
         output.writeInt(groupStats.getGroupId().getValue().intValue());
@@ -242,7 +244,8 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
         output.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_BODY);
     }
 
-    private static void serializeMeterConfigBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
+    private static void serializeMeterConfigBody(final MultipartRequestBody multipartRequestBody,
+            final ByteBuf output) {
         MultipartRequestMeterConfigCase meterConfigCase = (MultipartRequestMeterConfigCase) multipartRequestBody;
         MultipartRequestMeterConfig meterConfig = meterConfigCase.getMultipartRequestMeterConfig();
         output.writeInt(meterConfig.getMeterId().getValue().intValue());
@@ -251,11 +254,12 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
 
     private void serializeTableFeaturesBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
         if (multipartRequestBody != null) {
-            MultipartRequestTableFeaturesCase tableFeaturesCase = (MultipartRequestTableFeaturesCase) multipartRequestBody;
+            MultipartRequestTableFeaturesCase tableFeaturesCase =
+                    (MultipartRequestTableFeaturesCase)multipartRequestBody;
             MultipartRequestTableFeatures tableFeatures = tableFeaturesCase.getMultipartRequestTableFeatures();
-            if(tableFeatures.getTableFeatures() != null) {
+            if (tableFeatures.getTableFeatures() != null) {
                 for (TableFeatures currTableFeature : tableFeatures.getTableFeatures()) {
-                    int tableFeatureLengthIndex = output.writerIndex();
+                    final int tableFeatureLengthIndex = output.writerIndex();
                     output.writeShort(EncodeConstants.EMPTY_LENGTH);
                     output.writeByte(currTableFeature.getTableId());
                     output.writeZero(PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY);
@@ -315,12 +319,12 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
 
     private void writeInstructionRelatedTableProperty(final ByteBuf output,
             final TableFeatureProperties property, final byte code) {
-        int startIndex = output.writerIndex();
+        final int startIndex = output.writerIndex();
         output.writeShort(code);
         int lengthIndex = output.writerIndex();
         output.writeShort(EncodeConstants.EMPTY_LENGTH);
-        List<Instruction> instructions = property.
-                getAugmentation(InstructionRelatedTableFeatureProperty.class).getInstruction();
+        List<Instruction> instructions = property.getAugmentation(
+                InstructionRelatedTableFeatureProperty.class).getInstruction();
         if (instructions != null) {
             TypeKeyMaker<Instruction> keyMaker = TypeKeyMakerFactory
                     .createInstructionKeyMaker(EncodeConstants.OF13_VERSION_ID);
@@ -333,12 +337,12 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
 
     private static void writeNextTableRelatedTableProperty(final ByteBuf output,
             final TableFeatureProperties property, final byte code) {
-        int startIndex = output.writerIndex();
+        final int startIndex = output.writerIndex();
         output.writeShort(code);
         int lengthIndex = output.writerIndex();
         output.writeShort(EncodeConstants.EMPTY_LENGTH);
-        List<NextTableIds> nextTableIds = property.
-                getAugmentation(NextTableRelatedTableFeatureProperty.class).getNextTableIds();
+        List<NextTableIds> nextTableIds = property.getAugmentation(
+                NextTableRelatedTableFeatureProperty.class).getNextTableIds();
         if (nextTableIds != null) {
             for (NextTableIds next : nextTableIds) {
                 output.writeByte(next.getTableId());
@@ -360,12 +364,11 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
 
     private void writeActionsRelatedTableProperty(final ByteBuf output,
             final TableFeatureProperties property, final byte code) {
-        int startIndex = output.writerIndex();
+        final int startIndex = output.writerIndex();
         output.writeShort(code);
         int lengthIndex = output.writerIndex();
         output.writeShort(EncodeConstants.EMPTY_LENGTH);
-        List<Action> actions = property.
-                getAugmentation(ActionRelatedTableFeatureProperty.class).getAction();
+        List<Action> actions = property.getAugmentation(ActionRelatedTableFeatureProperty.class).getAction();
         if (actions != null) {
             TypeKeyMaker<Action> keyMaker = TypeKeyMakerFactory
                     .createActionKeyMaker(EncodeConstants.OF13_VERSION_ID);
@@ -378,12 +381,11 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
 
     private void writeOxmRelatedTableProperty(final ByteBuf output,
             final TableFeatureProperties property, final byte code) {
-        int startIndex = output.writerIndex();
+        final int startIndex = output.writerIndex();
         output.writeShort(code);
         int lengthIndex = output.writerIndex();
         output.writeShort(EncodeConstants.EMPTY_LENGTH);
-        List<MatchEntry> entries = property.
-                getAugmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry();
+        List<MatchEntry> entries = property.getAugmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry();
         if (entries != null) {
             TypeKeyMaker<MatchEntry> keyMaker = TypeKeyMakerFactory
                     .createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
index cb1fce88d49e8c875af3d3740628b499cff75b34..c979a82c336400a5726e28d4e6037989f6978707 100644 (file)
@@ -9,14 +9,14 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
 
 /**
- * Translates BarrierRequest messages
+ * Translates BarrierRequest messages.
+ *
  * @author michal.polkorab
  */
 public class OF10BarrierInputMessageFactory implements OFSerializer<BarrierInput> {
index 2e317a1d4423b761b761f054a399294f208e2ed7..cbacb7df51864b2c94124065bf5a25d6484017fd 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates BarrierReply messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10BarrierReplyMessageFactory implements OFSerializer<BarrierOutput> {
 
index 0df774dfbabffc039b103ab07a2dee0b12d7ebfa..7bdff7562d1808d4b2e12bfef80e50d92aaae07b 100644 (file)
@@ -23,8 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.features.reply.PhyPort;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates FeaturesReply messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10FeaturesReplyMessageFactory implements OFSerializer<GetFeaturesOutput> {
 
@@ -125,18 +126,17 @@ public class OF10FeaturesReplyMessageFactory implements OFSerializer<GetFeatures
         byte[] nameBytes = name.getBytes();
         if (nameBytes.length < 16) {
             byte[] nameBytesPadding = new byte[16];
-            int i = 0;
+            int index = 0;
             for (byte b : nameBytes) {
-                nameBytesPadding[i] = b;
-                i++;
+                nameBytesPadding[index] = b;
+                index++;
             }
-            for (; i < 16; i++) {
-                nameBytesPadding[i] = 0x0;
+            for (; index < 16; index++) {
+                nameBytesPadding[index] = 0x0;
             }
             outBuffer.writeBytes(nameBytesPadding);
         } else {
             outBuffer.writeBytes(nameBytes);
         }
-
     }
 }
index 790f0df9eaed8520370a62e018cca75824ebb3f0..f658589894a3a5117fcc1097b1fb2b32ac937c18 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
@@ -25,7 +24,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
 
 /**
- * Translates FlowMod messages
+ * Translates FlowMod messages.
+ *
  * @author michal.polkorab
  */
 public class OF10FlowModInputMessageFactory implements OFSerializer<FlowModInput>, SerializerRegistryInjector {
index 71b5a28b1c4fdb34a8b808c1746727a99247be4c..81519758973a69b9b0237fa476349e03fa6026d0 100644 (file)
@@ -18,8 +18,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessage;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates FlowRemoved messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10FlowRemovedMessageFactory implements OFSerializer<FlowRemovedMessage>, SerializerRegistryInjector {
 
index 73a7b81c2cd01ad7e30cebb46f4831a4270d0ff1..4f2c8cfd44ee805990892fbee177394fe1ed5d83 100644 (file)
@@ -9,14 +9,14 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
 
 /**
- * Translates Hello messages
+ * Translates Hello messages.
+ *
  * @author michal.polkorab
  */
 public class OF10HelloInputMessageFactory implements OFSerializer<HelloInput> {
index d2a1812fddc0b4dba935fbb6fa7d2272aa972a0e..92905d55e84390621cac1b9d1b13770f396442e5 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessage;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates PacketIn messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10PacketInMessageFactory implements OFSerializer<PacketInMessage> {
     private static final byte MESSAGE_TYPE = 10;
index a83c1a6d4e0f71bde897bd1e231b9fcea9caaee1..c99418b81d9029d4d245f450eab8630a1367f7b9 100644 (file)
@@ -9,18 +9,18 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
 import org.opendaylight.openflowjava.protocol.impl.util.ListSerializer;
+import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
 
 /**
- * Translates PacketOut messages
+ * Translates PacketOut messages.
+ *
  * @author michal.polkorab
  */
 public class OF10PacketOutInputMessageFactory implements OFSerializer<PacketOutInput>, SerializerRegistryInjector {
index e4822a264a59c6b8264928c14fbc45178baa8a84..318d7f6c3266b6714c5cc5c598dde73c4d382bb4 100644 (file)
@@ -18,7 +18,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
 
 /**
- * Translates PortMod messages
+ * Translates PortMod messages.
+ *
  * @author michal.polkorab
  */
 public class OF10PortModInputMessageFactory implements OFSerializer<PortModInput> {
@@ -38,10 +39,6 @@ public class OF10PortModInputMessageFactory implements OFSerializer<PortModInput
         ByteBufUtils.updateOFHeaderLength(outBuffer);
     }
 
-    /**
-     * @param config
-     * @return port config bitmask
-     */
     private static int createPortConfigBitmask(final PortConfigV10 config) {
         return ByteBufUtils.fillBitMask(0,
                 config.isPortDown(),
index 25d0f5ceaf129f39330ae9d363a0f5efbe57abb6..a9d1560b6fb0aa8c673dd7a54f5dd4dce334cb25 100644 (file)
@@ -20,8 +20,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates PortStatus messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10PortStatusMessageFactory implements OFSerializer<PortStatusMessage> {
 
@@ -94,13 +95,13 @@ public class OF10PortStatusMessageFactory implements OFSerializer<PortStatusMess
         byte[] nameBytes = name.getBytes();
         if (nameBytes.length < 16) {
             byte[] nameBytesPadding = new byte[16];
-            int i = 0;
+            int index = 0;
             for (byte b : nameBytes) {
-                nameBytesPadding[i] = b;
-                i++;
+                nameBytesPadding[index] = b;
+                index++;
             }
-            for (; i < 16; i++) {
-                nameBytesPadding[i] = 0x0;
+            for (; index < 16; index++) {
+                nameBytesPadding[index] = 0x0;
             }
             outBuffer.writeBytes(nameBytesPadding);
         } else {
index 7afa4bc25c9058bad96f2d972d8f385a203d42d0..a49813ed9244015b2e6e8036c4c5b8d25b23ed38 100644 (file)
@@ -9,14 +9,14 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
 
 /**
- * Translates QueueGetConfigRequest messages
+ * Translates QueueGetConfigRequest messages.
+ *
  * @author michal.polkorab
  */
 public class OF10QueueGetConfigInputMessageFactory implements OFSerializer<GetQueueConfigInput> {
index 8504447939122a461897eecb55fe189d11866055..db0d2e3d308ca2ee5866aa92307c872e9bffff0b 100644 (file)
@@ -19,8 +19,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueueProperty;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates QueueGetConfigReply messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10QueueGetConfigReplyMessageFactory implements OFSerializer<GetQueueConfigOutput> {
 
index 268f7f0621c3fe4f172759224f41ac19c3a0042c..68f8e31a4b79c0395e931835f1f1f576e31fee14 100644 (file)
@@ -46,8 +46,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table._case.multipart.reply.table.TableStats;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates StatsReply messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10StatsReplyMessageFactory implements OFSerializer<MultipartReplyMessage>, SerializerRegistryInjector {
 
@@ -75,29 +76,29 @@ public class OF10StatsReplyMessageFactory implements OFSerializer<MultipartReply
         outBuffer.writeShort(message.getType().getIntValue());
         writeFlags(message.getFlags(), outBuffer);
         switch (message.getType()) {
-        case OFPMPDESC:
-            serializeDescBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPFLOW:
-            serializeFlowBody(message.getMultipartReplyBody(), outBuffer, message);
-            break;
-        case OFPMPAGGREGATE:
-            serializeAggregateBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPTABLE:
-            serializeTableBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPPORTSTATS:
-            serializePortStatsBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPQUEUE:
-            serializeQueueBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        case OFPMPEXPERIMENTER:
-            serializeExperimenterBody(message.getMultipartReplyBody(), outBuffer);
-            break;
-        default:
-            break;
+            case OFPMPDESC:
+                serializeDescBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPFLOW:
+                serializeFlowBody(message.getMultipartReplyBody(), outBuffer, message);
+                break;
+            case OFPMPAGGREGATE:
+                serializeAggregateBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPTABLE:
+                serializeTableBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPPORTSTATS:
+                serializePortStatsBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPQUEUE:
+                serializeQueueBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            case OFPMPEXPERIMENTER:
+                serializeExperimenterBody(message.getMultipartReplyBody(), outBuffer);
+                break;
+            default:
+                break;
         }
         ByteBufUtils.updateOFHeaderLength(outBuffer);
     }
@@ -232,13 +233,13 @@ public class OF10StatsReplyMessageFactory implements OFSerializer<MultipartReply
         byte[] nameBytes = toWrite.getBytes();
         if (nameBytes.length < 256) {
             byte[] nameBytesPadding = new byte[256];
-            int i = 0;
+            int index = 0;
             for (byte b : nameBytes) {
-                nameBytesPadding[i] = b;
-                i++;
+                nameBytesPadding[index] = b;
+                index++;
             }
-            for (; i < 256; i++) {
-                nameBytesPadding[i] = 0x0;
+            for (; index < 256; index++) {
+                nameBytesPadding[index] = 0x0;
             }
             outBuffer.writeBytes(nameBytesPadding);
         } else {
@@ -250,13 +251,13 @@ public class OF10StatsReplyMessageFactory implements OFSerializer<MultipartReply
         byte[] nameBytes = toWrite.getBytes();
         if (nameBytes.length < 16) {
             byte[] nameBytesPadding = new byte[16];
-            int i = 0;
+            int index = 0;
             for (byte b : nameBytes) {
-                nameBytesPadding[i] = b;
-                i++;
+                nameBytesPadding[index] = b;
+                index++;
             }
-            for (; i < 16; i++) {
-                nameBytesPadding[i] = 0x0;
+            for (; index < 16; index++) {
+                nameBytesPadding[index] = 0x0;
             }
             outBuffer.writeBytes(nameBytesPadding);
         } else {
@@ -268,13 +269,13 @@ public class OF10StatsReplyMessageFactory implements OFSerializer<MultipartReply
         byte[] nameBytes = toWrite.getBytes();
         if (nameBytes.length < 32) {
             byte[] nameBytesPadding = new byte[32];
-            int i = 0;
+            int index = 0;
             for (byte b : nameBytes) {
-                nameBytesPadding[i] = b;
-                i++;
+                nameBytesPadding[index] = b;
+                index++;
             }
-            for (; i < 32; i++) {
-                nameBytesPadding[i] = 0x0;
+            for (; index < 32; index++) {
+                nameBytesPadding[index] = 0x0;
             }
             outBuffer.writeBytes(nameBytesPadding);
         } else {
index fa01f6d8fc3784c87ae9e56a40386baea018c4b8..991139e8e5d72810e2b13d828a26eb89ab866b07 100644 (file)
@@ -35,7 +35,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue;
 
 /**
- * Translates StatsRequest messages
+ * Translates StatsRequest messages.
+ *
  * @author michal.polkorab
  */
 public class OF10StatsRequestInputFactory implements OFSerializer<MultipartRequestInput>, SerializerRegistryInjector {
@@ -75,18 +76,10 @@ public class OF10StatsRequestInputFactory implements OFSerializer<MultipartReque
         return ByteBufUtils.fillBitMask(0, flags.isOFPMPFREQMORE());
     }
 
-    /**
-     * @param multipartRequestBody
-     * @param output
-     */
     private void serializeDescBody() {
         // The body of MultiPartRequestDesc is empty
     }
 
-    /**
-     * @param multipartRequestBody
-     * @param out
-     */
     private void serializeTableBody() {
      // The body of MultiPartTable is empty
     }
@@ -147,4 +140,4 @@ public class OF10StatsRequestInputFactory implements OFSerializer<MultipartReque
     public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
         this.registry = serializerRegistry;
     }
-}
\ No newline at end of file
+}
index 713e8edaabf0bf38b36e91b351f2a5f965b730b2..929253a017c8623fa0a8be5c5fa226d2e1510acd 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessage;
 
 /**
- * Translates PacketIn messages
+ * Translates PacketIn messages.
  */
 public class PacketInMessageFactory implements OFSerializer<PacketInMessage>, SerializerRegistryInjector {
     private static final byte PADDING = 2;
@@ -33,8 +33,8 @@ public class PacketInMessageFactory implements OFSerializer<PacketInMessage>, Se
         outBuffer.writeByte(message.getReason().getIntValue());
         outBuffer.writeByte(message.getTableId().getValue().byteValue());
         outBuffer.writeLong(message.getCookie().longValue());
-        OFSerializer<Match> matchSerializer = registry
-                .<Match, OFSerializer<Match>> getSerializer(new MessageTypeKey<>(message.getVersion(), Match.class));
+        OFSerializer<Match> matchSerializer = registry.<Match, OFSerializer<Match>>getSerializer(
+                new MessageTypeKey<>(message.getVersion(), Match.class));
         matchSerializer.serialize(message.getMatch(), outBuffer);
         outBuffer.writeZero(PADDING);
 
@@ -51,4 +51,4 @@ public class PacketInMessageFactory implements OFSerializer<PacketInMessage>, Se
         this.registry = serializerRegistry;
     }
 
-}
\ No newline at end of file
+}
index f229424d8645252beee0236199759bf6a553fb39..afa9a66fec52d4f92de368959f2979c8f90fa28d 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
@@ -20,13 +19,14 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
 
 /**
- * Translates PacketOut messages
+ * Translates PacketOut messages.
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  */
 public class PacketOutInputMessageFactory implements OFSerializer<PacketOutInput>, SerializerRegistryInjector {
 
-    /** Code type of PacketOut message */
+    /** Code type of PacketOut message. */
     private static final byte MESSAGE_TYPE = 13;
     private static final byte PADDING_IN_PACKET_OUT_MESSAGE = 6;
     private SerializerRegistry registry;
@@ -36,7 +36,7 @@ public class PacketOutInputMessageFactory implements OFSerializer<PacketOutInput
         ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
         outBuffer.writeInt(message.getBufferId().intValue());
         outBuffer.writeInt(message.getInPort().getValue().intValue());
-        int actionsLengthIndex = outBuffer.writerIndex();
+        final int actionsLengthIndex = outBuffer.writerIndex();
         outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);
         outBuffer.writeZero(PADDING_IN_PACKET_OUT_MESSAGE);
         int actionsStartIndex = outBuffer.writerIndex();
index 03c39887f8e786d5365d37b30848183bd0384613..2fa0ad3b8091eced34f2f876892fde1513b8d50d 100644 (file)
@@ -20,8 +20,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortMod;
 
 /**
- * Translates PortMod messages.
- * OF protocol versions: 1.3.
+ * Translates PortMod messages. OF protocol versions: 1.3.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -33,7 +33,7 @@ public class PortModInputMessageFactory implements OFSerializer<PortMod> {
 
     @Override
     public void serialize(final PortMod message, final ByteBuf outBuffer) {
-        int index = outBuffer.writerIndex();
+        final int index = outBuffer.writerIndex();
         ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
         outBuffer.writeInt(message.getPortNo().getValue().intValue());
         outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_01);
@@ -46,20 +46,14 @@ public class PortModInputMessageFactory implements OFSerializer<PortMod> {
         ByteBufUtils.updateOFHeaderLength(outBuffer, index);
     }
 
-    /**
-     * @param config
-     * @return port config bitmask
-     */
     private static int createPortConfigBitmask(final PortConfig config) {
-        int configBitmask = 0;
         Map<Integer, Boolean> portConfigMap = new HashMap<>();
         portConfigMap.put(0, config.isPortDown());
         portConfigMap.put(2, config.isNoRecv());
         portConfigMap.put(5, config.isNoFwd());
         portConfigMap.put(6, config.isNoPacketIn());
 
-        configBitmask = ByteBufUtils.fillBitMaskFromMap(portConfigMap);
-        return configBitmask;
+        return ByteBufUtils.fillBitMaskFromMap(portConfigMap);
     }
 
     private static int createPortFeaturesBitmask(final PortFeatures feature) {
index 1a4e6fc81071dc1a50f6069703ef69523f3bd197..c2ff2de2ae27b315491c2ae1f8f1be24918d9586 100644 (file)
@@ -20,8 +20,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates PortStatus messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class PortStatusMessageFactory implements OFSerializer<PortStatusMessage> {
 
@@ -65,13 +66,13 @@ public class PortStatusMessageFactory implements OFSerializer<PortStatusMessage>
         byte[] nameBytes = name.getBytes();
         if (nameBytes.length < 16) {
             byte[] nameBytesPadding = new byte[16];
-            int i = 0;
+            int index = 0;
             for (byte b : nameBytes) {
-                nameBytesPadding[i] = b;
-                i++;
+                nameBytesPadding[index] = b;
+                index++;
             }
-            for (; i < 16; i++) {
-                nameBytesPadding[i] = 0x0;
+            for (; index < 16; index++) {
+                nameBytesPadding[index] = 0x0;
             }
             outBuffer.writeBytes(nameBytesPadding);
         } else {
index 3a15aaccde9e17ec5d07ebc845ad07d67d48b31f..ba98bcf8640739bb97ed3b0bdce1f2ca8bd23613 100644 (file)
@@ -19,8 +19,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueueProperty;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates GetQueueConfig messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class QueueGetConfigReplyMessageFactory implements OFSerializer<GetQueueConfigOutput> {
 
@@ -51,18 +52,18 @@ public class QueueGetConfigReplyMessageFactory implements OFSerializer<GetQueueC
                 propertyBuff.writeShort(EncodeConstants.EMPTY_LENGTH);
                 propertyBuff.writeZero(PROPERTY_HEADER_PADDING);
                 switch (property.getProperty()) {
-                case OFPQTMINRATE:
-                    serializeRateBody(property.getAugmentation(RateQueueProperty.class), propertyBuff);
-                    break;
-                case OFPQTMAXRATE:
-                    serializeRateBody(property.getAugmentation(RateQueueProperty.class), propertyBuff);
-                    break;
-                case OFPQTEXPERIMENTER:
-                    serializeExperimenterBody(property.getAugmentation(ExperimenterIdQueueProperty.class),
-                            propertyBuff);
-                    break;
-                default:
-                    break;
+                    case OFPQTMINRATE:
+                        serializeRateBody(property.getAugmentation(RateQueueProperty.class), propertyBuff);
+                        break;
+                    case OFPQTMAXRATE:
+                        serializeRateBody(property.getAugmentation(RateQueueProperty.class), propertyBuff);
+                        break;
+                    case OFPQTEXPERIMENTER:
+                        serializeExperimenterBody(property.getAugmentation(ExperimenterIdQueueProperty.class),
+                                propertyBuff);
+                        break;
+                    default:
+                        break;
                 }
                 propertyBuff.setShort(PROPERTY_LENGTH_INDEX, propertyBuff.readableBytes());
                 queueBuff.writeBytes(propertyBuff);
index 0225665cd36b5b0dfc620a36b046e2bfba1d99da..bac3772d9ccaa1105bd25cd8ff9c538fc1d6986a 100644 (file)
@@ -14,8 +14,9 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Translates RoleReply messages.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class RoleReplyMessageFactory implements OFSerializer<RoleRequestOutput> {
     private static final byte MESSAGE_TYPE = 25;
@@ -29,5 +30,4 @@ public class RoleReplyMessageFactory implements OFSerializer<RoleRequestOutput>
         outBuffer.writeLong(message.getGenerationId().longValue());
         ByteBufUtils.updateOFHeaderLength(outBuffer);
     }
-
 }
index ce7d0cbf61826e0270aa3cbc046355433e0384e5..2c835b150a01647ca383fdbf741e598b1d4489c2 100644 (file)
@@ -9,20 +9,20 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput;
 
 /**
- * Translates RoleRequest messages
+ * Translates RoleRequest messages.
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  */
 public class RoleRequestInputMessageFactory implements OFSerializer<RoleRequestInput> {
 
-    /** Code type of RoleRequest message */
+    /** Code type of RoleRequest message. */
     private static final byte MESSAGE_TYPE = 24;
     private static final byte PADDING_IN_ROLE_REQUEST_MESSAGE = 4;
 
@@ -34,5 +34,4 @@ public class RoleRequestInputMessageFactory implements OFSerializer<RoleRequestI
         outBuffer.writeLong(message.getGenerationId().longValue());
         ByteBufUtils.updateOFHeaderLength(outBuffer);
     }
-
-}
\ No newline at end of file
+}
index 65cb07e33ff880fce4edf468555dfa7102f10424..2c471b04bcc3b95355a8a637a7845587c17b3371 100644 (file)
@@ -9,14 +9,12 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowRemovedReason;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortReason;
@@ -26,7 +24,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PortStatusMask;
 
 /**
- * Translates SetAsync messages
+ * Translates SetAsync messages.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -106,5 +105,4 @@ public class SetAsyncInputMessageFactory implements OFSerializer<SetAsyncInput>
             }
         }
     }
-
-}
\ No newline at end of file
+}
index 84c69ab8868e3d0dd8c7a7a0cdf5646139092298..a55e26f5d1d4877646b4ad54954054734b5d1589 100644 (file)
@@ -9,20 +9,20 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;
 
 /**
- * Translates SetConfig messages (both OpenFlow v1.0 and OpenFlow v1.3)
+ * Translates SetConfig messages (both OpenFlow v1.0 and OpenFlow v1.3).
+ *
  * @author michal.polkorab
  * @author timotej.kubas
  */
 public class SetConfigMessageFactory implements OFSerializer<SetConfigInput> {
 
-    /** Code type of SetConfig message */
+    /** Code type of SetConfig message. */
     private static final byte MESSAGE_TYPE = 9;
 
     @Override
@@ -32,5 +32,4 @@ public class SetConfigMessageFactory implements OFSerializer<SetConfigInput> {
         outBuffer.writeShort(message.getMissSendLen());
         ByteBufUtils.updateOFHeaderLength(outBuffer);
     }
-
 }
index 1f5e38a239a52d40f0f917c766c1366101ba431b..ba8b7a8bcb7f7888f11a3f2e0022cc285593a9b3 100644 (file)
@@ -9,15 +9,15 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;
 
 /**
- * Translates TableMod messages
+ * Translates TableMod messages.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -34,12 +34,7 @@ public class TableModInputMessageFactory implements OFSerializer<TableModInput>
         ByteBufUtils.updateOFHeaderLength(outBuffer);
     }
 
-    /**
-     * @param tableConfig
-     * @return port config bitmask
-     */
     private static int createConfigBitmask(final TableConfig tableConfig) {
         return ByteBufUtils.fillBitMask(3, tableConfig.isOFPTCDEPRECATEDMASK());
     }
-
 }
index 2cc7148e944c3bf5279517d09d8ba65b87cda21f..d1faee4422c97d11cff32d6a2140619f34c3e81f 100644 (file)
@@ -18,7 +18,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
 
 /**
- * Translates Vendor messages (OF-1.0 limited version - skipping experimenter type)
+ * Translates Vendor messages (OF-1.0 limited version - skipping experimenter type).
+ *
  * @author michal.polkorab
  */
 public class VendorInputMessageFactory implements OFSerializer<ExperimenterOfMessage>,
@@ -43,4 +44,4 @@ public class VendorInputMessageFactory implements OFSerializer<ExperimenterOfMes
     public void injectSerializerRegistry(SerializerRegistry serializerRegistry) {
         this.registry = serializerRegistry;
     }
-}
\ No newline at end of file
+}