com.hazelcast.core
Interface ClientService

All Known Implementing Classes:
ClientServiceProxy

public interface ClientService

ClientService allows you to query connected Clients and attach/detach ClientListeners to listen to connection events. All the methods are thread-safe.

See Also:
Client, ClientListener

Method Summary
 String addClientListener(ClientListener clientListener)
          Adds a ClientListener.
 Collection<Client> getConnectedClients()
          Returns all connected clients to this member.
 boolean removeClientListener(String registrationId)
          Removes a ClientListener.
 

Method Detail

getConnectedClients

Collection<Client> getConnectedClients()
Returns all connected clients to this member.

Returns:
all connected clients to this member

addClientListener

String addClientListener(ClientListener clientListener)
Adds a ClientListener. When a ClientListener is added more than once, it will receive duplicate events.

Parameters:
clientListener - the ClientListener to add
Returns:
registration id. This id can be used to remove the listener using the removeClientListener(String) method.
Throws:
NullPointerException - if clientListener is null.

removeClientListener

boolean removeClientListener(String registrationId)
Removes a ClientListener. Can safely be called with a non existing id, or when the ClientListener already is removed.

Parameters:
registrationId - Id of the ClientListener registration.
Returns:
true if registration is removed, false otherwise
Throws:
NullPointerException - if registrationId is null.


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