1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
2 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
4 import io.netty.buffer.ByteBuf;
6 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
7 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder;
11 * @author michal.polkorab
12 * @author timotej.kubas
15 public class BarrierReplyMessageFactory implements
16 OFDeserializer<BarrierOutput> {
18 private static BarrierReplyMessageFactory instance;
20 private BarrierReplyMessageFactory() {
21 // do nothing, just singleton
25 * @return singleton factory
27 public static synchronized BarrierReplyMessageFactory getInstance() {
28 if (instance == null) {
29 instance = new BarrierReplyMessageFactory();
35 public BarrierOutput bufferToMessage(ByteBuf rawMessage, short version) {
36 BarrierOutputBuilder builder = new BarrierOutputBuilder();
37 builder.setVersion(version);
38 builder.setXid(rawMessage.readUnsignedInt());
39 return builder.build();