X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowjava%2Fopenflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fserialization%2Ffactories%2FMultipartReplyMessageFactory.java;h=e56d4894c5641b980b84897ee85b26a442e8a65b;hb=777c94332871b8c34f56f7f2010de1536cb759ba;hp=b1522e8b9ddbe2303b32f367535abfd50b1d4692;hpb=0b595be684db641f3cb25f1995de1f1660c07edb;p=openflowplugin.git diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactory.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactory.java index b1522e8b9d..e56d4894c5 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactory.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactory.java @@ -31,7 +31,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.InstructionRelatedTableFeatureProperty; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeatureProperty; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeatureProperty; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.next.table.related.table.feature.property.NextTableIds; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType; @@ -99,6 +99,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.MultipartReplyTableFeatures; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.multipart.reply.table.features.TableFeatures; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties; +import org.opendaylight.yangtools.yang.common.Uint32; /** * Translates MultipartReply messages. @@ -220,9 +221,9 @@ public class MultipartReplyMessageFactory implements OFSerializer map = new HashMap<>(); - map.put(0, flags.isOFPMPFREQMORE()); + map.put(0, flags.getOFPMPFREQMORE()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeShort(bitmap); } @@ -233,7 +234,7 @@ public class MultipartReplyMessageFactory implements OFSerializer serializer = registry.getSerializer(ExperimenterSerializerKeyFactory - .createMultipartRequestTFSerializerKey(EncodeConstants.OF13_VERSION_ID, expId)); + .createMultipartRequestTFSerializerKey(EncodeConstants.OF_VERSION_1_3, expId)); serializer.serialize(property, output); } @@ -316,7 +317,7 @@ public class MultipartReplyMessageFactory implements OFSerializer entries = property.augmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry(); if (entries != null) { TypeKeyMaker keyMaker = TypeKeyMakerFactory - .createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID); + .createMatchEntriesKeyMaker(EncodeConstants.OF_VERSION_1_3); ListSerializer.serializeHeaderList(entries, keyMaker, registry, output); } int length = output.writerIndex() - startIndex; @@ -332,7 +333,7 @@ public class MultipartReplyMessageFactory implements OFSerializer actions = property.augmentation(ActionRelatedTableFeatureProperty.class).getAction(); if (actions != null) { - TypeKeyMaker keyMaker = TypeKeyMakerFactory.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID); + TypeKeyMaker keyMaker = TypeKeyMakerFactory.createActionKeyMaker(EncodeConstants.OF_VERSION_1_3); ListSerializer.serializeHeaderList(actions, keyMaker, registry, output); } int length = output.writerIndex() - startIndex; @@ -350,7 +351,7 @@ public class MultipartReplyMessageFactory implements OFSerializer keyMaker = TypeKeyMakerFactory - .createInstructionKeyMaker(EncodeConstants.OF13_VERSION_ID); + .createInstructionKeyMaker(EncodeConstants.OF_VERSION_1_3); ListSerializer.serializeHeaderList(instructions, keyMaker, registry, output); } int length = output.writerIndex() - startIndex; @@ -385,33 +386,33 @@ public class MultipartReplyMessageFactory implements OFSerializer map = new HashMap<>(); - map.put(0, tableConfig.isOFPTCDEPRECATEDMASK()); + map.put(0, tableConfig.getOFPTCDEPRECATEDMASK()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeInt(bitmap); } - private void serializeMeterFeaturesBody(final MultipartReplyBody body, final ByteBuf outBuffer) { + private static void serializeMeterFeaturesBody(final MultipartReplyBody body, final ByteBuf outBuffer) { MultipartReplyMeterFeaturesCase meterFeaturesCase = (MultipartReplyMeterFeaturesCase) body; MultipartReplyMeterFeatures meterFeatures = meterFeaturesCase.getMultipartReplyMeterFeatures(); outBuffer.writeInt(meterFeatures.getMaxMeter().intValue()); writeBandTypes(meterFeatures.getBandTypes(), outBuffer); writeMeterFlags(meterFeatures.getCapabilities(), outBuffer); - outBuffer.writeByte(meterFeatures.getMaxBands()); - outBuffer.writeByte(meterFeatures.getMaxColor()); + outBuffer.writeByte(meterFeatures.getMaxBands().toJava()); + outBuffer.writeByte(meterFeatures.getMaxColor().toJava()); outBuffer.writeZero(METER_FEATURES_PADDING); } - private void writeBandTypes(final MeterBandTypeBitmap bandTypes, final ByteBuf outBuffer) { + private static void writeBandTypes(final MeterBandTypeBitmap bandTypes, final ByteBuf outBuffer) { Map map = new HashMap<>(); - map.put(0, bandTypes.isOFPMBTDROP()); - map.put(1, bandTypes.isOFPMBTDSCPREMARK()); + map.put(0, bandTypes.getOFPMBTDROP()); + map.put(1, bandTypes.getOFPMBTDSCPREMARK()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeInt(bitmap); } - private void serializeMeterConfigBody(final MultipartReplyBody body, final ByteBuf outBuffer) { + private static void serializeMeterConfigBody(final MultipartReplyBody body, final ByteBuf outBuffer) { MultipartReplyMeterConfigCase meterConfigCase = (MultipartReplyMeterConfigCase) body; MultipartReplyMeterConfig meter = meterConfigCase.getMultipartReplyMeterConfig(); for (MeterConfig meterConfig : meter.getMeterConfig()) { @@ -447,17 +448,17 @@ public class MultipartReplyMessageFactory implements OFSerializer map = new HashMap<>(); - map.put(0, flags.isOFPMFKBPS()); - map.put(1, flags.isOFPMFPKTPS()); - map.put(2, flags.isOFPMFBURST()); - map.put(3, flags.isOFPMFSTATS()); + map.put(0, flags.getOFPMFKBPS()); + map.put(1, flags.getOFPMFPKTPS()); + map.put(2, flags.getOFPMFBURST()); + map.put(3, flags.getOFPMFSTATS()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeShort(bitmap); } - private void serializeMeterBody(final MultipartReplyBody body, final ByteBuf outBuffer) { + private static void serializeMeterBody(final MultipartReplyBody body, final ByteBuf outBuffer) { MultipartReplyMeterCase meterCase = (MultipartReplyMeterCase) body; MultipartReplyMeter meter = meterCase.getMultipartReplyMeter(); for (MeterStats meterStats : meter.getMeterStats()) { @@ -479,12 +480,12 @@ public class MultipartReplyMessageFactory implements OFSerializer map = new HashMap<>(); - map.put(0, action.isOFPATOUTPUT()); - map.put(1, action.isOFPATCOPYTTLOUT()); - map.put(2, action.isOFPATCOPYTTLIN()); - map.put(3, action.isOFPATSETMPLSTTL()); - map.put(4, action.isOFPATDECMPLSTTL()); - map.put(5, action.isOFPATPUSHVLAN()); - map.put(6, action.isOFPATPOPVLAN()); - map.put(7, action.isOFPATPUSHMPLS()); - map.put(8, action.isOFPATPOPMPLS()); - map.put(9, action.isOFPATSETQUEUE()); - map.put(10, action.isOFPATGROUP()); - map.put(11, action.isOFPATSETNWTTL()); - map.put(12, action.isOFPATDECNWTTL()); - map.put(13, action.isOFPATSETFIELD()); - map.put(14, action.isOFPATPUSHPBB()); - map.put(15, action.isOFPATPOPPBB()); - map.put(16, action.isOFPATEXPERIMENTER()); + map.put(0, action.getOFPATOUTPUT()); + map.put(1, action.getOFPATCOPYTTLOUT()); + map.put(2, action.getOFPATCOPYTTLIN()); + map.put(3, action.getOFPATSETMPLSTTL()); + map.put(4, action.getOFPATDECMPLSTTL()); + map.put(5, action.getOFPATPUSHVLAN()); + map.put(6, action.getOFPATPOPVLAN()); + map.put(7, action.getOFPATPUSHMPLS()); + map.put(8, action.getOFPATPOPMPLS()); + map.put(9, action.getOFPATSETQUEUE()); + map.put(10, action.getOFPATGROUP()); + map.put(11, action.getOFPATSETNWTTL()); + map.put(12, action.getOFPATDECNWTTL()); + map.put(13, action.getOFPATSETFIELD()); + map.put(14, action.getOFPATPUSHPBB()); + map.put(15, action.getOFPATPOPPBB()); + map.put(16, action.getOFPATEXPERIMENTER()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeInt(bitmap); } - private void writeGroupCapabilities(final GroupCapabilities capabilities, final ByteBuf outBuffer) { + private static void writeGroupCapabilities(final GroupCapabilities capabilities, final ByteBuf outBuffer) { Map map = new HashMap<>(); - map.put(0, capabilities.isOFPGFCSELECTWEIGHT()); - map.put(1, capabilities.isOFPGFCSELECTLIVENESS()); - map.put(2, capabilities.isOFPGFCCHAINING()); - map.put(3, capabilities.isOFPGFCCHAININGCHECKS()); + map.put(0, capabilities.getOFPGFCSELECTWEIGHT()); + map.put(1, capabilities.getOFPGFCSELECTLIVENESS()); + map.put(2, capabilities.getOFPGFCCHAINING()); + map.put(3, capabilities.getOFPGFCCHAININGCHECKS()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeInt(bitmap); } - private void writeGroupTypes(final GroupTypes types, final ByteBuf outBuffer) { + private static void writeGroupTypes(final GroupTypes types, final ByteBuf outBuffer) { Map map = new HashMap<>(); - map.put(0, types.isOFPGTALL()); - map.put(1, types.isOFPGTSELECT()); - map.put(2, types.isOFPGTINDIRECT()); - map.put(3, types.isOFPGTFF()); + map.put(0, types.getOFPGTALL()); + map.put(1, types.getOFPGTSELECT()); + map.put(2, types.getOFPGTINDIRECT()); + map.put(3, types.getOFPGTFF()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeInt(bitmap); } @@ -548,7 +549,7 @@ public class MultipartReplyMessageFactory implements OFSerializer(message.getVersion(), Match.class)); matchSerializer.serialize(flowStats.getMatch(), flowStatsBuff); ListSerializer.serializeList(flowStats.getInstruction(), - TypeKeyMakerFactory.createInstructionKeyMaker(message.getVersion()), registry, flowStatsBuff); + TypeKeyMakerFactory.createInstructionKeyMaker(message.getVersion()), registry, + flowStatsBuff); flowStatsBuff.setShort(FLOW_STATS_LENGTH_INDEX, flowStatsBuff.readableBytes()); outBuffer.writeBytes(flowStatsBuff); } } - private void serializeDescBody(final MultipartReplyBody body, final ByteBuf outBuffer) { + private static void serializeDescBody(final MultipartReplyBody body, final ByteBuf outBuffer) { MultipartReplyDescCase descCase = (MultipartReplyDescCase) body; MultipartReplyDesc desc = descCase.getMultipartReplyDesc(); write256String(desc.getMfrDesc(), outBuffer); @@ -682,7 +684,7 @@ public class MultipartReplyMessageFactory implements OFSerializer map = new HashMap<>(); - map.put(0, config.isPortDown()); - map.put(2, config.isNoRecv()); - map.put(5, config.isNoFwd()); - map.put(6, config.isNoPacketIn()); + map.put(0, config.getPortDown()); + map.put(2, config.getNoRecv()); + map.put(5, config.getNoFwd()); + map.put(6, config.getNoPacketIn()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeInt(bitmap); } - private void writePortState(final PortState state, final ByteBuf outBuffer) { + private static void writePortState(final PortState state, final ByteBuf outBuffer) { Map map = new HashMap<>(); - map.put(0, state.isLinkDown()); - map.put(1, state.isBlocked()); - map.put(2, state.isLive()); + map.put(0, state.getLinkDown()); + map.put(1, state.getBlocked()); + map.put(2, state.getLive()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeInt(bitmap); } - private void writePortFeatures(final PortFeatures features, final ByteBuf outBuffer) { + private static void writePortFeatures(final PortFeatures features, final ByteBuf outBuffer) { Map map = new HashMap<>(); - map.put(0, features.is_10mbHd()); - map.put(1, features.is_10mbFd()); - map.put(2, features.is_100mbHd()); - map.put(3, features.is_100mbFd()); - map.put(4, features.is_1gbHd()); - map.put(5, features.is_1gbFd()); - map.put(6, features.is_10gbFd()); - map.put(7, features.is_40gbFd()); - map.put(8, features.is_100gbFd()); - map.put(9, features.is_1tbFd()); - map.put(10, features.isOther()); - map.put(11, features.isCopper()); - map.put(12, features.isFiber()); - map.put(13, features.isAutoneg()); - map.put(14, features.isPause()); - map.put(15, features.isPauseAsym()); + map.put(0, features.get_10mbHd()); + map.put(1, features.get_10mbFd()); + map.put(2, features.get_100mbHd()); + map.put(3, features.get_100mbFd()); + map.put(4, features.get_1gbHd()); + map.put(5, features.get_1gbFd()); + map.put(6, features.get_10gbFd()); + map.put(7, features.get_40gbFd()); + map.put(8, features.get_100gbFd()); + map.put(9, features.get_1tbFd()); + map.put(10, features.getOther()); + map.put(11, features.getCopper()); + map.put(12, features.getFiber()); + map.put(13, features.getAutoneg()); + map.put(14, features.getPause()); + map.put(15, features.getPauseAsym()); int bitmap = ByteBufUtils.fillBitMaskFromMap(map); outBuffer.writeInt(bitmap); }