1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
2 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
4 import io.netty.buffer.ByteBuf;
6 import org.opendaylight.openflowjava.protocol.impl.serialization.OFSerializer;
7 import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
11 * @author timotej.kubas
12 * @author michal.polkorab
14 public class GetQueueConfigInputMessageFactory implements OFSerializer<GetQueueConfigInput> {
16 private static final byte MESSAGE_TYPE = 22;
17 private static final byte PADDING_IN_GET_QUEUE_CONFIG_MESSAGE = 4;
18 private static final int MESSAGE_LENGTH = 16;
20 private static GetQueueConfigInputMessageFactory instance;
23 private GetQueueConfigInputMessageFactory() {
29 * @return singleton factory
31 public static synchronized GetQueueConfigInputMessageFactory getInstance(){
33 instance = new GetQueueConfigInputMessageFactory();
39 public void messageToBuffer(short version, ByteBuf out, GetQueueConfigInput message){
40 ByteBufUtils.writeOFHeader(instance, message, out);
41 out.writeInt(message.getPort().getValue().intValue());
42 ByteBufUtils.padBuffer(PADDING_IN_GET_QUEUE_CONFIG_MESSAGE, out);
46 public int computeLength(GetQueueConfigInput message){
47 return MESSAGE_LENGTH;
51 public byte getMessageType() {