Package com.hazelcast.client
Interface ClientService
-
public interface ClientService
ClientService allows you to query connectedClient
s and attach/detachClientListener
s to listen to connection events.All the methods are thread-safe.
- See Also:
Client
,ClientListener
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.UUID
addClientListener(ClientListener clientListener)
Adds a ClientListener.java.util.Collection<Client>
getConnectedClients()
Returns all connected clients to this member.boolean
removeClientListener(java.util.UUID registrationId)
Removes a ClientListener.
-
-
-
Method Detail
-
getConnectedClients
@Nonnull java.util.Collection<Client> getConnectedClients()
Returns all connected clients to this member.- Returns:
- all connected clients to this member
-
addClientListener
@Nonnull java.util.UUID addClientListener(@Nonnull 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 which can be used to remove the listener using the
removeClientListener(UUID)
method - Throws:
java.lang.NullPointerException
- if clientListener isnull
-
removeClientListener
boolean removeClientListener(@Nonnull java.util.UUID 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:
java.lang.NullPointerException
- if registration ID isnull
-
-