X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fdeserialization%2Ffactories%2FFeaturesReplyMessageFactory.java;h=ad08dc12623cc92d3fd52f1c9f4b97763712e51e;hb=7424f6fec6016081265f98bdd9c5b17f671c0d88;hp=388a6e772c609d0b8616f14c88d1d306241efeec;hpb=b463f7cdcac1941603dcc16057f948966bfa4091;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FeaturesReplyMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FeaturesReplyMessageFactory.java index 388a6e77..ad08dc12 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FeaturesReplyMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FeaturesReplyMessageFactory.java @@ -12,7 +12,7 @@ import io.netty.buffer.ByteBuf; import java.math.BigInteger; -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.Capabilities; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput; @@ -24,29 +24,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 * @author timotej.kubas */ public class FeaturesReplyMessageFactory implements OFDeserializer{ - + private static final byte PADDING_IN_FEATURES_REPLY_HEADER = 2; - - private static FeaturesReplyMessageFactory instance; - private FeaturesReplyMessageFactory() { - // do nothing, just singleton - } - - /** - * @return singleton factory - */ - public static synchronized FeaturesReplyMessageFactory getInstance() { - if (instance == null) { - instance = new FeaturesReplyMessageFactory(); - } - return instance; - } - @Override - public GetFeaturesOutput bufferToMessage(ByteBuf rawMessage, short version) { + public GetFeaturesOutput deserialize(ByteBuf rawMessage) { GetFeaturesOutputBuilder builder = new GetFeaturesOutputBuilder(); - builder.setVersion(version); + builder.setVersion((short) EncodeConstants.OF13_VERSION_ID); builder.setXid(rawMessage.readUnsignedInt()); byte[] datapathId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES]; rawMessage.readBytes(datapathId);