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.BarrierOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder;
* @author michal.polkorab
* @author timotej.kubas
*/
-public class BarrierReplyMessageFactory implements
- OFDeserializer<BarrierOutput> {
-
- private static BarrierReplyMessageFactory instance;
-
- private BarrierReplyMessageFactory() {
- // do nothing, just singleton
- }
-
- /**
- * @return singleton factory
- */
- public static synchronized BarrierReplyMessageFactory getInstance() {
- if (instance == null) {
- instance = new BarrierReplyMessageFactory();
- }
- return instance;
- }
+public class BarrierReplyMessageFactory implements OFDeserializer<BarrierOutput> {
@Override
- public BarrierOutput bufferToMessage(ByteBuf rawMessage, short version) {
+ public BarrierOutput deserialize(ByteBuf rawMessage) {
BarrierOutputBuilder builder = new BarrierOutputBuilder();
- builder.setVersion(version);
+ builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
builder.setXid(rawMessage.readUnsignedInt());
return builder.build();
}
-
}