use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class BundleAddMessageConverterTest method testConvert.
private void testConvert(final boolean withProperty) throws Exception {
final BundleInnerMessage message = new BundleAddFlowCaseBuilder().setAddFlowCaseData(new AddFlowCaseDataBuilder().build()).build();
testConvert(message, BundleFlowModCase.class, withProperty);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class BundleAddMessageConverterTest method testConvert.
private void testConvert(final BundleInnerMessage message, Class clazz, final boolean withProperty) throws Exception {
final BundleAddMessageSal original = createMessage(withProperty, message);
final BundleAddMessageOnf converted = converter.convert(original);
Assert.assertEquals("Wrong BundleId", new BundleId(original.getSalAddMessageData().getBundleId().getValue()), converted.getOnfAddMessageGroupingData().getBundleId());
Assert.assertEquals("Wrong flags", new BundleFlags(original.getSalAddMessageData().getFlags().isAtomic(), original.getSalAddMessageData().getFlags().isOrdered()), converted.getOnfAddMessageGroupingData().getFlags());
Assert.assertEquals("Wrong inner message conversion", clazz, converted.getOnfAddMessageGroupingData().getBundleInnerMessage().getImplementedInterface());
if (withProperty) {
final BundlePropertyExperimenter originalProperty = (BundlePropertyExperimenter) original.getSalAddMessageData().getBundleProperty().get(0).getBundlePropertyEntry();
final BundlePropertyExperimenter convertedProperty = (BundlePropertyExperimenter) converted.getOnfAddMessageGroupingData().getBundleProperty().get(0).getBundlePropertyEntry();
Assert.assertEquals("Wrong property ExperimenterId", new ExperimenterId(originalProperty.getExperimenter()), convertedProperty.getExperimenter());
Assert.assertEquals("Wrong property experimenter type", originalProperty.getExpType(), convertedProperty.getExpType());
Assert.assertEquals("Wrong property data", originalProperty.getBundlePropertyExperimenterData(), convertedProperty.getBundlePropertyExperimenterData());
} else {
Assert.assertTrue("Properties not empty", converted.getOnfAddMessageGroupingData().getBundleProperty().isEmpty());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class MultipartReplyTranslatorUtil method translateMeter.
private static MultipartReplyMeterStats translateMeter(final MultipartReply msg, final VersionDatapathIdConvertorData data, final ConvertorExecutor convertorExecutor) {
MultipartReplyMeterStatsBuilder message = new MultipartReplyMeterStatsBuilder();
MultipartReplyMeterCase caseBody = (MultipartReplyMeterCase) msg.getMultipartReplyBody();
MultipartReplyMeter replyBody = caseBody.getMultipartReplyMeter();
final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats>> meterStatsList = convertorExecutor.convert(replyBody.getMeterStats(), data);
message.setMeterStats(meterStatsList.orElse(Collections.emptyList()));
return message.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class MultipartReplyTranslatorUtil method translateGroup.
private static MultipartReplyGroupStats translateGroup(final MultipartReply msg, final VersionDatapathIdConvertorData data, final ConvertorExecutor convertorExecutor) {
MultipartReplyGroupStatsBuilder message = new MultipartReplyGroupStatsBuilder();
MultipartReplyGroupCase caseBody = (MultipartReplyGroupCase) msg.getMultipartReplyBody();
MultipartReplyGroup replyBody = caseBody.getMultipartReplyGroup();
final Optional<List<GroupStats>> groupStatsList = convertorExecutor.convert(replyBody.getGroupStats(), data);
message.setGroupStats(groupStatsList.orElse(Collections.emptyList()));
return message.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message in project openflowplugin by opendaylight.
the class MultipartReplyTranslatorUtil method translateMeterConfig.
private static org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.reply.multipart.reply.body.MultipartReplyMeterConfig translateMeterConfig(final MultipartReply msg, final VersionDatapathIdConvertorData data, final ConvertorExecutor convertorExecutor) {
MultipartReplyMeterConfigBuilder message = new MultipartReplyMeterConfigBuilder();
MultipartReplyMeterConfigCase caseBody = (MultipartReplyMeterConfigCase) msg.getMultipartReplyBody();
MultipartReplyMeterConfig replyBody = caseBody.getMultipartReplyMeterConfig();
final Optional<List<MeterConfigStats>> meterConfigStatsList = convertorExecutor.convert(replyBody.getMeterConfig(), data);
message.setMeterConfigStats(meterConfigStatsList.orElse(Collections.emptyList()));
return message.build();
}
Aggregations