1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
\r
2 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
\r
4 import io.netty.buffer.ByteBuf;
\r
6 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
\r
7 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag;
\r
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutput;
\r
9 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutputBuilder;
\r
12 * @author michal.polkorab
\r
15 public class OF10GetConfigReplyMessageFactory implements OFDeserializer<GetConfigOutput> {
\r
17 private static OF10GetConfigReplyMessageFactory instance;
\r
19 private OF10GetConfigReplyMessageFactory() {
\r
24 * @return singleton factory
\r
26 public static synchronized OF10GetConfigReplyMessageFactory getInstance(){
\r
27 if(instance == null){
\r
28 instance = new OF10GetConfigReplyMessageFactory();
\r
34 public GetConfigOutput bufferToMessage(ByteBuf rawMessage, short version) {
\r
35 GetConfigOutputBuilder builder = new GetConfigOutputBuilder();
\r
36 builder.setVersion(version);
\r
37 builder.setXid(rawMessage.readUnsignedInt());
\r
38 builder.setFlags(SwitchConfigFlag.forValue(rawMessage.readUnsignedShort()));
\r
39 builder.setMissSendLen(rawMessage.readUnsignedShort());
\r
40 return builder.build();
\r