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%2FGetAsyncRequestMessageFactory.java;h=3dfd5dccf5fe33406e693957d98eee8157c4cefb;hb=1adc52b6fedfc7ecdb03cb6cab5ae7da3bfb52e4;hp=a4a1a59e06a5045d21ab4648fae7ee7469e308fb;hpb=cbe4871cddf78adab335b5270269b6e704eb8bf9;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetAsyncRequestMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetAsyncRequestMessageFactory.java index a4a1a59e..3dfd5dcc 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetAsyncRequestMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetAsyncRequestMessageFactory.java @@ -10,8 +10,9 @@ 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.api.extensibility.OFSerializer; import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils; +import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInput; /** @@ -21,37 +22,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 */ public class GetAsyncRequestMessageFactory implements OFSerializer { private static final byte MESSAGE_TYPE = 26; - private static final int MESSAGE_LENGTH = 8; - private static GetAsyncRequestMessageFactory instance; - - private GetAsyncRequestMessageFactory() { - // singleton - } - - /** - * @return singleton factory - */ - public static synchronized GetAsyncRequestMessageFactory getInstance() { - if (instance == null) { - instance = new GetAsyncRequestMessageFactory(); - } - return instance; - } - - @Override - public void messageToBuffer(short version, ByteBuf out, - GetAsyncInput message) { - ByteBufUtils.writeOFHeader(instance, message, out); - } - - @Override - public int computeLength(GetAsyncInput message) { - return MESSAGE_LENGTH; - } - + @Override - public byte getMessageType() { - return MESSAGE_TYPE; + public void serialize(GetAsyncInput message, ByteBuf outBuffer) { + ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.OFHEADER_SIZE); } }