Adding initial code jy.oak@samsung.com
[ric-app/kpimon.git] / src / KPI-Monitoring / kpi_db.hpp
diff --git a/src/KPI-Monitoring/kpi_db.hpp b/src/KPI-Monitoring/kpi_db.hpp
new file mode 100755 (executable)
index 0000000..68b31c6
--- /dev/null
@@ -0,0 +1,55 @@
+/*\r
+==================================================================================\r
+        Copyright (c) 2018-2019 AT&T Intellectual Property.\r
+\r
+   Licensed under the Apache License, Version 2.0 (the "License");\r
+   you may not use this file except in compliance with the License.\r
+   You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+==================================================================================\r
+*/\r
+\r
+\r
+#ifndef KPI_DB_RESP_\r
+#define KPI_DB_RESP_\r
+\r
+  \r
+#include <iostream>\r
+#include <string.h>\r
+#include <errno.h>\r
+#include <mdclog/mdclog.h>\r
+#include <sstream>\r
+#include <hiredis/hiredis.h>\r
+#include <cu_cp_resource_status_report_helper.hpp>\r
+\r
+class kpi_db_resp {\r
+public:\r
+\r
+  ~kpi_db_resp();\r
+\r
+  void UpdateDB(redisContext* c,cucp_resource_helper *kpi_data);\r
+\r
+  std::string get_error(void) const {return error_string;};\r
+\r
+private:\r
+\r
+  // Wrapper over Redis APIs\r
+  void Rpush(redisContext *, std::string key,std::string value);\r
+  void Get(redisContext *, std::string key);\r
+  void Del(redisContext *, std::string key);\r
+  void Exists(redisContext *, std::string key);\r
+\r
+  redisReply *redis_reply;\r
+  std::string error_string;\r
+  char errbuf[128];\r
+  size_t errbuf_len = 128;\r
+};\r
+\r
+#endif\r