Interface NetworkManager

    • Method Detail

      • initialize

        void initialize​(String groupName,
                        String instanceName,
                        Map properties)
                 throws IOException
        Initializes this network manager with given params and properties
        Parameters:
        groupName - group name
        instanceName - instance name
        properties - specific properties
        Throws:
        IOException - if an unexpected error occurs
      • stop

        void stop()
           throws IOException
        Stops this network manager For cleaning up remaining values and finishing I/O operation, this method could be used
        Specified by:
        stop in interface ShoalMessageSender
        Throws:
        IOException - if an I/O error occurs
      • addMessageListener

        void addMessageListener​(MessageListener messageListener)
        Parameters:
        messageListener - a message listener which should be registered on this network manager
      • removeMessageListener

        void removeMessageListener​(MessageListener messageListener)
        Removes the MessageListener
        Parameters:
        messageListener - a message listener which should be removed
      • receiveMessage

        void receiveMessage​(Message message,
                            Map piggyback)
        Processes a received Message In this process, inbound Message will be wrapped into MessageEvent and be delivered to registered MessageListener with corresponding to the message type
        Parameters:
        message - inbound message
        piggyback - piggyback
      • getLocalPeerID

        PeerID getLocalPeerID()
        Returns local PeerID
        Returns:
        peer id
      • getPeerID

        PeerID getPeerID​(String instanceName)
        Returns the proper PeerID corresponding with a given instance name
        Parameters:
        instanceName - instance name
        Returns:
        peer id
      • addRemotePeer

        void addRemotePeer​(PeerID peerID)
        Add the peerID to this network manager
        Parameters:
        peerID - the peer Id
      • removePeerID

        void removePeerID​(PeerID peerID)
        Removes the peerID from this network manager
        Parameters:
        peerID - the peer Id
      • isConnected

        boolean isConnected​(PeerID peerID)
        Check whether the suspicious peer is alive or not This API is mainly used in HealthMonitor in order to determine the failure member
        Parameters:
        peerID - peer id
        Returns:
        true if the peer is still alive, otherwise false