summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-11-25 08:19:57 +0000
committerGerrit Code Review <gerrit@fd.io>2016-11-25 08:19:57 +0000
commitf3b25c44e49bb290a30314bea0e6dd21bd4a2b2a (patch)
treeb391d4314de070329e94d8ebc5777611bcd5d486 /v3po/v3po2vpp/src/main/java
parentd690028c4ca575209449cef263e993e299e5a725 (diff)
parentfff56adeda975a76f441425d9c650dd93e19ae1c (diff)
Merge "HONEYCOMB-277 - Keep-alive timeout exported"
Diffstat (limited to 'v3po/v3po2vpp/src/main/java')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/VppStateHoneycombReaderFactory.java12
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/cfgattrs/V3poConfiguration.java8
2 files changed, 16 insertions, 4 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/VppStateHoneycombReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/VppStateHoneycombReaderFactory.java
index 03da2c755..8fcad8f49 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/VppStateHoneycombReaderFactory.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/VppStateHoneycombReaderFactory.java
@@ -18,6 +18,10 @@ package io.fd.hc2vpp.v3po;
import com.google.inject.Inject;
import com.google.inject.name.Named;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.hc2vpp.common.translate.util.ReadTimeoutException;
+import io.fd.hc2vpp.common.translate.util.VppStatusListener;
+import io.fd.hc2vpp.v3po.cfgattrs.V3poConfiguration;
import io.fd.hc2vpp.v3po.vppstate.BridgeDomainCustomizer;
import io.fd.hc2vpp.v3po.vppstate.L2FibEntryCustomizer;
import io.fd.hc2vpp.v3po.vppstate.VersionCustomizer;
@@ -26,9 +30,6 @@ import io.fd.honeycomb.translate.impl.read.GenericReader;
import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
import io.fd.honeycomb.translate.util.read.KeepaliveReaderWrapper;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.common.translate.util.ReadTimeoutException;
-import io.fd.hc2vpp.common.translate.util.VppStatusListener;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.concurrent.ScheduledExecutorService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.VppState;
@@ -51,6 +52,9 @@ public final class VppStateHoneycombReaderFactory implements ReaderFactory {
private final VppStatusListener vppStatusListener;
@Inject
+ private V3poConfiguration v3poConfiguration;
+
+ @Inject
public VppStateHoneycombReaderFactory(final FutureJVppCore jVpp,
@Named("interface-context") final NamingContext ifcCtx,
@Named("bridge-domain-context") final NamingContext bdCtx,
@@ -73,7 +77,7 @@ public final class VppStateHoneycombReaderFactory implements ReaderFactory {
// Relying on VersionCustomizer to provide a "timing out read"
registry.add(new KeepaliveReaderWrapper<>(
new GenericReader<>(vppStateId.child(Version.class), new VersionCustomizer(jVpp)),
- keepaliveExecutor, ReadTimeoutException.class, 30, vppStatusListener));
+ keepaliveExecutor, ReadTimeoutException.class, v3poConfiguration.getKeepaliveDelay(), vppStatusListener));
// BridgeDomains(Structural)
final InstanceIdentifier<BridgeDomains> bridgeDomainsId = vppStateId.child(BridgeDomains.class);
registry.addStructuralReader(bridgeDomainsId, BridgeDomainsBuilder.class);
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/cfgattrs/V3poConfiguration.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/cfgattrs/V3poConfiguration.java
index 6676956d8..f7b52accd 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/cfgattrs/V3poConfiguration.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/cfgattrs/V3poConfiguration.java
@@ -17,8 +17,16 @@
package io.fd.hc2vpp.v3po.cfgattrs;
import net.jmob.guice.conf.core.BindConfig;
+import net.jmob.guice.conf.core.InjectConfig;
import net.jmob.guice.conf.core.Syntax;
@BindConfig(value = "v3po", syntax = Syntax.JSON)
public class V3poConfiguration {
+
+ @InjectConfig("keepalive-delay")
+ private String keepaliveDelay;
+
+ public int getKeepaliveDelay() {
+ return Integer.valueOf(this.keepaliveDelay);
+ }
}