From 744551ed3b657da9f6c8d06bfed4dba4c9fc7700 Mon Sep 17 00:00:00 2001 From: Tibor Sirovatka Date: Mon, 30 May 2016 16:52:57 +0200 Subject: HONEYCOMB-67 Introduce exception handling into JVPP VppApiInvocationException replaced by VPP VPPBaseCallException(s) VppInvocationException - send request failed VppCallbackException - operation had failed (negative result) Change-Id: I897afead8d65ef1240e657116a0610850c62348f Signed-off-by: Tibor Sirovatka --- .../v3po/interfaces/SubInterfaceL2Customizer.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceL2Customizer.java') diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceL2Customizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceL2Customizer.java index a1957f5a0..c621612c7 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceL2Customizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceL2Customizer.java @@ -21,7 +21,6 @@ import io.fd.honeycomb.v3po.translate.spi.write.ChildWriterCustomizer; import io.fd.honeycomb.v3po.translate.v3po.util.FutureJVppCustomizer; import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; import io.fd.honeycomb.v3po.translate.v3po.util.SubInterfaceUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.VppApiInvocationException; import io.fd.honeycomb.v3po.translate.write.WriteContext; import io.fd.honeycomb.v3po.translate.write.WriteFailedException; import javax.annotation.Nonnull; @@ -32,6 +31,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.L2; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.openvpp.jvpp.VppBaseCallException; import org.openvpp.jvpp.future.FutureJVpp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -64,12 +64,7 @@ public class SubInterfaceL2Customizer extends FutureJVppCustomizer implements Ch throws WriteFailedException { final String subInterfaceName = getSubInterfaceName(id); final int subInterfaceIndex = interfaceContext.getIndex(subInterfaceName, writeContext.getMappingContext()); - try { - setL2(id, subInterfaceIndex, subInterfaceName, dataAfter, writeContext); - } catch (VppApiInvocationException e) { - LOG.warn("Write of L2 failed", e); - throw new WriteFailedException.CreateFailedException(id, dataAfter, e); - } + setL2(id, subInterfaceIndex, subInterfaceName, dataAfter, writeContext); } private String getSubInterfaceName(@Nonnull final InstanceIdentifier id) { @@ -87,12 +82,7 @@ public class SubInterfaceL2Customizer extends FutureJVppCustomizer implements Ch final String subInterfaceName = getSubInterfaceName(id); final int subInterfaceIndex = interfaceContext.getIndex(subInterfaceName, writeContext.getMappingContext()); // TODO handle update properly (if possible) - try { - setL2(id, subInterfaceIndex, subInterfaceName, dataAfter, writeContext); - } catch (VppApiInvocationException e) { - LOG.warn("Update of L2 failed", e); - throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter, e); - } + setL2(id, subInterfaceIndex, subInterfaceName, dataAfter, writeContext); } @Override @@ -103,7 +93,7 @@ public class SubInterfaceL2Customizer extends FutureJVppCustomizer implements Ch private void setL2(final InstanceIdentifier id, final int swIfIndex, final String ifcName, final L2 l2, final WriteContext writeContext) - throws VppApiInvocationException, WriteFailedException { + throws WriteFailedException { LOG.debug("Setting L2 for sub-interface: {}", ifcName); icWriterUtils.setInterconnection(id, swIfIndex, ifcName, l2.getInterconnection(), writeContext); } -- cgit 1.2.3-korg