AdminCheckResponse is class for responses to AdminCheckRequests.
It differs from CheckResponse as it contains additional information
about existence of start bucket. Start bucket is BucketId provided
by AdminCheckRequest from which policy search is started.
Change-Id: I9858cfdb8a0acc0016a080eb850bbc65ec081a98
${COMMON_PATH}/request/RequestTaker.cpp
${COMMON_PATH}/request/SetPoliciesRequest.cpp
${COMMON_PATH}/request/SignalRequest.cpp
+ ${COMMON_PATH}/response/AdminCheckResponse.cpp
${COMMON_PATH}/response/AgentActionResponse.cpp
${COMMON_PATH}/response/AgentRegisterResponse.cpp
${COMMON_PATH}/response/CancelResponse.cpp
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @file src/common/response/AdminCheckResponse.cpp
+ * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
+ * @version 1.0
+ * @brief This file implements admin check response class
+ */
+
+#include <memory>
+
+#include "AdminCheckResponse.h"
+
+namespace Cynara {
+
+void AdminCheckResponse::execute(ResponsePtr self, ResponseTakerPtr taker,
+ RequestContextPtr context) const {
+ taker->execute(context, std::dynamic_pointer_cast<AdminCheckResponse>(self));
+}
+
+} // namespace Cynara
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @file src/common/response/AdminCheckResponse.h
+ * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
+ * @version 1.0
+ * @brief This file defines response class for admin check request
+ */
+
+#ifndef SRC_COMMON_RESPONSE_ADMINCHECKRESPONSE_H_
+#define SRC_COMMON_RESPONSE_ADMINCHECKRESPONSE_H_
+
+#include <types/PolicyResult.h>
+
+#include <request/pointers.h>
+#include <response/pointers.h>
+#include <response/Response.h>
+
+namespace Cynara {
+
+class AdminCheckResponse : public Response {
+public:
+ AdminCheckResponse(const PolicyResult &result, bool bucketValid,
+ ProtocolFrameSequenceNumber sequenceNumber) :
+ Response(sequenceNumber), m_result(result), m_bucketValid(bucketValid) {
+ }
+
+ virtual ~AdminCheckResponse() {}
+
+ virtual void execute(ResponsePtr self, ResponseTakerPtr taker,
+ RequestContextPtr context) const;
+
+ const PolicyResult &result(void) const {
+ return m_result;
+ }
+
+ bool isBucketValid(void) const {
+ return m_bucketValid;
+ }
+
+private:
+ const PolicyResult m_result;
+ bool m_bucketValid;
+};
+
+} // namespace Cynara
+
+#endif /* SRC_COMMON_RESPONSE_ADMINCHECKRESPONSE_H_ */
namespace Cynara {
-void ResponseTaker::execute(RequestContextPtr context UNUSED, AgentActionResponsePtr response UNUSED) {
+void ResponseTaker::execute(RequestContextPtr context UNUSED,
+ AdminCheckResponsePtr response UNUSED) {
throw NotImplementedException();
}
-void ResponseTaker::execute(RequestContextPtr context UNUSED, AgentRegisterResponsePtr response UNUSED) {
+void ResponseTaker::execute(RequestContextPtr context UNUSED,
+ AgentActionResponsePtr response UNUSED) {
+ throw NotImplementedException();
+}
+
+void ResponseTaker::execute(RequestContextPtr context UNUSED,
+ AgentRegisterResponsePtr response UNUSED) {
throw NotImplementedException();
}
ResponseTaker() = default;
virtual ~ResponseTaker() {};
+ virtual void execute(RequestContextPtr context, AdminCheckResponsePtr response);
virtual void execute(RequestContextPtr context, AgentActionResponsePtr response);
virtual void execute(RequestContextPtr context, AgentRegisterResponsePtr response);
virtual void execute(RequestContextPtr context, CancelResponsePtr response);
namespace Cynara {
+class AdminCheckResponse;
+typedef std::shared_ptr<AdminCheckResponse> AdminCheckResponsePtr;
+
class AgentActionResponse;
typedef std::shared_ptr<AgentActionResponse> AgentActionResponsePtr;
${CYNARA_SRC}/common/request/RemoveBucketRequest.cpp
${CYNARA_SRC}/common/request/RequestTaker.cpp
${CYNARA_SRC}/common/request/SetPoliciesRequest.cpp
+ ${CYNARA_SRC}/common/response/AdminCheckResponse.cpp
${CYNARA_SRC}/common/response/CheckResponse.cpp
${CYNARA_SRC}/common/response/CodeResponse.cpp
${CYNARA_SRC}/common/response/ListResponse.cpp