Merge "add basic lib - plugin communication"
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / openflow / lib / deserialization / OfDeserializer.java
1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
2 package org.openflow.lib.deserialization;\r
3 \r
4 import org.opendaylight.yangtools.yang.binding.DataObject;\r
5 \r
6 import io.netty.buffer.ByteBuf;\r
7 \r
8 /**\r
9  * @author michal.polkorab\r
10  *\r
11  * @param <E> message code type\r
12  */\r
13 public interface OfDeserializer<E extends DataObject> {\r
14 \r
15     /**\r
16      * Transforms byte message into POJO/DTO (of type E).\r
17      * Assumes that input ByteBuf's readerIndex is pointing on length in OpenFlow header\r
18      * \r
19      * @param rawMessage message as bytes in ByteBuf\r
20      * @param version version of used OF Protocol\r
21      * @return HelloMessage as DataObject\r
22      */\r
23     public abstract E bufferToMessage(ByteBuf rawMessage, short version);\r
24 \r
25 }\r