Repository: ignite
Updated Branches:
  refs/heads/master 1a6e54489 -> 819d7469d


IGNITE-7578 Actualized client connector configuration.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/819d7469
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/819d7469
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/819d7469

Branch: refs/heads/master
Commit: 819d7469dc3e38628513a4740f9e293722f532e5
Parents: 1a6e544
Author: Vasiliy Sisko <vsi...@gridgain.com>
Authored: Mon Feb 12 20:24:30 2018 +0700
Committer: Alexey Kuznetsov <akuznet...@apache.org>
Committed: Mon Feb 12 20:24:30 2018 +0700

----------------------------------------------------------------------
 .../node/VisorClientConnectorConfiguration.java | 117 ++++++++++++++++++-
 .../config/VisorConfigurationCommand.scala      |   8 ++
 modules/web-console/backend/app/schemas.js      |  10 +-
 .../generator/ConfigurationGenerator.js         |  14 +++
 .../generator/defaults/Cluster.service.js       |  15 +++
 .../configuration/clusters/client-connector.pug |  33 +++++-
 .../frontend/app/services/Version.service.js    |   4 +
 .../frontend/controllers/clusters-controller.js |   9 +-
 8 files changed, 202 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/819d7469/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorClientConnectorConfiguration.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorClientConnectorConfiguration.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorClientConnectorConfiguration.java
index 397b72a..0a1459e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorClientConnectorConfiguration.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorClientConnectorConfiguration.java
@@ -26,6 +26,8 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorDataTransferObject;
 import org.jetbrains.annotations.Nullable;
 
+import static 
org.apache.ignite.internal.visor.util.VisorTaskUtils.compactClass;
+
 /**
  * Data transfer object for client connector configuration.
  */
