org.jgroups.blocks
public class ReplicatedTree extends Object implements Runnable, MessageListener, MembershipListener
Nested Class Summary | |
---|---|
static class | ReplicatedTree.Node |
interface | ReplicatedTree.ReplicatedTreeListener |
Field Summary | |
---|---|
protected Log | log |
static String | SEPARATOR |
Constructor Summary | |
---|---|
ReplicatedTree(String groupname, String props, long state_fetch_timeout)
Creates a channel with the given properties. | |
ReplicatedTree(String groupname, String props, long state_fetch_timeout, boolean jmx) | |
ReplicatedTree() | |
ReplicatedTree(JChannel channel)
Expects an already connected channel. |
Method Summary | |
---|---|
void | addReplicatedTreeListener(ReplicatedTree.ReplicatedTreeListener listener) |
void | block() Block sending and receiving of messages until viewAccepted() is called |
boolean | exists(String fqn)
Checks whether a given node exists in the tree |
void | fetchState(long timeout)
Fetch the group state from the current coordinator. |
Object | get(String fqn, String key)
Finds a node given its name and returns the value associated with a given key in its data
map. |
Channel | getChannel()
Returns the Channel the DistributedTree is connected to |
Set | getChildrenNames(String fqn)
Returns all children of a given node |
int | getGroupMembersNumber()
Returns the number of current members joined to the group |
String | getGroupName()
Returns the name of the group that the DistributedTree is connected to |
Set | getKeys(String fqn)
Gets the keys of the data map. |
Address | getLocalAddress() |
Vector | getMembers() |
byte[] | getState() Return a copy of the current cache (tree) |
static void | main(String[] args) |
String | print(String fqn)
Prints a representation of the node defined by fqn . |
void | put(String fqn, HashMap data)
Adds a new node to the tree and sets its data. |
void | put(String fqn, String key, Object value)
Adds a key and value to a given node. |
void | receive(Message msg) Callback. |
void | remove(String fqn)
Removes the node from the tree. |
void | remove(String fqn, String key)
Removes key from the node's hashmap |
void | removeReplicatedTreeListener(ReplicatedTree.ReplicatedTreeListener listener) |
void | run() Request handler thread |
void | setRemoteCalls(boolean flag) |
void | setRootNode(ReplicatedTree.Node n) |
void | setState(byte[] new_state) Set the cache (tree) to this value |
void | start() |
void | stop() |
void | suspect(Address suspected_mbr) Called when a member is suspected |
String | toString() |
void | viewAccepted(View new_view) |
void | _put(String fqn, HashMap data) |
void | _put(String fqn, String key, Object value) |
void | _remove(String fqn) |
void | _remove(String fqn, String key) |
void | _removeData(String fqn) |
Parameters: fqn The fully qualified name of the node
Returns: boolean Whether or not the node exists
data
map. Returns null if the node was not found in the tree or the key was not found in the hashmap.Parameters: fqn The fully qualified name of the node. key The key.
Returns: Channel
Parameters: fqn The fully qualified name of the node
Returns: Set A list of child names (as Strings)
Returns: int
Returns: String
data
map. Returns all keys as Strings. Returns null if node
does not exist.Parameters: fqn The fully qualified name of the node
Returns: Set A set of keys (as Strings)
fqn
. Output includes name, fqn and
data.Parameters: fqn The fully qualified name of the new node data The new data. May be null if no data should be set in the node.
Parameters: fqn The fully qualified name of the node key The key value The value
Parameters: fqn The fully qualified name of the node.
key
from the node's hashmapParameters: fqn The fullly qualified name of the node key The key to be removed