diff options
author | Jan Srnicek <jsrnicek@cisco.com> | 2016-11-25 08:43:57 +0100 |
---|---|---|
committer | Jan Srnicek <jsrnicek@cisco.com> | 2016-11-25 08:44:13 +0100 |
commit | fff56adeda975a76f441425d9c650dd93e19ae1c (patch) | |
tree | 2274b68cd42aac4ccc334b71af5d8b1ad1c75616 /v3po/v3po2vpp/src/main/java | |
parent | e259ab7990b8179eda4462907ecebccd0e85b587 (diff) |
HONEYCOMB-277 - Keep-alive timeout exported
Timeout exported to configurable property
Change-Id: Ic095469be4d95f6726fdcabe17a6d2e4e51ba856
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java')
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/VppStateHoneycombReaderFactory.java | 12 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/cfgattrs/V3poConfiguration.java | 8 |
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); + } } |