com.hazelcast.client.spi.impl
Class ClientClusterServiceImpl

java.lang.Object
  extended by com.hazelcast.client.spi.impl.ClusterListenerSupport
      extended by com.hazelcast.client.spi.impl.ClientClusterServiceImpl
All Implemented Interfaces:
ClientClusterService, ConnectionHeartbeatListener, ConnectionListener

public class ClientClusterServiceImpl
extends ClusterListenerSupport

The ClientClusterService implementation.


Field Summary
 
Fields inherited from class com.hazelcast.client.spi.impl.ClusterListenerSupport
client
 
Constructor Summary
ClientClusterServiceImpl(HazelcastClientInstanceImpl client)
           
 
Method Summary
 String addMembershipListener(MembershipListener listener)
           
 long getClusterTime()
          Returns the cluster-time.
 Client getLocalClient()
           
 Address getMasterAddress()
          Returns the address of the master member.
 MemberImpl getMember(Address address)
          Gets the member for the given address.
 MemberImpl getMember(String uuid)
          Gets the member with the given uuid.
 Collection<MemberImpl> getMemberList()
          Gets the collection of members.
 int getSize()
          Gets the current number of members.
 boolean removeMembershipListener(String registrationId)
           
 void start()
           
 
Methods inherited from class com.hazelcast.client.spi.impl.ClusterListenerSupport
connectionAdded, connectionRemoved, connectToCluster, getOwnerConnectionAddress, getPrincipal, heartBeatStarted, heartBeatStopped, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientClusterServiceImpl

public ClientClusterServiceImpl(HazelcastClientInstanceImpl client)
Method Detail

getMember

public MemberImpl getMember(Address address)
Description copied from interface: ClientClusterService
Gets the member for the given address.

Parameters:
address - the address of the member to lookup.
Returns:
the found member, or null if not found. If address is null, null is returned.

getMember

public MemberImpl getMember(String uuid)
Description copied from interface: ClientClusterService
Gets the member with the given uuid.

Parameters:
uuid - the uuid of the member
Returns:
the found member, or null if not found. If uuid is null, null is returned.

getMemberList

public Collection<MemberImpl> getMemberList()
Description copied from interface: ClientClusterService
Gets the collection of members.

Returns:
the collection of member. Null will never be returned.

getMasterAddress

public Address getMasterAddress()
Description copied from interface: ClientClusterService
Returns the address of the master member.

Returns:
the address of the master member. Could be null if the master is not yet known.

getSize

public int getSize()
Description copied from interface: ClientClusterService
Gets the current number of members.

Returns:
the current number of members.

getClusterTime

public long getClusterTime()
Description copied from interface: ClientClusterService
Returns the cluster-time.

Returns:
the cluster-time.

getLocalClient

public Client getLocalClient()
Returns:
Client interface representing local client

addMembershipListener

public String addMembershipListener(MembershipListener listener)
Parameters:
listener - to be registered
Returns:
registration id

removeMembershipListener

public boolean removeMembershipListener(String registrationId)
Parameters:
registrationId - of listener
Returns:
true if successfully removed, false otherwise

start

public void start()
           throws Exception
Throws:
Exception


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.