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 * Uniform interface for serializing factories
\r
10 * @author michal.polkorab
\r
11 * @author timotej.kubas
\r
12 * @param <E> message type
\r
14 public interface OFSerializer <E extends DataObject> {
\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
22 public abstract void messageToBuffer(short version, ByteBuf out, E message);
\r
25 * Compute length of received message
\r
27 * @return computed length
\r
29 public abstract int computeLength(E message);
\r
32 * @return message code type
\r
34 public byte getMessageType();
\r