Search in sources :

Example 1 with ClientImpl

use of com.hazelcast.client.impl.ClientImpl in project hazelcast by hazelcast.

the class ClientClusterServiceImpl method getLocalClient.

@Override
public Client getLocalClient() {
    Address address = getOwnerConnectionAddress();
    final ClientConnectionManager cm = client.getConnectionManager();
    final ClientConnection connection = (ClientConnection) cm.getConnection(address);
    InetSocketAddress inetSocketAddress = connection != null ? connection.getLocalSocketAddress() : null;
    final String uuid = getPrincipal().getUuid();
    return new ClientImpl(uuid, inetSocketAddress);
}
Also used : Address(com.hazelcast.nio.Address) InetSocketAddress(java.net.InetSocketAddress) InetSocketAddress(java.net.InetSocketAddress) ClientImpl(com.hazelcast.client.impl.ClientImpl) ClientConnection(com.hazelcast.client.connection.nio.ClientConnection) ClientConnectionManager(com.hazelcast.client.connection.ClientConnectionManager)

Aggregations

ClientConnectionManager (com.hazelcast.client.connection.ClientConnectionManager)1 ClientConnection (com.hazelcast.client.connection.nio.ClientConnection)1 ClientImpl (com.hazelcast.client.impl.ClientImpl)1 Address (com.hazelcast.nio.Address)1 InetSocketAddress (java.net.InetSocketAddress)1