From 3341ac467cc08ac95f937945c7502ac4a019d805 Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Wed, 17 Aug 2016 15:38:01 +0200 Subject: Make Restconf thread pools configurable Change-Id: Ie03a1fde5181cfd8457e36d67afc2cc0c69c1e1d Signed-off-by: Maros Marsalek --- .../distro/cfgattrs/HoneycombConfiguration.groovy | 59 +++++++++++++++++----- 1 file changed, 47 insertions(+), 12 deletions(-) (limited to 'infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/cfgattrs') diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/cfgattrs/HoneycombConfiguration.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/cfgattrs/HoneycombConfiguration.groovy index 422c84435..85708f11e 100644 --- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/cfgattrs/HoneycombConfiguration.groovy +++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/cfgattrs/HoneycombConfiguration.groovy @@ -41,37 +41,72 @@ class HoneycombConfiguration { int notificationServiceQueueDepth // RESTCONF + // HTTP + @InjectConfig("restconf-http-enabled") + String restconfHttp + @InjectConfig("restconf-binding-address") - String restconfBindingAddress + Optional restconfBindingAddress @InjectConfig("restconf-port") - int restconfPort + Optional restconfPort + // HTTPS + @InjectConfig("restconf-https-enabled") + String restconfHttps @InjectConfig("restconf-https-binding-address") - String restconfHttpsBindingAddress + Optional restconfHttpsBindingAddress @InjectConfig("restconf-https-port") - int restconfHttpsPort + Optional restconfHttpsPort + @InjectConfig("restconf-websocket-port") - int restconfWebsocketPort + Optional restconfWebsocketPort = Optional.of(7779) + @InjectConfig("restconf-root-path") - String restconfRootPath + Optional restconfRootPath = Optional.of("/restconf") + @InjectConfig("restconf-pool-max-size") + Optional restPoolMaxSize = Optional.of(10) + @InjectConfig("restconf-pool-min-size") + Optional restPoolMinSize = Optional.of(1) + + @InjectConfig("restconf-acceptors-size") + Optional acceptorsSize = Optional.of(1) + @InjectConfig("restconf-selectors-size") + Optional selectorsSize = Optional.of(1) + @InjectConfig("restconf-https-acceptors-size") + Optional httpsAcceptorsSize = Optional.of(1) + @InjectConfig("restconf-https-selectors-size") + Optional httpsSelectorsSize = Optional.of(1) + + // Booleans not supported + boolean isRestconfHttpEnabled() { Boolean.valueOf(restconfHttp) } + boolean isRestconfHttpsEnabled() { Boolean.valueOf(restconfHttps) } + boolean isRestconfEnabled() { isRestconfHttpEnabled() || isRestconfHttpsEnabled() } // NETCONF @InjectConfig("netconf-netty-threads") - Optional netconfNettyThreads - // NETCONF TCP optional + Integer netconfNettyThreads + + // NETCONF TCP + @InjectConfig("netconf-tcp-enabled") + String netconfTcp @InjectConfig("netconf-tcp-binding-address") Optional netconfTcpBindingAddress @InjectConfig("netconf-tcp-binding-port") Optional netconfTcpBindingPort + // NETCONF SSH + @InjectConfig("netconf-ssh-enabled") + String netconfSsh @InjectConfig("netconf-ssh-binding-address") - String netconfSshBindingAddress + Optional netconfSshBindingAddress @InjectConfig("netconf-ssh-binding-port") - Integer netconfSshBindingPort + Optional netconfSshBindingPort @InjectConfig("netconf-notification-stream-name") - String netconfNotificationStreamName + Optional netconfNotificationStreamName = Optional.of("honeycomb") - boolean isNetconfTcpServerEnabled() { netconfTcpBindingAddress.isPresent() && netconfTcpBindingPort.isPresent() } + boolean isNetconfTcpEnabled() { Boolean.valueOf(netconfTcp) } + boolean isNetconfSshEnabled() { Boolean.valueOf(netconfSsh) } + boolean isNetconfEnabled() { isNetconfTcpEnabled() || isNetconfSshEnabled() } @InjectConfig("username") String username -- cgit 1.2.3-korg