2 * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowjava.protocol.impl.core;
11 import com.google.common.base.Preconditions;
12 import io.netty.buffer.ByteBuf;
15 * Wraps received messages (includes version).
17 * @author michal.polkorab
19 public class VersionMessageWrapper {
20 private final short version;
21 private final ByteBuf messageBuffer;
26 * @param version version decoded in {@link OFVersionDetector}
27 * @param messageBuffer message received from {@link OFFrameDecoder}
29 public VersionMessageWrapper(final short version, final ByteBuf messageBuffer) {
30 this.version = version;
31 this.messageBuffer = Preconditions.checkNotNull(messageBuffer);
35 * Returns the version version decoded in {@link OFVersionDetector}.
37 * @return the version version decoded in {@link OFVersionDetector}
39 public short getVersion() {
44 * Returns the messageBuffer message received from {@link OFFrameDecoder}.
46 * @return the messageBuffer message received from {@link OFFrameDecoder}
48 public ByteBuf getMessageBuffer() {