From: Jakub Morvay Date: Wed, 13 Jan 2016 14:09:29 +0000 (+0100) Subject: Fix setting connection timeout milliseconds parameter X-Git-Tag: release/beryllium~31 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=9cb58cc42d98ebb76c6113831ccd3b50d2736987;p=netconf.git Fix setting connection timeout milliseconds parameter Populate connection timeout milliseconds parameter in netconf topology with corresponding value from netconf node. Change-Id: Ib742a2d905228656e0236268269cb2548413e649 Signed-off-by: Jakub Morvay --- diff --git a/opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java b/opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java index 8f3f62140f..b25a7bd6ae 100644 --- a/opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java +++ b/opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java @@ -79,12 +79,13 @@ public abstract class AbstractNetconfTopology implements NetconfTopology, Bindin private static final Logger LOG = LoggerFactory.getLogger(AbstractNetconfTopology.class); - protected static final long DEFAULT_REQUEST_TIMEOUT_MILIS = 60000L; + protected static final long DEFAULT_REQUEST_TIMEOUT_MILLIS = 60000L; protected static final int DEFAULT_KEEPALIVE_DELAY = 0; protected static final boolean DEFAULT_RECONNECT_ON_CHANGED_SCHEMA = false; - protected static final int DEFAULT_MAX_CONNECTION_ATTEMPTS = 0; - protected static final int DEFAULT_BETWEEN_ATTEMPTS_TIMEOUT_MILLIS = 2000; - protected static final BigDecimal DEFAULT_SLEEP_FACTOR = new BigDecimal(1.5); + private static final int DEFAULT_MAX_CONNECTION_ATTEMPTS = 0; + private static final int DEFAULT_BETWEEN_ATTEMPTS_TIMEOUT_MILLIS = 2000; + private static final long DEFAULT_CONNECTION_TIMEOUT_MILLIS = 20000L; + private static final BigDecimal DEFAULT_SLEEP_FACTOR = new BigDecimal(1.5); private static FilesystemSchemaSourceCache CACHE = null; //keep track of already initialized repositories to avoid adding redundant listeners @@ -218,7 +219,7 @@ public abstract class AbstractNetconfTopology implements NetconfTopology, Bindin final NetconfNode node) { //setup default values since default value is not supported yet in mdsal // TODO remove this when mdsal starts supporting default values - final Long defaultRequestTimeoutMillis = node.getDefaultRequestTimeoutMillis() == null ? DEFAULT_REQUEST_TIMEOUT_MILIS : node.getDefaultRequestTimeoutMillis(); + final Long defaultRequestTimeoutMillis = node.getDefaultRequestTimeoutMillis() == null ? DEFAULT_REQUEST_TIMEOUT_MILLIS : node.getDefaultRequestTimeoutMillis(); final Long keepaliveDelay = node.getKeepaliveDelay() == null ? DEFAULT_KEEPALIVE_DELAY : node.getKeepaliveDelay(); final Boolean reconnectOnChangedSchema = node.isReconnectOnChangedSchema() == null ? DEFAULT_RECONNECT_ON_CHANGED_SCHEMA : node.isReconnectOnChangedSchema(); @@ -249,7 +250,7 @@ public abstract class AbstractNetconfTopology implements NetconfTopology, Bindin //setup default values since default value is not supported yet in mdsal // TODO remove this when mdsal starts supporting default values - final long clientConnectionTimeoutMillis = node.getDefaultRequestTimeoutMillis() == null ? DEFAULT_REQUEST_TIMEOUT_MILIS : node.getDefaultRequestTimeoutMillis(); + final long clientConnectionTimeoutMillis = node.getConnectionTimeoutMillis() == null ? DEFAULT_CONNECTION_TIMEOUT_MILLIS : node.getConnectionTimeoutMillis(); final long maxConnectionAttempts = node.getMaxConnectionAttempts() == null ? DEFAULT_MAX_CONNECTION_ATTEMPTS : node.getMaxConnectionAttempts(); final int betweenAttemptsTimeoutMillis = node.getBetweenAttemptsTimeoutMillis() == null ? DEFAULT_BETWEEN_ATTEMPTS_TIMEOUT_MILLIS : node.getBetweenAttemptsTimeoutMillis(); final BigDecimal sleepFactor = node.getSleepFactor() == null ? DEFAULT_SLEEP_FACTOR : node.getSleepFactor(); diff --git a/opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/ClusteredNetconfTopology.java b/opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/ClusteredNetconfTopology.java index 6b64d9513e..275a2e1d86 100644 --- a/opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/ClusteredNetconfTopology.java +++ b/opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/ClusteredNetconfTopology.java @@ -140,7 +140,7 @@ public class ClusteredNetconfTopology extends AbstractNetconfTopology implements final NetconfNode node) { //setup default values since default value is not supported yet in mdsal // TODO remove this when mdsal starts supporting default values - final Long defaultRequestTimeoutMillis = node.getDefaultRequestTimeoutMillis() == null ? DEFAULT_REQUEST_TIMEOUT_MILIS : node.getDefaultRequestTimeoutMillis(); + final Long defaultRequestTimeoutMillis = node.getDefaultRequestTimeoutMillis() == null ? DEFAULT_REQUEST_TIMEOUT_MILLIS : node.getDefaultRequestTimeoutMillis(); final Long keepaliveDelay = node.getKeepaliveDelay() == null ? DEFAULT_KEEPALIVE_DELAY : node.getKeepaliveDelay(); final Boolean reconnectOnChangedSchema = node.isReconnectOnChangedSchema() == null ? DEFAULT_RECONNECT_ON_CHANGED_SCHEMA : node.isReconnectOnChangedSchema();