Extensibility support (deserialization part)
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / GetAsyncReplyMessageFactory.java
index 2f482cf74efc74c7ff05a51a620c40efea81d7ea..c6156a0b530969a2db203b18eb0e90f8eee3d88c 100644 (file)
@@ -13,7 +13,8 @@ import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
 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;
@@ -32,28 +33,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
  * @author michal.polkorab
  */
 public class GetAsyncReplyMessageFactory implements OFDeserializer<GetAsyncOutput> {
-    
-    private static GetAsyncReplyMessageFactory instance;
+
     private static final byte SEPARATE_ROLES = 2;
-    
-    private GetAsyncReplyMessageFactory() {
-        // singleton
-    }
 
-    /**
-     * @return singleton factory
-     */
-    public static synchronized GetAsyncReplyMessageFactory getInstance() {
-        if (instance == null) {
-            instance = new GetAsyncReplyMessageFactory();
-        }
-        return instance;
-    }
-    
     @Override
-    public GetAsyncOutput bufferToMessage(ByteBuf rawMessage, short version) {
+    public GetAsyncOutput deserialize(ByteBuf rawMessage) {
         GetAsyncOutputBuilder builder = new GetAsyncOutputBuilder();
-        builder.setVersion(version);
+        builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
         builder.setXid(rawMessage.readUnsignedInt());
         builder.setPacketInMask(decodePacketInMask(rawMessage));
         builder.setPortStatusMask(decodePortStatusMask(rawMessage));