From fb6666efe7b6009528e98702efc66e9118011174 Mon Sep 17 00:00:00 2001 From: Jan Srnicek Date: Thu, 6 Oct 2016 08:54:02 +0200 Subject: HONEYCOMB-236 - Unified read/write exceptions Change-Id: Idde761d0c0c2c4d96555ef94dbdaa87fad889493 Signed-off-by: Jan Srnicek --- .../read/dump/executor/MappingsDumpExecutor.java | 25 +++++++--------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/MappingsDumpExecutor.java') diff --git a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/MappingsDumpExecutor.java b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/MappingsDumpExecutor.java index 8e68c143a..778ce5308 100755 --- a/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/MappingsDumpExecutor.java +++ b/lisp/lisp2vpp/src/main/java/io/fd/honeycomb/lisp/translate/read/dump/executor/MappingsDumpExecutor.java @@ -20,17 +20,14 @@ package io.fd.honeycomb.lisp.translate.read.dump.executor; import static com.google.common.base.Preconditions.checkNotNull; import io.fd.honeycomb.lisp.translate.read.dump.executor.params.MappingsDumpParams; +import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor; -import io.fd.honeycomb.translate.util.read.cache.exceptions.execution.DumpExecutionFailedException; -import io.fd.honeycomb.translate.util.read.cache.exceptions.execution.i.DumpCallFailedException; -import io.fd.honeycomb.translate.util.read.cache.exceptions.execution.i.DumpTimeoutException; import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer; -import java.util.concurrent.TimeoutException; -import javax.annotation.Nonnull; -import io.fd.vpp.jvpp.VppBaseCallException; import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump; import io.fd.vpp.jvpp.core.dto.LispEidTableDump; import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import javax.annotation.Nonnull; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; /** @@ -45,8 +42,10 @@ public class MappingsDumpExecutor extends AbstractJvppDumpExecutor @Override - public LispEidTableDetailsReplyDump executeDump(final MappingsDumpParams params) - throws DumpExecutionFailedException { + @Nonnull + public LispEidTableDetailsReplyDump executeDump(final InstanceIdentifier identifier, + final MappingsDumpParams params) + throws ReadFailedException { checkNotNull(params, "Params for dump request not present"); LispEidTableDump request = new LispEidTableDump(); @@ -57,14 +56,6 @@ public class MappingsDumpExecutor extends AbstractJvppDumpExecutor request.vni = params.getVni(); request.filter = params.getFilter(); - try { - return getReply(vppApi.lispEidTableDump(request).toCompletableFuture()); - } catch (TimeoutException e) { - throw DumpTimeoutException - .wrapTimeoutException("Mappings dump execution timed out with params " + params.toString(), e); - } catch (VppBaseCallException e) { - throw DumpCallFailedException - .wrapFailedCallException("Mappings dump execution failed with params " + params.toString(), e); - } + return getReplyForRead(vppApi.lispEidTableDump(request).toCompletableFuture(), identifier); } } -- cgit 1.2.3-korg