# ignite-128: Reworking non-code usages.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4126b60e Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4126b60e Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4126b60e Branch: refs/heads/ignite-194 Commit: 4126b60e2762f17338be650e3dc59ea8d19c118c Parents: f2909f5 Author: vozerov-gridgain <voze...@gridgain.com> Authored: Thu Feb 5 11:45:04 2015 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Thu Feb 5 11:45:05 2015 +0300 ---------------------------------------------------------------------- .../HibernateL2CacheExampleNodeStartup.java | 2 +- .../internal/TaskEventSubjectIdSelfTest.java | 2 +- .../ClientAbstractMultiThreadedSelfTest.java | 6 +- .../client/ClientDefaultCacheSelfTest.java | 6 +- .../ClientTcpSslAuthenticationSelfTest.java | 6 +- ...skExecutionAfterTopologyRestartSelfTest.java | 6 +- .../client/ClientTopologyCacheSelfTest.java | 6 +- .../ClientAbstractMultiNodeSelfTest.java | 6 +- .../integration/ClientAbstractSelfTest.java | 8 +- .../integration/ClientPreferDirectSelfTest.java | 6 +- .../ClientTcpConnectivitySelfTest.java | 6 +- .../client/router/ClientFailedInitSelfTest.java | 6 +- .../rest/AbstractRestProcessorSelfTest.java | 6 +- .../rest/ClientMemcachedProtocolSelfTest.java | 4 +- .../rest/JettyRestProcessorSignedSelfTest.java | 4 +- .../rest/RestBinaryProtocolSelfTest.java | 6 +- .../rest/RestMemcacheProtocolSelfTest.java | 6 +- .../rest/RestProcessorMultiStartSelfTest.java | 2 +- .../rest/RestProcessorStartSelfTest.java | 6 +- .../processors/rest/RestProcessorTest.java | 6 +- .../rest/TaskCommandHandlerSelfTest.java | 6 +- .../ignite/jdbc/JdbcComplexQuerySelfTest.java | 2 +- .../ignite/jdbc/JdbcConnectionSelfTest.java | 6 +- .../ignite/jdbc/JdbcEmptyCacheSelfTest.java | 2 +- .../ignite/jdbc/JdbcLocalCachesSelfTest.java | 2 +- .../ignite/jdbc/JdbcMetadataSelfTest.java | 2 +- .../jdbc/JdbcPreparedStatementSelfTest.java | 2 +- .../ignite/jdbc/JdbcResultSetSelfTest.java | 2 +- .../ignite/jdbc/JdbcStatementSelfTest.java | 2 +- .../clients/src/test/resources/spring-cache.xml | 4 +- .../src/test/resources/spring-server-node.xml | 7 +- .../test/resources/spring-server-ssl-node.xml | 7 +- .../apache/ignite/IgniteBasicWarmupClosure.java | 2 +- .../ClientConnectionConfiguration.java | 552 ------------------- .../configuration/ClientMessageInterceptor.java | 45 -- .../configuration/ConnectorConfiguration.java | 552 +++++++++++++++++++ .../ConnectorMessageInterceptor.java | 45 ++ .../configuration/IgniteConfiguration.java | 16 +- .../apache/ignite/internal/IgniteKernal.java | 14 +- .../org/apache/ignite/internal/IgnitionEx.java | 8 +- .../router/GridTcpRouterConfiguration.java | 4 +- .../processors/rest/GridRestProcessor.java | 20 +- .../rest/protocols/GridRestProtocolAdapter.java | 8 +- .../rest/protocols/tcp/GridTcpRestProtocol.java | 6 +- .../ignite/internal/util/nio/GridNioServer.java | 4 +- .../node/VisorExecutorServiceConfiguration.java | 2 +- .../visor/node/VisorRestConfiguration.java | 2 +- .../ignite/startup/BasicWarmupClosure.java | 2 +- .../test/config/default-spring-url-testing.xml | 2 +- modules/core/src/test/config/example-cache.xml | 2 +- .../src/test/config/io-manager-benchmark.xml | 2 +- .../src/test/config/job-loadtest/client.xml | 2 +- .../src/test/config/job-loadtest/server.xml | 2 +- modules/core/src/test/config/jobs-load-base.xml | 2 +- .../src/test/config/load/cache-benchmark.xml | 2 +- .../test/config/load/cache-client-benchmark.xml | 2 +- .../core/src/test/config/load/dsi-load-base.xml | 2 +- .../src/test/config/load/merge-sort-base.xml | 2 +- .../test/config/loaders/grid-cfg-2-grids.xml | 4 +- .../core/src/test/config/loaders/grid-cfg.xml | 4 +- .../config/spring-cache-put-remove-load.xml | 2 +- .../src/test/config/spring-start-nodes-attr.xml | 2 +- .../core/src/test/config/spring-start-nodes.xml | 2 +- .../config/streamer/spring-streamer-base.xml | 2 +- .../test/config/websession/spring-cache-1.xml | 2 +- .../test/config/websession/spring-cache-2.xml | 2 +- .../test/config/websession/spring-cache-3.xml | 2 +- .../internal/GridDiscoveryEventSelfTest.java | 2 +- .../internal/GridLifecycleAwareSelfTest.java | 12 +- .../ignite/internal/GridStartStopSelfTest.java | 6 +- .../GridCacheDaemonNodeAbstractSelfTest.java | 2 +- .../cache/GridCacheDeploymentSelfTest.java | 2 +- .../cache/GridCacheLuceneQueryIndexTest.java | 2 +- ...GridCacheQueueMultiNodeAbstractSelfTest.java | 2 +- ...dCacheMultithreadedFailoverAbstractTest.java | 2 +- .../GridCachePreloadLifecycleAbstractTest.java | 2 +- .../GridCacheNearReaderPreloadSelfTest.java | 2 +- .../near/GridCachePartitionedLockSelfTest.java | 2 +- .../dataload/GridDataLoaderPerformanceTest.java | 2 +- ...heGgfsPerBlockLruEvictionPolicySelfTest.java | 4 +- .../processors/fs/GridGgfsAbstractSelfTest.java | 2 +- .../processors/fs/GridGgfsModesSelfTest.java | 4 +- .../cache/GridCacheCommandHandlerSelfTest.java | 2 +- ...tartupWithUndefinedGridGainHomeSelfTest.java | 2 +- .../spi/GridTcpSpiForwardingSelfTest.java | 2 +- .../discovery/tcp/GridTcpDiscoverySelfTest.java | 2 +- .../GridTcpDiscoverySnapshotHistoryTest.java | 2 +- .../testframework/junits/GridAbstractTest.java | 2 +- .../fs/GridGgfsHadoopDualAbstractSelfTest.java | 2 +- ...idGgfsHadoopFileSystemHandshakeSelfTest.java | 2 +- ...GgfsHadoopFileSystemLoggerStateSelfTest.java | 2 +- .../hadoop/GridHadoopAbstractSelfTest.java | 4 +- .../log4j/GridLog4jCorrectFileNameTest.java | 2 +- .../http/jetty/GridJettyRestProtocol.java | 2 +- .../ignite/internal/GridFactorySelfTest.java | 10 +- .../GridSpringBeanSerializationSelfTest.java | 2 +- .../scala/org/apache/ignite/visor/visor.scala | 2 +- modules/yardstick/config/ignite-base-config.xml | 2 +- .../yardstick/config/ignite-store-config.xml | 2 +- .../org/apache/ignite/yardstick/IgniteNode.java | 4 +- 100 files changed, 782 insertions(+), 788 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java index 322b417..c7f9c6c 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java @@ -54,7 +54,7 @@ public class HibernateL2CacheExampleNodeStartup { cfg.setGridName("hibernate-grid"); cfg.setLocalHost("127.0.0.1"); - cfg.setClientConnectionConfiguration(null); + cfg.setConnectorConfiguration(null); TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java index 0fe04ea..ce1ad15 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java @@ -53,7 +53,7 @@ public class TaskEventSubjectIdSelfTest extends GridCommonAbstractTest { @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); - cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); + cfg.setConnectorConfiguration(new ConnectorConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java index 1b2088d..be3ba1d 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java @@ -160,9 +160,9 @@ public abstract class ClientAbstractMultiThreadedSelfTest extends GridCommonAbst c.setLocalHost(HOST); - assert c.getClientConnectionConfiguration() == null; + assert c.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(REST_TCP_PORT_BASE); @@ -172,7 +172,7 @@ public abstract class ClientAbstractMultiThreadedSelfTest extends GridCommonAbst clientCfg.setSslContextFactory(sslContextFactory()); } - c.setClientConnectionConfiguration(clientCfg); + c.setConnectorConfiguration(clientCfg); TcpDiscoverySpi disco = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java index b2135e9..3b35e07 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java @@ -88,13 +88,13 @@ public class ClientDefaultCacheSelfTest extends GridCommonAbstractTest { @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setJettyPath(REST_JETTY_CFG); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); TcpDiscoverySpi disco = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpSslAuthenticationSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpSslAuthenticationSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpSslAuthenticationSelfTest.java index 16f5737..438b943 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpSslAuthenticationSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpSslAuthenticationSelfTest.java @@ -65,9 +65,9 @@ public class ClientTcpSslAuthenticationSelfTest extends GridCommonAbstractTest { c.setLocalHost(getTestResources().getLocalHost()); - assert c.getClientConnectionConfiguration() == null; + assert c.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(REST_TCP_PORT); clientCfg.setSslEnabled(true); @@ -81,7 +81,7 @@ public class ClientTcpSslAuthenticationSelfTest extends GridCommonAbstractTest { clientCfg.setSslContextFactory(factory); - c.setClientConnectionConfiguration(clientCfg); + c.setConnectorConfiguration(clientCfg); return c; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpTaskExecutionAfterTopologyRestartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpTaskExecutionAfterTopologyRestartSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpTaskExecutionAfterTopologyRestartSelfTest.java index cec28eb..5fc6b06 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpTaskExecutionAfterTopologyRestartSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTcpTaskExecutionAfterTopologyRestartSelfTest.java @@ -35,13 +35,13 @@ public class ClientTcpTaskExecutionAfterTopologyRestartSelfTest extends GridComm cfg.setLocalHost("127.0.0.1"); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(PORT); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTopologyCacheSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTopologyCacheSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTopologyCacheSelfTest.java index bf0f560..7d0bcf4 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTopologyCacheSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientTopologyCacheSelfTest.java @@ -273,13 +273,13 @@ public class ClientTopologyCacheSelfTest extends GridCommonAbstractTest { cfg.setLocalHost(HOST); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(BINARY_PORT); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); cfg.setCacheConfiguration(cacheCfg); cfg.setDiscoverySpi(disco); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java index 4fbc7df..a8b2661 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java @@ -131,10 +131,10 @@ public abstract class ClientAbstractMultiNodeSelfTest extends GridCommonAbstract c.setLocalHost(HOST); - assert c.getClientConnectionConfiguration() == null; + assert c.getConnectorConfiguration() == null; if (restEnabled) { - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(REST_TCP_PORT_BASE); @@ -145,7 +145,7 @@ public abstract class ClientAbstractMultiNodeSelfTest extends GridCommonAbstract clientCfg.setSslContextFactory(sslCtxFactory); } - c.setClientConnectionConfiguration(clientCfg); + c.setConnectorConfiguration(clientCfg); } TcpDiscoverySpi disco = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java index d5541b7..20bb62a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java @@ -189,9 +189,9 @@ public abstract class ClientAbstractSelfTest extends GridCommonAbstractTest { cfg.setLocalHost(HOST); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(BINARY_PORT); @@ -201,7 +201,7 @@ public abstract class ClientAbstractSelfTest extends GridCommonAbstractTest { clientCfg.setSslContextFactory(sslContextFactory()); } - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); TcpDiscoverySpi disco = new TcpDiscoverySpi(); @@ -212,7 +212,7 @@ public abstract class ClientAbstractSelfTest extends GridCommonAbstractTest { cfg.setCacheConfiguration(cacheConfiguration(null), cacheConfiguration("replicated"), cacheConfiguration("partitioned"), cacheConfiguration(CACHE_NAME)); - clientCfg.setMessageInterceptor(new ClientMessageInterceptor() { + clientCfg.setMessageInterceptor(new ConnectorMessageInterceptor() { @Override public Object onReceive(@Nullable Object obj) { if (obj != null) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientPreferDirectSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientPreferDirectSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientPreferDirectSelfTest.java index d6461c9..e7705df 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientPreferDirectSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientPreferDirectSelfTest.java @@ -66,13 +66,13 @@ public class ClientPreferDirectSelfTest extends GridCommonAbstractTest { c.setLocalHost(HOST); - assert c.getClientConnectionConfiguration() == null; + assert c.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(REST_TCP_PORT_BASE); - c.setClientConnectionConfiguration(clientCfg); + c.setConnectorConfiguration(clientCfg); return c; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpConnectivitySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpConnectivitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpConnectivitySelfTest.java index 8c23094..e42d824 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpConnectivitySelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpConnectivitySelfTest.java @@ -33,9 +33,9 @@ public class ClientTcpConnectivitySelfTest extends ClientAbstractConnectivitySel throws Exception { IgniteConfiguration cfg = getConfiguration(name); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); if (addr != null) clientCfg.setHost(addr); @@ -43,7 +43,7 @@ public class ClientTcpConnectivitySelfTest extends ClientAbstractConnectivitySel if (port != null) clientCfg.setPort(port); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); return G.start(cfg); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/client/router/ClientFailedInitSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/router/ClientFailedInitSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/router/ClientFailedInitSelfTest.java index 59e6063..ed0d720 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/router/ClientFailedInitSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/router/ClientFailedInitSelfTest.java @@ -64,16 +64,16 @@ public class ClientFailedInitSelfTest extends GridCommonAbstractTest { @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; cfg.setLocalHost(HOST); - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(BINARY_PORT); clientCfg.setJettyPath(REST_JETTY_CFG); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); TcpDiscoverySpi disco = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/AbstractRestProcessorSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/AbstractRestProcessorSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/AbstractRestProcessorSelfTest.java index de4b559..4cfcc0e 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/AbstractRestProcessorSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/AbstractRestProcessorSelfTest.java @@ -67,11 +67,11 @@ abstract class AbstractRestProcessorSelfTest extends GridCommonAbstractTest { cfg.setLocalHost(LOC_HOST); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); TcpDiscoverySpi disco = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java index fd6d1f6..43eccf4 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ClientMemcachedProtocolSelfTest.java @@ -78,10 +78,10 @@ public class ClientMemcachedProtocolSelfTest extends AbstractRestProcessorSelfTe @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); - assert cfg.getClientConnectionConfiguration() != null; + assert cfg.getConnectorConfiguration() != null; if (customPort != null) - cfg.getClientConnectionConfiguration().setPort(customPort); + cfg.getConnectorConfiguration().setPort(customPort); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java index 636b44e..b6576dd 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorSignedSelfTest.java @@ -35,9 +35,9 @@ public class JettyRestProcessorSignedSelfTest extends JettyRestProcessorAbstract @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); - assert cfg.getClientConnectionConfiguration() != null; + assert cfg.getConnectorConfiguration() != null; - cfg.getClientConnectionConfiguration().setSecretKey(REST_SECRET_KEY); + cfg.getConnectorConfiguration().setSecretKey(REST_SECRET_KEY); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java index b029da9..bf69c38 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java @@ -87,13 +87,13 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest { cfg.setLocalHost(HOST); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(PORT); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); TcpDiscoverySpi disco = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java index af65765..06d3188 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java @@ -81,13 +81,13 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest { cfg.setLocalHost(HOST); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(PORT); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); TcpDiscoverySpi disco = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java index aaa61c5..1bed679 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorMultiStartSelfTest.java @@ -31,7 +31,7 @@ public class RestProcessorMultiStartSelfTest extends GridCommonAbstractTest { @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); - cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); + cfg.setConnectorConfiguration(new ConnectorConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java index f51d237..2c035f4 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorStartSelfTest.java @@ -57,13 +57,13 @@ public class RestProcessorStartSelfTest extends GridCommonAbstractTest { cfg.setLocalHost(HOST); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(TCP_PORT); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); TestDiscoverySpi disc = new TestDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorTest.java index 102db49..67c230a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestProcessorTest.java @@ -110,14 +110,14 @@ public class RestProcessorTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); // Ensure - no authentication. clientCfg.setSecretKey(null); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); cfg.setCacheConfiguration(defaultCacheConfiguration()); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java index 817b8e1..9befeda 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/TaskCommandHandlerSelfTest.java @@ -92,13 +92,13 @@ public class TaskCommandHandlerSelfTest extends GridCommonAbstractTest { cfg.setLocalHost(HOST); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setPort(BINARY_PORT); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); TcpDiscoverySpi disco = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java index 035044d..5d47b17 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcComplexQuerySelfTest.java @@ -68,7 +68,7 @@ public class JdbcComplexQuerySelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); + cfg.setConnectorConfiguration(new ConnectorConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java index 3002bf8..dc7325c 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcConnectionSelfTest.java @@ -60,14 +60,14 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - assert cfg.getClientConnectionConfiguration() == null; + assert cfg.getConnectorConfiguration() == null; - ClientConnectionConfiguration clientCfg = new ClientConnectionConfiguration(); + ConnectorConfiguration clientCfg = new ConnectorConfiguration(); if (!gridName.endsWith("0")) clientCfg.setPort(CUSTOM_PORT); - cfg.setClientConnectionConfiguration(clientCfg); + cfg.setConnectorConfiguration(clientCfg); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java index f0d1ddb..6dce600 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcEmptyCacheSelfTest.java @@ -64,7 +64,7 @@ public class JdbcEmptyCacheSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); + cfg.setConnectorConfiguration(new ConnectorConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java index 2e26752..ae01f04 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcLocalCachesSelfTest.java @@ -69,7 +69,7 @@ public class JdbcLocalCachesSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); + cfg.setConnectorConfiguration(new ConnectorConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java index 9b15dc3..ed3d16c 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcMetadataSelfTest.java @@ -63,7 +63,7 @@ public class JdbcMetadataSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); + cfg.setConnectorConfiguration(new ConnectorConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java index 3ea72fe..a98cddf 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcPreparedStatementSelfTest.java @@ -69,7 +69,7 @@ public class JdbcPreparedStatementSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); + cfg.setConnectorConfiguration(new ConnectorConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java index aed9bfd..997cc75 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcResultSetSelfTest.java @@ -76,7 +76,7 @@ public class JdbcResultSetSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); + cfg.setConnectorConfiguration(new ConnectorConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java index 32e665a..2e1692e 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcStatementSelfTest.java @@ -69,7 +69,7 @@ public class JdbcStatementSelfTest extends GridCommonAbstractTest { cfg.setDiscoverySpi(disco); - cfg.setClientConnectionConfiguration(new ClientConnectionConfiguration()); + cfg.setConnectorConfiguration(new ConnectorConfiguration()); return cfg; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/resources/spring-cache.xml ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/resources/spring-cache.xml b/modules/clients/src/test/resources/spring-cache.xml index 1896225..2f59540 100644 --- a/modules/clients/src/test/resources/spring-cache.xml +++ b/modules/clients/src/test/resources/spring-cache.xml @@ -48,8 +48,8 @@ <property name="localHost" value="127.0.0.1"/> <!-- Client configuration. --> - <property name="clientConnectionConfiguration"> - <bean class="org.apache.ignite.configuration.ClientConnectionConfiguration"/> + <property name="connectorConfiguration"> + <bean class="org.apache.ignite.configuration.ConnectorConfiguration"/> </property> <property name="cacheConfiguration"> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/resources/spring-server-node.xml ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/resources/spring-server-node.xml b/modules/clients/src/test/resources/spring-server-node.xml index 25d7c28..f896e84 100644 --- a/modules/clients/src/test/resources/spring-server-node.xml +++ b/modules/clients/src/test/resources/spring-server-node.xml @@ -63,9 +63,6 @@ <!-- Set to local host address. --> <property name="localHost" value="127.0.0.1"/> - <!-- Enable rest protocol. --> - <property name="restEnabled" value="true"/> - <!-- Configure to skip all events for better performance. --> <property name="includeEventTypes"> <list> @@ -97,8 +94,8 @@ </property> <!-- Client configuration. --> - <property name="clientConnectionConfiguration"> - <bean class="org.apache.ignite.configuration.ClientConnectionConfiguration"> + <property name="connectorConfiguration"> + <bean class="org.apache.ignite.configuration.ConnectorConfiguration"> <!-- Configure TCP rest protocol. --> <property name="restTcpPort" value="10080"/> </bean> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/clients/src/test/resources/spring-server-ssl-node.xml ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/resources/spring-server-ssl-node.xml b/modules/clients/src/test/resources/spring-server-ssl-node.xml index 975a459..783d7eb 100644 --- a/modules/clients/src/test/resources/spring-server-ssl-node.xml +++ b/modules/clients/src/test/resources/spring-server-ssl-node.xml @@ -63,12 +63,9 @@ <!-- Set to local host address. --> <property name="localHost" value="127.0.0.1"/> - <!-- Enable rest protocol. --> - <property name="restEnabled" value="true"/> - <!-- Client configuration. --> - <property name="clientConnectionConfiguration"> - <bean class="org.apache.ignite.configuration.ClientConnectionConfiguration"> + <property name="connectorConfiguration"> + <bean class="org.apache.ignite.configuration.ConnectorConfiguration"> <!-- Configure TCP+SSL rest protocol. --> <property name="restTcpSslEnabled" value="true"/> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/core/src/main/java/org/apache/ignite/IgniteBasicWarmupClosure.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteBasicWarmupClosure.java b/modules/core/src/main/java/org/apache/ignite/IgniteBasicWarmupClosure.java index 8350f94..deed54f 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteBasicWarmupClosure.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteBasicWarmupClosure.java @@ -338,7 +338,7 @@ public class IgniteBasicWarmupClosure implements IgniteInClosure<IgniteConfigura IgniteConfiguration cp = new IgniteConfiguration(); - cp.setClientConnectionConfiguration(null); + cp.setConnectorConfiguration(null); Collection<CacheConfiguration> reduced = new ArrayList<>(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectionConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectionConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectionConfiguration.java deleted file mode 100644 index 9c84aa8..0000000 --- a/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectionConfiguration.java +++ /dev/null @@ -1,552 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.configuration; - -import org.apache.ignite.*; -import org.apache.ignite.internal.client.ssl.*; -import org.jetbrains.annotations.*; - -import java.net.*; -import java.util.concurrent.*; - -/** - * REST access configuration. - */ -public class ClientConnectionConfiguration { - /** Default TCP server port. */ - public static final int DFLT_TCP_PORT = 11211; - - /** Default TCP_NODELAY flag. */ - public static final boolean DFLT_TCP_NODELAY = true; - - /** Default TCP direct buffer flag. */ - public static final boolean DFLT_TCP_DIRECT_BUF = false; - - /** Default REST idle timeout. */ - public static final int DFLT_IDLE_TIMEOUT = 7000; - - /** Default rest port range. */ - public static final int DFLT_PORT_RANGE = 100; - - /** Default size of REST thread pool. */ - public static final int DFLT_CORE_THREAD_CNT = IgniteConfiguration.DFLT_PUBLIC_CORE_THREAD_CNT; - - /** Default max size of REST thread pool. */ - public static final int DFLT_MAX_THREAD_CNT = IgniteConfiguration.DFLT_PUBLIC_CORE_THREAD_CNT; - - /** Default keep alive time for REST thread pool. */ - public static final long DFLT_KEEP_ALIVE_TIME = 0; - - /** Default max queue capacity of REST thread pool. */ - public static final int DFLT_THREADPOOL_QUEUE_CAP = Integer.MAX_VALUE; - - /** Default socket send and receive buffer size. */ - public static final int DFLT_SOCK_BUF_SIZE = 32 * 1024; - - /** Jetty XML configuration path. */ - private String jettyPath; - - /** REST secret key. */ - private String secretKey; - - /** TCP host. */ - private String host; - - /** TCP port. */ - private int port = DFLT_TCP_PORT; - - /** TCP no delay flag. */ - private boolean noDelay = DFLT_TCP_NODELAY; - - /** REST TCP direct buffer flag. */ - private boolean directBuf = DFLT_TCP_DIRECT_BUF; - - /** REST TCP send buffer size. */ - private int sndBufSize = DFLT_SOCK_BUF_SIZE; - - /** REST TCP receive buffer size. */ - private int rcvBufSize = DFLT_SOCK_BUF_SIZE; - - /** REST TCP send queue limit. */ - private int sndQueueLimit; - - /** REST TCP selector count. */ - private int selectorCnt = Math.min(4, Runtime.getRuntime().availableProcessors()); - - /** Idle timeout. */ - private long idleTimeout = DFLT_IDLE_TIMEOUT; - - /** SSL enable flag, default is disabled. */ - private boolean sslEnabled; - - /** SSL need client auth flag. */ - private boolean sslClientAuth; - - /** SSL context factory for rest binary server. */ - private GridSslContextFactory sslCtxFactory; - - /** Port range */ - private int portRange = DFLT_PORT_RANGE; - - /** REST requests executor service. */ - private ExecutorService execSvc; - - /** REST executor service shutdown flag. */ - private boolean execSvcShutdown = true; - - /** Client message interceptor. */ - private ClientMessageInterceptor msgInterceptor; - - /** - * Creates client connection configuration with all default values. - */ - public ClientConnectionConfiguration() { - // No-op. - } - - /** - * Creates client connection configuration by copying all properties from - * given configuration. - * - * @param cfg Client configuration. - */ - public ClientConnectionConfiguration(ClientConnectionConfiguration cfg) { - assert cfg != null; - - msgInterceptor = cfg.getMessageInterceptor(); - execSvc = cfg.getExecutorService(); - execSvcShutdown = cfg.isExecutorServiceShutdown(); - idleTimeout = cfg.getIdleTimeout(); - jettyPath = cfg.getJettyPath(); - portRange = cfg.getPortRange(); - secretKey = cfg.getSecretKey(); - directBuf = cfg.isDirectBuffer(); - host = cfg.getHost(); - noDelay = cfg.isNoDelay(); - port = cfg.getPort(); - rcvBufSize = cfg.getReceiveBufferSize(); - selectorCnt = cfg.getSelectorCount(); - sndBufSize = cfg.getSendBufferSize(); - sndQueueLimit = cfg.getSendQueueLimit(); - sslClientAuth = cfg.isSslClientAuth(); - sslCtxFactory = cfg.getSslContextFactory(); - sslEnabled = cfg.isSslEnabled(); - } - - /** - * Sets path, either absolute or relative to {@code IGNITE_HOME}, to {@code JETTY} - * XML configuration file. {@code JETTY} is used to support REST over HTTP protocol for - * accessing GridGain APIs remotely. - * - * @param jettyPath Path to {@code JETTY} XML configuration file. - */ - public void setJettyPath(String jettyPath) { - this.jettyPath = jettyPath; - } - - /** - * Gets path, either absolute or relative to {@code IGNITE_HOME}, to {@code Jetty} - * XML configuration file. {@code Jetty} is used to support REST over HTTP protocol for - * accessing GridGain APIs remotely. - * <p> - * If not provided, Jetty instance with default configuration will be started picking - * {@link IgniteSystemProperties#IGNITE_JETTY_HOST} and {@link IgniteSystemProperties#IGNITE_JETTY_PORT} - * as host and port respectively. - * - * @return Path to {@code JETTY} XML configuration file. - * @see IgniteSystemProperties#IGNITE_JETTY_HOST - * @see IgniteSystemProperties#IGNITE_JETTY_PORT - */ - public String getJettyPath() { - return jettyPath; - } - - /** - * Sets secret key to authenticate REST requests. If key is {@code null} or empty authentication is disabled. - * - * @param secretKey REST secret key. - */ - public void setSecretKey(@Nullable String secretKey) { - this.secretKey = secretKey; - } - - /** - * Gets secret key to authenticate REST requests. If key is {@code null} or empty authentication is disabled. - * - * @return Secret key. - * @see IgniteSystemProperties#IGNITE_JETTY_HOST - * @see IgniteSystemProperties#IGNITE_JETTY_PORT - */ - @Nullable public String getSecretKey() { - return secretKey; - } - - /** - * Gets host for TCP binary protocol server. This can be either an - * IP address or a domain name. - * <p> - * If not defined, system-wide local address will be used - * (see {@link IgniteConfiguration#getLocalHost()}. - * <p> - * You can also use {@code 0.0.0.0} value to bind to all - * locally-available IP addresses. - * - * @return TCP host. - */ - public String getHost() { - return host; - } - - /** - * Sets host for TCP binary protocol server. - * - * @param host TCP host. - */ - public void setHost(String host) { - this.host = host; - } - - /** - * Gets port for TCP binary protocol server. - * <p> - * Default is {@link #DFLT_TCP_PORT}. - * - * @return TCP port. - */ - public int getPort() { - return port; - } - - /** - * Sets port for TCP binary protocol server. - * - * @param port TCP port. - */ - public void setPort(int port) { - this.port = port; - } - - /** - * Gets flag indicating whether {@code TCP_NODELAY} option should be set for accepted client connections. - * Setting this option reduces network latency and should be set to {@code true} in majority of cases. - * For more information, see {@link Socket#setTcpNoDelay(boolean)} - * <p/> - * If not specified, default value is {@link #DFLT_TCP_NODELAY}. - * - * @return Whether {@code TCP_NODELAY} option should be enabled. - */ - public boolean isNoDelay() { - return noDelay; - } - - /** - * Sets whether {@code TCP_NODELAY} option should be set for all accepted client connections. - * - * @param noDelay {@code True} if option should be enabled. - * @see #isNoDelay() - */ - public void setNoDelay(boolean noDelay) { - this.noDelay = noDelay; - } - - /** - * Gets flag indicating whether REST TCP server should use direct buffers. A direct buffer is a buffer - * that is allocated and accessed using native system calls, without using JVM heap. Enabling direct - * buffer <em>may</em> improve performance and avoid memory issues (long GC pauses due to huge buffer - * size). - * - * @return Whether direct buffer should be used. - */ - public boolean isDirectBuffer() { - return directBuf; - } - - /** - * Sets whether to use direct buffer for REST TCP server. - * - * @param directBuf {@code True} if option should be enabled. - * @see #isDirectBuffer() - */ - public void setDirectBuffer(boolean directBuf) { - this.directBuf = directBuf; - } - - /** - * Gets REST TCP server send buffer size. - * - * @return REST TCP server send buffer size (0 for default). - */ - public int getSendBufferSize() { - return sndBufSize; - } - - /** - * Sets REST TCP server send buffer size. - * - * @param sndBufSize Send buffer size. - * @see #getSendBufferSize() - */ - public void setSendBufferSize(int sndBufSize) { - this.sndBufSize = sndBufSize; - } - - /** - * Gets REST TCP server receive buffer size. - * - * @return REST TCP server receive buffer size (0 for default). - */ - public int getReceiveBufferSize() { - return rcvBufSize; - } - - /** - * Sets REST TCP server receive buffer size. - * - * @param rcvBufSize Receive buffer size. - * @see #getReceiveBufferSize() - */ - public void setReceiveBufferSize(int rcvBufSize) { - this.rcvBufSize = rcvBufSize; - } - - /** - * Gets REST TCP server send queue limit. If the limit exceeds, all successive writes will - * block until the queue has enough capacity. - * - * @return REST TCP server send queue limit (0 for unlimited). - */ - public int getSendQueueLimit() { - return sndQueueLimit; - } - - /** - * Sets REST TCP server send queue limit. - * - * @param sndQueueLimit REST TCP server send queue limit (0 for unlimited). - * @see #getSendQueueLimit() - */ - public void setSendQueueLimit(int sndQueueLimit) { - this.sndQueueLimit = sndQueueLimit; - } - - /** - * Gets number of selector threads in REST TCP server. Higher value for this parameter - * may increase throughput, but also increases context switching. - * - * @return Number of selector threads for REST TCP server. - */ - public int getSelectorCount() { - return selectorCnt; - } - - /** - * Sets number of selector threads for REST TCP server. - * - * @param selectorCnt Number of selector threads for REST TCP server. - * @see #getSelectorCount() - */ - public void setSelectorCount(int selectorCnt) { - this.selectorCnt = selectorCnt; - } - - /** - * Gets idle timeout for REST server. - * <p> - * This setting is used to reject half-opened sockets. If no packets - * come within idle timeout, the connection is closed. - * - * @return Idle timeout in milliseconds. - */ - public long getIdleTimeout() { - return idleTimeout; - } - - /** - * Sets idle timeout for REST server. - * - * @param idleTimeout Idle timeout in milliseconds. - * @see #getIdleTimeout() - */ - public void setIdleTimeout(long idleTimeout) { - this.idleTimeout = idleTimeout; - } - - /** - * Whether secure socket layer should be enabled on binary rest server. - * <p> - * Note that if this flag is set to {@code true}, an instance of {@link GridSslContextFactory} - * should be provided, otherwise binary rest protocol will fail to start. - * - * @return {@code True} if SSL should be enabled. - */ - public boolean isSslEnabled() { - return sslEnabled; - } - - /** - * Sets whether Secure Socket Layer should be enabled for REST TCP binary protocol. - * <p/> - * Note that if this flag is set to {@code true}, then a valid instance of {@link GridSslContextFactory} - * should be provided in {@code GridConfiguration}. Otherwise, TCP binary protocol will fail to start. - * - * @param sslEnabled {@code True} if SSL should be enabled. - */ - public void setSslEnabled(boolean sslEnabled) { - this.sslEnabled = sslEnabled; - } - - /** - * Gets a flag indicating whether or not remote clients will be required to have a valid SSL certificate which - * validity will be verified with trust manager. - * - * @return Whether or not client authentication is required. - */ - public boolean isSslClientAuth() { - return sslClientAuth; - } - - /** - * Sets flag indicating whether or not SSL client authentication is required. - * - * @param sslClientAuth Whether or not client authentication is required. - */ - public void setSslClientAuth(boolean sslClientAuth) { - this.sslClientAuth = sslClientAuth; - } - - /** - * Gets context factory that will be used for creating a secure socket layer of rest binary server. - * - * @return SslContextFactory instance. - * @see GridSslContextFactory - */ - public GridSslContextFactory getSslContextFactory() { - return sslCtxFactory; - } - - /** - * Sets instance of {@link GridSslContextFactory} that will be used to create an instance of {@code SSLContext} - * for Secure Socket Layer on TCP binary protocol. This factory will only be used if - * {@link #setSslEnabled(boolean)} is set to {@code true}. - * - * @param sslCtxFactory Instance of {@link GridSslContextFactory} - */ - public void setSslContextFactory(GridSslContextFactory sslCtxFactory) { - this.sslCtxFactory = sslCtxFactory; - } - - /** - * Gets number of ports to try if configured port is already in use. - * - * @return Number of ports to try. - */ - public int getPortRange() { - return portRange; - } - - /** - * Sets number of ports to try if configured one is in use. - * - * @param portRange Port range. - */ - public void setPortRange(int portRange) { - this.portRange = portRange; - } - - /** - * Should return an instance of fully configured thread pool to be used for - * processing of client messages (REST requests). - * <p> - * If not provided, new executor service will be created using the following - * configuration: - * <ul> - * <li>Core pool size - {@link #DFLT_CORE_THREAD_CNT}</li> - * <li>Max pool size - {@link #DFLT_MAX_THREAD_CNT}</li> - * <li>Queue capacity - {@link #DFLT_THREADPOOL_QUEUE_CAP}</li> - * </ul> - * - * @return Thread pool implementation to be used for processing of client - * messages. - */ - public ExecutorService getExecutorService() { - return execSvc; - } - - /** - * Sets thread pool to use for processing of client messages (REST requests). - * - * @param execSvc Thread pool to use for processing of client messages. - */ - public void setExecutorService(ExecutorService execSvc) { - this.execSvc = execSvc; - } - - /** - * Sets REST executor service shutdown flag. - * - * @param execSvcShutdown REST executor service shutdown flag. - */ - public void setExecutorServiceShutdown(boolean execSvcShutdown) { - this.execSvcShutdown = execSvcShutdown; - } - - /** - * Shutdown flag for REST executor service. - * <p> - * If not provided, default value {@code true} will be used which will shutdown - * executor service when GridGain stops regardless whether it was started before GridGain - * or by GridGain. - * - * @return REST executor service shutdown flag. - */ - public boolean isExecutorServiceShutdown() { - return execSvcShutdown; - } - - /** - * Gets interceptor for objects, moving to and from remote clients. - * If this method returns {@code null} then no interception will be applied. - * <p> - * Setting interceptor allows to transform all objects exchanged via REST protocol. - * For example if you use custom serialisation on client you can write interceptor - * to transform binary representations received from client to Java objects and later - * access them from java code directly. - * <p> - * Default value is {@code null}. - * - * @see ClientMessageInterceptor - * @return Interceptor. - */ - @Nullable public ClientMessageInterceptor getMessageInterceptor() { - return msgInterceptor; - } - - /** - * Sets client message interceptor. - * <p> - * Setting interceptor allows to transform all objects exchanged via REST protocol. - * For example if you use custom serialisation on client you can write interceptor - * to transform binary representations received from client to Java objects and later - * access them from java code directly. - * - * @param interceptor Interceptor. - */ - public void setMessageInterceptor(ClientMessageInterceptor interceptor) { - msgInterceptor = interceptor; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/core/src/main/java/org/apache/ignite/configuration/ClientMessageInterceptor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ClientMessageInterceptor.java b/modules/core/src/main/java/org/apache/ignite/configuration/ClientMessageInterceptor.java deleted file mode 100644 index e1c2e66..0000000 --- a/modules/core/src/main/java/org/apache/ignite/configuration/ClientMessageInterceptor.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.configuration; - -import org.jetbrains.annotations.*; - -/** - * Interface for user-defined object interceptors. - * <p> - * Interceptors allow user to transform objects send and received via REST protocols. - * For example they could be used for customized multi-language marshalling by - * converting binary object representation received from client to java object. - */ -public interface ClientMessageInterceptor { - /** - * Intercepts received objects. - * - * @param obj Original incoming object. - * @return Object which should replace original in later processing. - */ - @Nullable public Object onReceive(@Nullable Object obj); - - /** - * Intercepts received objects. - * - * @param obj Original incoming object. - * @return Object which should be send to remote client instead of original. - */ - @Nullable public Object onSend(Object obj); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4126b60e/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java new file mode 100644 index 0000000..da4b174 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java @@ -0,0 +1,552 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.configuration; + +import org.apache.ignite.*; +import org.apache.ignite.internal.client.ssl.*; +import org.jetbrains.annotations.*; + +import java.net.*; +import java.util.concurrent.*; + +/** + * REST access configuration. + */ +public class ConnectorConfiguration { + /** Default TCP server port. */ + public static final int DFLT_TCP_PORT = 11211; + + /** Default TCP_NODELAY flag. */ + public static final boolean DFLT_TCP_NODELAY = true; + + /** Default TCP direct buffer flag. */ + public static final boolean DFLT_TCP_DIRECT_BUF = false; + + /** Default REST idle timeout. */ + public static final int DFLT_IDLE_TIMEOUT = 7000; + + /** Default rest port range. */ + public static final int DFLT_PORT_RANGE = 100; + + /** Default size of REST thread pool. */ + public static final int DFLT_CORE_THREAD_CNT = IgniteConfiguration.DFLT_PUBLIC_CORE_THREAD_CNT; + + /** Default max size of REST thread pool. */ + public static final int DFLT_MAX_THREAD_CNT = IgniteConfiguration.DFLT_PUBLIC_CORE_THREAD_CNT; + + /** Default keep alive time for REST thread pool. */ + public static final long DFLT_KEEP_ALIVE_TIME = 0; + + /** Default max queue capacity of REST thread pool. */ + public static final int DFLT_THREADPOOL_QUEUE_CAP = Integer.MAX_VALUE; + + /** Default socket send and receive buffer size. */ + public static final int DFLT_SOCK_BUF_SIZE = 32 * 1024; + + /** Jetty XML configuration path. */ + private String jettyPath; + + /** REST secret key. */ + private String secretKey; + + /** TCP host. */ + private String host; + + /** TCP port. */ + private int port = DFLT_TCP_PORT; + + /** TCP no delay flag. */ + private boolean noDelay = DFLT_TCP_NODELAY; + + /** REST TCP direct buffer flag. */ + private boolean directBuf = DFLT_TCP_DIRECT_BUF; + + /** REST TCP send buffer size. */ + private int sndBufSize = DFLT_SOCK_BUF_SIZE; + + /** REST TCP receive buffer size. */ + private int rcvBufSize = DFLT_SOCK_BUF_SIZE; + + /** REST TCP send queue limit. */ + private int sndQueueLimit; + + /** REST TCP selector count. */ + private int selectorCnt = Math.min(4, Runtime.getRuntime().availableProcessors()); + + /** Idle timeout. */ + private long idleTimeout = DFLT_IDLE_TIMEOUT; + + /** SSL enable flag, default is disabled. */ + private boolean sslEnabled; + + /** SSL need client auth flag. */ + private boolean sslClientAuth; + + /** SSL context factory for rest binary server. */ + private GridSslContextFactory sslCtxFactory; + + /** Port range */ + private int portRange = DFLT_PORT_RANGE; + + /** REST requests executor service. */ + private ExecutorService execSvc; + + /** REST executor service shutdown flag. */ + private boolean execSvcShutdown = true; + + /** Client message interceptor. */ + private ConnectorMessageInterceptor msgInterceptor; + + /** + * Creates client connection configuration with all default values. + */ + public ConnectorConfiguration() { + // No-op. + } + + /** + * Creates client connection configuration by copying all properties from + * given configuration. + * + * @param cfg Client configuration. + */ + public ConnectorConfiguration(ConnectorConfiguration cfg) { + assert cfg != null; + + msgInterceptor = cfg.getMessageInterceptor(); + execSvc = cfg.getExecutorService(); + execSvcShutdown = cfg.isExecutorServiceShutdown(); + idleTimeout = cfg.getIdleTimeout(); + jettyPath = cfg.getJettyPath(); + portRange = cfg.getPortRange(); + secretKey = cfg.getSecretKey(); + directBuf = cfg.isDirectBuffer(); + host = cfg.getHost(); + noDelay = cfg.isNoDelay(); + port = cfg.getPort(); + rcvBufSize = cfg.getReceiveBufferSize(); + selectorCnt = cfg.getSelectorCount(); + sndBufSize = cfg.getSendBufferSize(); + sndQueueLimit = cfg.getSendQueueLimit(); + sslClientAuth = cfg.isSslClientAuth(); + sslCtxFactory = cfg.getSslContextFactory(); + sslEnabled = cfg.isSslEnabled(); + } + + /** + * Sets path, either absolute or relative to {@code IGNITE_HOME}, to {@code JETTY} + * XML configuration file. {@code JETTY} is used to support REST over HTTP protocol for + * accessing GridGain APIs remotely. + * + * @param jettyPath Path to {@code JETTY} XML configuration file. + */ + public void setJettyPath(String jettyPath) { + this.jettyPath = jettyPath; + } + + /** + * Gets path, either absolute or relative to {@code IGNITE_HOME}, to {@code Jetty} + * XML configuration file. {@code Jetty} is used to support REST over HTTP protocol for + * accessing GridGain APIs remotely. + * <p> + * If not provided, Jetty instance with default configuration will be started picking + * {@link IgniteSystemProperties#IGNITE_JETTY_HOST} and {@link IgniteSystemProperties#IGNITE_JETTY_PORT} + * as host and port respectively. + * + * @return Path to {@code JETTY} XML configuration file. + * @see IgniteSystemProperties#IGNITE_JETTY_HOST + * @see IgniteSystemProperties#IGNITE_JETTY_PORT + */ + public String getJettyPath() { + return jettyPath; + } + + /** + * Sets secret key to authenticate REST requests. If key is {@code null} or empty authentication is disabled. + * + * @param secretKey REST secret key. + */ + public void setSecretKey(@Nullable String secretKey) { + this.secretKey = secretKey; + } + + /** + * Gets secret key to authenticate REST requests. If key is {@code null} or empty authentication is disabled. + * + * @return Secret key. + * @see IgniteSystemProperties#IGNITE_JETTY_HOST + * @see IgniteSystemProperties#IGNITE_JETTY_PORT + */ + @Nullable public String getSecretKey() { + return secretKey; + } + + /** + * Gets host for TCP binary protocol server. This can be either an + * IP address or a domain name. + * <p> + * If not defined, system-wide local address will be used + * (see {@link IgniteConfiguration#getLocalHost()}. + * <p> + * You can also use {@code 0.0.0.0} value to bind to all + * locally-available IP addresses. + * + * @return TCP host. + */ + public String getHost() { + return host; + } + + /** + * Sets host for TCP binary protocol server. + * + * @param host TCP host. + */ + public void setHost(String host) { + this.host = host; + } + + /** + * Gets port for TCP binary protocol server. + * <p> + * Default is {@link #DFLT_TCP_PORT}. + * + * @return TCP port. + */ + public int getPort() { + return port; + } + + /** + * Sets port for TCP binary protocol server. + * + * @param port TCP port. + */ + public void setPort(int port) { + this.port = port; + } + + /** + * Gets flag indicating whether {@code TCP_NODELAY} option should be set for accepted client connections. + * Setting this option reduces network latency and should be set to {@code true} in majority of cases. + * For more information, see {@link Socket#setTcpNoDelay(boolean)} + * <p/> + * If not specified, default value is {@link #DFLT_TCP_NODELAY}. + * + * @return Whether {@code TCP_NODELAY} option should be enabled. + */ + public boolean isNoDelay() { + return noDelay; + } + + /** + * Sets whether {@code TCP_NODELAY} option should be set for all accepted client connections. + * + * @param noDelay {@code True} if option should be enabled. + * @see #isNoDelay() + */ + public void setNoDelay(boolean noDelay) { + this.noDelay = noDelay; + } + + /** + * Gets flag indicating whether REST TCP server should use direct buffers. A direct buffer is a buffer + * that is allocated and accessed using native system calls, without using JVM heap. Enabling direct + * buffer <em>may</em> improve performance and avoid memory issues (long GC pauses due to huge buffer + * size). + * + * @return Whether direct buffer should be used. + */ + public boolean isDirectBuffer() { + return directBuf; + } + + /** + * Sets whether to use direct buffer for REST TCP server. + * + * @param directBuf {@code True} if option should be enabled. + * @see #isDirectBuffer() + */ + public void setDirectBuffer(boolean directBuf) { + this.directBuf = directBuf; + } + + /** + * Gets REST TCP server send buffer size. + * + * @return REST TCP server send buffer size (0 for default). + */ + public int getSendBufferSize() { + return sndBufSize; + } + + /** + * Sets REST TCP server send buffer size. + * + * @param sndBufSize Send buffer size. + * @see #getSendBufferSize() + */ + public void setSendBufferSize(int sndBufSize) { + this.sndBufSize = sndBufSize; + } + + /** + * Gets REST TCP server receive buffer size. + * + * @return REST TCP server receive buffer size (0 for default). + */ + public int getReceiveBufferSize() { + return rcvBufSize; + } + + /** + * Sets REST TCP server receive buffer size. + * + * @param rcvBufSize Receive buffer size. + * @see #getReceiveBufferSize() + */ + public void setReceiveBufferSize(int rcvBufSize) { + this.rcvBufSize = rcvBufSize; + } + + /** + * Gets REST TCP server send queue limit. If the limit exceeds, all successive writes will + * block until the queue has enough capacity. + * + * @return REST TCP server send queue limit (0 for unlimited). + */ + public int getSendQueueLimit() { + return sndQueueLimit; + } + + /** + * Sets REST TCP server send queue limit. + * + * @param sndQueueLimit REST TCP server send queue limit (0 for unlimited). + * @see #getSendQueueLimit() + */ + public void setSendQueueLimit(int sndQueueLimit) { + this.sndQueueLimit = sndQueueLimit; + } + + /** + * Gets number of selector threads in REST TCP server. Higher value for this parameter + * may increase throughput, but also increases context switching. + * + * @return Number of selector threads for REST TCP server. + */ + public int getSelectorCount() { + return selectorCnt; + } + + /** + * Sets number of selector threads for REST TCP server. + * + * @param selectorCnt Number of selector threads for REST TCP server. + * @see #getSelectorCount() + */ + public void setSelectorCount(int selectorCnt) { + this.selectorCnt = selectorCnt; + } + + /** + * Gets idle timeout for REST server. + * <p> + * This setting is used to reject half-opened sockets. If no packets + * come within idle timeout, the connection is closed. + * + * @return Idle timeout in milliseconds. + */ + public long getIdleTimeout() { + return idleTimeout; + } + + /** + * Sets idle timeout for REST server. + * + * @param idleTimeout Idle timeout in milliseconds. + * @see #getIdleTimeout() + */ + public void setIdleTimeout(long idleTimeout) { + this.idleTimeout = idleTimeout; + } + + /** + * Whether secure socket layer should be enabled on binary rest server. + * <p> + * Note that if this flag is set to {@code true}, an instance of {@link GridSslContextFactory} + * should be provided, otherwise binary rest protocol will fail to start. + * + * @return {@code True} if SSL should be enabled. + */ + public boolean isSslEnabled() { + return sslEnabled; + } + + /** + * Sets whether Secure Socket Layer should be enabled for REST TCP binary protocol. + * <p/> + * Note that if this flag is set to {@code true}, then a valid instance of {@link GridSslContextFactory} + * should be provided in {@code GridConfiguration}. Otherwise, TCP binary protocol will fail to start. + * + * @param sslEnabled {@code True} if SSL should be enabled. + */ + public void setSslEnabled(boolean sslEnabled) { + this.sslEnabled = sslEnabled; + } + + /** + * Gets a flag indicating whether or not remote clients will be required to have a valid SSL certificate which + * validity will be verified with trust manager. + * + * @return Whether or not client authentication is required. + */ + public boolean isSslClientAuth() { + return sslClientAuth; + } + + /** + * Sets flag indicating whether or not SSL client authentication is required. + * + * @param sslClientAuth Whether or not client authentication is required. + */ + public void setSslClientAuth(boolean sslClientAuth) { + this.sslClientAuth = sslClientAuth; + } + + /** + * Gets context factory that will be used for creating a secure socket layer of rest binary server. + * + * @return SslContextFactory instance. + * @see GridSslContextFactory + */ + public GridSslContextFactory getSslContextFactory() { + return sslCtxFactory; + } + + /** + * Sets instance of {@link GridSslContextFactory} that will be used to create an instance of {@code SSLContext} + * for Secure Socket Layer on TCP binary protocol. This factory will only be used if + * {@link #setSslEnabled(boolean)} is set to {@code true}. + * + * @param sslCtxFactory Instance of {@link GridSslContextFactory} + */ + public void setSslContextFactory(GridSslContextFactory sslCtxFactory) { + this.sslCtxFactory = sslCtxFactory; + } + + /** + * Gets number of ports to try if configured port is already in use. + * + * @return Number of ports to try. + */ + public int getPortRange() { + return portRange; + } + + /** + * Sets number of ports to try if configured one is in use. + * + * @param portRange Port range. + */ + public void setPortRange(int portRange) { + this.portRange = portRange; + } + + /** + * Should return an instance of fully configured thread pool to be used for + * processing of client messages (REST requests). + * <p> + * If not provided, new executor service will be created using the following + * configuration: + * <ul> + * <li>Core pool size - {@link #DFLT_CORE_THREAD_CNT}</li> + * <li>Max pool size - {@link #DFLT_MAX_THREAD_CNT}</li> + * <li>Queue capacity - {@link #DFLT_THREADPOOL_QUEUE_CAP}</li> + * </ul> + * + * @return Thread pool implementation to be used for processing of client + * messages. + */ + public ExecutorService getExecutorService() { + return execSvc; + } + + /** + * Sets thread pool to use for processing of client messages (REST requests). + * + * @param execSvc Thread pool to use for processing of client messages. + */ + public void setExecutorService(ExecutorService execSvc) { + this.execSvc = execSvc; + } + + /** + * Sets REST executor service shutdown flag. + * + * @param execSvcShutdown REST executor service shutdown flag. + */ + public void setExecutorServiceShutdown(boolean execSvcShutdown) { + this.execSvcShutdown = execSvcShutdown; + } + + /** + * Shutdown flag for REST executor service. + * <p> + * If not provided, default value {@code true} will be used which will shutdown + * executor service when GridGain stops regardless whether it was started before GridGain + * or by GridGain. + * + * @return REST executor service shutdown flag. + */ + public boolean isExecutorServiceShutdown() { + return execSvcShutdown; + } + + /** + * Gets interceptor for objects, moving to and from remote clients. + * If this method returns {@code null} then no interception will be applied. + * <p> + * Setting interceptor allows to transform all objects exchanged via REST protocol. + * For example if you use custom serialisation on client you can write interceptor + * to transform binary representations received from client to Java objects and later + * access them from java code directly. + * <p> + * Default value is {@code null}. + * + * @see ConnectorMessageInterceptor + * @return Interceptor. + */ + @Nullable public ConnectorMessageInterceptor getMessageInterceptor() { + return msgInterceptor; + } + + /** + * Sets client message interceptor. + * <p> + * Setting interceptor allows to transform all objects exchanged via REST protocol. + * For example if you use custom serialisation on client you can write interceptor + * to transform binary representations received from client to Java objects and later + * access them from java code directly. + * + * @param interceptor Interceptor. + */ + public void setMessageInterceptor(ConnectorMessageInterceptor interceptor) { + msgInterceptor = interceptor; + } +}