Fork me on GitHub

Group Member


Group membership management. Adds this instance into a group and keeps a cache of members in the group.

Participating Classes

  • GroupMember
  • PersistentNode
  • PathChildrenCache


Creating a GroupMember

public GroupMember(CuratorFramework client,
                        String membershipPath,
                        String thisId,
                        byte[] payload)
client - client instance
membershipPath - the path to use for membership
thisId - ID of this group member. MUST be unique for the group
payload - the payload to write in our member node

General Usage

GroupMember must be started:


When you are through with the GroupMember instance, you should call close:


NOTE: this will remove the instance from the group

You can get a current view of the members by calling:


Error Handling

GroupMember instances internally handle all error states recreating the node as necessary.