summaryrefslogtreecommitdiffstats
path: root/lisp/lisp2vpp/src/main
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-08-23 16:19:41 +0200
committerMarek Gradzki <mgradzki@cisco.com>2017-08-28 11:02:30 +0200
commit7e90b6c5f8a605470dd388bf3c31d9f5beb2724c (patch)
treef209149bfbb7525558c0ac3f9370cbcb78eeb7c1 /lisp/lisp2vpp/src/main
parentfe05c59bb2328bb6494cc3f0c994e8f10178f136 (diff)
DumpCacheManager: make dumpParams optional
Requires https://gerrit.fd.io/r/#/c/8185/ Change-Id: Ib2d529366bd3cf6bb292014026ab8053a19c0ed7 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'lisp/lisp2vpp/src/main')
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java3
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java6
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java3
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java5
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizer.java4
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizer.java6
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizer.java8
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizer.java6
-rwxr-xr-xlisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizer.java5
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java3
10 files changed, 15 insertions, 34 deletions
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java
index 1f2b4e921..958833d14 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/GpeForwardEntryCustomizer.java
@@ -16,7 +16,6 @@
package io.fd.hc2vpp.lisp.gpe.translate.read;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
import static java.lang.String.format;
import com.google.common.base.Optional;
@@ -245,7 +244,7 @@ public class GpeForwardEntryCustomizer extends FutureJVppCustomizer
private Stream<Integer> activeVnis(final InstanceIdentifier<GpeEntry> id,
final ModificationCache cache) throws ReadFailedException {
- final int[] vnis = activeVnisDumpManager.getDump(id, cache, NO_PARAMS).or(() -> {
+ final int[] vnis = activeVnisDumpManager.getDump(id, cache).or(() -> {
final GpeFwdEntryVnisGetReply reply = new GpeFwdEntryVnisGetReply();
reply.vnis = new int[0];
return reply;
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java
index d787592dd..07bc32f4a 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/read/NativeForwardPathsTableCustomizer.java
@@ -16,8 +16,6 @@
package io.fd.hc2vpp.lisp.gpe.translate.read;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
import com.google.common.primitives.UnsignedInts;
import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
@@ -145,7 +143,7 @@ public class NativeForwardPathsTableCustomizer extends FutureJVppCustomizer impl
private Stream<Integer> v4FibsStream(final InstanceIdentifier<NativeForwardPathsTable> id,
final ReadContext ctx) throws ReadFailedException {
- return dumpCacheManagerV4.getDump(id, ctx.getModificationCache(), NO_PARAMS).or(DEFAULT_REPLY_V4)
+ return dumpCacheManagerV4.getDump(id, ctx.getModificationCache()).or(DEFAULT_REPLY_V4)
.ipFibDetails.stream()
.map(ipFibDetails -> ipFibDetails.tableId);
}
@@ -153,7 +151,7 @@ public class NativeForwardPathsTableCustomizer extends FutureJVppCustomizer impl
private Stream<Integer> v6FibsStream(final InstanceIdentifier<NativeForwardPathsTable> id,
final ReadContext ctx) throws ReadFailedException {
- return dumpCacheManagerV6.getDump(id, ctx.getModificationCache(), NO_PARAMS).or(DEFAULT_REPLY_V6)
+ return dumpCacheManagerV6.getDump(id, ctx.getModificationCache()).or(DEFAULT_REPLY_V6)
.ip6FibDetails.stream()
.map(ip6FibDetails -> ip6FibDetails.tableId);
}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java
index 8d45f2387..cfdc0835c 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/service/GpeStateCheckServiceImpl.java
@@ -17,7 +17,6 @@
package io.fd.hc2vpp.lisp.gpe.translate.service;
import static com.google.common.base.Preconditions.checkState;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
import com.google.inject.Inject;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
@@ -73,7 +72,7 @@ public final class GpeStateCheckServiceImpl implements GpeStateCheckService, Jvp
public boolean isGpeEnabled(@Nonnull final ReadContext readContext) {
try {
return byteToBoolean(
- dumpCacheManager.getDump(GPE_FEATURE_STATE_ID, readContext.getModificationCache(), NO_PARAMS)
+ dumpCacheManager.getDump(GPE_FEATURE_STATE_ID, readContext.getModificationCache())
.or(DEFAULT_REPLY).gpeStatus);
} catch (ReadFailedException e) {
throw new IllegalStateException("Unable to read Gpe feature status", e);
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java
index 2cb85bb58..37adcff7c 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizer.java
@@ -17,8 +17,6 @@
package io.fd.hc2vpp.lisp.translate.read;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
import com.google.common.base.Optional;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
@@ -79,8 +77,7 @@ public class ItrRemoteLocatorSetCustomizer extends CheckedLispCustomizer
return;
}
- final Optional<OneGetMapRequestItrRlocsReply> reply =
- dumpCacheManager.getDump(id, ctx.getModificationCache(), NO_PARAMS);
+ final Optional<OneGetMapRequestItrRlocsReply> reply = dumpCacheManager.getDump(id, ctx.getModificationCache());
if (!reply.isPresent() || reply.get().locatorSetName == null) {
return;
}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizer.java
index 68ab8958d..d43d6f700 100755
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizer.java
@@ -17,8 +17,6 @@
package io.fd.hc2vpp.lisp.translate.read;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
import com.google.common.base.Optional;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
@@ -103,7 +101,7 @@ public class LispStateCustomizer extends FutureJVppCustomizer
*/
final Optional<OneLocatorSetDetailsReplyDump> dumpOptional;
try {
- dumpOptional = dumpManager.getDump(id, ctx.getModificationCache(), NO_PARAMS);
+ dumpOptional = dumpManager.getDump(id, ctx.getModificationCache());
} catch (ReadFailedException e) {
throw new IllegalStateException("Unable to initialize locator set context mapping", e);
}
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizer.java
index 7a6723f65..d210e07d4 100755
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizer.java
@@ -16,8 +16,6 @@
package io.fd.hc2vpp.lisp.translate.read;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
import com.google.common.base.Optional;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
import io.fd.hc2vpp.lisp.translate.read.init.LispInitPathsMapper;
@@ -79,7 +77,7 @@ public class LocatorSetCustomizer extends CheckedLispCustomizer
LOG.debug("Reading attributes for Locator Set {}", id);
final Optional<OneLocatorSetDetailsReplyDump> dumpOptional =
- dumpManager.getDump(id, ctx.getModificationCache(), NO_PARAMS);
+ dumpManager.getDump(id, ctx.getModificationCache());
if (!dumpOptional.isPresent() || dumpOptional.get().oneLocatorSetDetails.isEmpty()) {
return;
@@ -113,7 +111,7 @@ public class LocatorSetCustomizer extends CheckedLispCustomizer
LOG.debug("Dumping Locator Set {}", id);
final Optional<OneLocatorSetDetailsReplyDump> dumpOptional =
- dumpManager.getDump(id, context.getModificationCache(), NO_PARAMS);
+ dumpManager.getDump(id, context.getModificationCache());
if (!dumpOptional.isPresent() || dumpOptional.get().oneLocatorSetDetails.isEmpty()) {
return Collections.emptyList();
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizer.java
index 290540a36..2958e99d9 100755
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizer.java
@@ -16,8 +16,6 @@
package io.fd.hc2vpp.lisp.translate.read;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
import com.google.common.base.Optional;
import io.fd.hc2vpp.common.translate.util.AddressTranslator;
import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
@@ -34,12 +32,10 @@ import io.fd.vpp.jvpp.core.dto.OneMapResolverDetails;
import io.fd.vpp.jvpp.core.dto.OneMapResolverDetailsReplyDump;
import io.fd.vpp.jvpp.core.dto.OneMapResolverDump;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170808.map.resolvers.grouping.MapResolvers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170808.map.resolvers.grouping.MapResolversBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170808.map.resolvers.grouping.map.resolvers.MapResolver;
@@ -86,7 +82,7 @@ public class MapResolverCustomizer extends CheckedLispCustomizer
LOG.debug("Reading attributes...");
final Optional<OneMapResolverDetailsReplyDump> dumpOptional =
- dumpManager.getDump(id, ctx.getModificationCache(), NO_PARAMS);
+ dumpManager.getDump(id, ctx.getModificationCache());
if (!dumpOptional.isPresent() || dumpOptional.get().oneMapResolverDetails.isEmpty()) {
LOG.warn("No data dumped");
@@ -115,7 +111,7 @@ public class MapResolverCustomizer extends CheckedLispCustomizer
LOG.debug("Dumping MapResolver...");
final Optional<OneMapResolverDetailsReplyDump> dumpOptional =
- dumpManager.getDump(id, context.getModificationCache(), NO_PARAMS);
+ dumpManager.getDump(id, context.getModificationCache());
if (!dumpOptional.isPresent() || dumpOptional.get().oneMapResolverDetails.isEmpty()) {
return Collections.emptyList();
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizer.java
index 16c01628c..0fa81f955 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizer.java
@@ -16,8 +16,6 @@
package io.fd.hc2vpp.lisp.translate.read;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
-
import com.google.common.base.Optional;
import io.fd.hc2vpp.common.translate.util.AddressTranslator;
import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
@@ -95,7 +93,7 @@ public class MapServerCustomizer extends CheckedLispCustomizer
}
final Optional<OneMapServerDetailsReplyDump> dump =
- dumpManager.getDump(instanceIdentifier, readContext.getModificationCache(), NO_PARAMS);
+ dumpManager.getDump(instanceIdentifier, readContext.getModificationCache());
if (dump.isPresent() && dump.get().oneMapServerDetails != null) {
return dump.get().oneMapServerDetails.stream()
@@ -127,7 +125,7 @@ public class MapServerCustomizer extends CheckedLispCustomizer
return;
}
final Optional<OneMapServerDetailsReplyDump> dump =
- dumpManager.getDump(instanceIdentifier, readContext.getModificationCache(), NO_PARAMS);
+ dumpManager.getDump(instanceIdentifier, readContext.getModificationCache());
if (dump.isPresent() && dump.get().oneMapServerDetails != null) {
final IpAddress currentAddress = instanceIdentifier.firstKeyOf(MapServer.class).getIpAddress();
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizer.java
index cbd1ab91f..848dfbc47 100755
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizer.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizer.java
@@ -17,7 +17,6 @@
package io.fd.hc2vpp.lisp.translate.read;
import static com.google.common.base.Preconditions.checkState;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
import com.google.common.base.Optional;
import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
@@ -99,7 +98,7 @@ public class VniTableCustomizer extends CheckedLispCustomizer
LOG.trace("Reading all IDS...");
final Optional<OneEidTableVniDetailsReplyDump> optionalReply =
- dumpManager.getDump(id, context.getModificationCache(), NO_PARAMS);
+ dumpManager.getDump(id, context.getModificationCache());
if (!optionalReply.isPresent() || optionalReply.get().oneEidTableVniDetails.isEmpty()) {
return Collections.emptyList();
@@ -122,7 +121,7 @@ public class VniTableCustomizer extends CheckedLispCustomizer
VniTableKey key = new VniTableKey(id.firstKeyOf(VniTable.class).getVirtualNetworkIdentifier());
final Optional<OneEidTableVniDetailsReplyDump> optionalReply =
- dumpManager.getDump(id, ctx.getModificationCache(), NO_PARAMS);
+ dumpManager.getDump(id, ctx.getModificationCache());
if (!optionalReply.isPresent() || optionalReply.get().oneEidTableVniDetails.isEmpty()) {
return;
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java
index b63bc0b47..daf41d62c 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java
@@ -17,7 +17,6 @@
package io.fd.hc2vpp.lisp.translate.service;
import static com.google.common.base.Preconditions.checkState;
-import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS;
import com.google.inject.Inject;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
@@ -69,7 +68,7 @@ public final class LispStateCheckServiceImpl implements LispStateCheckService, J
public boolean lispEnabled(@Nonnull final ReadContext ctx) {
// in this case it must be dumped
try {
- return byteToBoolean(dumpManager.getDump(IDENTIFIER, ctx.getModificationCache(), NO_PARAMS)
+ return byteToBoolean(dumpManager.getDump(IDENTIFIER, ctx.getModificationCache())
.or(DEFAULT_REPLY).featureStatus);
} catch (ReadFailedException e) {
throw new IllegalStateException("Unable to read Lisp Feature status", e);