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.common.types.rev130731.SwitchConfigFlag;
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutput;
9 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutputBuilder;
12 * @author michal.polkorab
13 * @author timotej.kubas
15 public class GetConfigReplyMessageFactory implements OFDeserializer<GetConfigOutput> {
17 private static GetConfigReplyMessageFactory instance;
19 private GetConfigReplyMessageFactory() {
24 * @return singleton factory
26 public static synchronized GetConfigReplyMessageFactory getInstance(){
28 instance = new GetConfigReplyMessageFactory();
34 public GetConfigOutput bufferToMessage(ByteBuf rawMessage, short version) {
35 GetConfigOutputBuilder builder = new GetConfigOutputBuilder();
36 builder.setVersion(version);
37 builder.setXid(rawMessage.readUnsignedInt());
38 builder.setFlags(SwitchConfigFlag.forValue(rawMessage.readUnsignedShort()));
39 builder.setMissSendLen(rawMessage.readUnsignedShort());
40 return builder.build();