#include "RejoinDone.h" #include "Dispatcher.h" #include "common/validator/MessageValidator.h" namespace ubeeme { namespace moversight { /** * @brief Default Constructor */ RejoinDone::RejoinDone() : MulticastMessage("RD", RD) { } /** * @brief Copy constructor * @param other The instance to copy */ RejoinDone::RejoinDone(const RejoinDone &other) : MulticastMessage(other) { operator =(other); } /** * @brief Assignment operator * @param other The instance to assign. * @return A reference to the local instance. */ RejoinDone & RejoinDone::operator=(const RejoinDone & other) { if (this == &other) return *this; MulticastMessage::operator=(other); return *this; } /** * @brief Destructor */ RejoinDone::~RejoinDone() { } /** * @brief Duplicate method. Creates a copy of the current message. * @return The copy of the current instance. */ RejoinDone * RejoinDone::dup() const { return new RejoinDone(*this); } /** * @brief Handles this message. To handle a message, it has first successfully validated. * @param dis A reference to the dispatcher, used to forward this message to the handling modules. */ void RejoinDone::handleReceive(Dispatcher & dis) { // @NOTE this is not validated? and not passed to the NFD? //notify the NFD about ongoing traffic // dis.getNetworkFailureDetector().handleMessage(this); //handle the message dis.getMessageTransfer().handleMessage(this); } /** * @brief Handles the message delivering. To deliver a message, the message to each module which is interested in this message. * @param dis A reference to the dispatcher, used to forward this message to the handling modules. * @param missedPeers A list of peers, which have missed this message, as they are pending. */ void RejoinDone::handleDeliver(Dispatcher & dis, const PeerIDList & missedPeers) { // @NOTE not stored? //store the message for re-synchronization // dis.getMobilitySupport().storeMessage(*this); //process the message dis.getMobilitySupport().handleRejoinDone(*this, missedPeers); } /** * @brief Archive method. * @param archive The archive to which the attributes are to add */ void RejoinDone::set(Archive & archive) { MulticastMessage::set(archive); } } }