public interface Groups
GroupListener interface to receive group status change notifications.| Modifier and Type | Method and Description |
|---|---|
void |
createGroup(String groupName,
GroupInfo gInfo)
Create a Group with specified name and configuration.
|
GroupInfo |
getGroupInfo(String groupName)
Query for the information [attributes] of a group
|
List<String> |
getGroupMembers(String groupName)
Query for the list of instanceIds of the group members.
|
GroupMemberInfo |
getMemberInfo(String groupName,
String instacneId)
Retrieve the information about a member of the group identified by the
instanceId.
|
void |
heartBeat(String groupName,
String instanceId)
Application invokes this routine to periodically notify the groups
service that it is alive.
|
String |
joinGroup(String groupName,
String instanceId,
GroupListener listener)
Application instance to join a group.
|
void |
leaveGroup(String groupName,
String instacneId)
Application instance to leave a group.
|
void |
runElection(String groupName)
Trigger leader election for a group.
|
void createGroup(String groupName, GroupInfo gInfo) throws GroupsException, ServiceNotAvailableException, InterruptedException
groupName - Name of the groupgInfo - group configurationGroupsException - On ErrorInterruptedException - Operation interrupted exceptionServiceNotAvailableException - Groups service is not UpGroupsException.GroupConfigMismatchException - if tried to create
an existing group with different configurationGroupsException.DistributedServicesException - Distributed services
exceptionString joinGroup(String groupName, String instanceId, GroupListener listener) throws GroupsException, ServiceNotAvailableException, InterruptedException
groupName - group nameinstanceId - instance id, if non null, Groups attempts to join
with this idlistener - group listener for listening to changes to groupGroupsException - On ErrorInterruptedException - Operation interrupted exceptionServiceNotAvailableException - Group service is not UpGroupsException.MemberExistsException - A member with provided
instanceId existsGroupsException.GroupNotFoundException - Group not foundGroupsException.DistributedServicesException - Distributed services
exceptionvoid leaveGroup(String groupName, String instacneId) throws GroupsException, ServiceNotAvailableException, InterruptedException
groupName - group nameinstacneId - instance idGroupsException - On ErrorInterruptedException - Operation interrupted exceptionServiceNotAvailableException - Groups service is not UpGroupsException.MemberNotFoundException - No member corresponding to instanceIdGroupsException.DistributedServicesException - Distributed services
exceptionvoid runElection(String groupName) throws GroupsException, ServiceNotAvailableException, InterruptedException
groupName - group nameGroupsException - On ErrorInterruptedException - Operation interrupted exceptionServiceNotAvailableException - Groups service is not UpGroupsException.GroupNotFoundException - group doesn't existGroupsException.GroupChangedException - Group changed from the
last stateGroupsException.DistributedServicesException - Distributed services
exceptionGroupInfo getGroupInfo(String groupName) throws GroupsException, ServiceNotAvailableException, InterruptedException
groupName - group nameGroupsException - On ErrorInterruptedException - Operation interrupted exceptionServiceNotAvailableException - Group service is not UpGroupsException.GroupNotFoundException - group doesn't existGroupsException.DistributedServicesException - Distributed services
exceptionList<String> getGroupMembers(String groupName) throws GroupsException, ServiceNotAvailableException, InterruptedException
groupName - group nameGroupsException - On ErrorInterruptedException - Operation interrupted exceptionServiceNotAvailableException - Group service is not UpGroupsException.GroupNotFoundException - group doesn't existGroupsException.DistributedServicesException - Distributed
services exceptionGroupMemberInfo getMemberInfo(String groupName, String instacneId) throws GroupsException, ServiceNotAvailableException, InterruptedException
groupName - group nameinstacneId - instance idGroupsException - On ErrorInterruptedException - Operation interrupted exceptionServiceNotAvailableException - Group service is not UpGroupsException.MemberNotFoundException - member not foundvoid heartBeat(String groupName, String instanceId) throws GroupsException
groupName - group nameinstanceId - instance idGroupsException - On ErrorGroupsException.MemberNotFoundException - member not foundCopyright © 2014. All Rights Reserved.