ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [17/31] incubator-ignite git commit: #ignite-128: All classes are moved.
Date Tue, 03 Feb 2015 14:18:44 GMT
#ignite-128: All classes are moved.


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

Branch: refs/heads/ignite-128
Commit: b5b2f3099ad828a348903fd8a68181f8cad8f734
Parents: 4127b4d
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Feb 3 12:26:38 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Feb 3 12:26:38 2015 +0300

----------------------------------------------------------------------
 .../config/grid-client-spring-config.xml        |    2 +-
 .../ClientAbstractMultiThreadedSelfTest.java    |    2 +-
 .../client/ClientReconnectionSelfTest.java      |    2 +-
 .../ClientTcpSslAuthenticationSelfTest.java     |    2 +-
 .../client/impl/ClientCacheFlagsCodecTest.java  |    2 +-
 .../client/impl/ClientComputeImplSelfTest.java  |    1 +
 .../client/impl/ClientDataImplSelfTest.java     |    1 +
 .../impl/ClientFutureAdapterSelfTest.java       |    1 +
 .../impl/ClientPartitionAffinitySelfTest.java   |    1 +
 .../ClientPropertiesConfigurationSelfTest.java  |    3 +-
 .../ClientAbstractConnectivitySelfTest.java     |    1 +
 .../ClientAbstractMultiNodeSelfTest.java        |    1 +
 .../integration/ClientAbstractSelfTest.java     |    1 +
 .../integration/ClientPreferDirectSelfTest.java |    1 +
 .../ClientTcpDirectMultiNodeSelfTest.java       |    1 +
 .../integration/ClientTcpDirectSelfTest.java    |    1 +
 .../ClientTcpSslDirectMultiNodeSelfTest.java    |    1 +
 .../integration/ClientTcpSslDirectSelfTest.java |    1 +
 .../ClientTcpUnreachableMultiNodeSelfTest.java  |    1 +
 .../client/router/ClientFailedInitSelfTest.java |    3 +-
 .../router/TcpRouterAbstractSelfTest.java       |    1 +
 .../router/TcpRouterMultiNodeSelfTest.java      |    1 +
 .../internal/TaskEventSubjectIdSelfTest.java    |    1 +
 .../rest/RestProcessorStartSelfTest.java        |    1 +
 .../rest/TaskCommandHandlerSelfTest.java        |    1 +
 .../loadtests/client/ClientCacheBenchmark.java  |    1 +
 .../ignite/client/GridClientConfiguration.java  |  868 +++++++++++++
 .../apache/ignite/client/balancer/package.html  |   24 -
 .../impl/GridClientAbstractProjection.java      |  458 -------
 .../client/impl/GridClientAndPredicate.java     |   52 -
 .../client/impl/GridClientComputeImpl.java      |  293 -----
 .../ignite/client/impl/GridClientDataImpl.java  |  389 ------
 .../impl/GridClientDataMetricsAdapter.java      |  160 ---
 .../client/impl/GridClientFutureAdapter.java    |  349 ------
 .../client/impl/GridClientFutureCallback.java   |   35 -
 .../ignite/client/impl/GridClientImpl.java      |  524 --------
 .../ignite/client/impl/GridClientNodeImpl.java  |  411 -------
 .../impl/GridClientNodeMetricsAdapter.java      |  990 ---------------
 .../client/impl/GridClientThreadFactory.java    |   62 -
 .../impl/connection/GridClientConnection.java   |  531 --------
 .../GridClientConnectionCloseReason.java        |   32 -
 .../connection/GridClientConnectionManager.java |   71 --
 .../GridClientConnectionManagerAdapter.java     |  763 ------------
 .../GridClientConnectionManagerOsImpl.java      |   47 -
 .../GridClientConnectionResetException.java     |   48 -
 .../connection/GridClientNioTcpConnection.java  | 1159 ------------------
 .../impl/connection/GridClientTopology.java     |  450 -------
 .../GridConnectionIdleClosedException.java      |   36 -
 .../org/apache/ignite/client/impl/package.html  |   23 -
 .../ignite/client/marshaller/jdk/package.html   |   24 -
 .../client/marshaller/optimized/package.html    |   24 -
 .../ignite/client/marshaller/package.html       |   23 -
 .../ignite/client/router/impl/package.html      |   23 -
 .../apache/ignite/client/router/package.html    |   23 -
 .../org/apache/ignite/client/ssl/package.html   |   24 -
 .../org/apache/ignite/client/util/package.html  |   24 -
 .../ignite/internal/client/GridClient.java      |    8 +-
 .../internal/client/GridClientCompute.java      |   66 +-
 .../client/GridClientConfiguration.java         |  867 -------------
 .../ignite/internal/client/GridClientData.java  |    2 +-
 .../internal/client/GridClientFactory.java      |    3 +-
 .../internal/client/GridClientNodeMetrics.java  |    2 +-
 .../client/GridClientTopologyListener.java      |    2 +-
 .../client/balancer/GridClientLoadBalancer.java |    2 +-
 .../impl/GridClientAbstractProjection.java      |  458 +++++++
 .../client/impl/GridClientAndPredicate.java     |   52 +
 .../client/impl/GridClientComputeImpl.java      |  293 +++++
 .../client/impl/GridClientDataImpl.java         |  389 ++++++
 .../impl/GridClientDataMetricsAdapter.java      |  160 +++
 .../client/impl/GridClientFutureAdapter.java    |  349 ++++++
 .../client/impl/GridClientFutureCallback.java   |   35 +
 .../internal/client/impl/GridClientImpl.java    |  525 ++++++++
 .../client/impl/GridClientNodeImpl.java         |  411 +++++++
 .../impl/GridClientNodeMetricsAdapter.java      |  990 +++++++++++++++
 .../client/impl/GridClientThreadFactory.java    |   62 +
 .../impl/connection/GridClientConnection.java   |  529 ++++++++
 .../GridClientConnectionCloseReason.java        |   32 +
 .../connection/GridClientConnectionManager.java |   71 ++
 .../GridClientConnectionManagerAdapter.java     |  764 ++++++++++++
 .../GridClientConnectionManagerOsImpl.java      |   48 +
 .../GridClientConnectionResetException.java     |   48 +
 .../connection/GridClientNioTcpConnection.java  | 1159 ++++++++++++++++++
 .../impl/connection/GridClientTopology.java     |  451 +++++++
 .../GridConnectionIdleClosedException.java      |   36 +
 .../internal/client/router/GridTcpRouter.java   |    4 +-
 .../router/impl/GridRouterClientImpl.java       |    5 +-
 .../ignite/jdbc/IgniteJdbcConnection.java       |    1 +
 .../GridHadoopClientProtocolProvider.java       |    1 +
 88 files changed, 7808 insertions(+), 7992 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/config/grid-client-spring-config.xml
----------------------------------------------------------------------
diff --git a/modules/clients/config/grid-client-spring-config.xml b/modules/clients/config/grid-client-spring-config.xml
index 473d920..8c6772a 100644
--- a/modules/clients/config/grid-client-spring-config.xml
+++ b/modules/clients/config/grid-client-spring-config.xml
@@ -39,7 +39,7 @@
     <!--
         Configuration below demonstrates how to setup caches within grid nodes.
     -->
-    <bean id="grid.client.cfg" class="org.apache.ignite.internal.client.GridClientConfiguration">
+    <bean id="grid.client.cfg" class="org.apache.ignite.client.GridClientConfiguration">
         <!-- Data configurations. -->
         <property name="dataConfigurations">
             <list>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/ClientAbstractMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/ClientAbstractMultiThreadedSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/ClientAbstractMultiThreadedSelfTest.java
