74 lines
2.0 KiB
C++
74 lines
2.0 KiB
C++
/*
|
|
* File: CloudProvider.h
|
|
* Author: jgaebler
|
|
*
|
|
* Created on April 26, 2012, 3:27 PM
|
|
*/
|
|
|
|
#ifndef CLOUDPROVIDER_H
|
|
#define CLOUDPROVIDER_H
|
|
|
|
#include "common/Defines.h"
|
|
#include "Dispatcher.h"
|
|
#include "Moversight.h"
|
|
#include "mob/sync/cloud/transfer/TransferContainer.h"
|
|
#include "mob/sync/cloud/transfer/TransferContainerList.h"
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
class PeerIDList;
|
|
|
|
/**
|
|
* @brief Provides an generic interface to access the cloud storage.
|
|
*/
|
|
class CloudProvider {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param dis A reference to the Moversight Dispatcher.
|
|
* @param mov A reference to the Moversight Module.
|
|
*/
|
|
CloudProvider(Dispatcher & dis, Moversight & mov) : dispatcher(dis), module(mov) {
|
|
}
|
|
|
|
/**
|
|
* @brief Destructor
|
|
*/
|
|
virtual ~CloudProvider() {
|
|
}
|
|
|
|
/**
|
|
* @brief Puts the given data into the cloud.
|
|
* @param uploadData The data to upload.
|
|
* @param uPID The id of the uploading peer.
|
|
* @param fileName The name of the file that stores the data.
|
|
*/
|
|
virtual void upload(ByteArray & uploadData, PeerID uPID, std::string fileName) = 0;
|
|
|
|
/**
|
|
* @brief Determines which peer have stored messages within the cloud
|
|
* @return A list of IDs of that peers, which have stored messages in the cloud
|
|
*/
|
|
virtual PeerIDList determineStoringPeers() = 0;
|
|
|
|
|
|
/**
|
|
* @brief Downloads the messages from the given peer
|
|
* @param id The id of the peer that have stored messages within the cloud
|
|
* @return A list of received transfer containers
|
|
*/
|
|
virtual TransferContainerList downloadMessagesFromPeer(PeerID id) = 0;
|
|
|
|
protected:
|
|
|
|
Dispatcher & dispatcher;
|
|
Moversight & module;
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif /* CLOUDPROVIDER_H */
|
|
|