public interface Group<T extends NodeState>
extends java.io.Closeable
Modifier and Type | Method and Description |
---|---|
void |
add(GroupListener<T> listener)
Registers a listener which will be called
when the cluster membership changes or
the group is connected or disconnected.
|
void |
close()
A member should be closed to release acquired resources used
to monitor the group membership.
|
boolean |
isConnected()
Are we connected with the cluster?
|
boolean |
isMaster()
Check if we are the master.
|
T |
master()
Retrieve the master node.
|
java.util.Map<java.lang.String,T> |
members()
Get the list of members connected to this group.
|
void |
remove(GroupListener<T> listener)
Removes a previously added listener.
|
java.util.List<T> |
slaves()
Retrieve the list of slaves.
|
void |
start()
Start this member
|
void |
update(T state)
Update the state of this group member.
|
boolean isConnected()
void start()
void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
java.io.IOException
void add(GroupListener<T> listener)
void remove(GroupListener<T> listener)
void update(T state)
state
- the new state of this group memberjava.util.Map<java.lang.String,T> members()
boolean isMaster()
T master()
java.util.List<T> slaves()
Copyright © 2014 Red Hat. All Rights Reserved.