public class GroupMember extends Object implements Closeable
Constructor and Description |
---|
GroupMember(CuratorFramework client,
String membershipPath,
String thisId) |
GroupMember(CuratorFramework client,
String membershipPath,
String thisId,
byte[] payload) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Have thisId leave the group and stop caching membership
|
Map<String,byte[]> |
getCurrentMembers()
Return the current view of membership.
|
String |
idFromPath(String path)
Given a full ZNode path, return the member ID
|
void |
setThisData(byte[] data)
Change the data stored in this instance's node
|
void |
start()
Start the group membership.
|
public GroupMember(CuratorFramework client, String membershipPath, String thisId)
client
- clientmembershipPath
- the path to use for membershipthisId
- ID of this group member. MUST be unique for the grouppublic GroupMember(CuratorFramework client, String membershipPath, String thisId, byte[] payload)
client
- clientmembershipPath
- the path to use for membershipthisId
- ID of this group member. MUST be unique for the grouppayload
- the payload to write in our member nodepublic void start()
public void setThisData(byte[] data)
data
- new data (cannot be null)public void close()
close
in interface Closeable
close
in interface AutoCloseable
public Map<String,byte[]> getCurrentMembers()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.