diff --git a/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp b/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp index 2548d81fd..8813a0026 100644 --- a/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp +++ b/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp @@ -1,99 +1,47 @@ #include "BackupServiceImpl.h" -#include "ServerBidiReactorBase.h" -#include "ServerReadReactorBase.h" +#include "CreateNewBackupReactor.h" +#include "PullBackupReactor.h" +#include "RecoverBackupKeyReactor.h" +#include "SendLogReactor.h" #include namespace comm { namespace network { BackupServiceImpl::BackupServiceImpl() { Aws::InitAPI({}); } BackupServiceImpl::~BackupServiceImpl() { Aws::ShutdownAPI({}); } grpc::ServerBidiReactor< backup::CreateNewBackupRequest, backup::CreateNewBackupResponse> * BackupServiceImpl::CreateNewBackup(grpc::CallbackServerContext *context) { - class CreateNewBackupReactor : public reactor::ServerBidiReactorBase< - backup::CreateNewBackupRequest, - backup::CreateNewBackupResponse> { - public: - std::unique_ptr handleRequest( - backup::CreateNewBackupRequest request, - backup::CreateNewBackupResponse *response) override { - // TODO handle request - return std::make_unique( - grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "unimplemented")); - } - }; - - return new CreateNewBackupReactor(); + return new reactor::CreateNewBackupReactor(); } grpc::ServerReadReactor *BackupServiceImpl::SendLog( grpc::CallbackServerContext *context, google::protobuf::Empty *response) { - class SendLogReactor : public reactor::ServerReadReactorBase< - backup::SendLogRequest, - google::protobuf::Empty> { - public: - using ServerReadReactorBase< - backup::SendLogRequest, - google::protobuf::Empty>::ServerReadReactorBase; - std::unique_ptr - readRequest(backup::SendLogRequest request) override { - // TODO handle request - return std::make_unique( - grpc::StatusCode::UNIMPLEMENTED, "unimplemented"); - } - }; - - return new SendLogReactor(response); + return new reactor::SendLogReactor(response); } grpc::ServerBidiReactor< backup::RecoverBackupKeyRequest, backup::RecoverBackupKeyResponse> * BackupServiceImpl::RecoverBackupKey(grpc::CallbackServerContext *context) { - class RecoverBackupKeyReactor : public reactor::ServerBidiReactorBase< - backup::RecoverBackupKeyRequest, - backup::RecoverBackupKeyResponse> { - public: - std::unique_ptr handleRequest( - backup::RecoverBackupKeyRequest request, - backup::RecoverBackupKeyResponse *response) override { - // TODO handle request - return std::make_unique( - grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "unimplemented")); - } - }; - - return new RecoverBackupKeyReactor(); + return new reactor::RecoverBackupKeyReactor(); } grpc::ServerBidiReactor * BackupServiceImpl::PullBackup(grpc::CallbackServerContext *context) { - class PullBackupReactor : public reactor::ServerBidiReactorBase< - backup::PullBackupRequest, - backup::PullBackupResponse> { - public: - std::unique_ptr handleRequest( - backup::PullBackupRequest request, - backup::PullBackupResponse *response) override { - // TODO handle request - return std::make_unique( - grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "unimplemented")); - } - }; - - return new PullBackupReactor(); + return new reactor::PullBackupReactor(); } } // namespace network } // namespace comm