X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fserialization%2Ffactories%2FBarrierInputMessageFactory.java;h=def001427fed9ba7e16e284a6a45a4db3409ac82;hb=0d942e8fb70b2c21f97eea3ed8904336ab5c54a4;hp=83f77ba685507b77a5f207905b267d36deaeace9;hpb=d634962cad3b3adc75d452598493044ea7190c47;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactory.java index 83f77ba6..def00142 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactory.java @@ -1,49 +1,57 @@ -/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */ -package org.opendaylight.openflowjava.protocol.impl.serialization.factories; - -import io.netty.buffer.ByteBuf; - -import org.opendaylight.openflowjava.protocol.impl.serialization.OFSerializer; -import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput; - -/** - * @author michal.polkorab - * - */ -public class BarrierInputMessageFactory implements OFSerializer { - - /** Code type of BarrierRequest message */ - public static final byte MESSAGE_TYPE = 20; - private static BarrierInputMessageFactory instance; - private static final int MESSAGE_LENGTH = 8; - - private BarrierInputMessageFactory() { - // do nothing, just singleton - } - - /** - * @return singleton factory - */ - public static synchronized BarrierInputMessageFactory getInstance() { - if (instance == null) { - instance = new BarrierInputMessageFactory(); - } - return instance; - } - - @Override - public void messageToBuffer(short version, ByteBuf out, BarrierInput message) { - ByteBufUtils.writeOFHeader(instance, message, out); - } - - @Override - public int computeLength() { - return MESSAGE_LENGTH; - } - - @Override - public byte getMessageType() { - return MESSAGE_TYPE; - } -} +/* + * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.openflowjava.protocol.impl.serialization.factories; + +import io.netty.buffer.ByteBuf; + +import org.opendaylight.openflowjava.protocol.impl.serialization.OFSerializer; +import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput; + +/** + * Translates BarrierRequest messages + * @author michal.polkorab + * @author timotej.kubas + */ +public class BarrierInputMessageFactory implements OFSerializer { + + /** Code type of BarrierRequest message */ + public static final byte MESSAGE_TYPE = 20; + private static BarrierInputMessageFactory instance; + private static final int MESSAGE_LENGTH = 8; + + private BarrierInputMessageFactory() { + // do nothing, just singleton + } + + /** + * @return singleton factory + */ + public static synchronized BarrierInputMessageFactory getInstance() { + if (instance == null) { + instance = new BarrierInputMessageFactory(); + } + return instance; + } + + @Override + public void messageToBuffer(short version, ByteBuf out, BarrierInput message) { + ByteBufUtils.writeOFHeader(instance, message, out); + } + + @Override + public int computeLength(BarrierInput message) { + return MESSAGE_LENGTH; + } + + @Override + public byte getMessageType() { + return MESSAGE_TYPE; + } +}