diff options
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress')
8 files changed, 53 insertions, 85 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AbstractAceWriter.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AbstractAceWriter.java index 882c00a36..eed22a63b 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AbstractAceWriter.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AbstractAceWriter.java @@ -23,6 +23,7 @@ import com.google.common.annotations.VisibleForTesting; import io.fd.honeycomb.translate.util.RWUtils; import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer; import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException; +import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.vpp.jvpp.VppBaseCallException; import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSession; import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSessionReply; @@ -113,7 +114,7 @@ abstract class AbstractAceWriter<T extends AceType> implements AceWriter, JvppRe public final void write(@Nonnull final InstanceIdentifier<?> id, @Nonnull final List<Ace> aces, final InterfaceMode mode, @Nonnull final InputAclSetInterface request, @Nonnegative final int vlanTags) - throws VppBaseCallException, WriteTimeoutException { + throws WriteFailedException { final PacketHandling action = aces.stream().map(ace -> ace.getActions().getPacketHandling()).distinct() .collect(SINGLE_ITEM_COLLECTOR); @@ -133,7 +134,7 @@ abstract class AbstractAceWriter<T extends AceType> implements AceWriter, JvppRe private int createClassifyTable(@Nonnull final InstanceIdentifier<?> id, @Nonnull final ClassifyAddDelTable request) - throws VppBaseCallException, WriteTimeoutException { + throws WriteFailedException { final CompletionStage<ClassifyAddDelTableReply> cs = futureJVppCore.classifyAddDelTable(request); final ClassifyAddDelTableReply reply = getReplyForWrite(cs.toCompletableFuture(), id); @@ -142,7 +143,7 @@ abstract class AbstractAceWriter<T extends AceType> implements AceWriter, JvppRe private void createClassifySession(@Nonnull final InstanceIdentifier<?> id, @Nonnull final ClassifyAddDelSession request) - throws VppBaseCallException, WriteTimeoutException { + throws WriteFailedException { final CompletionStage<ClassifyAddDelSessionReply> cs = futureJVppCore.classifyAddDelSession(request); getReplyForWrite(cs.toCompletableFuture(), id); diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceWriter.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceWriter.java index 2be3e09f6..2e22ed1a0 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceWriter.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceWriter.java @@ -17,6 +17,7 @@ package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress; import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.List; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; @@ -42,5 +43,5 @@ interface AceWriter { */ void write(@Nonnull final InstanceIdentifier<?> id, @Nonnull final List<Ace> aces, final InterfaceMode mode, @Nonnull final InputAclSetInterface request, @Nonnegative final int vlanTags) - throws VppBaseCallException, WriteTimeoutException; + throws WriteFailedException; } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclCustomizer.java index a423a456f..30b60c6ff 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclCustomizer.java @@ -22,10 +22,8 @@ import io.fd.honeycomb.translate.spi.write.WriterCustomizer; import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager; import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer; import io.fd.honeycomb.translate.vpp.util.NamingContext; -import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException; import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.VppBaseCallException; import io.fd.vpp.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; @@ -53,40 +51,33 @@ public class AclCustomizer extends FutureJVppCustomizer implements WriterCustomi @Override public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataAfter, @Nonnull final WriteContext writeContext) throws WriteFailedException { - try { - setAcl(true, id, dataAfter, writeContext); - } catch (VppBaseCallException e) { - throw new WriteFailedException.CreateFailedException(id, dataAfter, e); - } + setAcl(true, id, dataAfter, writeContext); } @Override - public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore, + public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, + @Nonnull final Ingress dataBefore, @Nonnull final Ingress dataAfter, @Nonnull final WriteContext writeContext) - throws WriteFailedException { + throws WriteFailedException { throw new UnsupportedOperationException("Acl update is not supported. Please delete Acl container first."); } @Override - public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore, + public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, + @Nonnull final Ingress dataBefore, @Nonnull final WriteContext writeContext) throws WriteFailedException { - try { - setAcl(false, id, dataBefore, writeContext); - } catch (VppBaseCallException e) { - throw new WriteFailedException.DeleteFailedException(id, e); - } + setAcl(false, id, dataBefore, writeContext); } private void setAcl(final boolean isAdd, @Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress acl, - @Nonnull final WriteContext writeContext) - throws VppBaseCallException, WriteTimeoutException { + @Nonnull final WriteContext writeContext) throws WriteFailedException { final String ifName = id.firstKeyOf(Interface.class).getName(); final int ifIndex = interfaceContext.getIndex(ifName, writeContext.getMappingContext()); LOG.debug("Setting ACL(isAdd={}) on interface={}(id={}): {}", isAdd, ifName, ifIndex, acl); inputAclSetInterface(getFutureJVpp(), isAdd, id, acl, ifIndex, classifyTableContext, - writeContext.getMappingContext()); + writeContext.getMappingContext()); LOG.debug("Successfully set ACL(isAdd={}) on interface={}(id={}): {}", isAdd, ifName, ifIndex, acl); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclWriter.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclWriter.java index 8c3333476..01ae61d06 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclWriter.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AclWriter.java @@ -23,6 +23,7 @@ import io.fd.honeycomb.translate.vpp.util.ByteDataTranslator; import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer; import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException; import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; @@ -42,8 +43,7 @@ interface AclWriter extends ByteDataTranslator, JvppReplyConsumer { @Nonnull final InstanceIdentifier<?> id, @Nonnull final AclBaseAttributes acl, @Nonnegative final int ifIndex, @Nonnull final VppClassifierContextManager classifyTableContext, - @Nonnull final MappingContext mappingContext) - throws VppBaseCallException, WriteTimeoutException { + @Nonnull final MappingContext mappingContext) throws WriteFailedException { final InputAclSetInterface request = new InputAclSetInterface(); request.isAdd = booleanToByte(isAdd); request.swIfIndex = ifIndex; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAClWriter.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAClWriter.java index 91c7794d3..1ac9ff2b8 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAClWriter.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAClWriter.java @@ -22,10 +22,8 @@ import com.google.common.base.Optional; import com.google.common.base.Preconditions; import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAclWriter; import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer; -import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException; import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.VppBaseCallException; import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable; import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTableReply; import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface; @@ -92,30 +90,26 @@ public final class IetfAClWriter implements JvppReplyConsumer { } void deleteAcl(@Nonnull final InstanceIdentifier<?> id, final int swIfIndex) - throws WriteTimeoutException, WriteFailedException.DeleteFailedException { + throws WriteFailedException { final ClassifyTableByInterface request = new ClassifyTableByInterface(); request.swIfIndex = swIfIndex; - try { - final CompletionStage<ClassifyTableByInterfaceReply> cs = jvpp.classifyTableByInterface(request); - final ClassifyTableByInterfaceReply reply = getReplyForWrite(cs.toCompletableFuture(), id); + final CompletionStage<ClassifyTableByInterfaceReply> cs = jvpp.classifyTableByInterface(request); + final ClassifyTableByInterfaceReply reply = getReplyForDelete(cs.toCompletableFuture(), id); - // We unassign and remove all ACL-related classify tables for given interface (we assume we are the only - // classify table manager) + // We unassign and remove all ACL-related classify tables for given interface (we assume we are the only + // classify table manager) - unassignClassifyTables(id, reply); + unassignClassifyTables(id, reply); - removeClassifyTable(id, reply.l2TableId); - removeClassifyTable(id, reply.ip4TableId); - removeClassifyTable(id, reply.ip6TableId); - } catch (VppBaseCallException e) { - throw new WriteFailedException.DeleteFailedException(id, e); - } + removeClassifyTable(id, reply.l2TableId); + removeClassifyTable(id, reply.ip4TableId); + removeClassifyTable(id, reply.ip6TableId); } private void unassignClassifyTables(@Nonnull final InstanceIdentifier<?> id, final ClassifyTableByInterfaceReply currentState) - throws VppBaseCallException, WriteTimeoutException { + throws WriteFailedException { final InputAclSetInterface request = new InputAclSetInterface(); request.isAdd = 0; request.swIfIndex = currentState.swIfIndex; @@ -124,11 +118,11 @@ public final class IetfAClWriter implements JvppReplyConsumer { request.ip6TableIndex = currentState.ip6TableId; final CompletionStage<InputAclSetInterfaceReply> inputAclSetInterfaceReplyCompletionStage = jvpp.inputAclSetInterface(request); - getReplyForWrite(inputAclSetInterfaceReplyCompletionStage.toCompletableFuture(), id); + getReplyForDelete(inputAclSetInterfaceReplyCompletionStage.toCompletableFuture(), id); } private void removeClassifyTable(@Nonnull final InstanceIdentifier<?> id, final int tableIndex) - throws VppBaseCallException, WriteTimeoutException { + throws WriteFailedException { if (tableIndex == -1) { return; // classify table id is absent @@ -136,19 +130,19 @@ public final class IetfAClWriter implements JvppReplyConsumer { final ClassifyAddDelTable request = new ClassifyAddDelTable(); request.tableIndex = tableIndex; final CompletionStage<ClassifyAddDelTableReply> cs = jvpp.classifyAddDelTable(request); - getReplyForWrite(cs.toCompletableFuture(), id); + getReplyForDelete(cs.toCompletableFuture(), id); } void write(@Nonnull final InstanceIdentifier<?> id, final int swIfIndex, @Nonnull final List<Acl> acls, @Nullable final InterfaceMode mode, @Nonnull final WriteContext writeContext) - throws VppBaseCallException, WriteTimeoutException { + throws WriteFailedException { write(id, swIfIndex, mode, acls, writeContext, 0); } void write(@Nonnull final InstanceIdentifier<?> id, final int swIfIndex, final InterfaceMode mode, @Nonnull final List<Acl> acls, @Nonnull final WriteContext writeContext, @Nonnegative final int numberOfTags) - throws VppBaseCallException, WriteTimeoutException { + throws WriteFailedException { // filter ACE entries and group by AceType final Map<AclType, List<Ace>> acesByType = acls.stream() diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizer.java index b10dc362b..c9cd66ec2 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizer.java @@ -23,7 +23,6 @@ import io.fd.honeycomb.translate.spi.write.WriterCustomizer; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.VppBaseCallException; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.ietf.acl.base.attributes.AccessLists; @@ -60,20 +59,16 @@ public class IetfAclCustomizer implements WriterCustomizer<Ingress> { final AccessLists accessLists = dataAfter.getAccessLists(); checkArgument(accessLists != null && accessLists.getAcl() != null, - "ietf-acl container does not define acl list"); + "ietf-acl container does not define acl list"); - try { - aclWriter.write(id, ifIndex, accessLists.getAcl(), accessLists.getMode(), writeContext); - } catch (VppBaseCallException e) { - throw new WriteFailedException.CreateFailedException(id, dataAfter, e); - } + aclWriter.write(id, ifIndex, accessLists.getAcl(), accessLists.getMode(), writeContext); } @Override public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore, @Nonnull final Ingress dataAfter, @Nonnull final WriteContext writeContext) - throws WriteFailedException { + throws WriteFailedException { LOG.debug("ACLs update: removing previously configured ACLs"); deleteCurrentAttributes(id, dataBefore, writeContext); LOG.debug("ACLs update: adding updated ACLs"); diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizer.java index e71770121..80e43aa29 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizer.java @@ -23,10 +23,8 @@ import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager; import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.vpp.util.SubInterfaceUtils; -import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException; import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.VppBaseCallException; import io.fd.vpp.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; @@ -42,7 +40,7 @@ import org.slf4j.LoggerFactory; * Customizer for enabling/disabling ingress ACLs on given sub-interface. */ public class SubInterfaceAclCustomizer extends FutureJVppCustomizer - implements WriterCustomizer<Ingress>, AclWriter { + implements WriterCustomizer<Ingress>, AclWriter { private static final Logger LOG = LoggerFactory.getLogger(SubInterfaceAclCustomizer.class); private final NamingContext interfaceContext; @@ -59,44 +57,37 @@ public class SubInterfaceAclCustomizer extends FutureJVppCustomizer @Override public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataAfter, @Nonnull final WriteContext writeContext) throws WriteFailedException { - try { - setAcl(true, id, dataAfter, writeContext); - } catch (VppBaseCallException e) { - throw new WriteFailedException.CreateFailedException(id, dataAfter, e); - } + setAcl(true, id, dataAfter, writeContext); } @Override - public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore, + public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, + @Nonnull final Ingress dataBefore, @Nonnull final Ingress dataAfter, @Nonnull final WriteContext writeContext) - throws WriteFailedException { + throws WriteFailedException { throw new UnsupportedOperationException("Acl update is not supported. Please delete Acl container first."); } @Override - public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore, + public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, + @Nonnull final Ingress dataBefore, @Nonnull final WriteContext writeContext) throws WriteFailedException { - try { - setAcl(false, id, dataBefore, writeContext); - } catch (VppBaseCallException e) { - throw new WriteFailedException.DeleteFailedException(id, e); - } + setAcl(false, id, dataBefore, writeContext); } private void setAcl(final boolean isAdd, @Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress acl, - @Nonnull final WriteContext writeContext) - throws VppBaseCallException, WriteTimeoutException { + @Nonnull final WriteContext writeContext) throws WriteFailedException { final InterfaceKey parentInterfacekey = id.firstKeyOf(Interface.class); final SubInterfaceKey subInterfacekey = id.firstKeyOf(SubInterface.class); final String subInterfaceName = SubInterfaceUtils - .getSubInterfaceName(parentInterfacekey.getName(), subInterfacekey.getIdentifier().intValue()); + .getSubInterfaceName(parentInterfacekey.getName(), subInterfacekey.getIdentifier().intValue()); final int subInterfaceIndex = interfaceContext.getIndex(subInterfaceName, writeContext.getMappingContext()); LOG.debug("Setting ACL(isAdd={}) on sub-interface={}(id={}): {}", - isAdd, subInterfaceName, subInterfaceIndex, acl); + isAdd, subInterfaceName, subInterfaceIndex, acl); inputAclSetInterface(getFutureJVpp(), isAdd, id, acl, subInterfaceIndex, classifyTableContext, - writeContext.getMappingContext()); + writeContext.getMappingContext()); LOG.debug("Successfully set ACL(isAdd={}) on sub-interface={}(id={}): {}", - isAdd, subInterfaceName, subInterfaceIndex, acl); + isAdd, subInterfaceName, subInterfaceIndex, acl); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizer.java index c9068d797..ae40714e3 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizer.java @@ -27,7 +27,6 @@ import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.vpp.util.SubInterfaceUtils; import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.VppBaseCallException; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey; @@ -62,7 +61,7 @@ public class SubInterfaceIetfAclCustomizer implements WriterCustomizer<Ingress> final InterfaceKey parentInterfacekey = id.firstKeyOf(Interface.class); final SubInterfaceKey subInterfacekey = id.firstKeyOf(SubInterface.class); return SubInterfaceUtils - .getSubInterfaceName(parentInterfacekey.getName(), subInterfacekey.getIdentifier().intValue()); + .getSubInterfaceName(parentInterfacekey.getName(), subInterfacekey.getIdentifier().intValue()); } @Override @@ -74,19 +73,15 @@ public class SubInterfaceIetfAclCustomizer implements WriterCustomizer<Ingress> final AccessLists accessLists = dataAfter.getAccessLists(); checkArgument(accessLists != null && accessLists.getAcl() != null, - "ietf-acl container does not define acl list"); + "ietf-acl container does not define acl list"); final Optional<SubInterface> subInterfaceOptional = - writeContext.readAfter(id.firstIdentifierOf(SubInterface.class)); + writeContext.readAfter(id.firstIdentifierOf(SubInterface.class)); checkState(subInterfaceOptional.isPresent(), "Could not read SubInterface data object for %s", id); final SubInterface subInterface = subInterfaceOptional.get(); - try { - aclWriter.write(id, subInterfaceIndex, accessLists.getMode(), accessLists.getAcl(), writeContext, + aclWriter.write(id, subInterfaceIndex, accessLists.getMode(), accessLists.getAcl(), writeContext, getNumberOfTags(subInterface.getTags())); - } catch (VppBaseCallException e) { - throw new WriteFailedException.CreateFailedException(id, dataAfter, e); - } } @Override @@ -103,7 +98,7 @@ public class SubInterfaceIetfAclCustomizer implements WriterCustomizer<Ingress> @Override public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore, @Nonnull final WriteContext writeContext) - throws WriteFailedException { + throws WriteFailedException { final String subInterfaceName = getSubInterfaceName(id); final int subInterfaceIndex = interfaceContext.getIndex(subInterfaceName, writeContext.getMappingContext()); LOG.debug("Removing ACLs for sub-interface={}(id={}): {}", subInterfaceName, subInterfaceIndex, dataBefore); |