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 Type
    Method
    Description
    long
    Get 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.
    void
    Updates flags in the repository to indicate that this member has been unregistered.
    void
    validateMember(String operation, String memberID, boolean checkExist)
    Validate a member.
    void
    validateMember(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 IOException
      Validate a member.

      An invalid member id is null or empty

      Parameters:
      operation - the repository operation being invoked
      memberData - , check if the memberData tuple provided contains valid member id
      checkExists - if true, check that the memberID exists
      Throws:
      IOException - if there was any problem completing the operation
    • validateMember

      void validateMember(String operation, String memberID, boolean checkExist) throws IOException
      Validate a member.

      An invalid member id is null or empty

      Parameters:
      operation - the repository operation being invoked
      memberID - to validate
      checkExists - if true, check that the memberID exists
      Throws:
      IOException - if there was any problem completing the operation
    • startMonitoring

      String startMonitoring(int heartbeatInterval, Map<String,Object> memberData) throws 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:
      IOException - if there was any problem completing the operation
    • stopMonitoring

      void stopMonitoring(String memberID) throws 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:
      IOException - if there was any problem completing the operation
    • getMonitorCount

      long getMonitorCount() throws IOException
      Get number of monitored members from the collective repository.
      Throws:
      IOException - if there was any problem completing the operation