java.io.Closeable, java.lang.AutoCloseablepublic class GroupMember
extends java.lang.Object
implements java.io.Closeable
| Constructor | Description |
|---|---|
GroupMember(org.apache.curator.framework.CuratorFramework client,
java.lang.String membershipPath,
java.lang.String thisId) |
|
GroupMember(org.apache.curator.framework.CuratorFramework client,
java.lang.String membershipPath,
java.lang.String thisId,
byte[] payload) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Have thisId leave the group and stop caching membership
|
java.util.Map<java.lang.String,byte[]> |
getCurrentMembers() |
Return the current view of membership.
|
java.lang.String |
idFromPath(java.lang.String path) |
Given a full ZNode path, return the member ID
|
protected PathChildrenCache |
newPathChildrenCache(org.apache.curator.framework.CuratorFramework client,
java.lang.String membershipPath) |
|
protected PersistentEphemeralNode |
newPersistentEphemeralNode(org.apache.curator.framework.CuratorFramework client,
java.lang.String membershipPath,
java.lang.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,
java.lang.String membershipPath,
java.lang.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,
java.lang.String membershipPath,
java.lang.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 java.lang.AutoCloseableclose in interface java.io.Closeablepublic java.util.Map<java.lang.String,byte[]> getCurrentMembers()
public java.lang.String idFromPath(java.lang.String path)
path - full ZNode pathprotected PersistentEphemeralNode newPersistentEphemeralNode(org.apache.curator.framework.CuratorFramework client, java.lang.String membershipPath, java.lang.String thisId, byte[] payload)
protected PathChildrenCache newPathChildrenCache(org.apache.curator.framework.CuratorFramework client, java.lang.String membershipPath)
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.