summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceL2Customizer.java
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-06-15 12:02:42 +0200
committerMaros Marsalek <mmarsale@cisco.com>2016-06-15 10:32:17 +0000
commitd46e184662bc2ca83f721d4adb0a7a815acef0a0 (patch)
tree029ccf2d9f51fc567f3e381b3540d7b57e8acb43 /v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceL2Customizer.java
parent3508bc959e055c76c395e0f878d3c9f138f44114 (diff)
Implement L2 container delete
Change-Id: I5173a892ec3e8ac695a5391e570c10f488241e07 Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceL2Customizer.java')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceL2Customizer.java14
1 files changed, 11 insertions, 3 deletions
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 c621612c7..8ab3e2c12 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
@@ -31,7 +31,6 @@ 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;
@@ -87,8 +86,10 @@ public class SubInterfaceL2Customizer extends FutureJVppCustomizer implements Ch
@Override
public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<L2> id, @Nonnull final L2 dataBefore,
- @Nonnull final WriteContext writeContext) {
- // TODO implement delete (if possible)
+ @Nonnull final WriteContext writeContext) throws WriteFailedException {
+ final String subInterfaceName = getSubInterfaceName(id);
+ final int subInterfaceIndex = interfaceContext.getIndex(subInterfaceName, writeContext.getMappingContext());
+ deleteL2(id, subInterfaceIndex, subInterfaceName, dataBefore, writeContext);
}
private void setL2(final InstanceIdentifier<L2> id, final int swIfIndex, final String ifcName, final L2 l2,
@@ -97,4 +98,11 @@ public class SubInterfaceL2Customizer extends FutureJVppCustomizer implements Ch
LOG.debug("Setting L2 for sub-interface: {}", ifcName);
icWriterUtils.setInterconnection(id, swIfIndex, ifcName, l2.getInterconnection(), writeContext);
}
+
+ private void deleteL2(final InstanceIdentifier<L2> id, final int swIfIndex, final String ifcName, final L2 l2Before,
+ final WriteContext writeContext)
+ throws WriteFailedException {
+ LOG.debug("Deleting L2 for sub-interface: {}", ifcName);
+ icWriterUtils.deleteInterconnection(id, swIfIndex, ifcName, l2Before.getInterconnection(), writeContext);
+ }
}