89 lines
2.3 KiB
C++
89 lines
2.3 KiB
C++
/*
|
|
* File: JoinAnnounceTimer.cc
|
|
* Author: jgaebler
|
|
*
|
|
* Created on March 9, 2011, 1:26 PM
|
|
*/
|
|
|
|
#include "JoinAnnounceTimer.h"
|
|
|
|
#include "ms/MembershipService.h"
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param aMs A reference to the membership service.
|
|
*/
|
|
JoinAnnounceTimer::JoinAnnounceTimer(MembershipService & aMs) : InvitationTimer(aMs) {
|
|
#if OMNETPP
|
|
setName("JoinAnnounceTimer");
|
|
#endif
|
|
GenericTime t(JOIN_ANNOUNCE_TIMEOUT);
|
|
setTimeout(t);
|
|
|
|
}
|
|
|
|
/**
|
|
* @brief Destructor
|
|
*/
|
|
JoinAnnounceTimer::~JoinAnnounceTimer() {
|
|
}
|
|
|
|
/**
|
|
* @brief Creates a copy of the current timer.
|
|
* @return The pointer to the created timer copy.
|
|
*/
|
|
JoinAnnounceTimer *
|
|
JoinAnnounceTimer::dup() {
|
|
return new JoinAnnounceTimer(*this);
|
|
}
|
|
|
|
/**
|
|
* @brief If the timer is fired, this method is called and the timer
|
|
* handled.
|
|
*/
|
|
void
|
|
JoinAnnounceTimer::timeout() {
|
|
dynamic_cast<MembershipService &>(service).handleJoinAnnounceTimer(this);
|
|
}
|
|
|
|
/**
|
|
* @brief Sets the peer description of the invited peer.
|
|
* @param pDesc The peer description of the invited peer.
|
|
*/
|
|
void
|
|
JoinAnnounceTimer::setInviteePeerDescription(PeerDescription const & pDesc) {
|
|
inviteePeerDescription = pDesc;
|
|
}
|
|
|
|
/**
|
|
* @brief Returns the peer description of the invited peer.
|
|
* @return The peer description of the invited peer.
|
|
*/
|
|
PeerDescription &
|
|
JoinAnnounceTimer::getInviteePeerDescription() {
|
|
return inviteePeerDescription;
|
|
}
|
|
|
|
/**
|
|
* @brief Permits access to the resource value of the peer.
|
|
* @return The resource value of the peer.
|
|
*/
|
|
const PeerResources &
|
|
JoinAnnounceTimer::getPeerResources() const {
|
|
return peerResources;
|
|
}
|
|
|
|
/**
|
|
* @brief Sets the resources of the peer.
|
|
* @param resources A generic representation of the peer resources.
|
|
*/
|
|
void
|
|
JoinAnnounceTimer::setPeerResources(const PeerResources & resources) {
|
|
peerResources = resources;
|
|
}
|
|
}
|
|
}
|