Javadoc update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / OFSerializer.java
1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
2 package org.opendaylight.openflowjava.protocol.impl.serialization;\r
3 \r
4 import io.netty.buffer.ByteBuf;\r
5 \r
6 import org.opendaylight.yangtools.yang.binding.DataObject;\r
7 \r
8 /**\r
9  * Uniform interface for serializing factories\r
10  * @author michal.polkorab\r
11  * @author timotej.kubas\r
12  * @param <E> message type\r
13  */\r
14 public interface OFSerializer <E extends DataObject> {\r
15 \r
16     /**\r
17      * Transforms POJO/DTO into byte message (ByteBuf).\r
18      * @param version version of used OF Protocol\r
19      * @param out ByteBuf used for output\r
20      * @param message message that will be transformed into ByteBuf\r
21      */\r
22     public abstract void messageToBuffer(short version, ByteBuf out, E message);\r
23     \r
24     /**\r
25      * Compute length of received message\r
26      * @param message \r
27      * @return computed length\r
28      */\r
29     public abstract int computeLength(E message);\r
30     \r
31     /**\r
32      * @return message code type\r
33      */\r
34     public byte getMessageType();\r
35 }\r