ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [04/31] incubator-ignite git commit: #ignite-128: WIP.
Date Tue, 03 Feb 2015 14:18:31 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/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
deleted file mode 100644
index 4c559f9..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientConfiguration.java
+++ /dev/null
@@ -1,868 +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;
-
-import org.apache.ignite.portables.*;
-import org.apache.ignite.client.balancer.*;
-import org.apache.ignite.client.marshaller.*;
-import org.apache.ignite.client.marshaller.jdk.*;
-import org.apache.ignite.client.marshaller.optimized.*;
-import org.apache.ignite.client.ssl.*;
-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 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/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientData.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientData.java
deleted file mode 100644
index 073e08d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientData.java
+++ /dev/null
@@ -1,443 +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;
-
-import java.util.*;
-
-/**
- * A data projection of grid client. Contains various methods for cache operations and metrics retrieval.
- * An instance of data projection over some remote cache is provided via
- * {@link GridClient#data(String)} method.
- * <h1 class="header">Affinity Awareness</h1>
- * One of the unique properties of the GridGain remote clients is that they are
- * affinity aware. In other words, both compute and data APIs will optionally
- * contact exactly the node where the data is cached based on some affinity key.
- * This allows for collocation of computations and data and avoids extra network
- * hops that would be necessary if non-affinity nodes were contacted. By default
- * all operations on {@code GridClientData} API will be affinity-aware unless
- * such behavior is overridden by pinning one or more remote nodes
- * (see {@link #pinNodes(GridClientNode, GridClientNode...)} for more information).
- */
-public interface GridClientData {
-    /**
-     * Gets name of the remote cache. The cache name for this projection was specified
-     * via {@link GridClient#data(String)} method at the time of creation.
-     *
-     * @return Name of the remote cache.
-     */
-    public String cacheName();
-
-    /**
-     * Gets client data projection which will only contact specified remote grid node. By default, remote
-     * node is determined based on {@link GridClientDataAffinity} provided - this method allows
-     * to override default behavior and use only specified server for all cache operations.
-     * <p>
-     * Use this method when there are other than {@code key-affinity} reasons why a certain
-     * node should be contacted.
-     *
-     * @param node Node to be contacted (optional).
-     * @param nodes Additional nodes (optional).
-     * @return Client data which will only contact server with given node ID.
-     * @throws GridClientException If resulting projection is empty.
-     */
-    public GridClientData pinNodes(GridClientNode node, GridClientNode... nodes) throws GridClientException;
-
-    /**
-     * Gets pinned node or {@code null} if no nodes were pinned.
-     *
-     * @return Pinned node.
-     */
-    public Collection<GridClientNode> pinnedNodes();
-
-    /**
-     * Puts value to cache on remote grid.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to put in cache.
-     * @param val Value to put in cache.
-     * @return Whether value was actually put to cache.
-     * @throws GridClientException In case of error.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public <K, V> boolean put(K key, V val) throws GridClientException;
-
-    /**
-     * Asynchronously puts value to cache on remote node.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to put in cache.
-     * @param val Value to put in cache.
-     * @return Future whether value was actually put to cache.
-     */
-    public <K, V> GridClientFuture<Boolean> putAsync(K key, V val);
-
-    /**
-     * Puts entries to cache on remote grid.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote nodes on which these keys are supposed to be cached (unless
-     * some nodes were {@code pinned}). If entries do not map to one node, then the node
-     * which has most mapped entries will be contacted.
-     *
-     * @param entries Entries to put in cache.
-     * @throws GridClientException In case of error.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public <K, V> void putAll(Map<K, V> entries) throws GridClientException;
-
-    /**
-     * Asynchronously puts entries to cache on remote grid.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote nodes on which these keys are supposed to be cached (unless
-     * some nodes were {@code pinned}). If entries do not map to one node, then the node
-     * which has most mapped entries will be contacted.
-     *
-     * @param entries Entries to put in cache.
-     * @return Future whether this operation completes.
-     */
-    public <K, V> GridClientFuture<?> putAllAsync(Map<K, V> entries);
-
-    /**
-     * Gets value from cache on remote node.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to get from cache.
-     * @return Value for given key or {@code null} if no value was cached.
-     * @throws GridClientException In case of error.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public <K, V> V get(K key) throws GridClientException;
-
-    /**
-     * Asynchronously gets value from cache on remote grid.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to get from cache.
-     * @return Future with value for given key or with {@code null} if no value was cached.
-     */
-    public <K, V> GridClientFuture<V> getAsync(K key);
-
-    /**
-     * Gets entries from cache on remote grid.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote nodes on which these keys are supposed to be cached (unless
-     * some nodes were {@code pinned}). If entries do not map to one node, then the node
-     * which has most mapped entries will be contacted.
-     *
-     * @param keys Keys to get.
-     * @throws GridClientException In case of error.
-     * @return Entries retrieved from remote cache nodes.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public <K, V> Map<K, V> getAll(Collection<K> keys) throws GridClientException;
-
-    /**
-     * Asynchronously gets entries from cache on remote grid.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote nodes on which these keys are supposed to be cached (unless
-     * some nodes were {@code pinned}). If entries do not map to one node, then the node
-     * which has most mapped entries will be contacted.
-     *
-     * @param keys Keys to get.
-     * @return Future with entries retrieved from remote cache nodes.
-     */
-    public <K, V> GridClientFuture<Map<K, V>> getAllAsync(Collection<K> keys);
-
-    /**
-     * Removes value from cache on remote node.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to remove.
-     * @return Whether value was actually removed.
-     * @throws GridClientException In case of error.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public <K> boolean remove(K key) throws GridClientException;
-
-    /**
-     * Asynchronously removes value from cache on remote grid.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to remove.
-     * @return Future whether value was actually removed.
-     */
-    public <K> GridClientFuture<Boolean> removeAsync(K key);
-
-    /**
-     * Removes entries from cache on remote node.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote nodes on which these keys are supposed to be cached (unless
-     * some nodes were {@code pinned}). If entries do not map to one node, then the node
-     * which has most mapped entries will be contacted.
-     *
-     * @param keys Keys to remove.
-     * @throws GridClientException In case of error.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public <K> void removeAll(Collection<K> keys) throws GridClientException;
-
-    /**
-     * Asynchronously removes entries from cache on remote grid.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote nodes on which these keys are supposed to be cached (unless
-     * some nodes were {@code pinned}). If entries do not map to one node, then the node
-     * which has most mapped entries will be contacted.
-     *
-     * @param keys Keys to remove.
-     * @return Future whether operation finishes.
-     */
-    public <K> GridClientFuture<?> removeAllAsync(Collection<K> keys);
-
-    /**
-     * Replaces value in cache on remote grid only if there was a {@code non-null}
-     * value associated with this key.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to replace.
-     * @param val Value to replace.
-     * @return Whether value was actually replaced.
-     * @throws GridClientException In case of error.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public <K, V> boolean replace(K key, V val) throws GridClientException;
-
-    /**
-     * Asynchronously replaces value in cache on remote grid only if there was a {@code non-null}
-     * value associated with this key.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to replace.
-     * @param val Value to replace.
-     * @return Future whether value was actually replaced.
-     */
-    public <K, V> GridClientFuture<Boolean> replaceAsync(K key, V val);
-
-    /**
-     * Sets entry value to {@code val1} if current value is {@code val2} with
-     * following conditions:
-     * <ul>
-     * <li>
-     * If {@code val1} is {@code null} and {@code val2} is equal to current value,
-     * entry is removed from cache.
-     * </li>
-     * <li>
-     * If {@code val2} is {@code null}, entry is created if it doesn't exist.
-     * </li>
-     * <li>
-     * If both {@code val1} and {@code val2} are {@code null}, entry is removed.
-     * </li>
-     * </ul>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to set.
-     * @param val1 Value to set.
-     * @param val2 Check value.
-     * @return Whether value of entry was changed.
-     * @throws GridClientException In case of error.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public <K, V> boolean cas(K key, V val1, V val2) throws GridClientException;
-
-    /**
-     * Asynchronously sets entry value to {@code val1} if current value is {@code val2}
-     * with following conditions:
-     * <ul>
-     * <li>
-     * If {@code val1} is {@code null} and {@code val2} is equal to current value,
-     * entry is removed from cache.
-     * </li>
-     * <li>
-     * If {@code val2} is {@code null}, entry is created if it doesn't exist.
-     * </li>
-     * <li>
-     * If both {@code val1} and {@code val2} are {@code null}, entry is removed.
-     * </li>
-     * </ul>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to set.
-     * @param val1 Value to set.
-     * @param val2 Check value.
-     * @return Future whether value of entry was changed.
-     */
-    public <K, V> GridClientFuture<Boolean> casAsync(K key, V val1, V val2);
-
-    /**
-     * Gets affinity node ID for provided key. This method will return {@code null} if no
-     * affinity was configured for the given cache for this client or there are no nodes in topology with
-     * cache enabled.
-     *
-     * @param key Key.
-     * @return Node ID.
-     * @throws GridClientException In case of error.
-     */
-    public <K> UUID affinity(K key) throws GridClientException;
-
-    /**
-     * Fetches metrics for cache from remote grid.
-     *
-     * @return Cache metrics.
-     * @throws GridClientException In case of error.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public GridClientDataMetrics metrics() throws GridClientException;
-
-    /**
-     * Asynchronously fetches metrics for cache from remote grid.
-     *
-     * @return Future with cache metrics.
-     */
-    public GridClientFuture<GridClientDataMetrics> metricsAsync();
-
-    /**
-     * Tries to get metrics from local cache.
-     * <p>
-     * Local cache is updated on every {@link #metrics()} or {@link #metricsAsync()} call
-     * if {@link GridClientConfiguration#isEnableMetricsCache()} is enabled. If it is
-     * disabled then this method will always return {@code null}.
-     *
-     * @return Cached metrics or {@code null} if no cached metrics available.
-     * @throws GridClientException In case of error.
-     * @throws GridServerUnreachableException If none of the servers can be reached.
-     * @throws GridClientClosedException If client was closed manually.
-     */
-    public GridClientDataMetrics cachedMetrics() throws GridClientException;
-
-    /**
-     * Append requested value to already cached one. This method supports work with strings, lists and maps.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to manipulate cache value for.
-     * @param val Value to append to the cached one.
-     * @return Whether value of entry was changed.
-     * @throws GridClientException In case of error.
-     */
-    public <K, V> boolean append(K key, V val) throws GridClientException;
-
-    /**
-     * Append requested value to already cached one. This method supports work with strings, lists and maps.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to manipulate cache value for.
-     * @param val Value to append to the cached one.
-     * @return Future whether value of entry was changed.
-     * @throws GridClientException In case of error.
-     */
-    public <K, V> GridClientFuture<Boolean> appendAsync(K key, V val) throws GridClientException;
-
-    /**
-     * Prepend requested value to already cached one. This method supports work with strings, lists and maps.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to manipulate cache value for.
-     * @param val Value to prepend to the cached one.
-     * @return Whether value of entry was changed.
-     * @throws GridClientException In case of error.
-     */
-    public <K, V> boolean prepend(K key, V val) throws GridClientException;
-
-    /**
-     * Prepend requested value to already cached one. This method supports work with strings, lists and maps.
-     * <p>
-     * Note that this operation is affinity-aware and will immediately contact
-     * exactly the remote node on which this key is supposed to be cached (unless
-     * some nodes were {@code pinned}).
-     *
-     * @param key Key to manipulate cache value for.
-     * @param val Value to prepend to the cached one.
-     * @return Future whether value of entry was changed.
-     * @throws GridClientException In case of error.
-     */
-    public <K, V> GridClientFuture<Boolean> prependAsync(K key, V val) throws GridClientException;
-
-    /**
-     * Gets cache flags enabled on this data projection.
-     *
-     * @return Flags for this data projection (empty set if no flags have been set).
-     */
-    public Set<GridClientCacheFlag> flags();
-
-    /**
-     * Creates new client data object with enabled cache flags.
-     *
-     * @param flags Optional cache flags to be enabled.
-     * @return New client data object.
-     * @throws GridClientException In case of error.
-     */
-    public GridClientData flagsOn(GridClientCacheFlag... flags) throws GridClientException;
-
-    /**
-     * Creates new client data object with disabled cache flags.
-     *
-     * @param flags Cache flags to be disabled.
-     * @return New client data object.
-     * @throws GridClientException In case of error.
-     */
-    public GridClientData flagsOff(GridClientCacheFlag... flags) throws GridClientException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientDataAffinity.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientDataAffinity.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientDataAffinity.java
deleted file mode 100644
index a56636d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientDataAffinity.java
+++ /dev/null
@@ -1,39 +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;
-
-import java.util.*;
-
-/**
- * Determines which node should be connected when operation on a key is requested.
- * <p>
- * If implementation of data affinity implements {@link GridClientTopologyListener} interface as well,
- * then affinity will be added to topology listeners on client start before first connection is established
- * and will be removed after last connection is closed.
- */
-public interface GridClientDataAffinity {
-    /**
-     * Gets primary affinity node for a key. In case of replicated cache all nodes are equal and can be
-     * considered primary, so it may return any node. In case of partitioned cache primary node is returned.
-     *
-     * @param key Key to get affinity for.
-     * @param nodes Nodes to choose from.
-     * @return Affinity nodes for the given partition.
-     */
-    public GridClientNode node(Object key, Collection<? extends GridClientNode> nodes);
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientDataConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientDataConfiguration.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientDataConfiguration.java
deleted file mode 100644
index 896f0f1..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientDataConfiguration.java
+++ /dev/null
@@ -1,118 +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;
-
-import org.apache.ignite.client.balancer.*;
-
-/**
- * Java client data configuration.
- */
-public class GridClientDataConfiguration {
-    /** Grid cache name. */
-    private String name;
-
-    /** Affinity. */
-    private GridClientDataAffinity affinity;
-
-    /** Balancer for pinned mode. */
-    private GridClientLoadBalancer balancer = new GridClientRandomBalancer();
-
-    /**
-     * Creates empty configuration.
-     */
-    public GridClientDataConfiguration() {
-        // No-op.
-    }
-
-    /**
-     * Copy constructor.
-     *
-     * @param cfg Configuration to copy.
-     */
-    public GridClientDataConfiguration(GridClientDataConfiguration cfg) {
-        // Preserve alphabetic order for maintenance.
-        affinity = cfg.getAffinity();
-        balancer = cfg.getPinnedBalancer();
-        name = cfg.getName();
-    }
-
-    /**
-     * Gets name of remote cache.
-     *
-     * @return Remote cache name.
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Sets grid cache name for this configuration.
-     *
-     * @param name Cache name.
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * Gets affinity to be used to communicate with remote cache.
-     * Affinity allows to contact exactly the node where the data is and therefore
-     * avoiding extra network hops.
-     * <p>
-     * Use {@link GridClientPartitionAffinity} as default affinity communication to
-     * work with remote partitioned caches.
-     *
-     * @return Cache affinity to use.
-     */
-    public GridClientDataAffinity getAffinity() {
-        return affinity;
-    }
-
-    /**
-     * Sets client data affinity for this configuration.
-     * Affinity allows to contact exactly the node where the data is and therefore
-     * avoiding extra network hops.
-     * <p>
-     * Use {@link GridClientPartitionAffinity} as default affinity communication to
-     * work with remote partitioned caches.
-     *
-     * @param affinity Client data affinity.
-     */
-    public void setAffinity(GridClientDataAffinity affinity) {
-        this.affinity = affinity;
-    }
-
-    /**
-     * Gets balancer to use for pinned nodes. See {@link GridClientLoadBalancer}
-     * for more information.
-     *
-     * @return Node balancer for pinned mode.
-     */
-    public GridClientLoadBalancer getPinnedBalancer() {
-        return balancer;
-    }
-
-    /**
-     * Sets balancer for pinned mode for this configuration.
-     *
-     * @param balancer Balancer that will be used in pinned mode.
-     */
-    public void setBalancer(GridClientLoadBalancer balancer) {
-        this.balancer = balancer;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientDataMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientDataMetrics.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientDataMetrics.java
deleted file mode 100644
index 74b3f2f..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientDataMetrics.java
+++ /dev/null
@@ -1,77 +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;
-
-import java.io.*;
-
-/**
- * Cache metrics used to obtain statistics on cache itself or any of its entries.
- * Cache metrics can be fetched from server either for the whole cache or for
- * specific entry via any of the {@code metrics(...)} methods available on
- * {@link GridClientData} API.
- */
-public interface GridClientDataMetrics extends Serializable {
-    /**
-     * Gets create time of the owning entity (either cache or entry).
-     *
-     * @return Create time.
-     */
-    public long createTime();
-
-    /**
-     * Gets last write time of the owning entity (either cache or entry).
-     *
-     * @return Last write time.
-     */
-    public long writeTime();
-
-    /**
-     * Gets last read time of the owning entity (either cache or entry).
-     *
-     * @return Last read time.
-     */
-    public long readTime();
-
-    /**
-     * Gets total number of reads of the owning entity (either cache or entry).
-     *
-     * @return Total number of reads.
-     */
-    public int reads();
-
-    /**
-     * Gets total number of writes of the owning entity (either cache or entry).
-     *
-     * @return Total number of writes.
-     */
-    public int writes();
-
-    /**
-     * Gets total number of hits for the owning entity (either cache or entry).
-     *
-     * @return Number of hits.
-     */
-    public int hits();
-
-    /**
-     * Gets total number of misses for the owning entity (either cache or entry).
-     *
-     * @return Number of misses.
-     */
-    public int misses();
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientDisconnectedException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientDisconnectedException.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientDisconnectedException.java
deleted file mode 100644
index 561f8f0..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientDisconnectedException.java
+++ /dev/null
@@ -1,36 +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;
-
-/**
- * This exception is thrown when client has no Grid topology and (probably temporary) can't obtain it.
- */
-public class GridClientDisconnectedException extends GridClientException {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /**
-     * Creates exception with given message and cause.
-     *
-     * @param msg Error message.
-     * @param cause Cause exception.
-     */
-    public GridClientDisconnectedException(String msg, GridClientException cause) {
-        super(msg, cause);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientException.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientException.java
deleted file mode 100644
index e754eca..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientException.java
+++ /dev/null
@@ -1,111 +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;
-
-import org.apache.ignite.internal.util.typedef.*;
-import org.jetbrains.annotations.*;
-
-/**
- * Client exception is a common super class of all client exceptions.
- */
-public class GridClientException extends Exception {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /**
-     * Constructs client exception.
-     *
-     * @param msg Message.
-     */
-    public GridClientException(String msg) {
-        super(msg);
-    }
-
-    /**
-     * Constructs client exception.
-     *
-     * @param msg Message.
-     * @param cause Cause.
-     */
-    public GridClientException(String msg, Throwable cause) {
-        super(msg, cause);
-    }
-
-    /**
-     * Constructs client exception.
-     *
-     * @param cause Cause.
-     */
-    public GridClientException(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Checks if passed in {@code 'Throwable'} has given class in {@code 'cause'} hierarchy
-     * <b>including</b> that throwable itself.
-     * <p>
-     * Note that this method follows includes {@link Throwable#getSuppressed()}
-     * into check.
-     *
-     * @param cls Cause classes to check (if {@code null} or empty, {@code false} is returned).
-     * @return {@code True} if one of the causing exception is an instance of passed in classes,
-     *      {@code false} otherwise.
-     */
-    public boolean hasCause(@Nullable Class<? extends Throwable>... cls) {
-        return hasCause(this, cls);
-    }
-
-    /**
-     * Checks if passed in {@code 'Throwable'} has given class in {@code 'cause'} hierarchy
-     * <b>including</b> that throwable itself.
-     * <p>
-     * Note that this method follows includes {@link Throwable#getSuppressed()}
-     * into check.
-     *
-     * @param t Throwable to check (if {@code null}, {@code false} is returned).
-     * @param cls Cause classes to check (if {@code null} or empty, {@code false} is returned).
-     * @return {@code True} if one of the causing exception is an instance of passed in classes,
-     *      {@code false} otherwise.
-     */
-    private boolean hasCause(@Nullable Throwable t, @Nullable Class<? extends Throwable>... cls) {
-        if (t == null || F.isEmpty(cls))
-            return false;
-
-        assert cls != null;
-
-        for (Throwable th = t; th != null; th = th.getCause()) {
-            for (Class<? extends Throwable> c : cls)
-                if (c.isAssignableFrom(th.getClass()))
-                    return true;
-
-            for (Throwable n : th.getSuppressed())
-                if (hasCause(n, cls))
-                    return true;
-
-            if (th.getCause() == th)
-                break;
-        }
-
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return getClass() + ": " + getMessage();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientFactory.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientFactory.java
deleted file mode 100644
index 647155e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientFactory.java
+++ /dev/null
@@ -1,138 +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;
-
-import org.apache.ignite.client.impl.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.locks.*;
-
-/**
- * Client factory opens and closes clients. It also tracks all currently opened clients as well.
- */
-public class GridClientFactory {
-    /** Map that contain all opened clients. */
-    private static ConcurrentMap<UUID, GridClientImpl> openClients = new ConcurrentHashMap<>();
-
-    /** Lock to prevent concurrent adding of clients while stopAll is working. */
-    private static ReadWriteLock busyLock = new ReentrantReadWriteLock();
-
-    /**
-     * Ensure singleton.
-     */
-    private GridClientFactory() {
-        // No-op.
-    }
-
-    /**
-     * Starts a client with given configuration. Starting client will be assigned a randomly generated
-     * UUID which can be obtained by {@link GridClient#id()} method.
-     *
-     * @param cfg Client configuration.
-     * @return Started client.
-     * @throws GridClientException If client could not be created.
-     */
-    public static GridClient start(GridClientConfiguration cfg) throws GridClientException {
-        busyLock.readLock().lock();
-
-        try {
-            UUID clientId = UUID.randomUUID();
-
-            GridClientImpl client = new GridClientImpl(clientId, cfg);
-
-            GridClientImpl old = openClients.putIfAbsent(clientId, client);
-
-            assert old == null : "Random unique UUID generation failed.";
-
-            return client;
-        }
-        finally {
-            busyLock.readLock().unlock();
-        }
-    }
-
-    /**
-     * Waits for all open clients to finish their operations and stops them, This method
-     * is equivalent to {@code stopAll(true)} method invocation.
-     *
-     * @see #stopAll(boolean)
-     */
-    public static void stopAll() {
-        stopAll(true);
-    }
-
-    /**
-     * Stops all currently open clients.
-     *
-     * @param wait If {@code true} then each client will wait to finish all ongoing requests before
-     *      closing (however, no new requests will be accepted). If {@code false}, clients will be
-     *      closed immediately and all ongoing requests will be failed.
-     */
-    @SuppressWarnings("TooBroadScope")
-    public static void stopAll(boolean wait) {
-        ConcurrentMap<UUID, GridClientImpl> old;
-
-        busyLock.writeLock().lock();
-
-        try {
-            old = openClients;
-
-            openClients = new ConcurrentHashMap<>();
-        }
-        finally {
-            busyLock.writeLock().unlock();
-        }
-
-        for (GridClientImpl client : old.values())
-            client.stop(wait);
-    }
-
-    /**
-     * Waits for all pending requests for a particular client to be completed (no new requests will be
-     * accepted) and then closes the client. This method is equivalent to {@code stop(clientId, true)}.
-     *
-     * @param clientId Identifier of client to close.
-     * @see #stop(UUID, boolean)
-     */
-    public static void stop(UUID clientId) {
-        stop(clientId, true);
-    }
-
-    /**
-     * Stops particular client.
-     *
-     * @param clientId Client identifier to close.
-     * @param wait If {@code true} then client will wait to finish all ongoing requests before
-     *      closing (however, no new requests will be accepted). If {@code false}, client will be
-     *      closed immediately and all ongoing requests will be failed.
-     */
-    public static void stop(UUID clientId, boolean wait) {
-        busyLock.readLock().lock();
-
-        try {
-            GridClientImpl client = openClients.remove(clientId);
-
-            if (client != null)
-                client.stop(wait);
-        }
-        finally {
-            busyLock.readLock().unlock();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientFuture.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientFuture.java
deleted file mode 100644
index 99eb0ea..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientFuture.java
+++ /dev/null
@@ -1,68 +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;
-
-import java.util.concurrent.*;
-
-/**
- * Future for asynchronous operations.
- */
-public interface GridClientFuture<R> {
-    /**
-     * Synchronously waits for completion and returns result.
-     *
-     * @return Completed future result.
-     * @throws GridClientException In case of error.
-     */
-    public R get() throws GridClientException;
-
-    /**
-     * Synchronously waits for completion and returns result.
-     *
-     * @param timeout Timeout interval to wait future completes.
-     * @param unit Timeout interval unit to wait future completes.
-     * @return Completed future result.
-     * @throws GridClientException In case of error.
-     * @throws GridClientFutureTimeoutException If timed out before future finishes.
-     */
-    public R get(long timeout, TimeUnit unit) throws GridClientException;
-
-    /**
-     * Checks if future is done.
-     *
-     * @return Whether future is done.
-     */
-    public boolean isDone();
-
-    /**
-     * Register new listeners for notification when future completes.
-     *
-     * Note that current implementations are calling listeners in
-     * the completing thread.
-     *
-     * @param lsnrs Listeners to be registered.
-     */
-    public void listenAsync(GridClientFutureListener<R>... lsnrs);
-
-    /**
-     * Removes listeners registered before.
-     *
-     * @param lsnrs Listeners to be removed.
-     */
-    public void stopListenAsync(GridClientFutureListener<R>... lsnrs);
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientFutureListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientFutureListener.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientFutureListener.java
deleted file mode 100644
index 3d149a5..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientFutureListener.java
+++ /dev/null
@@ -1,30 +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;
-
-/**
- * Listener interface for {@link GridClientFuture}.
- */
-public interface GridClientFutureListener<R> {
-    /**
-     * This method will be called when the future completes.
-     *
-     * @param fut Completed future.
-     */
-    public void onDone(GridClientFuture<R> fut);
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientFutureTimeoutException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientFutureTimeoutException.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientFutureTimeoutException.java
deleted file mode 100644
index 31171f0..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientFutureTimeoutException.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.client;
-
-/**
- * Client future timeout exception is thrown whenever any client waiting is timed out.
- */
-public class GridClientFutureTimeoutException extends GridClientException {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /**
-     * Creates exception with specified error message.
-     *
-     * @param msg Error message.
-     */
-    public GridClientFutureTimeoutException(String msg) {
-        super(msg);
-    }
-
-    /**
-     * Creates exception with specified error message and cause.
-     *
-     * @param msg Error message.
-     * @param cause Error cause.
-     */
-    public GridClientFutureTimeoutException(String msg, Throwable cause) {
-        super(msg, cause);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientHandshakeException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientHandshakeException.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientHandshakeException.java
deleted file mode 100644
index 9af9529..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientHandshakeException.java
+++ /dev/null
@@ -1,48 +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;
-
-/**
- * This exception is thrown when a client handshake has failed.
- */
-public class GridClientHandshakeException extends GridClientException {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Status code for handshake error. */
-    private final byte statusCode;
-
-    /**
-     * Constructor.
-     *
-     * @param statusCode Error status code.
-     * @param msg Error message.
-     */
-    public GridClientHandshakeException(byte statusCode, String msg) {
-        super(msg);
-
-        this.statusCode = statusCode;
-    }
-
-    /**
-     * @return Error status code.
-     */
-    public byte getStatusCode() {
-        return statusCode;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42347658/modules/core/src/main/java/org/apache/ignite/client/GridClientNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/client/GridClientNode.java b/modules/core/src/main/java/org/apache/ignite/client/GridClientNode.java
deleted file mode 100644
index 7408543..0000000
--- a/modules/core/src/main/java/org/apache/ignite/client/GridClientNode.java
+++ /dev/null
@@ -1,152 +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;
-
-import org.jetbrains.annotations.*;
-
-import java.net.*;
-import java.util.*;
-
-/**
- * Descriptor of remote grid node. Use {@link GridClientCompute#nodes()} to
- * get a full view over remote grid nodes.
- */
-public interface GridClientNode {
-    /**
-     * Gets ID of a remote node.
-     *
-     * @return Node ID.
-     */
-    public UUID nodeId();
-
-    /**
-     * Gets consistent globally unique node ID. Unlike {@link #nodeId()} method,
-     * this method returns consistent node ID which survives node restarts.
-     *
-     * @return Consistent globally unique node ID.
-     */
-    public Object consistentId();
-
-    /**
-     * Gets list of REST TCP server addresses of remote node.
-     *
-     * @return REST TCP server addresses.
-     */
-    public List<String> tcpAddresses();
-
-    /**
-     * Gets list of REST TCP server host names of remote node.
-     *
-     * @return REST TCP server host names.
-     */
-    public List<String> tcpHostNames();
-
-    /**
-     * Gets list of REST HTTP server addresses of remote node.
-     *
-     * @return REST HTTP server addresses.
-     */
-    @Deprecated
-    public List<String> jettyAddresses();
-
-    /**
-     * Gets list of REST HTTP server host names of remote node.
-     *
-     * @return REST HTTP server host names.
-     */
-    @Deprecated
-    public List<String> jettyHostNames();
-
-    /**
-     * Gets client TCP port of remote node.
-     *
-     * @return Remote tcp port.
-     */
-    public int tcpPort();
-
-    /**
-     * Gets client HTTP port of remote node.
-     *
-     * @return Remote http port.
-     */
-    @Deprecated
-    public int httpPort();
-
-    /**
-     * Gets all attributes of remote node. Note that all system and
-     * environment properties are automatically includes in node
-     * attributes. User can also attach custom attributes and then
-     * use them to further filter remote nodes into virtual subgrids
-     * for task execution.
-     *
-     * @return All node attributes.
-     */
-    public Map<String, Object> attributes();
-
-    /**
-     * Gets specific attribute of remote node.
-     *
-     * @param name Attribute name.
-     * @return Attribute value.
-     * @see #attributes()
-     */
-    @Nullable public <T> T attribute(String name);
-
-    /**
-     * Gets various dynamic metrics of remote node.
-     *
-     * @return Metrics of remote node.
-     */
-    public GridClientNodeMetrics metrics();
-
-    /**
-     * Gets all configured caches and their types on remote node.
-     *
-     * @return Map in which key is a configured cache name on the node,
-     *      value is mode of configured cache.
-     */
-    public Map<String, GridClientCacheMode> caches();
-
-    /**
-     * Gets node replica count for consistent hash ring (valid only for
-     * {@code PARTITIONED} caches).
-     *
-     * @return Node replica count for consistent hash ring.
-     */
-    public int replicaCount();
-
-    /**
-     * Gets collection of addresses on which REST binary protocol is bound.
-     *
-     * @param proto Protocol for which addresses are obtained.
-     * @param filterResolved Whether to filter resolved addresses ( {@link InetSocketAddress#isUnresolved()}
-     * returns {@code False} ) or not.
-     * @return List of addresses.
-     */
-    public Collection<InetSocketAddress> availableAddresses(GridClientProtocol proto, boolean filterResolved);
-
-    /**
-     * Indicates whether client can establish direct connection with this node.
-     * So it is guaranteed that that any request will take only one network
-     * 'hop' before it will be processed by a Grid node.
-     *
-     * @return {@code true} if node can be directly connected,
-     *  {@code false} if request may be passed through a router.
-     */
-    public boolean connectable();
-}


Mime
View raw message