index b3dc41f..c714084 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/ClientAbstractMultiThreadedSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/ClientAbstractMultiThreadedSelfTest.java
@@ -26,10 +26,10 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.client.balancer.*;
+import org.apache.ignite.internal.client.impl.*;
 import org.apache.ignite.internal.client.ssl.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.resources.*;
-import org.apache.ignite.client.impl.*;
 import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/ClientReconnectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/ClientReconnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/ClientReconnectionSelfTest.java
index 04343ec..7f7ed6f 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/ClientReconnectionSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/ClientReconnectionSelfTest.java
@@ -18,8 +18,8 @@
 package org.apache.ignite.client;
 
 import org.apache.ignite.*;
-import org.apache.ignite.client.impl.connection.*;
 import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.client.impl.connection.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.testframework.junits.common.*;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/ClientTcpSslAuthenticationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/ClientTcpSslAuthenticationSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/ClientTcpSslAuthenticationSelfTest.java
index 801235b..48b9862 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/ClientTcpSslAuthenticationSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/ClientTcpSslAuthenticationSelfTest.java
@@ -18,9 +18,9 @@
 package org.apache.ignite.client;
 
 import org.apache.ignite.configuration.*;
-import org.apache.ignite.client.impl.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.client.balancer.*;
+import org.apache.ignite.internal.client.impl.*;
 import org.apache.ignite.internal.client.ssl.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientCacheFlagsCodecTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientCacheFlagsCodecTest.java b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientCacheFlagsCodecTest.java
index edbe92c..8e31476 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientCacheFlagsCodecTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientCacheFlagsCodecTest.java
@@ -18,8 +18,8 @@
 package org.apache.ignite.client.impl;
 
 import junit.framework.*;
-import org.apache.ignite.client.impl.connection.*;
 import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.client.impl.connection.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.rest.handlers.cache.*;
 import org.apache.ignite.internal.util.typedef.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientComputeImplSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientComputeImplSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientComputeImplSelfTest.java
index f46fc87..f3bc0a9 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientComputeImplSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientComputeImplSelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.client.impl;
 
 import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.client.impl.*;
 import org.apache.ignite.testframework.junits.common.*;
 
 import java.util.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientDataImplSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientDataImplSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientDataImplSelfTest.java
index a4876cc..fbdfe3c 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientDataImplSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientDataImplSelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.client.impl;
 
 import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.client.impl.*;
 import org.apache.ignite.testframework.junits.common.*;
 
 import java.util.concurrent.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientFutureAdapterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientFutureAdapterSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientFutureAdapterSelfTest.java
index ca9b706..5aac9bf 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientFutureAdapterSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientFutureAdapterSelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.client.impl;
 
 import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.client.impl.*;
 import org.apache.ignite.testframework.junits.common.*;
 
 import java.util.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPartitionAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPartitionAffinitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPartitionAffinitySelfTest.java
index 88b5e60..ca88bd1 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPartitionAffinitySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPartitionAffinitySelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cache.affinity.consistenthash.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.client.impl.*;
 import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.testframework.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPropertiesConfigurationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPropertiesConfigurationSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPropertiesConfigurationSelfTest.java
index 0dc9534..247fe34 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPropertiesConfigurationSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/impl/ClientPropertiesConfigurationSelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.client.impl;
 
 import org.apache.commons.io.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.client.balancer.*;
 import org.apache.ignite.internal.util.*;
@@ -29,7 +30,7 @@ import java.io.*;
 import java.net.*;
 import java.util.*;
 
