Interface MemberHandler
-
public interface MemberHandler
The MemberHandler interface is used by the CollectiveRepositoryMBean to handle the monitoring requirements of a registered member
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getMonitorCount()
Get number of monitored members from the collective repository.java.lang.String
startMonitoring(int heartbeatInterval, java.util.Map<java.lang.String,java.lang.Object> memberData)
Start monitoring a member when it is registering for the first time or re-registering.void
stopMonitoring(java.lang.String memberID)
Updates flags in the repository to indicate that this member has been unregistered.void
validateMember(java.lang.String operation, java.lang.String memberID, boolean checkExist)
Validate a member.void
validateMember(java.lang.String operation, java.util.Map<java.lang.String,java.lang.Object> memberData, boolean checkExist)
Validate a member.
-
-
-
Method Detail
-
validateMember
void validateMember(java.lang.String operation, java.util.Map<java.lang.String,java.lang.Object> memberData, boolean checkExist) throws java.io.IOException
Validate 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:
java.io.IOException
- if there was any problem completing the operation
-
validateMember
void validateMember(java.lang.String operation, java.lang.String memberID, boolean checkExist) throws java.io.IOException
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:
java.io.IOException
- if there was any problem completing the operation
-
startMonitoring
java.lang.String startMonitoring(int heartbeatInterval, java.util.Map<java.lang.String,java.lang.Object> memberData) throws java.io.IOException
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:
java.io.IOException
- if there was any problem completing the operation
-
stopMonitoring
void stopMonitoring(java.lang.String memberID) throws java.io.IOException
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:
java.io.IOException
- if there was any problem completing the operation
-
getMonitorCount
long getMonitorCount() throws java.io.IOException
Get number of monitored members from the collective repository.- Throws:
java.io.IOException
- if there was any problem completing the operation
-
-