Package com.hazelcast.client
Interface ClientService
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:
-
Method Summary
Modifier and TypeMethodDescriptionaddClientListener(ClientListener clientListener) Adds a ClientListener.Returns all connected clients to this member.booleanremoveClientListener(UUID registrationId) Removes a ClientListener.
-
Method Details
-
getConnectedClients
Returns all connected clients to this member.- Returns:
- all connected clients to this member
-
addClientListener
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 which can be used to remove the listener using the
removeClientListener(UUID)method - Throws:
NullPointerException- if clientListener isnull
-
removeClientListener
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:
trueif registration is removed,falseotherwise- Throws:
NullPointerException- if registration ID isnull
-