Changed output directory for generated classes
[openflowjava.git] / openflow-protocol-ext / src / main / java / org / opendaylight / openflowjava / protocol / ext / serialization / OF13ExperimenterInputMessageFactory.java
1 /*\r
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 \r
9 package org.opendaylight.openflowjava.protocol.ext.serialization;\r
10 \r
11 import io.netty.buffer.ByteBuf;\r
12 \r
13 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;\r
14 import org.opendaylight.openflowjava.protocol.ext.util.ExtBufferUtils;\r
15 import org.opendaylight.openflowjava.protocol.ext.util.ExtConstants;\r
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;\r
17 \r
18 /**\r
19  * Translates Experimenter messages\r
20  * @author michal.polkorab\r
21  * @author timotej.kubas\r
22  */\r
23 public class OF13ExperimenterInputMessageFactory implements OFSerializer<ExperimenterInput>{\r
24 \r
25     /** Code type of Experimenter message */\r
26     public static final byte MESSAGE_TYPE = 4;\r
27 \r
28     @Override\r
29     public void serialize(ExperimenterInput message, ByteBuf outBuffer) {\r
30         ExtBufferUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, ExtConstants.EMPTY_LENGTH);\r
31         outBuffer.writeInt(message.getExperimenter().intValue());\r
32         outBuffer.writeInt(message.getExpType().intValue());\r
33         byte[] data = message.getData();\r
34         if (data != null) {\r
35             outBuffer.writeBytes(data);\r
36         }\r
37         ExtBufferUtils.updateOFHeaderLength(outBuffer);\r
38     }\r
39 \r
40 }