public class GroupMember extends Object implements Closeable
| Constructor and Description |
|---|
GroupMember(org.apache.curator.framework.CuratorFramework client,
String membershipPath,
String thisId) |
GroupMember(org.apache.curator.framework.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
|
protected PathChildrenCache |
newPathChildrenCache(org.apache.curator.framework.CuratorFramework client,
String membershipPath) |
protected PersistentEphemeralNode |
newPersistentEphemeralNode(org.apache.curator.framework.CuratorFramework client,
String membershipPath,
String thisId,
byte[] payload) |
void |
setThisData(byte[] data)
Change the data stored in this instance's node
|
void |
start()
Start the group membership.
|
public GroupMember(org.apache.curator.framework.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(org.apache.curator.framework.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 Closeableclose in interface AutoCloseablepublic Map<String,byte[]> getCurrentMembers()
public String idFromPath(String path)
path - full ZNode pathprotected PersistentEphemeralNode newPersistentEphemeralNode(org.apache.curator.framework.CuratorFramework client, String membershipPath, String thisId, byte[] payload)
protected PathChildrenCache newPathChildrenCache(org.apache.curator.framework.CuratorFramework client, String membershipPath)
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.