Error code support for ErrorMessage
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / EncoderTable.java
index 903ea7ddf553afac1301acaeba2be0b0a6066d71..b26d4257e5f37a777b1d75ecb26676635b50cefb 100644 (file)
@@ -4,7 +4,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization;
 import java.util.HashMap;\r
 import java.util.Map;\r
 \r
-import org.opendaylight.openflowjava.protocol.impl.core.OFVersionDetector;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.BarrierInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.EchoInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.EchoReplyInputMessageFactory;\r
@@ -19,16 +18,11 @@ import org.opendaylight.openflowjava.protocol.impl.serialization.factories.Hello
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.MeterModInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.MultipartRequestInputFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10BarrierInputMessageFactory;\r
-import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10EchoInputMessageFactory;\r
-import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10EchoReplyInputMessageFactory;\r
-import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10FeaturesInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10FlowModInputMessageFactory;\r
-import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10GetConfigInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10HelloInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10PacketOutInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10PortModInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10QueueGetConfigInputMessageFactory;\r
-import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10SetConfigMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10StatsRequestInputFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10VendorInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.PacketOutInputMessageFactory;\r
@@ -37,6 +31,7 @@ import org.opendaylight.openflowjava.protocol.impl.serialization.factories.RoleR
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.SetAsyncInputMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.SetConfigMessageFactory;\r
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.TableModInputMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInput;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;\r
@@ -65,8 +60,8 @@ import org.opendaylight.yangtools.yang.binding.DataObject;
  */\r
 public class EncoderTable {\r
 \r
-    private static final short OF10 = OFVersionDetector.OF10_VERSION_ID;\r
-    private static final short OF13 = OFVersionDetector.OF13_VERSION_ID;\r
+    private static final short OF10 = EncodeConstants.OF10_VERSION_ID;\r
+    private static final short OF13 = EncodeConstants.OF13_VERSION_ID;\r
     private static EncoderTable instance;\r
     private Map<MessageTypeKey<?>, OFSerializer<?>> table;\r
 \r
@@ -92,18 +87,18 @@ public class EncoderTable {
     public void init() {\r
         table = new HashMap<>();\r
         table.put(new MessageTypeKey<>(OF10, BarrierInput.class), OF10BarrierInputMessageFactory.getInstance());\r
-        table.put(new MessageTypeKey<>(OF10, EchoInput.class), OF10EchoInputMessageFactory.getInstance());\r
-        table.put(new MessageTypeKey<>(OF10, EchoReplyInput.class), OF10EchoReplyInputMessageFactory.getInstance());\r
+        table.put(new MessageTypeKey<>(OF10, EchoInput.class), EchoInputMessageFactory.getInstance());\r
+        table.put(new MessageTypeKey<>(OF10, EchoReplyInput.class), EchoReplyInputMessageFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF10, ExperimenterInput.class), OF10VendorInputMessageFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF10, FlowModInput.class), OF10FlowModInputMessageFactory.getInstance());\r
-        table.put(new MessageTypeKey<>(OF10, GetConfigInput.class), OF10GetConfigInputMessageFactory.getInstance());\r
-        table.put(new MessageTypeKey<>(OF10, GetFeaturesInput.class), OF10FeaturesInputMessageFactory.getInstance());\r
+        table.put(new MessageTypeKey<>(OF10, GetConfigInput.class), GetConfigInputMessageFactory.getInstance());\r
+        table.put(new MessageTypeKey<>(OF10, GetFeaturesInput.class), GetFeaturesInputMessageFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF10, GetQueueConfigInput.class), OF10QueueGetConfigInputMessageFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF10, HelloInput.class), OF10HelloInputMessageFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF10, MultipartRequestInput.class), OF10StatsRequestInputFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF10, PacketOutInput.class), OF10PacketOutInputMessageFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF10, PortModInput.class), OF10PortModInputMessageFactory.getInstance());\r
-        table.put(new MessageTypeKey<>(OF10, SetConfigInput.class), OF10SetConfigMessageFactory.getInstance());\r
+        table.put(new MessageTypeKey<>(OF10, SetConfigInput.class), SetConfigMessageFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF13, BarrierInput.class), BarrierInputMessageFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF13, EchoInput.class), EchoInputMessageFactory.getInstance());\r
         table.put(new MessageTypeKey<>(OF13, EchoReplyInput.class), EchoReplyInputMessageFactory.getInstance());\r