diff --git a/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp b/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp --- a/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp +++ b/services/backup/docker-server/contents/server/src/BackupServiceImpl.cpp @@ -1,7 +1,9 @@ #include "BackupServiceImpl.h" -#include "ServerReadReactorBase.h" -#include "ServerBidiReactorBase.h" +#include "CreateNewBackupReactor.h" +#include "PullBackupReactor.h" +#include "RecoverBackupKeyReactor.h" +#include "SendLogReactor.h" #include @@ -20,79 +22,25 @@ 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::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::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::StatusCode::UNIMPLEMENTED, "unimplemented"); - } - }; - - return new PullBackupReactor(); + return new reactor::PullBackupReactor(); } } // namespace network