/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2016 Regents of the University of California.
*
* This file is part of the nTorrent codebase.
*
* nTorrent is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* nTorrent is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received copies of the GNU General Public License and GNU Lesser
* General Public License along with nTorrent, e.g., in COPYING.md file. If not, see
* <http://www.gnu.org/licenses/>.
*
* See AUTHORS for complete list of nTorrent authors and contributors.
*/

#ifndef FETCHING_STRATEGY_MANAGER_HPP
#define FETCHING_STRATEGY_MANAGER_HPP

#include <ndn-cxx/data.hpp>
#include <ndn-cxx/interest.hpp>
#include <ndn-cxx/util/time.hpp>

namespace ndn {
namespace ntorrent {

class FetchingStrategyManager {
  public:
    /**
     * @brief Default Constructor
     */
    FetchingStrategyManager() = default;

    /**
     * @brief Class Destructor
     */
    virtual
    ~FetchingStrategyManager();

    /**
     * @brief Method called to start the torrent downloading
     */
    virtual void
    start(const time::milliseconds& timeout = time::milliseconds::zero()) = 0;

    /**
     * @brief Method called to pause the torrent downloading
     */
    virtual void
    pause() = 0;

    /**
     * @brief Method called to continue the torrent downloading
     */
    virtual void
    resume() = 0;

    /**
     * @brief Struct representing the status of the downloading
     *  process that will be passed to the application layer
     */
    struct status {
      double downloadedPercent;
    };
  private:
    /**
     * @brief Callback to be called when data is received
     */
    virtual void
    onDataPacketReceived(const ndn::Data& data) = 0;

    /**
     * @brief Callback to be called when data retrieval failed
     */
    virtual void
    onDataRetrievalFailure(const ndn::Interest& interest, const std::string& errorCode) = 0;

    /**
     * @brief Callback to be called when a torrent file segment is received
     */
    virtual void
    onTorrentFileSegmentReceived(const std::vector<Name>& manifestNames) = 0;

    /**
     * @brief Callback to be called when a file manifest is received
     */
    virtual void
    onManifestReceived(const std::vector<Name>& packetNames) = 0;
};

inline
FetchingStrategyManager::~FetchingStrategyManager()
{
}

} // namespace ntorrent
} // namespace ndn

#endif // FETCHING_STRATEGY_MANAGER_HPP
