summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizer.java
diff options
context:
space:
mode:
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizer.java')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizer.java35
1 files changed, 13 insertions, 22 deletions
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);
}
}