Class GroupMember
java.lang.Object
org.apache.curator.framework.recipes.nodes.GroupMember
- All Implemented Interfaces:
- Closeable,- AutoCloseable
Group membership management. Adds this instance into a group and
 keeps a cache of members in the group
- 
Constructor SummaryConstructorsConstructorDescriptionGroupMember(CuratorFramework client, String membershipPath, String thisId) GroupMember(CuratorFramework client, String membershipPath, String thisId, byte[] payload) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Have thisId leave the group and stop caching membershipReturn the current view of membership.idFromPath(String path) Given a full ZNode path, return the member IDvoidsetThisData(byte[] data) Change the data stored in this instance's nodevoidstart()Start the group membership.
- 
Constructor Details- 
GroupMember- Parameters:
- client- client
- membershipPath- the path to use for membership
- thisId- ID of this group member. MUST be unique for the group
 
- 
GroupMember- Parameters:
- client- client
- 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
 
 
- 
- 
Method Details- 
startpublic void start()Start the group membership. Register thisId as a member and begin caching all members
- 
setThisDatapublic void setThisData(byte[] data) Change the data stored in this instance's node- Parameters:
- data- new data (cannot be null)
 
- 
closepublic void close()Have thisId leave the group and stop caching membership- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
- 
getCurrentMembersReturn the current view of membership. The keys are the IDs of the members. The values are each member's payload- Returns:
- membership
 
- 
idFromPathGiven a full ZNode path, return the member ID- Parameters:
- path- full ZNode path
- Returns:
- id
 
 
-