use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.bundle.group.mod._case.GroupModCaseDataBuilder in project openflowplugin by opendaylight.
the class BundleAddMessageConverter method convertBundleGroupCase.
private BundleGroupModCase convertBundleGroupCase(final BundleInnerMessage messageCase, final VersionDatapathIdConvertorData data) throws ConversionException {
Optional<GroupModInputBuilder> groupModInput = Optional.empty();
final Class clazz = messageCase.getImplementedInterface();
if (clazz.equals(BundleAddGroupCase.class)) {
groupModInput = CONVERTER_EXECUTOR.convert(new AddGroupInputBuilder(((BundleAddGroupCase) messageCase).getAddGroupCaseData()).build(), data);
} else if (clazz.equals(BundleUpdateGroupCase.class)) {
groupModInput = CONVERTER_EXECUTOR.convert(new UpdatedGroupBuilder(((BundleUpdateGroupCase) messageCase).getUpdateGroupCaseData()).build(), data);
} else if (clazz.equals(BundleRemoveGroupCase.class)) {
groupModInput = CONVERTER_EXECUTOR.convert(new RemoveGroupInputBuilder(((BundleRemoveGroupCase) messageCase).getRemoveGroupCaseData()).build(), data);
}
if (groupModInput.isPresent()) {
return new BundleGroupModCaseBuilder().setGroupModCaseData(new GroupModCaseDataBuilder(groupModInput.get().setXid(xid).build()).build()).build();
} else {
throw new ConversionException("BundleGroupCase conversion unsuccessful.");
}
}
Aggregations