-import static org.apache.ignite.internal.client.GridClientConfiguration.*;
+import static org.apache.ignite.client.GridClientConfiguration.*;
 
 /**
  * Properties-based configuration self test.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractConnectivitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractConnectivitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractConnectivitySelfTest.java
index 4392256..ec2c271 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractConnectivitySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractConnectivitySelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.client.integration;
 
 import org.apache.ignite.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.internal.util.typedef.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java
index 418901f..bf3250b 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractMultiNodeSelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.client.integration;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractSelfTest.java
index f376a4b..5d7bb19 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientAbstractSelfTest.java
@@ -24,6 +24,7 @@ import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.GridCache;
 import org.apache.ignite.cache.affinity.consistenthash.*;
 import org.apache.ignite.cache.store.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.client.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientPreferDirectSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientPreferDirectSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientPreferDirectSelfTest.java
index 921957c..b353bfa 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientPreferDirectSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientPreferDirectSelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.client.integration;
 
 import org.apache.ignite.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.client.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectMultiNodeSelfTest.java
index 68f7f92..89f7b2f 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectMultiNodeSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.client.integration;
 
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 
 import java.util.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectSelfTest.java
index e8db016..563952e 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpDirectSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.client.integration;
 
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.client.ssl.*;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectMultiNodeSelfTest.java
index d34ca8f..df3bb58 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectMultiNodeSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.client.integration;
 
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.client.ssl.*;
 import org.apache.ignite.testframework.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectSelfTest.java
index a67c101..d49971a 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpSslDirectSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.client.integration;
 
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.client.ssl.*;
 import org.apache.ignite.testframework.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
index 201ffa5..5450fa7 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.client.integration;
 
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.client.balancer.*;
 import org.apache.ignite.internal.util.typedef.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/router/ClientFailedInitSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/router/ClientFailedInitSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/router/ClientFailedInitSelfTest.java
index 6fd44a1..c28b915 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/router/ClientFailedInitSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/router/ClientFailedInitSelfTest.java
@@ -18,10 +18,11 @@
 package org.apache.ignite.client.router;
 
 import org.apache.ignite.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
-import org.apache.ignite.client.impl.connection.*;
 import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.client.impl.connection.*;
 import org.apache.ignite.internal.client.router.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterAbstractSelfTest.java
index a85f351..d5eedd3 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterAbstractSelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.client.router;
 
 import org.apache.ignite.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.client.router.*;
 import org.apache.ignite.internal.client.router.impl.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterMultiNodeSelfTest.java
index 00091d0..cb7f8d4 100644
--- a/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/client/router/TcpRouterMultiNodeSelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.client.router;
 
 import org.apache.ignite.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.client.router.*;
 import org.apache.ignite.internal.client.router.impl.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/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 d1d21d7..cc36411 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
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal;
 
 import org.apache.ignite.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/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 8db093a..bf9b044 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
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.rest;
 
+import org.apache.ignite.client.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.client.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/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 b899566..3b7bf5f 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
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.rest;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientCacheBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientCacheBenchmark.java b/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientCacheBenchmark.java
index e1945d6..ce36cbf 100644
--- a/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientCacheBenchmark.java
+++ b/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientCacheBenchmark.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.loadtests.client;
 
 import org.apache.ignite.*;
+import org.apache.ignite.client.*;
 import org.apache.ignite.internal.client.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/core/src/main/java/org/apache/ignite/client/GridClientConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientConfiguration.java
new file mode 100644
index 0000000..8bf9d52
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/client/GridClientConfiguration.java
@@ -0,0 +1,868 @@
+/*
+ * 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.client;
+
+import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.client.balancer.*;
+import org.apache.ignite.internal.client.marshaller.*;
+import org.apache.ignite.internal.client.marshaller.optimized.*;
+import org.apache.ignite.internal.client.ssl.*;
+import org.apache.ignite.portables.*;
+import org.apache.ignite.plugin.security.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.jetbrains.annotations.*;
+
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Java client configuration.
+ */
+public class GridClientConfiguration {
+    /** Default client protocol. */
+    public static final GridClientProtocol DFLT_CLIENT_PROTOCOL = GridClientProtocol.TCP;
+
+    /** Default topology refresh frequency is 2 sec. */
+    public static final int DFLT_TOP_REFRESH_FREQ = 2000;
+
+    /** Default maximum time connection can be idle. */
+    public static final long DFLT_MAX_CONN_IDLE_TIME = 30000;
+
+    /** Default ping interval in milliseconds. */
+    public static final long DFLT_PING_INTERVAL = 5000;
+
+    /** Default ping timeout in milliseconds. */
+    public static final long DFLT_PING_TIMEOUT = 7000;
+
+    /** Default connect timeout in milliseconds. */
+    public static final int DFLT_CONNECT_TIMEOUT = 10000;
+
+    /** Default flag setting for TCP_NODELAY option. */
+    public static final boolean DFLT_TCP_NODELAY = true;
+
+    /** List of servers to connect to. */
+    private Collection<String> srvs = Collections.emptySet();
+
+    /** List of routers to connect to. */
+    private Collection<String> routers = Collections.emptySet();
+
+    /** Client protocol. */
+    private GridClientProtocol proto = DFLT_CLIENT_PROTOCOL;
+
+    /** Socket connect timeout. */
+    private int connectTimeout = DFLT_CONNECT_TIMEOUT;
+
+    /** TCP_NODELAY flag. */
+    private boolean tcpNoDelay = DFLT_TCP_NODELAY;
+
+    /** SSL context factory  */
+    private GridSslContextFactory sslCtxFactory;
+
+    /** Flag indicating whether metrics cache is enabled. */
+    private boolean enableMetricsCache = true;
+
+    /** Flag indicating whether attributes cache is enabled. */
+    private boolean enableAttrsCache = true;
+
+    /** Flag indicating whether metrics should be automatically fetched. */
+    private boolean autoFetchMetrics = true;
+
+    /** Flag indicating whether attributes should be automatically fetched. */
+    private boolean autoFetchAttrs = true;
+
+    /** Topology refresh  frequency. */
+    private long topRefreshFreq = DFLT_TOP_REFRESH_FREQ;
+
+    /** Max time of connection idleness. */
+    private long maxConnIdleTime = DFLT_MAX_CONN_IDLE_TIME;
+
+    /** Ping interval. */
+    private long pingInterval = DFLT_PING_INTERVAL;
+
+    /** Ping timeout. */
+    private long pingTimeout = DFLT_PING_TIMEOUT;
+
+    /** Default balancer. */
+    private GridClientLoadBalancer balancer = new GridClientRandomBalancer();
+
+    /** Collection of data configurations. */
+    private Map<String, GridClientDataConfiguration> dataCfgs = Collections.emptyMap();
+
+    /** Credentials. */
+    private GridSecurityCredentialsProvider credProvider;
+
+    /** Executor. */
+    private ExecutorService executor;
+
+    /** Marshaller. */
+    private GridClientMarshaller marshaller = new GridClientOptimizedMarshaller();
+
+    /** Daemon flag. */
+    private boolean daemon;
+
+    /** Portable configuration. */
+    private PortableConfiguration portableCfg;
+
+    /**
+     * Creates default configuration.
+     */
+    public GridClientConfiguration() {
+        // No-op.
+    }
+
+    /**
+     * Copy constructor.
+     *
+     * @param cfg Configuration to be copied.
+     */
+    public GridClientConfiguration(GridClientConfiguration cfg) {
+        // Preserve alphabetical order for maintenance;
+        autoFetchAttrs = cfg.isAutoFetchAttributes();
+        autoFetchMetrics = cfg.isAutoFetchMetrics();
+        balancer = cfg.getBalancer();
+        connectTimeout = cfg.getConnectTimeout();
+        credProvider = cfg.getSecurityCredentialsProvider();
+        enableAttrsCache = cfg.isEnableAttributesCache();
+        enableMetricsCache = cfg.isEnableMetricsCache();
+        executor = cfg.getExecutorService();
+        marshaller = cfg.getMarshaller();
+        maxConnIdleTime = cfg.getMaxConnectionIdleTime();
+        pingInterval = cfg.getPingInterval();
+        pingTimeout = cfg.getPingTimeout();
+        proto = cfg.getProtocol();
+        routers = cfg.getRouters();
+        srvs = cfg.getServers();
+        sslCtxFactory = cfg.getSslContextFactory();
+        tcpNoDelay = cfg.isTcpNoDelay();
+        topRefreshFreq = cfg.getTopologyRefreshFrequency();
+        daemon = cfg.isDaemon();
+        marshaller = cfg.getMarshaller();
+        portableCfg = cfg.getPortableConfiguration();
+
+        setDataConfigurations(cfg.getDataConfigurations());
+    }
+
+    /**
+     * Creates properties-based configuration based on passed in properties.
+     *
+     * @param in Client configuration in properties format.
+     * @throws GridClientException If parsing configuration failed.
+     */
+    public GridClientConfiguration(Properties in) throws GridClientException {
+        this("gg.client", in);
+    }
+
+    /**
+     * Creates properties-based configuration.
+     *
+     * @param prefix Prefix for the client properties.
+     * @param in Properties map to load configuration from.
+     * @throws GridClientException If parsing configuration failed.
+     */
+    public GridClientConfiguration(String prefix, Properties in) throws GridClientException {
+        load(prefix, in);
+    }
+
+    /**
+     * Collection of {@code 'host:port'} pairs representing
+     * remote grid servers used to establish initial connection to
+     * the grid. Once connection is established, GridGain will get
+     * a full view on grid topology and will be able to connect to
+     * any available remote node.
+     * <p>
+     * Note that only these addresses are used to perform
+     * topology updates in background and to detect Grid connectivity
+     * status.
+     *
+     * @return Collection of {@code 'host:port'} pairs representing remote
+     *      grid servers.
+     * @see GridClient#connected()
+     */
+    public Collection<String> getServers() {
+        return Collections.unmodifiableCollection(srvs);
+    }
+
+    /**
+     * Collection of {@code 'host:port'} pairs representing
+     * grid routers used to establish connection to the grid.
+     * <p>
+     * Addresses here could be owned by Routers as well as
+     * by individual Grid nodes. No additional connections
+     * will be made even if other Grid nodes are available.
+     * <p>
+     * This configuration mode is designated for cases when
+     * some Grid nodes are unavailable (due to security restrictions
+     * for example). So only few nodes acting as routers or
+     * dedicated router components used to access entire Grid.
+     * <p>
+     * This configuration parameter will not be used and direct
+     * connections to all grid nodes will be established if
+     * {@link #getServers()} return non-empty collection value.
+     * <p>
+     * Note that only these addresses are used to perform
+     * topology updates in background and to detect Grid connectivity
+     * status.
+     *
+     * @return Collection of {@code 'host:port'} pairs
+     *      representing routers.
+     * @see GridClient#connected()
+     */
+    public Collection<String> getRouters() {
+        return routers;
+    }
+
+    /**
+     * Sets list of servers this client should connect to.
+     *
+     * @param srvs List of servers.
+     */
+    public void setServers(Collection<String> srvs) {
+        this.srvs = srvs != null ? srvs : Collections.<String>emptySet();
+    }
+
+    /**
+     * Sets list of routers this client should connect to.
+     *
+     * @param routers List of routers.
+     */
+    public void setRouters(Collection<String> routers) {
+        this.routers = routers != null ? routers : Collections.<String>emptySet();
+    }
+
+    /**
+     * Gets protocol for communication between client and remote grid.
+     * Default is defined by {@link #DFLT_CLIENT_PROTOCOL} constant.
+     *
+     * @return Protocol for communication between client and remote grid.
+     */
+    public GridClientProtocol getProtocol() {
+        return proto;
+    }
+
+    /**
+     * Sets protocol type that should be used in communication. Protocol type cannot be changed after
+     * client is created.
+     *
+     * @param proto Protocol type.
+     * @see GridClientProtocol
+     */
+    public void setProtocol(GridClientProtocol proto) {
+        this.proto = proto;
+    }
+
+    /**
+     * Gets timeout for socket connect operation in milliseconds. If {@code 0} -
+     * then wait infinitely. Default is defined by {@link #DFLT_CONNECT_TIMEOUT} constant.
+     *
+     * @return Connect timeout in milliseconds.
+     */
+    public int getConnectTimeout() {
+        return connectTimeout;
+    }
+
+    /**
+     * Gets flag indicating whether {@code TCP_NODELAY} flag should be enabled for outgoing connections.
+     * This flag reduces communication latency and in the majority of cases should be set to true. For more
+     * information, see {@link Socket#setTcpNoDelay(boolean)}
+     * <p>
+     * If not set, default value is {@link #DFLT_TCP_NODELAY}
+     *
+     * @return If {@code TCP_NODELAY} should be set on underlying sockets.
+     */
+    public boolean isTcpNoDelay() {
+        return tcpNoDelay;
+    }
+
+    /**
+     * Sets whether {@code TCP_NODELAY} flag should be set on underlying socket connections.
+     *
+     * @param tcpNoDelay {@code True} if flag should be set.
+     */
+    public void setTcpNoDelay(boolean tcpNoDelay) {
+        this.tcpNoDelay = tcpNoDelay;
+    }
+
+    /**
+     * Sets timeout for socket connect operation.
+     *
+     * @param connectTimeout Connect timeout in milliseconds.
+     */
+    public void setConnectTimeout(int connectTimeout) {
+        this.connectTimeout = connectTimeout;
+    }
+
+    /**
+     * Gets a factory that should be used for SSL context creation.
+     * If it returns {@code null} then SSL is considered disabled.
+     *
+     * @return Factory instance.
+     * @see GridSslContextFactory
+     */
+    public GridSslContextFactory getSslContextFactory() {
+        return sslCtxFactory;
+    }
+
+    /**
+     * Sets SSL context factory that will be used for creation of secure connections.
+     *
+     * @param sslCtxFactory Context factory.
+     */
+    public void setSslContextFactory(GridSslContextFactory sslCtxFactory) {
+        this.sslCtxFactory = sslCtxFactory;
+    }
+
+    /**
+     * Default balancer to be used for computational client. It can be overridden
+     * for different compute instances. By default {@link GridClientRandomBalancer}
+     * is used.
+     *
+     * @return Default balancer to be used for computational client.
+     */
+    public GridClientLoadBalancer getBalancer() {
+        return balancer;
+    }
+
+    /**
+     * Sets default compute balancer.
+     *
+     * @param balancer Balancer to use.
+     */
+    public void setBalancer(GridClientLoadBalancer balancer) {
+        this.balancer = balancer;
+    }
+
+    /**
+     * Gets client credentials provider to authenticate with.
+     *
+     * @return Credentials provider.
+     */
+    public GridSecurityCredentialsProvider getSecurityCredentialsProvider() {
+        return credProvider;
+    }
+
+    /**
+     * Sets client credentials provider used in authentication process.
+     *
+     * @param credProvider Client credentials provider.
+     */
+    public void setSecurityCredentialsProvider(GridSecurityCredentialsProvider credProvider) {
+        this.credProvider = credProvider;
+    }
+
+    /**
+     * Gets a collection of data configurations specified by user.
+     *
+     * @return Collection of data configurations (possibly empty).
+     */
+    public Collection<GridClientDataConfiguration> getDataConfigurations() {
+        return dataCfgs.values();
+    }
+
+    /**
+     * Sets data configurations.
+     *
+     * @param dataCfgs Data configurations.
+     */
+    public void setDataConfigurations(Collection<? extends GridClientDataConfiguration> dataCfgs) {
+        this.dataCfgs = U.newHashMap(dataCfgs.size());
+
+        for (GridClientDataConfiguration dataCfg : dataCfgs)
+            this.dataCfgs.put(dataCfg.getName(), new GridClientDataConfiguration(dataCfg));
+    }
+
+    /**
+     * Gets data configuration for a cache with specified name.
+     *
+     * @param name Name of grid cache.
+     * @return Configuration or {@code null} if there is not configuration for specified name.
+     */
+    public GridClientDataConfiguration getDataConfiguration(@Nullable String name) {
+        return dataCfgs.get(name);
+    }
+
+    /**
+     * Sets flag indicating whether node and cache metrics should be cached by client.
+     *
+     * @param enableMetricsCache {@code True} if cache should be enabled.
+     */
+    public void setEnableMetricsCache(boolean enableMetricsCache) {
+        this.enableMetricsCache = enableMetricsCache;
+    }
+
+    /**
+     * Enables client to cache per-node and per-cache metrics internally. In memory
+     * sensitive environments, such as mobile platforms, caching metrics
+     * may be expensive and, hence, this parameter should be set to {@code false}.
+     * <p>
+     * Note that topology is refreshed automatically every {@link #getTopologyRefreshFrequency()}
+     * interval, and if {@link #isAutoFetchMetrics()} enabled then metrics will be updated
+     * with that frequency.
+     * <p>
+     * By default this value is {@code true} which means that metrics will be cached
+     * on the client side.
+     *
+     * @return {@code True} if metrics cache is enabled, {@code false} otherwise.
+     */
+    public boolean isEnableMetricsCache() {
+        return enableMetricsCache;
+    }
+
+    /**
+     * Sets flag indicating whether node attributes should be cached by client.
+     *
+     * @param enableAttrsCache {@code True} if cache should be enabled.
+     */
+    public void setEnableAttributesCache(boolean enableAttrsCache) {
+        this.enableAttrsCache = enableAttrsCache;
+    }
+
+    /**
+     * Enables client to cache per-node attributes internally. In memory
+     * sensitive environments, such as mobile platforms, caching node attributes
+     * may be expensive and, hence, this parameter should be set to {@code false}.
+     * <p>
+     * Note that node attributes are static and, if cached, there is no need
+     * to refresh them again. If {@link #isAutoFetchAttributes()} is enabled then
+     * attributes will be cached during client initialization.
+     * <p>
+     * By default this value is {@code true} which means that node attributes
+     * will be cached on the client side.
+     *
+     * @return {@code True} if attributes cache is enabled, {@code false} otherwise.
+     */
+    public boolean isEnableAttributesCache() {
+        return enableAttrsCache;
+    }
+
+    /**
+     * Sets flag indicating whether node metrics should be fetched by client automatically.
+     *
+     * @param autoFetchMetrics {@code True} if metrics should be fetched.
+     */
+    public void setAutoFetchMetrics(boolean autoFetchMetrics) {
+        this.autoFetchMetrics = autoFetchMetrics;
+    }
+
+    /**
+     * Allows client to fetch node metrics automatically with background topology refresh.
+     * <p>
+     * Note that this parameter will only affect auto-fetching of node metrics.
+     * Cache metrics still need to be fetched explicitly via
+     * {@link GridClientData#metrics()} or {@link GridClientData#metricsAsync()} methods.
+     * <p>
+     * By default this value is {@code true} which means that metrics will be fetched
+     * automatically.
+     *
+     * @return {@code true} if client should fetch metrics on topology refresh,
+     *      {@code false} otherwise.
+     */
+    public boolean isAutoFetchMetrics() {
+        return autoFetchMetrics;
+    }
+
+    /**
+     * Sets flag indicating whether node attributes should be fetched by client automatically.
+     *
+     * @param autoFetchAttrs {@code True} if attributes should be fetched.
+     */
+    public void setAutoFetchAttributes(boolean autoFetchAttrs) {
+        this.autoFetchAttrs = autoFetchAttrs;
+    }
+
+    /**
+     * Allows client to fetch node attributes automatically with background topology refresh.
+     * <p>
+     * By default this value is {@code true} which means that attributes will be fetched
+     * automatically.
+     *
+     * @return {@code True} if client should fetch attributes once on topology refresh,
+     *      {@code false} otherwise.
+     */
+    public boolean isAutoFetchAttributes() {
+        return autoFetchAttrs;
+    }
+
+    /**
+     * Gets topology refresh frequency. Default is defined by {@link #DFLT_TOP_REFRESH_FREQ}
+     * constant.
+     *
+     * @return Topology refresh frequency.
+     */
+    public long getTopologyRefreshFrequency() {
+        return topRefreshFreq;
+    }
+
+    /**
+     * Sets topology refresh frequency. If topology cache is enabled, grid topology
+     * will be refreshed every {@code topRefreshFreq} milliseconds.
+     *
+     * @param topRefreshFreq Topology refresh frequency in milliseconds.
+     */
+    public void setTopologyRefreshFrequency(long topRefreshFreq) {
+        this.topRefreshFreq = topRefreshFreq;
+    }
+
+    /**
+     * Gets maximum amount of time that client connection can be idle before it is closed.
+     * Default is defined by {@link #DFLT_MAX_CONN_IDLE_TIME} constant.
+     *
+     * @return Maximum idle time in milliseconds.
+     */
+    public long getMaxConnectionIdleTime() {
+        return maxConnIdleTime;
+    }
+
+    /**
+     * Sets maximum time in milliseconds which connection can be idle before it is closed by client.
+     *
+     * @param maxConnIdleTime Maximum time of connection idleness in milliseconds.
+     */
+    public void setMaxConnectionIdleTime(long maxConnIdleTime) {
+        this.maxConnIdleTime = maxConnIdleTime;
+    }
+
+    /**
+     * Gets time interval in milliseconds between ping requests. Default is defined
+     * by {@link #DFLT_PING_INTERVAL} constant.
+     * <p>
+     * Ping requests used by {@link GridClientProtocol#TCP} protocol
+     * to detect network failures and half-opened sockets.
+     *
+     * @return Ping interval.
+     */
+    public long getPingInterval() {
+        return pingInterval;
+    }
+
+    /**
+     * Sets ping interval in milliseconds.
+     *
+     * @param pingInterval Ping interval in milliseconds.
+     */
+    public void setPingInterval(long pingInterval) {
+        this.pingInterval = pingInterval;
+    }
+
+    /**
+     * Gets ping timeout. Default is defined by {@link #DFLT_PING_TIMEOUT} constant.
+     * <p>
+     * Ping requests used by {@link GridClientProtocol#TCP} protocol
+     * to detect network failures and half-opened sockets.
+     * If no response received in period equal to this timeout than connection
+     * considered broken and closed.
+     *
+     * @return Ping timeout.
+     */
+    public long getPingTimeout() {
+        return pingTimeout;
+    }
+
+    /**
+     * Sets ping timeout in milliseconds.
+     *
+     * @param pingTimeout Ping interval in milliseconds.
+     */
+    public void setPingTimeout(long pingTimeout) {
+        this.pingTimeout = pingTimeout;
+    }
+
+    /**
+     * Gets {@link ExecutorService} where client could run asynchronous operations.
+     * <p>
+     * When using {@link GridClientProtocol#TCP} this executor should be able to serve at least
+     * {@code Runtime.getRuntime().availableProcessors()} parallel tasks.
+     * <p>
+     * Note that this executor will be automatically shut down when client get closed.
+     *
+     * @return {@link ExecutorService} instance to use.
+     */
+    public ExecutorService getExecutorService() {
+        return executor;
+    }
+
+    /**
+     * Sets executor service.
+     *
+     * @param executor Executor service to use in client.
+     */
+    public void setExecutorService(ExecutorService executor) {
+        this.executor = executor;
+    }
+
+    /**
+     * Gets the marshaller, that is used to communicate between client and server.
+     * <p>
+     * Options, that can be used out-of-the-box:
+     * <ul>
+     *     <li>{@link GridClientOptimizedMarshaller} (default) - GridGain's optimized marshaller.</li>
+     *     <li>{@code GridClientPortableMarshaller} - Marshaller that supports portable objects.</li>
+     *     <li>{@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended).</li>
+     * </ul>
+     *
+     * @return A marshaller to use.
+     */
+    public GridClientMarshaller getMarshaller() {
+        return marshaller;
+    }
+
+    /**
+     * Sets the marshaller to use for communication.
+     *
+     * @param marshaller A marshaller to use.
+     */
+    public void setMarshaller(GridClientMarshaller marshaller) {
+        this.marshaller = marshaller;
+    }
+
+    /**
+     * Gets portable configuration.
+     *
+     * @return Portable configuration.
+     */
+    public PortableConfiguration getPortableConfiguration() {
+        return portableCfg;
+    }
+
+    /**
+     * Sets portable configuration.
+     *
+     * @param portableCfg Portable configuration.
+     */
+    public void setPortableConfiguration(@Nullable PortableConfiguration portableCfg) {
+        this.portableCfg = portableCfg;
+    }
+
+    /**
+     * Load client configuration from the properties map.
+     *
+     * @param prefix Prefix for the client properties.
+     * @param in Properties map to load configuration from.
+     * @throws GridClientException If parsing configuration failed.
+     */
+    public void load(String prefix, Properties in) throws GridClientException {
+        while (prefix.endsWith("."))
+            prefix = prefix.substring(0, prefix.length() - 1);
+
+        if (!prefix.isEmpty())
+            prefix += ".";
+
+        String balancer = in.getProperty(prefix + "balancer");
+        String connectTimeout = in.getProperty(prefix + "connectTimeout");
+        String cred = in.getProperty(prefix + "credentials");
+        String autoFetchMetrics = in.getProperty(prefix + "autoFetchMetrics");
+        String autoFetchAttrs = in.getProperty(prefix + "autoFetchAttributes");
+        String maxConnIdleTime = in.getProperty(prefix + "idleTimeout");
+        String proto = in.getProperty(prefix + "protocol");
+        String srvrs = in.getProperty(prefix + "servers");
+        String tcpNoDelay = in.getProperty(prefix + "tcp.noDelay");
+        String topRefreshFreq = in.getProperty(prefix + "topology.refresh");
+
+        String sslEnabled = in.getProperty(prefix + "ssl.enabled");
+
+        String sslProto = in.getProperty(prefix + "ssl.protocol", "TLS");
+        String sslKeyAlg = in.getProperty(prefix + "ssl.key.algorithm", "SunX509");
+
+        String keyStorePath = in.getProperty(prefix + "ssl.keystore.location");
+        String keyStorePwd = in.getProperty(prefix + "ssl.keystore.password");
+        String keyStoreType = in.getProperty(prefix + "ssl.keystore.type");
+
+        String trustStorePath = in.getProperty(prefix + "ssl.truststore.location");
+        String trustStorePwd = in.getProperty(prefix + "ssl.truststore.password");
+        String trustStoreType = in.getProperty(prefix + "ssl.truststore.type");
+
+        String dataCfgs = in.getProperty(prefix + "data.configurations");
+
+        setBalancer(resolveBalancer(balancer));
+
+        if (!F.isEmpty(connectTimeout))
+            setConnectTimeout(Integer.parseInt(connectTimeout));
+
+        if (!F.isEmpty(cred)) {
+            int idx = cred.indexOf(':');
+
+            if (idx >= 0 && idx < cred.length() - 1) {
+                setSecurityCredentialsProvider(new GridSecurityCredentialsBasicProvider(
+                    new GridSecurityCredentials(cred.substring(0, idx), cred.substring(idx + 1))));
+            }
+            else {
+                setSecurityCredentialsProvider(new GridSecurityCredentialsBasicProvider(
+                    new GridSecurityCredentials(null, null, cred)));
+            }
+        }
+
+        if (!F.isEmpty(autoFetchMetrics))
+            setAutoFetchMetrics(Boolean.parseBoolean(autoFetchMetrics));
+
+        if (!F.isEmpty(autoFetchAttrs))
+            setAutoFetchAttributes(Boolean.parseBoolean(autoFetchAttrs));
+
+        if (!F.isEmpty(maxConnIdleTime))
+            setMaxConnectionIdleTime(Integer.parseInt(maxConnIdleTime));
+
+        if (!F.isEmpty(proto))
+            setProtocol(GridClientProtocol.valueOf(proto));
+
+        if (!F.isEmpty(srvrs))
+            setServers(Arrays.asList(srvrs.replaceAll("\\s+", "").split(",")));
+
+        if (!F.isEmpty(tcpNoDelay))
+            setTcpNoDelay(Boolean.parseBoolean(tcpNoDelay));
+
+        if (!F.isEmpty(topRefreshFreq))
+            setTopologyRefreshFrequency(Long.parseLong(topRefreshFreq));
+
+        //
+        // SSL configuration section
+        //
+
+        if (!F.isEmpty(sslEnabled) && Boolean.parseBoolean(sslEnabled)) {
+            GridSslBasicContextFactory factory = new GridSslBasicContextFactory();
+
+            factory.setProtocol(F.isEmpty(sslProto) ? "TLS" : sslProto);
+            factory.setKeyAlgorithm(F.isEmpty(sslKeyAlg) ? "SunX509" : sslKeyAlg);
+
+            if (F.isEmpty(keyStorePath))
+                throw new IllegalArgumentException("SSL key store location is not specified.");
+
+            factory.setKeyStoreFilePath(keyStorePath);
+
+            if (keyStorePwd != null)
+                factory.setKeyStorePassword(keyStorePwd.toCharArray());
+
+            factory.setKeyStoreType(F.isEmpty(keyStoreType) ? "jks" : keyStoreType);
+
+            if (F.isEmpty(trustStorePath))
+                factory.setTrustManagers(GridSslBasicContextFactory.getDisabledTrustManager());
+            else {
+                factory.setTrustStoreFilePath(trustStorePath);
+
+                if (trustStorePwd != null)
+                    factory.setTrustStorePassword(trustStorePwd.toCharArray());
+
+                factory.setTrustStoreType(F.isEmpty(trustStoreType) ? "jks" : trustStoreType);
+            }
+
+            setSslContextFactory(factory);
+        }
+
+        //
+        // Data configuration section
+        //
+
+        if (!F.isEmpty(dataCfgs)) {
+            String[] names = dataCfgs.replaceAll("\\s+", "").split(",");
+            Collection<GridClientDataConfiguration> list = new ArrayList<>();
+
+            for (String cfgName : names) {
+                if (F.isEmpty(cfgName))
+                    continue;
+
+                String name = in.getProperty(prefix + "data." + cfgName + ".name");
+                String bal = in.getProperty(prefix + "data." + cfgName + ".balancer");
+                String aff = in.getProperty(prefix + "data." + cfgName + ".affinity");
+
+                GridClientDataConfiguration dataCfg = new GridClientDataConfiguration();
+
+                dataCfg.setName(F.isEmpty(name) ? null : name);
+                dataCfg.setBalancer(resolveBalancer(bal));
+                dataCfg.setAffinity(resolveAffinity(aff));
+
+                list.add(dataCfg);
+            }
+
+            setDataConfigurations(list);
+        }
+    }
+
+    /**
+     * Resolve load balancer from string definition.
+     *
+     * @param balancer Load balancer string definition.
+     * @return Resolved load balancer.
+     * @throws GridClientException If loading failed.
+     */
+    private static GridClientLoadBalancer resolveBalancer(String balancer) throws GridClientException {
+        if (F.isEmpty(balancer) || "random".equals(balancer))
+            return new GridClientRandomBalancer();
+
+        if ("roundrobin".equals(balancer))
+            return new GridClientRoundRobinBalancer();
+
+        return newInstance(GridClientLoadBalancer.class, balancer);
+    }
+
+    /**
+     * Resolve data affinity from string definition.
+     *
+     * @param affinity Data affinity string definition.
+     * @return Resolved data affinity.
+     * @throws GridClientException If loading failed.
+     */
+    private static GridClientDataAffinity resolveAffinity(String affinity) throws GridClientException {
+        if (F.isEmpty(affinity))
+            return null;
+
+        if ("partitioned".equals(affinity))
+            return new GridClientPartitionAffinity();
+
+        return newInstance(GridClientDataAffinity.class, affinity);
+    }
+
+    /**
+     * Constructs new instance of the specified class.
+     *
+     * @param exp Expected class for the new instance.
+     * @param clsName Class name to create new instance for.
+     * @param <T> Expected class type for the new instance.
+     * @return New instance of specified class.
+     * @throws GridClientException If loading failed.
+     */
+    private static <T> T newInstance(Class<T> exp, String clsName) throws GridClientException {
+        Object obj;
+
+        try {
+            obj = Class.forName(clsName).newInstance();
+        }
+        // Catch all for convenience.
+        catch (Exception e) {
+            throw new GridClientException("Failed to create class instance: " + clsName, e);
+        }
+
+        return exp.cast(obj);
+    }
+
+    /**
+     * Set the daemon flag value. Communication threads will be created as daemons if this flag is set.
+     *
+     * @param daemon Daemon flag.
+     */
+    public void setDaemon(boolean daemon) {
+        this.daemon = daemon;
+    }
+
+    /**
+     * Get the daemon flag.
+     *
+     * @return Daemon flag.
+     */
+    public boolean isDaemon() {
+        return daemon;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/core/src/main/java/org/apache/ignite/client/balancer/package.html
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/balancer/package.html b/modules/core/src/main/java/org/apache/ignite/client/balancer/package.html
deleted file mode 100644
index d8bb4b6..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/balancer/package.html
+++ /dev/null
@@ -1,24 +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.
-  -->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<body>
-<!-- Package description. -->
-    Provides API and implementations of simple load balancers.
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/core/src/main/java/org/apache/ignite/client/impl/GridClientAbstractProjection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/impl/GridClientAbstractProjection.java b/modules/core/src/main/java/org/apache/ignite/client/impl/GridClientAbstractProjection.java
deleted file mode 100644
index aaed5fa..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/impl/GridClientAbstractProjection.java
+++ /dev/null
@@ -1,458 +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.client.impl;
-
-import org.apache.ignite.*;
-import org.apache.ignite.client.impl.connection.*;
-import org.apache.ignite.internal.client.*;
-import org.apache.ignite.internal.client.balancer.*;
-import org.apache.ignite.internal.client.util.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-import java.util.logging.*;
-
-import static org.apache.ignite.internal.client.util.GridClientUtils.*;
-
-/**
- * Class contains common connection-error handling logic.
- */
-abstract class GridClientAbstractProjection<T extends GridClientAbstractProjection> {
-    /** Logger. */
-    private static final Logger log = Logger.getLogger(GridClientAbstractProjection.class.getName());
-
-    /** List of nodes included in this projection. If null, all nodes in topology are included. */
-    protected Collection<GridClientNode> nodes;
-
-    /** Node filter to be applied for this projection. */
-    protected GridClientPredicate<? super GridClientNode> filter;
-
-    /** Balancer to be used in this projection. */
-    protected GridClientLoadBalancer balancer;
-
-    /** Count of reconnect retries before exception is thrown. */
-    private static final int RETRY_CNT = 3;
-
-    /** Retry delay. */
-    private static final int RETRY_DELAY = 1000;
-
-    /** Client instance. */
-    protected GridClientImpl client;
-
-    /**
-     * Creates projection with specified client.
-     *
-     * @param client Client instance to use.
-     * @param nodes Collections of nodes included in this projection.
-     * @param filter Node filter to be applied.
-     * @param balancer Balancer to use.
-     */
-    protected GridClientAbstractProjection(GridClientImpl client, Collection<GridClientNode> nodes,
-        GridClientPredicate<? super GridClientNode> filter, GridClientLoadBalancer balancer) {
-        assert client != null;
-
-        this.client = client;
-        this.nodes = nodes;
-        this.filter = filter;
-        this.balancer = balancer;
-    }
-
-    /**
-     * This method executes request to a communication layer and handles connection error, if it occurs.
-     * In case of communication exception client instance is notified and new instance of client is created.
-     * If none of the grid servers can be reached, an exception is thrown.
-     *
-     * @param c Closure to be executed.
-     * @param <R> Result future type.
-     * @return Future returned by closure.
-     */
-    protected <R> GridClientFuture<R> withReconnectHandling(ClientProjectionClosure<R> c) {
-        try {
-            GridClientNode node = null;
-
-            boolean changeNode = false;
-
-            Throwable cause = null;
-
-            for (int i = 0; i < RETRY_CNT; i++) {
-                if (node == null || changeNode)
-                    try {
-                        node = balancedNode(node);
-                    }
-                    catch (GridClientException e) {
-                        if (node == null)
-                            throw e;
-                        else
-                            throw new GridServerUnreachableException(
-                                "All nodes in projection failed when retrying to perform request. Attempts made: " + i,
-                                cause);
-                    }
-
-                GridClientConnection conn = null;
-
-                try {
-                    conn = client.connectionManager().connection(node);
-
-                    return c.apply(conn, node.nodeId());
-                }
-                catch (GridConnectionIdleClosedException e) {
-                    client.connectionManager().terminateConnection(conn, node, e);
-
-                    // It's ok, just reconnect to the same node.
-                    changeNode = false;
-
-                    cause = e;
-                }
-                catch (GridClientConnectionResetException e) {
-                    client.connectionManager().terminateConnection(conn, node, e);
-
-                    changeNode = true;
-
-                    cause = e;
-                }
-                catch (GridServerUnreachableException e) {
-                    changeNode = true;
-
-                    cause = e;
-                }
-
-                U.sleep(RETRY_DELAY);
-            }
-
-            assert cause != null;
-
-            throw new GridServerUnreachableException("Failed to communicate with grid nodes " +
-                "(maximum count of retries reached).", cause);
-        }
-        catch (GridClientException e) {
-            return new GridClientFutureAdapter<>(e);
-        }
-        catch (IgniteInterruptedException | InterruptedException e) {
-            Thread.currentThread().interrupt();
-
-            return new GridClientFutureAdapter<>(
-                new GridClientException("Interrupted when (re)trying to perform request.", e));
-        }
-    }
-
-    /**
-     * This method executes request to a communication layer and handles connection error, if it occurs. Server
-     * is picked up according to the projection affinity and key given. Connection will be made with the node
-     * on which key is cached. In case of communication exception client instance is notified and new instance
-     * of client is created. If none of servers can be reached, an exception is thrown.
-     *
-     * @param c Closure to be executed.
-     * @param cacheName Cache name for which mapped node will be calculated.
-     * @param affKey Affinity key.
-     * @param <R> Type of result in future.
-     * @return Operation future.
-     */
-    protected <R> GridClientFuture<R> withReconnectHandling(ClientProjectionClosure<R> c, String cacheName,
-        @Nullable Object affKey) {
-        GridClientDataAffinity affinity = client.affinity(cacheName);
-
-        // If pinned (fixed-nodes) or no affinity provided use balancer.
-        if (nodes != null || affinity == null || affKey == null)
-            return withReconnectHandling(c);
-
-        try {
-            Collection<? extends GridClientNode> prjNodes = projectionNodes();
-
-            if (prjNodes.isEmpty())
-                throw new GridServerUnreachableException("Failed to get affinity node (no nodes in topology were " +
-                    "accepted by the filter): " + filter);
-
-            GridClientNode node = affinity.node(affKey, prjNodes);
-
-            for (int i = 0; i < RETRY_CNT; i++) {
-                GridClientConnection conn = null;
-
-                try {
-                    conn = client.connectionManager().connection(node);
-
-                    return c.apply(conn, node.nodeId());
-                }
-                catch (GridConnectionIdleClosedException e) {
-                    client.connectionManager().terminateConnection(conn, node, e);
-                }
-                catch (GridClientConnectionResetException e) {
-                    client.connectionManager().terminateConnection(conn, node, e);
-
-                    if (!checkNodeAlive(node.nodeId()))
-                        throw new GridServerUnreachableException("Failed to communicate with mapped grid node for " +
-                            "given affinity key (node left the grid) [nodeId=" + node.nodeId() + ", affKey=" + affKey +
-                            ']', e);
-                }
-                catch (RuntimeException | Error e) {
-                    if (conn != null)
-                        client.connectionManager().terminateConnection(conn, node, e);
-
-                    throw e;
-                }
-
-                U.sleep(RETRY_DELAY);
-            }
-
-            throw new GridServerUnreachableException("Failed to communicate with mapped grid node for given affinity " +
-                "key (did node leave the grid?) [nodeId=" + node.nodeId() + ", affKey=" + affKey + ']');
-        }
-        catch (GridClientException e) {
-            return new GridClientFutureAdapter<>(e);
-        }
-        catch (IgniteInterruptedException | InterruptedException e) {
-            Thread.currentThread().interrupt();
-
-            return new GridClientFutureAdapter<>(new GridClientException("Interrupted when (re)trying to perform " +
-                "request.", e));
-        }
-    }
-
-    /**
-     * Tries to refresh node on every possible connection in topology.
-     *
-     * @param nodeId Node id to check.
-     * @return {@code True} if response was received, {@code false} if either {@code null} response received or
-     *      no nodes can be contacted at all.
-     * @throws GridClientException If failed to refresh topology or if client was closed manually.
-     * @throws InterruptedException If interrupted.
-     */
-    protected boolean checkNodeAlive(UUID nodeId) throws GridClientException, InterruptedException {
-        // Try to get node information on any of the connections possible.
-        for (GridClientNodeImpl node : client.topology().nodes()) {
-            try {
-                // Do not try to connect to the same node.
-                if (node.nodeId().equals(nodeId))
-                    continue;
-
-                GridClientConnection conn = client.connectionManager().connection(node);
-
-                try {
-                    GridClientNode target = conn.node(nodeId, false, false, node.nodeId()).get();
-
-                    if (target == null)
-                        client.topology().nodeFailed(nodeId);
-
-                    return target != null;
-                }
-                catch (GridClientConnectionResetException e) {
-                    client.connectionManager().terminateConnection(conn, node, e);
-                }
-                catch (GridClientClosedException e) {
-                    throw e;
-                }
-                catch (GridClientException e) {
-                    if (log.isLoggable(Level.FINE))
-                        log.log(Level.FINE, "Node request failed, try next node.", e);
-                }
-            }
-            catch (GridServerUnreachableException e) {
-                if (log.isLoggable(Level.FINE))
-                    log.log(Level.FINE, "Node request failed, try next node.", e);
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Gets most recently refreshed topology. If this compute instance is a projection,
-     * then only nodes that satisfy projection criteria will be returned.
-     *
-     * @return Most recently refreshed topology.
-     * @throws GridClientException If failed to refresh topology.
-     */
-    public Collection<? extends GridClientNode> projectionNodes() throws GridClientException {
-        return projectionNodes(null);
-    }
-
-    /**
-     * Gets most recently refreshed topology. If this compute instance is a projection,
-     * then only nodes that satisfy projection criteria will be returned.
-     *
-     * @param pred Predicate to additionally filter projection nodes,
-     *  if {@code null} just return projection.
-     * @return Most recently refreshed topology.
-     * @throws GridClientException If failed to refresh topology.
-     */
-    protected Collection<? extends GridClientNode> projectionNodes(@Nullable GridClientPredicate<GridClientNode> pred)
-        throws GridClientException {
-        Collection<? extends GridClientNode> prjNodes;
-
-        if (nodes == null) {
-            // Dynamic projection, ask topology for current snapshot.
-            prjNodes = client.topology().nodes();
-
-            if (filter != null || pred != null)
-                prjNodes = applyFilter(prjNodes, filter, pred);
-        }
-        else
-            prjNodes = nodes;
-
-        return prjNodes;
-    }
-
-    /**
-     * Return balanced node for current projection.
-     *
-     * @param exclude Nodes to exclude.
-     * @return Balanced node.
-     * @throws GridServerUnreachableException If topology is empty.
-     */
-    private GridClientNode balancedNode(@Nullable final GridClientNode exclude) throws GridClientException {
-        GridClientPredicate<GridClientNode> excludeFilter = exclude == null ?
-            new GridClientPredicate<GridClientNode>() {
-                @Override public boolean apply(GridClientNode e) {
-                    return restAvailable(e, client.cfg.getProtocol());
-                }
-
-                @Override public String toString() {
-                    return "Filter nodes with available REST.";
-                }
-            } :
-            new GridClientPredicate<GridClientNode>() {
-                @Override public boolean apply(GridClientNode e) {
-                    return !exclude.equals(e) && restAvailable(e, client.cfg.getProtocol());
-                }
-
-                @Override public String toString() {
-                    return "Filter nodes with available REST and " +
-                        "exclude (probably due to connection failure) node: " + exclude.nodeId();
-                }
-            };
-
-        Collection<? extends GridClientNode> prjNodes = projectionNodes(excludeFilter);
-
-        if (prjNodes.isEmpty())
-            throw new GridServerUnreachableException("Failed to get balanced node (no nodes in topology were " +
-                "accepted by the filters): " + Arrays.asList(filter, excludeFilter));
-
-        if (prjNodes.size() == 1) {
-            GridClientNode ret = GridClientUtils.first(prjNodes);
-
-            assert ret != null;
-
-            return ret;
-        }
-
-        return balancer.balancedNode(prjNodes);
-    }
-
-    /**
-     * Creates a sub-projection for current projection.
-     *
-     * @param nodes Collection of nodes that sub-projection will be restricted to. If {@code null},
-     *      created projection is dynamic and will take nodes from topology.
-     * @param filter Filter to be applied to nodes in projection. If {@code null} - no filter applied.
-     * @param balancer Balancer to use in projection. If {@code null} - inherit balancer from the current projection.
-     * @param factory Factory to create new projection.
-     * @return Created projection.
-     * @throws GridClientException If resulting projection is empty. Note that this exception may
-     *      only be thrown on case of static projections, i.e. where collection of nodes is not null.
-     */
-    protected T createProjection(@Nullable Collection<GridClientNode> nodes,
-        @Nullable GridClientPredicate<? super GridClientNode> filter, @Nullable GridClientLoadBalancer balancer,
-        ProjectionFactory<T> factory) throws GridClientException {
-        if (nodes != null && nodes.isEmpty())
-            throw new GridClientException("Failed to create projection: given nodes collection is empty.");
-
-        if (filter != null && this.filter != null)
-            filter = new GridClientAndPredicate<>(this.filter, filter);
-        else if (filter == null)
-            filter = this.filter;
-
-        Collection<GridClientNode> subset = intersection(this.nodes, nodes);
-
-        if (subset != null && subset.isEmpty())
-            throw new GridClientException("Failed to create projection (given node set does not overlap with " +
-                "existing node set) [prjNodes=" + this.nodes + ", nodes=" + nodes);
-
-        if (filter != null && subset != null) {
-            subset = applyFilter(subset, filter);
-
-            if (subset != null && subset.isEmpty())
-                throw new GridClientException("Failed to create projection (none of the nodes in projection node " +
-                    "set passed the filter) [prjNodes=" + subset + ", filter=" + filter + ']');
-        }
-
-        if (balancer == null)
-            balancer = this.balancer;
-
-        return factory.create(nodes, filter, balancer);
-    }
-
-    /**
-     * Calculates intersection of two collections. Returned collection always a new collection.
-     *
-     * @param first First collection to intersect.
-     * @param second Second collection to intersect.
-     * @return Intersection or {@code null} if both collections are {@code null}.
-     */
-    @Nullable private Collection<GridClientNode> intersection(@Nullable Collection<? extends GridClientNode> first,
-        @Nullable Collection<? extends GridClientNode> second) {
-        if (first == null && second == null)
-            return null;
-
-        if (first != null && second != null) {
-            Collection<GridClientNode> res = new LinkedList<>(first);
-
-            res.retainAll(second);
-
-            return res;
-        }
-        else
-            return new ArrayList<>(first != null ? first : second);
-    }
-
-    /**
-     * Factory for new projection creation.
-     *
-     * @param <X> Projection implementation.
-     */
-    protected static interface ProjectionFactory<X extends GridClientAbstractProjection> {
-        /**
-         * Subclasses must implement this method and return concrete implementation of projection needed.
-         *
-         * @param nodes Nodes that are included in projection.
-         * @param filter Filter to be applied.
-         * @param balancer Balancer to be used.
-         * @return Created projection.
-         */
-        public X create(@Nullable Collection<GridClientNode> nodes,
-            @Nullable GridClientPredicate<? super GridClientNode> filter, GridClientLoadBalancer balancer);
-    }
-
-    /**
-     * Closure to execute reconnect-handling code.
-     */
-    protected static interface ClientProjectionClosure<R> {
-        /**
-         * All closures that implement this interface may safely call all methods of communication connection.
-         * If any exceptions in connection occur, they will be automatically handled by projection.
-         *
-         * @param conn Communication connection that should be accessed.
-         * @param affinityNodeId Affinity node ID.
-         * @return Future - result of operation.
-         * @throws GridClientConnectionResetException If connection was unexpectedly reset. Connection will be
-         *      either re-established or different server will be accessed (if available).
-         * @throws GridClientClosedException If client was manually closed by user.
-         */
-        public GridClientFuture<R> apply(GridClientConnection conn, UUID affinityNodeId)
-            throws GridClientConnectionResetException, GridClientClosedException;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5b2f309/modules/core/src/main/java/org/apache/ignite/client/impl/GridClientAndPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/impl/GridClientAndPredicate.java b/modules/core/src/main/java/org/apache/ignite/client/impl/GridClientAndPredicate.java
deleted file mode 100644
index cc74920..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/impl/GridClientAndPredicate.java
+++ /dev/null
@@ -1,52 +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.client.impl;
-
-import org.apache.ignite.internal.client.*;
-
-/**
- * AND predicate. Passes if and only if both provided filters accept the node.
- * This filter uses short-term condition evaluation, i.e. second filter would not
- * be invoked if first filter returned {@code false}.
- */
-class GridClientAndPredicate<T> implements GridClientPredicate<T> {
-    /** First filter to check. */
-    private GridClientPredicate<? super T> first;
-
-    /** Second filter to check. */
-    private GridClientPredicate<? super T> second;
-
-    /**
-     * Creates AND filter.
-     *
-     * @param first First filter to check.
-     * @param second Second filter to check.
-     */
-    GridClientAndPredicate(GridClientPredicate<? super T> first, GridClientPredicate<? super T> second) {
-        assert first != null;
-        assert second != null;
-
-        this.first = first;
-        this.second = second;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean apply(T elem) {
-        return first.apply(elem) && second.apply(elem);
-    }
-}


Mime
View raw message