Interface MemberHandler
public interface MemberHandler
The MemberHandler interface is used by the CollectiveRepositoryMBean to handle the monitoring requirements of a registered member
-
Method Summary
Modifier and TypeMethodDescriptionlongGet number of monitored members from the collective repository.startMonitoring(int heartbeatInterval, Map<String, Object> memberData) Start monitoring a member when it is registering for the first time or re-registering.voidstopMonitoring(String memberID) Updates flags in the repository to indicate that this member has been unregistered.voidvalidateMember(String operation, String memberID, boolean checkExist) Validate a member.voidvalidateMember(String operation, Map<String, Object> memberData, boolean checkExist) Validate a member.
-
Method Details
-
validateMember
void validateMember(String operation, Map<String, Object> memberData, boolean checkExist) throws IOExceptionValidate a member.An invalid member id is null or empty
- Parameters:
operation- the repository operation being invokedmemberData- , check if the memberData tuple provided contains valid member idcheckExists- iftrue, check that the memberID exists- Throws:
IOException- if there was any problem completing the operation
-
validateMember
Validate a member.An invalid member id is null or empty
- Parameters:
operation- the repository operation being invokedmemberID- to validatecheckExists- iftrue, check that the memberID exists- Throws:
IOException- if there was any problem completing the operation
-
startMonitoring
Start monitoring a member when it is registering for the first time or re-registering. Also create or update the necessary nodes in the repository that allow a member to function properly in the collective and be able to be monitored by the Liveness Monitor.- Parameters:
heartbeatInterval- the member's heart beat interval (seconds)memberData- from the repository invocation, containing the member identity- Throws:
IOException- if there was any problem completing the operation
-
stopMonitoring
Updates flags in the repository to indicate that this member has been unregistered. Stop monitoring a member when it is unregistered. Also remove the member from any monitoring list.- Parameters:
memberID- the collective ID for the member- Throws:
IOException- if there was any problem completing the operation
-
getMonitorCount
Get number of monitored members from the collective repository.- Throws:
IOException- if there was any problem completing the operation
-