import io.netty.buffer.ByteBuf;
-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.protocol.rev130731.EchoOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutputBuilder;
*/
public class EchoReplyMessageFactory implements OFDeserializer<EchoOutput> {
- private static EchoReplyMessageFactory instance;
-
- private EchoReplyMessageFactory() {
- // do nothing, just singleton
- }
-
- /**
- * @return singleton factory
- */
- public static synchronized EchoReplyMessageFactory getInstance() {
- if (instance == null) {
- instance = new EchoReplyMessageFactory();
- }
- return instance;
- }
-
@Override
- public EchoOutput bufferToMessage(ByteBuf rawMessage, short version) {
+ public EchoOutput deserialize(ByteBuf rawMessage) {
EchoOutputBuilder builder = new EchoOutputBuilder();
- builder.setVersion(version);
+ builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
builder.setXid(rawMessage.readUnsignedInt());
int remainingBytes = rawMessage.readableBytes();
if (remainingBytes > 0) {