@@ -55,7 +57,31 @@ public class VisorClientConnectorConfiguration extends 
VisorDataTransferObject {
     private boolean tcpNoDelay;
 
     /** Thread pool size. */
-    private int threadPoolSize ;
+    private int threadPoolSize;
+
+    /** Idle timeout. */
+    private long idleTimeout;
+
+    /** JDBC connections enabled flag. */
+    private boolean jdbcEnabled;
+
+    /** ODBC connections enabled flag. */
+    private boolean odbcEnabled;
+
+    /** JDBC connections enabled flag. */
+    private boolean thinCliEnabled;
+
+    /** SSL enable flag, default is disabled. */
+    private boolean sslEnabled;
+
+    /** If to use SSL context factory from Ignite configuration. */
+    private boolean useIgniteSslCtxFactory;
+
+    /** SSL need client auth flag. */
+    private boolean sslClientAuth;
+
+    /** SSL connection factory class name. */
+    private String sslCtxFactory;
 
     /**
      * Default constructor.
@@ -78,6 +104,14 @@ public class VisorClientConnectorConfiguration extends 
VisorDataTransferObject {
         sockRcvBufSize = cfg.getSocketReceiveBufferSize();
         tcpNoDelay = cfg.isTcpNoDelay();
         threadPoolSize = cfg.getThreadPoolSize();
+        idleTimeout = cfg.getIdleTimeout();
+        jdbcEnabled = cfg.isJdbcEnabled();
+        odbcEnabled = cfg.isOdbcEnabled();
+        thinCliEnabled = cfg.isThinClientEnabled();
+        sslEnabled = cfg.isSslEnabled();
+        useIgniteSslCtxFactory = cfg.isUseIgniteSslContextFactory();
+        sslClientAuth = cfg.isSslClientAuth();
+        sslCtxFactory = compactClass(cfg.getSslContextFactory());
     }
 
     /**
@@ -135,6 +169,66 @@ public class VisorClientConnectorConfiguration extends 
VisorDataTransferObject {
         return threadPoolSize;
     }
 
+    /**
+     * @return Idle timeout.
+     */
+    public long getIdleTimeout() {
+        return idleTimeout;
+    }
+
+    /**
+     * @return JDBC connections enabled flag.
+     */
+    public boolean isJdbcEnabled() {
+        return jdbcEnabled;
+    }
+
+    /**
+     * @return ODBC connections enabled flag.
+     */
+    public boolean isOdbcEnabled() {
+        return odbcEnabled;
+    }
+
+    /**
+     * @return JDBC connections enabled flag.
+     */
+    public boolean isThinClientEnabled() {
+        return thinCliEnabled;
+    }
+
+    /**
+     * @return SSL enable flag, default is disabled.
+     */
+    public boolean isSslEnabled() {
+        return sslEnabled;
+    }
+
+    /**
+     * @return If to use SSL context factory from Ignite configuration.
+     */
+    public boolean isUseIgniteSslContextFactory() {
+        return useIgniteSslCtxFactory;
+    }
+
+    /**
+     * @return SSL need client auth flag.
+     */
+    public boolean isSslClientAuth() {
+        return sslClientAuth;
+    }
+
+    /**
+     * @return SSL connection factory.
+     */
+    public String getSslContextFactory() {
+        return sslCtxFactory;
+    }
+
+    @Override public byte getProtocolVersion() {
+        return V2;
+    }
+
     /** {@inheritDoc} */
     @Override protected void writeExternalData(ObjectOutput out) throws 
IOException {
         U.writeString(out, host);
@@ -142,9 +236,17 @@ public class VisorClientConnectorConfiguration extends 
VisorDataTransferObject {
         out.writeInt(portRange);
         out.writeInt(maxOpenCursorsPerConn);
         out.writeInt(sockSndBufSize);
-        out.writeInt(sockRcvBufSize );
+        out.writeInt(sockRcvBufSize);
         out.writeBoolean(tcpNoDelay);
         out.writeInt(threadPoolSize);
+        out.writeLong(idleTimeout);
+        out.writeBoolean(jdbcEnabled);
+        out.writeBoolean(odbcEnabled);
+        out.writeBoolean(thinCliEnabled);
+        out.writeBoolean(sslEnabled);
+        out.writeBoolean(useIgniteSslCtxFactory);
+        out.writeBoolean(sslClientAuth);
+        U.writeString(out, sslCtxFactory);
     }
 
     /** {@inheritDoc} */
@@ -157,6 +259,17 @@ public class VisorClientConnectorConfiguration extends 
VisorDataTransferObject {
         sockRcvBufSize = in.readInt();
         tcpNoDelay = in.readBoolean();
         threadPoolSize = in.readInt();
+
+        if (protoVer > V1) {
+            idleTimeout = in.readLong();
+            jdbcEnabled = in.readBoolean();
+            odbcEnabled = in.readBoolean();
+            thinCliEnabled = in.readBoolean();
+            sslEnabled = in.readBoolean();
+            useIgniteSslCtxFactory = in.readBoolean();
+            sslClientAuth = in.readBoolean();
+            sslCtxFactory = U.readString(in);
+        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/819d7469/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala
----------------------------------------------------------------------
diff --git 
a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala
 
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala
index 67d9c14..1a82381 100644
--- 
a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala
+++ 
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala
@@ -245,7 +245,15 @@ class VisorConfigurationCommand extends 
VisorConsoleCommand {
             cliConnTbl += ("Socket receive buffer size", 
formatMemory(cliConnCfg.getSocketReceiveBufferSize))
             cliConnTbl += ("Max connection cursors", 
cliConnCfg.getMaxOpenCursorsPerConnection)
             cliConnTbl += ("Pool size", cliConnCfg.getThreadPoolSize)
+            cliConnTbl += ("Idle Timeout", cliConnCfg.getIdleTimeout + "ms")
             cliConnTbl += ("TCP_NODELAY", bool2Str(cliConnCfg.isTcpNoDelay))
+            cliConnTbl += ("JDBC Enabled", bool2Str(cliConnCfg.isJdbcEnabled))
+            cliConnTbl += ("ODBC Enabled", bool2Str(cliConnCfg.isOdbcEnabled))
+            cliConnTbl += ("Thin Client Enabled", 
bool2Str(cliConnCfg.isThinClientEnabled))
+            cliConnTbl += ("SSL Enabled", bool2Str(cliConnCfg.isSslEnabled))
+            cliConnTbl += ("Ssl Client Auth", 
bool2Str(cliConnCfg.isSslClientAuth))
+            cliConnTbl += ("Use Ignite SSL Context Factory", 
bool2Str(cliConnCfg.isUseIgniteSslContextFactory))
+            cliConnTbl += ("SSL Context Factory", 
safe(cliConnCfg.getSslContextFactory))
 
             cliConnTbl.render()
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/819d7469/modules/web-console/backend/app/schemas.js
----------------------------------------------------------------------
diff --git a/modules/web-console/backend/app/schemas.js 
b/modules/web-console/backend/app/schemas.js
index 0ed85b2..b3d61ac 100644
--- a/modules/web-console/backend/app/schemas.js
+++ b/modules/web-console/backend/app/schemas.js
@@ -859,7 +859,15 @@ module.exports.factory = function(mongoose) {
             socketReceiveBufferSize: Number,
             tcpNoDelay: {type: Boolean, default: true},
             maxOpenCursorsPerConnection: Number,
-            threadPoolSize: Number
+            threadPoolSize: Number,
+            idleTimeout: Number,
+            jdbcEnabled: {type: Boolean, default: true},
+            odbcEnabled: {type: Boolean, default: true},
+            thinClientEnabled: {type: Boolean, default: true},
+            sslEnabled: Boolean,
+            useIgniteSslContextFactory: {type: Boolean, default: true},
+            sslClientAuth: Boolean,
+            sslContextFactory: String
         },
         loadBalancingSpi: [{
             kind: {type: String, enum: ['RoundRobin', 'Adaptive', 
'WeightedRandom', 'Custom']},

http://git-wip-us.apache.org/repos/asf/ignite/blob/819d7469/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
----------------------------------------------------------------------
diff --git 
a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
 
b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
index 9269fc9..645e3e3 100644
--- 
a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
+++ 
b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
@@ -788,6 +788,20 @@ export default class IgniteConfigurationGenerator {
             .intProperty('threadPoolSize')
             .boolProperty('tcpNoDelay');
 
+        if (available('2.4.0')) {
+            bean.longProperty('idleTimeout')
+                .boolProperty('jdbcEnabled')
+                .boolProperty('odbcEnabled')
+                .boolProperty('thinClientEnabled');
+        }
+
+        if (available('2.5.0')) {
+            bean.boolProperty('sslEnabled')
+                .boolProperty('sslClientAuth')
+                .boolProperty('useIgniteSslContextFactory')
+                .emptyBeanProperty('sslContextFactory');
+        }
+
         cfg.beanProperty('clientConnectorConfiguration', bean);
 
         return cfg;

http://git-wip-us.apache.org/repos/asf/ignite/blob/819d7469/modules/web-console/frontend/app/modules/configuration/generator/defaults/Cluster.service.js
----------------------------------------------------------------------
diff --git 
a/modules/web-console/frontend/app/modules/configuration/generator/defaults/Cluster.service.js
 
b/modules/web-console/frontend/app/modules/configuration/generator/defaults/Cluster.service.js
index f636869..b55ed83 100644
--- 
a/modules/web-console/frontend/app/modules/configuration/generator/defaults/Cluster.service.js
+++ 
b/modules/web-console/frontend/app/modules/configuration/generator/defaults/Cluster.service.js
@@ -395,6 +395,21 @@ const DFLT_CLUSTER = {
         socketReceiveBufferSize: 0,
         tcpNoDelay: true,
         maxOpenCursorsPerConnection: 128
+    },
+    clientConnectorConfiguration: {
+        port: 10800,
+        portRange: 100,
+        socketSendBufferSize: 0,
+        socketReceiveBufferSize: 0,
+        tcpNoDelay: true,
+        maxOpenCursorsPerConnection: 128,
+        idleTimeout: 0,
+        jdbcEnabled: true,
+        odbcEnabled: true,
+        thinClientEnabled: true,
+        sslEnabled: false,
+        useIgniteSslContextFactory: true,
+        sslClientAuth: false
     }
 };
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/819d7469/modules/web-console/frontend/app/modules/states/configuration/clusters/client-connector.pug
----------------------------------------------------------------------
diff --git 
a/modules/web-console/frontend/app/modules/states/configuration/clusters/client-connector.pug
 
b/modules/web-console/frontend/app/modules/states/configuration/clusters/client-connector.pug
index dd2fa6d..c90cc45 100644
--- 
a/modules/web-console/frontend/app/modules/states/configuration/clusters/client-connector.pug
+++ 
b/modules/web-console/frontend/app/modules/states/configuration/clusters/client-connector.pug
@@ -18,8 +18,10 @@ include /app/helpers/jade/mixins
 
 -var form = 'clientConnector'
 -var model = 'backupItem'
--var connectionModel = model + '.clientConnectorConfiguration'
--var connectionEnabled = connectionModel + '.enabled'
+-var connectionModel = `${model}.clientConnectorConfiguration`
+-var connectionEnabled = `${connectionModel}.enabled`
+-var sslEnabled = `${connectionEnabled} && ${connectionModel}.sslEnabled`
+-var sslFactoryEnabled = `${sslEnabled} && 
!${connectionModel}.useIgniteSslContextFactory`
 
 .panel.panel-default(ng-show='$ctrl.available("2.3.0")' ng-form=form 
novalidate)
     .panel-heading(bs-collapse-toggle ng-click=`ui.loadPanel('${form}')`)
@@ -41,11 +43,11 @@ include /app/helpers/jade/mixins
                     +number('Port range:', `${connectionModel}.portRange`, 
'"ClientConnectorPortRange"', connectionEnabled, '100', '0', 'Port range')
                 .settings-row
                     +number('Socket send buffer size:', 
`${connectionModel}.socketSendBufferSize`, 
'"ClientConnectorSocketSendBufferSize"', connectionEnabled, '0', '0',
-                        'Socket send buffer size.<br/>\
+                        'Socket send buffer size<br/>\
                         When set to <b>0</b>, operation system default will be 
used')
                 .settings-row
                     +number('Socket receive buffer size:', 
`${connectionModel}.socketReceiveBufferSize`, 
'"ClientConnectorSocketReceiveBufferSize"', connectionEnabled, '0', '0',
-                        'Socket receive buffer size.<br/>\
+                        'Socket receive buffer size<br/>\
                         When set to <b>0</b>, operation system default will be 
used')
                 .settings-row
                     +number('Max connection cursors:', 
`${connectionModel}.maxOpenCursorsPerConnection`, 
'"ClientConnectorMaxOpenCursorsPerConnection"', connectionEnabled, '128', '0',
@@ -53,7 +55,30 @@ include /app/helpers/jade/mixins
                 .settings-row
                     +number('Pool size:', `${connectionModel}.threadPoolSize`, 
'"ClientConnectorThreadPoolSize"', connectionEnabled, 'max(8, 
availableProcessors)', '1',
                         'Size of thread pool that is in charge of processing 
SQL requests')
+                .settings-row(ng-if='$ctrl.available("2.4.0")')
+                    +number('Idle timeout:', `${connectionModel}.idleTimeout`, 
'"ClientConnectorIdleTimeout"', connectionEnabled, '0', '-1',
+                        'Idle timeout for client connections<br/>\
+                        Zero or negative means no timeout')
+                div(ng-if='$ctrl.available("2.5.0")')
+                    .settings-row
+                        +checkbox-enabled('Enable SSL', 
`${connectionModel}.sslEnabled`, '"ClientConnectorSslEnabled"', 
connectionEnabled, 'Enable secure socket layer on client connector')
+                    .settings-row
+                        +checkbox-enabled('Enable SSL client auth', 
`${connectionModel}.sslClientAuth`, '"ClientConnectorSslClientAuth"', 
sslEnabled, 'Flag indicating whether or not SSL client authentication is 
required')
+                    .settings-row
+                        +checkbox-enabled('Use Ignite SSL', 
`${connectionModel}.useIgniteSslContextFactory`, 
'"ClientConnectorUseIgniteSslContextFactory"', sslEnabled, 'Use SSL factory 
Ignite configuration')
+                    .settings-row
+                        +java-class('SSL factory:', 
`${connectionModel}.sslContextFactory`, '"ClientConnectorSslContextFactory"', 
sslFactoryEnabled, sslFactoryEnabled,
+                        'If SSL factory specified then replication will be 
performed through secure SSL channel created with this factory<br/>\
+                        If not present <b>isUseIgniteSslContextFactory()</b> 
flag will be evaluated<br/>\
+                        If set to <b>true</b> and 
<b>IgniteConfiguration#getSslContextFactory()</b> exists, then Ignite SSL 
context factory will be used to establish secure connection')
                 .settings-row
                     +checkbox-enabled('TCP_NODELAY option', 
`${connectionModel}.tcpNoDelay`, '"ClientConnectorTcpNoDelay"', 
connectionEnabled, 'Value for TCP_NODELAY socket option')
+                div(ng-if='$ctrl.available("2.4.0")')
+                    .settings-row
+                        +checkbox-enabled('JDBC Enabled', 
`${connectionModel}.jdbcEnabled`, '"ClientConnectorJdbcEnabled"', 
connectionEnabled, 'Access through JDBC is enabled')
+                    .settings-row
+                        +checkbox-enabled('ODBC Enabled', 
`${connectionModel}.odbcEnabled`, '"ClientConnectorOdbcEnabled"', 
connectionEnabled, 'Access through ODBC is enabled')
+                    .settings-row
+                        +checkbox-enabled('Thin client enabled', 
`${connectionModel}.thinClientEnabled`, '"ClientConnectorThinCliEnabled"', 
connectionEnabled, 'Access through thin client is enabled')
             .col-sm-6
                 +preview-xml-java(model, 'clusterClientConnector')

http://git-wip-us.apache.org/repos/asf/ignite/blob/819d7469/modules/web-console/frontend/app/services/Version.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/services/Version.service.js 
b/modules/web-console/frontend/app/services/Version.service.js
index ece8fcb..6daf3aa 100644
--- a/modules/web-console/frontend/app/services/Version.service.js
+++ b/modules/web-console/frontend/app/services/Version.service.js
@@ -77,6 +77,10 @@ export default class IgniteVersion {
 
         this.supportedVersions = [
             {
+                label: 'Ignite 2.5',
+                ignite: '2.5.0'
+            },
+            {
                 label: 'Ignite 2.4',
                 ignite: '2.4.0'
             },

http://git-wip-us.apache.org/repos/asf/ignite/blob/819d7469/modules/web-console/frontend/controllers/clusters-controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/controllers/clusters-controller.js 
b/modules/web-console/frontend/controllers/clusters-controller.js
index 2485fa6..7d987dd 100644
--- a/modules/web-console/frontend/controllers/clusters-controller.js
+++ b/modules/web-console/frontend/controllers/clusters-controller.js
@@ -468,7 +468,14 @@ export default ['$rootScope', '$scope', '$http', '$state', 
'$timeout', 'IgniteLe
                 failoverSpi: [],
                 logger: {Log4j: { mode: 'Default'}},
                 caches: linkId && _.find($scope.caches, {value: linkId}) ? 
[linkId] : [],
-                igfss: linkId && _.find($scope.igfss, {value: linkId}) ? 
[linkId] : []
+                igfss: linkId && _.find($scope.igfss, {value: linkId}) ? 
[linkId] : [],
+                clientConnectorConfiguration: {
+                    tcpNoDelay: true,
+                    jdbcEnabled: true,
+                    odbcEnabled: true,
+                    thinClientEnabled: true,
+                    useIgniteSslContextFactory: true
+                }
             });
         }
 

Reply via email to