/* * File: StorageService.h * Author: jgaebler * * Created on August 20, 2012, 2:29 PM */ #ifndef STORAGESERVICE_H #define STORAGESERVICE_H #include "../../common/MoversightService.h" #include "mt/MulticastMessageQueue.h" namespace ubeeme { namespace moversight { class MoversightMessage; /** * @brief Defines an interface to an storing service. A storing service * is used to store and retrieve message. The messages are used to enable * the virtual synchrony within the group, after a disconnected peer * re-joins the group. * @class StorageService * @author Jan Gäbler * @ingroup Moversight */ class StorageService : public MoversightService { public: /** * @brief Constructor * @param dis A reference to the dispatcher */ StorageService(Dispatcher & dis) : MoversightService(dis, "StorageService") { } /** * @brief Destructor */ virtual ~StorageService() { } /** * @brief Stores a message in for synchronization. * @param m The message to store. */ virtual void store( MulticastMessage & m) = 0; /** * @brief Retrieves messages from the cloud to resync the peer. The * lastSeenLt determines the virtual logical time of the last successfully * seen message locally. Thus, the messages retrieved from the cloud * are up from the lastSeenLt logical time. * @param lastSeenLt The virtual time of the last seen message. * @return The list of missed messages, found in the cloud, starting from lastSeenLt */ virtual MulticastMessageQueue retrieve(VirtualLogicalTime const & lastSeenLt) = 0; private: }; } } #endif /* STORAGESERVICE_H */