2 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package io.fd.honeycomb.lisp.translate.read.dump.executor;
20 import io.fd.honeycomb.translate.v3po.util.TranslateUtils;
21 import io.fd.honeycomb.translate.v3po.util.cache.EntityDumpExecutor;
22 import io.fd.honeycomb.translate.v3po.util.cache.exceptions.execution.DumpExecutionFailedException;
23 import io.fd.honeycomb.translate.v3po.util.cache.exceptions.execution.i.DumpCallFailedException;
24 import io.fd.honeycomb.translate.v3po.util.cache.exceptions.execution.i.DumpTimeoutException;
25 import java.util.concurrent.TimeoutException;
26 import javax.annotation.Nonnull;
27 import org.openvpp.jvpp.VppBaseCallException;
28 import org.openvpp.jvpp.core.dto.LispMapResolverDetailsReplyDump;
29 import org.openvpp.jvpp.core.dto.LispMapResolverDump;
30 import org.openvpp.jvpp.core.future.FutureJVppCore;
33 public class MapResolversDumpExecutor extends AbstractDumpExecutor
34 implements EntityDumpExecutor<LispMapResolverDetailsReplyDump, Void> {
36 public MapResolversDumpExecutor(@Nonnull FutureJVppCore api) {
41 public LispMapResolverDetailsReplyDump executeDump(final Void params) throws DumpExecutionFailedException {
43 return TranslateUtils.getReply(vppApi.lispMapResolverDump(new LispMapResolverDump()).toCompletableFuture());
44 } catch (TimeoutException e) {
45 throw DumpTimeoutException
46 .wrapTimeoutException("Map resolver dump execution ended in timeout", e);
47 } catch (VppBaseCallException e) {
48 throw DumpCallFailedException.wrapFailedCallException("Map resolver dump execution failed", e);