com.hazelcast.client.spi

## Interface ClientClusterService

-     public interface ClientClusterService

  Cluster service for Hazelcast clients. Allows to retrieve Hazelcast members of the cluster, e.g. by their `Address` or UUID.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `addMembershipListener(MembershipListener listener)`
    `long` | `getClusterTime()` Returns the cluster-time.
    `Client` | `getLocalClient()`
    `Address` | `getMasterAddress()` Returns the address of the master member.
    `Member` | `getMember(Address address)` Gets the member for the given address.
    `Member` | `getMember(String uuid)` Gets the member with the given UUID.
    `Collection<Member>` | `getMemberList()` Gets the collection of members.
    `Collection<Member>` | `getMembers(MemberSelector selector)` Returns a collection of the members that satisfy the given `MemberSelector`.
    `int` | `getSize()` Gets the current number of members.
    `int` | `getSize(MemberSelector selector)` Gets the number of members that satisfy the given `MemberSelector` instance.
    `boolean` | `removeMembershipListener(String registrationId)`
    `void` | `reset()`

- - ### Method Detail

    - #### getLocalClient

          Client getLocalClient()

      Returns:
        The client interface representing the local client.

    - #### getMember

          Member getMember(Address address)

      Gets the member for the given address.
      Parameters:
        `address` - The address of the member to look up.
      Returns:
        The member that was found, or null if not found. If address is null, null is returned.

    - #### getMember

          Member getMember(String uuid)

      Gets the member with the given UUID.
      Parameters:
        `uuid` - The UUID of the member.
      Returns:
        The member that was found, or null if not found. If UUID is null, null is returned.

    - #### getMemberList

          Collection<Member> getMemberList()

      Gets the collection of members.
      Returns:
        The collection of members. Null will never be returned.

    - #### getMembers

          Collection<Member> getMembers(MemberSelector selector)

      Returns a collection of the members that satisfy the given `MemberSelector`.
      Parameters:
        `selector` - `MemberSelector` instance to filter members to return
      Returns:
        members that satisfy the given `MemberSelector`.

    - #### 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.

    - #### getSize

          int getSize()

      Gets the current number of members.
      Returns:
        The current number of members.

    - #### getSize

          int getSize(MemberSelector selector)

      Gets the number of members that satisfy the given `MemberSelector` instance.
      Parameters:
        `selector` - `MemberSelector` instance that filters members to be counted.
      Returns:
        the number of members that satisfy the given `MemberSelector` instance.

    - #### getClusterTime

          long getClusterTime()

      Returns the cluster-time.
      Returns:
        The cluster-time.

    - #### addMembershipListener

          String addMembershipListener(MembershipListener listener)

      Parameters:
        `listener` - The listener to be registered.
      Returns:
        The registration ID

    - #### removeMembershipListener

          boolean removeMembershipListener(String registrationId)

      Parameters:
        `registrationId` - The registrationId of the listener to be removed.
      Returns:
        true if successfully removed, false otherwise.

    - #### reset

          void reset()

Copyright © 2020. All rights reserved.