import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
private static final byte PADDING_IN_PORT_STATUS_HEADER = 7;
- private static OF10PortStatusMessageFactory instance;
-
- private OF10PortStatusMessageFactory() {
- // Singleton
- }
-
- /**
- * @return singleton factory
- */
- public static synchronized OF10PortStatusMessageFactory getInstance(){
- if(instance == null){
- instance = new OF10PortStatusMessageFactory();
- }
- return instance;
- }
-
@Override
- public PortStatusMessage bufferToMessage(ByteBuf rawMessage, short version) {
+ public PortStatusMessage deserialize(ByteBuf rawMessage) {
PortStatusMessageBuilder builder = new PortStatusMessageBuilder();
- builder.setVersion(version);
+ builder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
builder.setXid(rawMessage.readUnsignedInt());
builder.setReason(PortReason.forValue(rawMessage.readUnsignedByte()));
rawMessage.skipBytes(PADDING_IN_PORT_STATUS_HEADER);