Search in sources :

Example 1 with PortModCaseDataBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.bundle.port.mod._case.PortModCaseDataBuilder in project openflowplugin by opendaylight.

the class BundleAddMessageConverter method convertBundlePortCase.

private BundlePortModCase convertBundlePortCase(final BundleInnerMessage messageCase, final VersionDatapathIdConvertorData data) throws ConversionException {
    Optional<PortModInput> portModInput = Optional.empty();
    final Class<?> clazz = messageCase.getImplementedInterface();
    if (clazz.equals(BundleUpdatePortCase.class)) {
        portModInput = CONVERTER_EXECUTOR.convert(new PortBuilder(((BundleUpdatePortCase) messageCase).getUpdatePortCaseData().getPort().getPort().get(0)).build(), data);
    }
    if (portModInput.isPresent()) {
        return new BundlePortModCaseBuilder().setPortModCaseData(new PortModCaseDataBuilder(portModInput.get()).setXid(xid).build()).build();
    } else {
        throw new ConversionException("BundlePortCase conversion unsuccessful.");
    }
}
Also used : ConversionException(org.opendaylight.openflowplugin.extension.api.exception.ConversionException) PortModCaseDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.bundle.port.mod._case.PortModCaseDataBuilder) BundlePortModCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.BundlePortModCaseBuilder) PortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder) PortModInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput)

Aggregations

ConversionException (org.opendaylight.openflowplugin.extension.api.exception.ConversionException)1 PortBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder)1 PortModInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput)1 BundlePortModCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.BundlePortModCaseBuilder)1 PortModCaseDataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.bundle.port.mod._case.PortModCaseDataBuilder)1