#ifndef _PLUGIN_SERVER_H_
#define _PLUGIN_SERVER_H_

#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#ifdef __linux__
#include <vector>
#include <signal.h>
#include <unistd.h>
#endif

// #include "BlockCRUDApiImpl.h"
// #include "MetaSchemaCRUDApiImpl.h"
// #include "NotificationSubscriptionCRUDApiImpl.h"
// #include "NotificationSubscriptionsCRUDApiImpl.h"
// #include "RecordCRUDApiImpl.h"
#include "PluginApiImpl.hpp"
#include "logger.hpp"

#define PISTACHE_SERVER_THREADS 2
#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768
#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768

using namespace org::openapitools::server::api;

class PLUGINApiServer {

public:
  PLUGINApiServer(Pistache::Address address);
  void init(size_t thr = 1);
  void start();
  void shutdown();

private:
  std::shared_ptr<Pistache::Http::Endpoint> m_httpEndpoint;
  std::shared_ptr<Pistache::Rest::Router> m_router;

  std::shared_ptr<PluginApiImpl>
       m_PluginApiserver;


//   std::shared_ptr<BlockCRUDApiImpl>
//       m_BlockCRUDApiserver;
//   std::shared_ptr<MetaSchemaCRUDApiImpl>
//       m_MetaSchemaCRUDApiserver;
//   std::shared_ptr<NotificationSubscriptionCRUDApiImpl>
//       m_NotificationSubscriptionCRUDApiserver;
//   std::shared_ptr<NotificationSubscriptionsCRUDApiImpl>
//       m_NotificationSubscriptionsCRUDApiserver;
//   std::shared_ptr<RecordCRUDApiImpl>
//       m_RecordCRUDApiserver;
 
};

#endif