Class SenderManager


  • public class SenderManager
    extends java.lang.Object
    Keeps track of all sent messages, until the final sequence number is known
    Since:
    3.1
    Author:
    Pedro Ruivo
    • Constructor Detail

      • SenderManager

        public SenderManager()
    • Method Detail

      • addNewMessageToSend

        public void addNewMessageToSend​(MessageID messageID,
                                        java.util.Collection<Address> destinations,
                                        long initialSequenceNumber,
                                        boolean deliverToMyself)
        Add a new message sent
        Parameters:
        messageID - the message ID
        destinations - the destination set
        initialSequenceNumber - the initial sequence number
        deliverToMyself - true if *this* member is in destination sent, false otherwise
      • addPropose

        public long addPropose​(MessageID messageID,
                               Address from,
                               long sequenceNumber)
        Add a propose from a member in destination set
        Parameters:
        messageID - the message ID
        from - the originator of the propose
        sequenceNumber - the proposed sequence number
        Returns:
        NOT_READY if the final sequence number is not know, or the final sequence number
      • markSent

        public boolean markSent​(MessageID messageID)
        Mark the message as sent
        Parameters:
        messageID - the message ID
        Returns:
        return true if *this* member is in destination set
      • getDestination

        public java.util.Set<Address> getDestination​(MessageID messageID)
        obtains the destination set of a message
        Parameters:
        messageID - the message ID
        Returns:
        the destination set
      • clear

        public void clear()
        removes all pending messages
      • getPendingMessageIDs

        public java.util.Collection<MessageID> getPendingMessageIDs()
      • removeLeavers

        public long removeLeavers​(MessageID messageID,
                                  java.util.Collection<Address> leavers)