Prepare service for database corruption handling
[platform/core/security/cynara.git] / src / common / response / ListResponse.h
index ec52736..2a67225 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
 /**
  * @file        src/common/response/ListResponse.h
  * @author      Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
+ * @author      Pawel Wieczorek <p.wieczorek2@samsung.com>
  * @version     1.0
  * @brief       This file defines response class for policies list request
  */
@@ -35,9 +36,10 @@ namespace Cynara {
 
 class ListResponse : public Response {
 public:
-    ListResponse(const std::vector<Policy> &policies, bool bucketValid,
+    ListResponse(const std::vector<Policy> &policies, bool bucketValid, bool dbCorrupted,
                  ProtocolFrameSequenceNumber sequenceNumber) :
-        Response(sequenceNumber), m_policies(policies), m_bucketValid(bucketValid) {
+        Response(sequenceNumber), m_policies(policies), m_bucketValid(bucketValid),
+        m_dbCorrupted(dbCorrupted) {
     }
 
     virtual ~ListResponse() {};
@@ -48,6 +50,10 @@ public:
         return m_bucketValid;
     }
 
+    bool isDbCorrupted(void) const {
+        return m_dbCorrupted;
+    }
+
     const std::vector<Policy> &policies(void) const {
         return m_policies;
     }
@@ -55,6 +61,7 @@ public:
 private:
     std::vector<Policy> m_policies;
     bool m_bucketValid;
+    bool m_dbCorrupted;
 };
 
 } // namespace Cynara