#ifndef BIBUNM_INBOX_H
#define BIBUNM_INBOX_H

#include "bibun_messenging/request.h"

namespace bibunm
{

class Receiver;

namespace internal_objects
{

enum class InboxType
{
   FROM_CLIENT,
   FROM_NODE
};

class Inbox : public Request
{
   friend class ::bibunm::Receiver;
public:
   // Generate a request for all outstanding messages for the app id.
   Inbox(std::string application_id, InboxType type);

   const std::string &appId() const;

   InboxType type() const;

   virtual ~Inbox();
protected:
   virtual std::map<std::string, std::string> create_protocol_headers() const;

   virtual void handle_protocol_headers(std::map<std::string, std::string> &protocol_hdrs);
private:
   Inbox(std::map<std::string, std::string> &protocol_hdrs);

   virtual const char *wireName() const final;

   // Headers.
   std::string _app_id;
   InboxType _type;
   static const char *_wire_name;
};

}
}

#endif // BIBUNM_INBOX_H
