1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
\r
2 package org.opendaylight.openflowjava.protocol.impl.serialization;
\r
4 import io.netty.buffer.ByteBuf;
\r
6 import org.opendaylight.yangtools.yang.binding.DataObject;
\r
9 * @author michal.polkorab
\r
11 * @param <E> message type
\r
13 public interface OFSerializer <E extends DataObject> {
\r
16 * Transforms POJO/DTO into byte message (ByteBuf).
\r
17 * @param version version of used OF Protocol
\r
18 * @param out ByteBuf used for output
\r
19 * @param message message that will be transformed into ByteBuf
\r
21 public abstract void messageToBuffer(short version, ByteBuf out, E message);
\r
24 * Compute length of received message
\r
26 * @return computed length
\r
28 public abstract int computeLength(E message);
\r
32 * @return message code type
\r
34 public byte getMessageType();
\r