SET(LIB_CYNARA_AGENT_SOURCES
${CYNARA_LIB_CYNARA_AGENT_PATH}/api/agent-api.cpp
${CYNARA_LIB_CYNARA_AGENT_PATH}/logic/Logic.cpp
+ ${CYNARA_LIB_CYNARA_AGENT_PATH}/socket/AgentSocketClient.cpp
)
INCLUDE_DIRECTORIES(
* @brief This file contains implementation of Logic class - main libcynara-agent class
*/
+#include <memory>
+
#include <common.h>
+#include <config/PathConfig.h>
+#include <log/log.h>
+#include <protocol/Protocol.h>
+#include <protocol/ProtocolAgent.h>
+#include <request/AgentActionRequest.h>
+#include <request/AgentRegisterRequest.h>
+#include <request/pointers.h>
+#include <request/RequestContext.h>
+#include <response/AgentActionResponse.h>
+#include <response/AgentRegisterResponse.h>
+#include <response/pointers.h>
+#include <types/ProtocolFields.h>
#include <cynara-error.h>
#include "Logic.h"
+namespace {
+
+Cynara::ProtocolFrameSequenceNumber generateSequenceNumber(void) {
+ static Cynara::ProtocolFrameSequenceNumber sequenceNumber = 0;
+ return ++sequenceNumber;
+}
+
+} // namespace anonymous
+
namespace Cynara {
-Logic::Logic(const AgentType &agentType) : m_agentType(agentType) {
+Logic::Logic(const AgentType &agentType) : m_agentType(agentType), m_registered(false) {
+ m_agentSocket = std::make_shared<AgentSocketClient>(PathConfig::SocketPath::agent,
+ std::make_shared<ProtocolAgent>());
+ m_responseTakerPtr = std::make_shared<ProtocolAgent>();
+ m_responseBuffer = std::make_shared<BinaryQueue>();
}
-int Logic::getRequest(AgentActionResponsePtr &resultPtr UNUSED) {
- // TODO: implement
- return CYNARA_API_SUCCESS;
+int Logic::registerInCynara(void) {
+ ProtocolFrameSequenceNumber sequenceNumber = generateSequenceNumber();
+
+ //Ask cynara service
+ AgentRegisterResponsePtr registerResponsePtr;
+ RequestPtr request = std::make_shared<AgentRegisterRequest>(m_agentType, sequenceNumber);
+ ResponsePtr response = m_agentSocket->askCynaraServer(request);
+ if (!response) {
+ LOGW("Disconnected by cynara server.");
+ return CYNARA_API_SERVICE_NOT_AVAILABLE;
+ }
+
+ registerResponsePtr = std::dynamic_pointer_cast<AgentRegisterResponse>(response);
+ if (!registerResponsePtr) {
+ LOGC("Casting response to AgentRegisterResponse failed.");
+ return CYNARA_API_UNKNOWN_ERROR;
+ }
+ LOGD("registerResponse: answer code [%d]", static_cast<int>(registerResponsePtr->m_code));
+
+ switch (registerResponsePtr->m_code) {
+ case AgentRegisterResponse::DONE:
+ return CYNARA_API_SUCCESS;
+ case AgentRegisterResponse::REJECTED:
+ LOGE("Registering agent of type <%s> has been rejected", m_agentType.c_str());
+ return CYNARA_API_ACCESS_DENIED;
+ default:
+ LOGE("Registering agent of type <%s> has finished with unknown error",
+ m_agentType.c_str());
+ return CYNARA_API_UNKNOWN_ERROR;
+ }
}
-int Logic::putResponse(const AgentResponseType responseType UNUSED,
- const ProtocolFrameSequenceNumber sequenceNumber UNUSED,
- const RawBuffer &pluginData UNUSED) {
+int Logic::ensureConnection(void) {
+ switch (m_agentSocket->connect()) {
+ case SS_CONNECTED:
+ return CYNARA_API_SUCCESS;
+ case SS_RECONNECTED:
+ return registerInCynara();
+ case SS_DISCONNECTED:
+ LOGE("Agent socket disconnected.");
+ return CYNARA_API_SERVICE_NOT_AVAILABLE;
+ }
- // TODO: implement
+ return CYNARA_API_UNKNOWN_ERROR;
+}
+
+int Logic::getRequest(AgentActionResponsePtr &resultPtr) {
+ int ret = ensureConnection();
+ if (ret != CYNARA_API_SUCCESS)
+ return ret;
+
+ ResponsePtr responsePtr = m_agentSocket->receiveResponseFromServer();
+ if (!responsePtr) {
+ LOGW("Disconnected by cynara server.");
+ return CYNARA_API_SERVICE_NOT_AVAILABLE;
+ }
+
+ AgentActionResponsePtr actionResponsePtr =
+ std::dynamic_pointer_cast<AgentActionResponse>(responsePtr);
+ if (!actionResponsePtr) {
+ LOGC("Casting request to AgentActionResponse failed.");
+ return CYNARA_API_UNKNOWN_ERROR;
+ }
+ LOGD("agentActionResponse: type: [%" PRIu8 "], data length: [%zu]",
+ actionResponsePtr->type(), actionResponsePtr->data().size());
+
+ resultPtr = actionResponsePtr;
return CYNARA_API_SUCCESS;
}
+int Logic::putResponse(const AgentResponseType responseType,
+ const ProtocolFrameSequenceNumber sequenceNumber,
+ const RawBuffer &pluginData) {
+ if (!m_agentSocket->isConnected()) {
+ LOGE("Agent not connected to cynara service.");
+ return CYNARA_API_SERVICE_NOT_AVAILABLE;
+ }
+
+ RequestPtr requestPtr = std::make_shared<AgentActionRequest>(responseType, pluginData,
+ sequenceNumber);
+ m_responseBuffer->clear();
+ RequestContextPtr contextPtr = std::make_shared<RequestContext>(ResponseTakerPtr(),
+ m_responseBuffer);
+ requestPtr->execute(requestPtr, m_responseTakerPtr, contextPtr);
+ return m_agentSocket->sendDataToServer(*m_responseBuffer) ? CYNARA_API_SUCCESS :
+ CYNARA_API_SERVICE_NOT_AVAILABLE;
+}
+
} // namespace Cynara
#include <types/Agent.h>
#include <api/ApiInterface.h>
+#include <socket/AgentSocketClient.h>
namespace Cynara {
private:
AgentType m_agentType;
+ AgentSocketPtr m_agentSocket;
+ bool m_registered;
+ RequestTakerPtr m_responseTakerPtr;
+ BinaryQueuePtr m_responseBuffer;
+
+ int registerInCynara(void);
+ int ensureConnection(void);
};
} // 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/agent/socket/AgentSocket.cpp
+ * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+ * @version 1.0
+ * @brief This file contains implementation of agent socket client
+ */
+
+#include <memory>
+#include <string>
+
+#include <log/log.h>
+#include <protocol/Protocol.h>
+#include <request/pointers.h>
+#include <request/Request.h>
+#include <request/RequestContext.h>
+#include <response/pointers.h>
+#include <sockets/Socket.h>
+
+#include "AgentSocketClient.h"
+
+namespace Cynara {
+
+AgentSocketClient::AgentSocketClient(const std::string &socketPath, ProtocolPtr protocol)
+ : m_socket(socketPath), m_protocol(protocol) {
+ m_writeQueue = std::make_shared<BinaryQueue>();
+ m_readQueue = std::make_shared<BinaryQueue>();
+}
+
+ResponsePtr AgentSocketClient::askCynaraServer(RequestPtr request) {
+ //pass request to protocol
+ RequestContextPtr context = std::make_shared<RequestContext>(ResponseTakerPtr(), m_writeQueue);
+ request->execute(request, m_protocol, context);
+
+ //send request to cynara
+ if (!sendDataToServer(*m_writeQueue)) {
+ return nullptr;
+ }
+
+ // receive response from cynara
+ return receiveResponseFromServer();
+}
+
+ResponsePtr AgentSocketClient::receiveResponseFromServer(void) {
+ while (true) {
+ if (!m_socket.receiveFromServer(*m_readQueue)) {
+ LOGW("Error receiving data from Cynara. Service not available.");
+ return nullptr;
+ }
+
+ ResponsePtr response = m_protocol->extractResponseFromBuffer(m_readQueue);
+ if (response) {
+ return response;
+ }
+ }
+}
+
+bool AgentSocketClient::sendDataToServer(BinaryQueue &data) {
+ if (m_socket.sendToServer(data) == Socket::SendStatus::CONNECTION_LOST) {
+ LOGW("Error sending data to Cynara. Service not available.");
+ return false;
+ }
+
+ return true;
+}
+
+bool AgentSocketClient::isConnected(void) {
+ return m_socket.isConnected();
+}
+
+AgentSocketState AgentSocketClient::connect(void) {
+ if (isConnected())
+ return SS_CONNECTED;
+
+ if (m_socket.connect() == Socket::ConnectionStatus::CONNECTION_SUCCEEDED) {
+ resetState();
+ return SS_RECONNECTED;
+ }
+
+ return SS_DISCONNECTED;
+}
+
+void AgentSocketClient::resetState(void) {
+ m_readQueue->clear();
+ m_writeQueue->clear();
+}
+
+} // 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/agent/socket/AgentSocketClient.h
+ * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+ * @version 1.0
+ * @brief This file contains definition of agent socket client
+ */
+
+#ifndef SRC_AGENT_SOCKET_AGENTSOCKETCLIENT_H_
+#define SRC_AGENT_SOCKET_AGENTSOCKETCLIENT_H_
+
+#include <memory>
+#include <string>
+
+#include <containers/BinaryQueue.h>
+#include <protocol/Protocol.h>
+#include <request/pointers.h>
+#include <response/pointers.h>
+#include <sockets/Socket.h>
+
+namespace Cynara {
+
+class AgentSocketClient;
+typedef std::shared_ptr<AgentSocketClient> AgentSocketPtr;
+
+typedef enum {
+ SS_DISCONNECTED,
+ SS_CONNECTED,
+ SS_RECONNECTED,
+} AgentSocketState;
+
+class AgentSocketClient {
+public:
+ AgentSocketClient(const std::string &socketPath, ProtocolPtr protocol);
+ virtual ~AgentSocketClient() {};
+
+ bool isConnected(void);
+ AgentSocketState connect(void);
+
+ ResponsePtr receiveResponseFromServer(void);
+ bool sendDataToServer(BinaryQueue &data);
+ ResponsePtr askCynaraServer(RequestPtr request);
+
+private:
+ Socket m_socket;
+ ProtocolPtr m_protocol;
+ BinaryQueuePtr m_readQueue;
+ BinaryQueuePtr m_writeQueue;
+
+ void resetState(void);
+};
+
+} // namespace Cynara
+
+#endif /* SRC_AGENT_SOCKET_AGENTSOCKETCLIENT_H_ */
${COMMON_PATH}/protocol/ProtocolSerialization.cpp
${COMMON_PATH}/protocol/ProtocolSignal.cpp
${COMMON_PATH}/request/AdminCheckRequest.cpp
+ ${COMMON_PATH}/request/AgentActionRequest.cpp
+ ${COMMON_PATH}/request/AgentRegisterRequest.cpp
${COMMON_PATH}/request/CancelRequest.cpp
${COMMON_PATH}/request/CheckRequest.cpp
${COMMON_PATH}/request/InsertOrUpdateBucketRequest.cpp
${COMMON_PATH}/request/SetPoliciesRequest.cpp
${COMMON_PATH}/request/SignalRequest.cpp
${COMMON_PATH}/response/AgentActionResponse.cpp
+ ${COMMON_PATH}/response/AgentRegisterResponse.cpp
${COMMON_PATH}/response/CancelResponse.cpp
${COMMON_PATH}/response/CheckResponse.cpp
${COMMON_PATH}/response/CodeResponse.cpp
#include <inttypes.h>
#include <memory>
+#include <attributes/attributes.h>
#include <exceptions/InvalidProtocolException.h>
#include <log/log.h>
#include <protocol/ProtocolFrameSerializer.h>
return nullptr;
}
+void ProtocolAgent::execute(RequestContextPtr context UNUSED,
+ AgentActionRequestPtr request UNUSED) {
+ //TODO: implement
+}
+
+void ProtocolAgent::execute(RequestContextPtr context UNUSED,
+ AgentActionResponsePtr request UNUSED) {
+ //TODO: implement
+}
+
} // namespace Cynara
virtual RequestPtr extractRequestFromBuffer(BinaryQueuePtr bufferQueue);
virtual ResponsePtr extractResponseFromBuffer(BinaryQueuePtr bufferQueue);
+
+ virtual void execute(RequestContextPtr context, AgentActionRequestPtr request);
+ virtual void execute(RequestContextPtr context, AgentActionResponsePtr response);
};
} // 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/request/AgentActionRequest.cpp
+ * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+ * @version 1.0
+ * @brief This file implements agent action request class
+ */
+
+#include <memory>
+
+#include <request/RequestTaker.h>
+
+#include "AgentActionRequest.h"
+
+namespace Cynara {
+
+void AgentActionRequest::execute(RequestPtr self, RequestTakerPtr taker,
+ RequestContextPtr context) const {
+ taker->execute(context, std::dynamic_pointer_cast<AgentActionRequest>(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/request/AgentActionRequest.h
+ * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+ * @version 1.0
+ * @brief This file defines agent register request class
+ */
+
+#ifndef SRC_COMMON_REQUEST_AGENTACTIONTREQUEST_H_
+#define SRC_COMMON_REQUEST_AGENTACTIONTREQUEST_H_
+
+#include <types/Agent.h>
+
+#include <containers/RawBuffer.h>
+#include <request/pointers.h>
+#include <request/Request.h>
+
+namespace Cynara {
+
+class AgentActionRequest : public Request {
+public:
+ AgentActionRequest(const AgentRequestType type, const RawBuffer &data,
+ ProtocolFrameSequenceNumber sequenceNumber) : Request(sequenceNumber),
+ m_type(type), m_data(data) {
+ }
+
+ virtual ~AgentActionRequest() {};
+
+ const RawBuffer &data(void) const {
+ return m_data;
+ }
+
+ AgentRequestType type(void) const {
+ return m_type;
+ }
+
+ virtual void execute(RequestPtr self, RequestTakerPtr taker, RequestContextPtr context) const;
+
+private:
+ const AgentRequestType m_type;
+ const RawBuffer m_data;
+};
+
+} // namespace Cynara
+
+#endif /* SRC_COMMON_REQUEST_AGENTACTIONTREQUEST_H_ */
--- /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/request/AgentRegisterRequest.cpp
+ * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+ * @version 1.0
+ * @brief This file implements agent register request class
+ */
+
+#include <memory>
+
+#include <request/RequestTaker.h>
+
+#include "AgentRegisterRequest.h"
+
+namespace Cynara {
+
+void AgentRegisterRequest::execute(RequestPtr self, RequestTakerPtr taker,
+ RequestContextPtr context) const {
+ taker->execute(context, std::dynamic_pointer_cast<AgentRegisterRequest>(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/request/AgentRegisterRequest.h
+ * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+ * @version 1.0
+ * @brief This file defines agent register request class
+ */
+
+#ifndef SRC_COMMON_REQUEST_AGENTREGISTERREQUEST_H_
+#define SRC_COMMON_REQUEST_AGENTREGISTERREQUEST_H_
+
+#include <types/Agent.h>
+
+#include <request/pointers.h>
+#include <request/Request.h>
+
+namespace Cynara {
+
+class AgentRegisterRequest : public Request {
+public:
+ AgentRegisterRequest(const AgentType &agentType, ProtocolFrameSequenceNumber sequenceNumber) :
+ Request(sequenceNumber), m_agentType(agentType) {
+ }
+
+ virtual ~AgentRegisterRequest() {};
+
+ const AgentType &agentType(void) const {
+ return m_agentType;
+ }
+
+ virtual void execute(RequestPtr self, RequestTakerPtr taker, RequestContextPtr context) const;
+
+private:
+ AgentType m_agentType;
+};
+
+} // namespace Cynara
+
+#endif /* SRC_COMMON_REQUEST_AGENTREGISTERREQUEST_H_ */
throw NotImplementedException();
}
+void RequestTaker::execute(RequestContextPtr context UNUSED, AgentActionRequestPtr request UNUSED) {
+ throw NotImplementedException();
+}
+
+void RequestTaker::execute(RequestContextPtr context UNUSED, AgentRegisterRequestPtr request UNUSED) {
+ throw NotImplementedException();
+}
+
void RequestTaker::execute(RequestContextPtr context UNUSED, CancelRequestPtr request UNUSED) {
throw NotImplementedException();
}
virtual ~RequestTaker() {};
virtual void execute(RequestContextPtr context, AdminCheckRequestPtr request);
+ virtual void execute(RequestContextPtr context, AgentActionRequestPtr request);
+ virtual void execute(RequestContextPtr context, AgentRegisterRequestPtr request);
virtual void execute(RequestContextPtr context, CancelRequestPtr request);
virtual void execute(RequestContextPtr context, CheckRequestPtr request);
virtual void execute(RequestContextPtr context, InsertOrUpdateBucketRequestPtr request);
class AgentActionRequest;
typedef std::shared_ptr<AgentActionRequest> AgentActionRequestPtr;
+class AgentRegisterRequest;
+typedef std::shared_ptr<AgentRegisterRequest> AgentRegisterRequestPtr;
+
class CancelRequest;
typedef std::shared_ptr<CancelRequest> CancelRequestPtr;
--- /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/AgentRegisterResponse.cpp
+ * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+ * @version 1.0
+ * @brief This file implements class for responding to agent register request
+ */
+
+#include <memory>
+
+#include <request/RequestTaker.h>
+
+#include "AgentRegisterResponse.h"
+
+namespace Cynara {
+
+void AgentRegisterResponse::execute(ResponsePtr self, ResponseTakerPtr taker,
+ RequestContextPtr context) const {
+ taker->execute(context, std::dynamic_pointer_cast<AgentRegisterResponse>(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/AgentRegisterResponse.h
+ * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+ * @version 1.0
+ * @brief This file defines class for responding to agent register request
+ */
+
+#ifndef SRC_COMMON_RESPONSE_AGENTREGISTERRESPONSE_H_
+#define SRC_COMMON_RESPONSE_AGENTREGISTERRESPONSE_H_
+
+#include <request/pointers.h>
+#include <response/pointers.h>
+#include <response/Response.h>
+
+namespace Cynara {
+
+class AgentRegisterResponse : public Response {
+public:
+ enum Code {
+ DONE,
+ REJECTED,
+ ERROR
+ };
+
+ const Code m_code;
+
+ AgentRegisterResponse(Code code, ProtocolFrameSequenceNumber sequenceNumber) :
+ Response(sequenceNumber), m_code(code) {
+ }
+
+ virtual ~AgentRegisterResponse() {};
+
+ virtual void execute(ResponsePtr self, ResponseTakerPtr taker, RequestContextPtr context) const;
+};
+
+} // namespace Cynara
+
+#endif /* SRC_COMMON_RESPONSE_AGENTREGISTERRESPONSE_H_ */
throw NotImplementedException();
}
+void ResponseTaker::execute(RequestContextPtr context UNUSED, AgentRegisterResponsePtr response UNUSED) {
+ throw NotImplementedException();
+}
+
void ResponseTaker::execute(RequestContextPtr context UNUSED, CancelResponsePtr response UNUSED) {
throw NotImplementedException();
}
virtual ~ResponseTaker() {};
virtual void execute(RequestContextPtr context, AgentActionResponsePtr response);
+ virtual void execute(RequestContextPtr context, AgentRegisterResponsePtr response);
virtual void execute(RequestContextPtr context, CancelResponsePtr response);
virtual void execute(RequestContextPtr context, CheckResponsePtr response);
virtual void execute(RequestContextPtr context, CodeResponsePtr response);
class AgentActionResponse;
typedef std::shared_ptr<AgentActionResponse> AgentActionResponsePtr;
+class AgentRegisterResponse;
+typedef std::shared_ptr<AgentRegisterResponse> AgentRegisterResponsePtr;
+
class CancelResponse;
typedef std::shared_ptr<CancelResponse> CancelResponsePtr;