Just a second...

Client groups

Clients that are connected can be managed in client groups allowing messages to be sent to groups of clients

Client groups are a convenient way of managing groups of clients with common attributes.

A publisher can create a client group and add clients to it. Messages can be sent to the group of clients rather than to individual clients.

When a client disconnects it is automatically removed from all client groups of which it is a member.

A client group belongs to the publisher that created it and can be used only from within that publisher. Group names are unique within the publisher only.

Client groups are a feature of the Java™ API using the Publisher interface.

Creating a client group

A publisher can create a new client group at any time using createClientGroup. When creating the group it is given a name which must be unique within the publisher. When a client group is created a reference to a ClientGroup object is returned.

Adding clients to a group

Clients can be added to a client group using the addClient method on a ClientGroup object.

Sending messages to clients in a group

A message can be sent to all clients in a client group using the ClientGroup.send method. To send to all but a specified client use publishExclusiveMessage.

Removing clients from a group

To remove clients from a client group, use the ClientGroup.removeClient method.

Removing a client group

To delete / remove a client group that is no longer required, use the Publisher.removeClientGroup method.

Other methods

All clients within a client group can be listed using ClientGroup.getClients.

You can check whether a particular client is already a member of a client group using ClientGroup.containsClient.

To enquire upon which client groups a particular client belongs to you can use Publisher.getClientGroupMembership.

To get a reference to a named client group from a publisher use getClientGroup.

Temporary client groups

Normally client groups have publisher scope, but you can create temporary groups using the union and intersect methods. These methods allow for the creation of client groups which are not managed by the client group manager. These temporary groups allow for the sending of messages which contain clients from different groups.