com.hazelcast.cluster
Interface ClusterService

All Superinterfaces:
CoreService
All Known Implementing Classes:
ClusterServiceImpl

public interface ClusterService
extends CoreService

A service responsible for member related functionality. So members joining, leaving etc.

This API is an internal API; the end user will use the Cluster interface.


Method Summary
 long getClusterTime()
          Returns the cluster-time.
 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.
 Collection<Member> getMembers()
          Returns a collection of all members part of the cluster.
 int getSize()
          Gets the current number of members.
 Address getThisAddress()
          Gets the address of this member.
 boolean isMaster()
          Checks if this member is the master.
 

Method Detail

getMember

MemberImpl getMember(Address address)
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

MemberImpl getMember(String uuid)
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

Collection<MemberImpl> getMemberList()
Gets the collection of members.

TODO: The name of this method is confusing since it says that a list is returned, but a collection is returned. TODO: This method also is a bit of a duplicate since there already is getMembers. So I think this method can be dropped if we take care of the generics.

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

getMembers

Collection<Member> getMembers()
Returns a collection of all members part of the cluster.

Returns:
all members that are part of the cluster.

getMasterAddress

Address getMasterAddress()
Returns the address of the master member.

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

isMaster

boolean isMaster()
Checks if this member is the master.

Returns:
true if master, false otherwise.

getThisAddress

Address getThisAddress()
Gets the address of this member.

Returns:
the address of this member. The returned value will never be null.

getSize

int getSize()
Gets the current number of members.

Returns:
the current number of members.

getClusterTime

long getClusterTime()
Returns the cluster-time.

TODO: We need to document what cluster time really means and what is can be used for.

Returns:
the cluster-time.


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