-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrontendGRpcSvc.h
40 lines (28 loc) · 1.53 KB
/
FrontendGRpcSvc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include "version.h"
#include <grpcpp/grpcpp.h>
#include <grpcpp/security/server_credentials.h>
#include <scheduler/Scheduler.hpp>
#include "common/log/Logger.hpp"
#include "cta_dcache.grpc.pb.h"
using cta::Scheduler;
using cta::catalogue::Catalogue;
using cta::dcache::rpc::CtaRpc;
using grpc::Server;
using grpc::ServerBuilder;
using grpc::ServerContext;
using grpc::Status;
static const std::string CTA_DCACHE_VERSION = "cta-dcache-" + std::string(DCACHE_INTERFACE_VERSION);
class CtaRpcImpl : public CtaRpc::Service {
private:
std::unique_ptr <cta::catalogue::Catalogue> m_catalogue;
std::unique_ptr <cta::Scheduler> m_scheduler;
cta::log::Logger *m_log;
public:
CtaRpcImpl(cta::log::Logger *logger, std::unique_ptr<cta::catalogue::Catalogue> &catalogue, std::unique_ptr<cta::Scheduler> &scheduler);
Status Version(::grpc::ServerContext *context, const ::google::protobuf::Empty *request, ::cta::admin::Version *response);
Status Archive(::grpc::ServerContext* context, const ::cta::dcache::rpc::ArchiveRequest* request, ::cta::dcache::rpc::ArchiveResponse* response);
Status Retrieve(::grpc::ServerContext* context, const ::cta::dcache::rpc::RetrieveRequest* request, ::cta::dcache::rpc::RetrieveResponse* response);
Status Delete(::grpc::ServerContext* context, const ::cta::dcache::rpc::DeleteRequest* request, ::google::protobuf::Empty* response);
Status CancelRetrieve(::grpc::ServerContext* context, const ::cta::dcache::rpc::CancelRetrieveRequest* request, ::google::protobuf::Empty* response);
};