/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2012 University of California, Los Angeles
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
 *         卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
 *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
 */

#ifndef SYNC_APP_DATA_PUBLISH_H
#define SYNC_APP_DATA_PUBLISH_H
#include <boost/shared_ptr.hpp>
#include <boost/unordered_map.hpp>
#include "sync-seq-no.h"
#include "sync-ccnx-wrapper.h"

/**
 * \defgroup sync SYNC protocol
 *
 * Implementation of SYNC protocol
 */
namespace Sync {

struct Seq
{
  uint32_t session;
  uint32_t seq;
};

/**
 * \ingroup sync
 * @brief publishes application data using incrementing sequence number (for
 * each sequence namber and keeps track of most recently published data for
 * each name prefix
 */
class AppDataPublish
{
public:
	AppDataPublish(boost::shared_ptr<CcnxWrapper> ccnxHandle)
	{ m_ccnxHandle = ccnxHandle; }
	~AppDataPublish() {};

	/**
	 * @brief get the name (including sequence number) and the content
	 * (unencoded, just XML stanza) of the most recent published data
	 *
	 * @param prefix the name prefix to look for
	 * @return the pair of name and content
	 */
	std::string getRecentData(std::string prefix, uint32_t session);

	/**
	 * brief get the most recent sequence number for a name prefix
	 */
	 u_int32_t getHighestSeq(std::string prefix, uint32_t session);

	/**
	 * @brief publish data for a name prefix, updates the corresponding
	 * sequence number and recent data
	 *
	 * @param name data prefix
	 * @param dataBuffer the data itself
	 * @param freshness the freshness for the data object
	 * @return whether the publish succeeded
	 */
	bool publishData(std::string name, uint32_t session, std::string dataBuffer, int freshness);

private:
	boost::unordered_map<std::string, Seq> m_sequenceLog;
	boost::shared_ptr<CcnxWrapper> m_ccnxHandle;
	boost::unordered_map<std::string, std::string> m_recentData;
};

} // Sync

#endif // SYNC_APP_DATA_PUBLISH_H
