diff --git a/native/android/app/src/cpp/GlobalNetworkSingletonJNIHelper.cpp b/native/android/app/src/cpp/GlobalNetworkSingletonJNIHelper.cpp --- a/native/android/app/src/cpp/GlobalNetworkSingletonJNIHelper.cpp +++ b/native/android/app/src/cpp/GlobalNetworkSingletonJNIHelper.cpp @@ -2,16 +2,7 @@ #include namespace comm { -void GlobalNetworkSingletonJNIHelper::sendPong( - facebook::jni::alias_ref jThis) { - GlobalNetworkSingleton::instance.scheduleOrRun( - [](NetworkModule &networkModule) { networkModule.sendPong(); }); -} - void GlobalNetworkSingletonJNIHelper::registerNatives() { - javaClassStatic()->registerNatives({ - makeNativeMethod("sendPong", GlobalNetworkSingletonJNIHelper::sendPong), - }); } } // namespace comm diff --git a/native/android/app/src/main/java/app/comm/android/CommNotificationsHandler.java b/native/android/app/src/main/java/app/comm/android/CommNotificationsHandler.java --- a/native/android/app/src/main/java/app/comm/android/CommNotificationsHandler.java +++ b/native/android/app/src/main/java/app/comm/android/CommNotificationsHandler.java @@ -91,10 +91,6 @@ String backgroundNotifType = message.getData().get(BACKGROUND_NOTIF_TYPE_KEY); - if ("PING".equals(backgroundNotifType)) { - NetworkModule.sendPong(); - return; - } String rawMessageInfosString = message.getData().get(MESSAGE_INFOS_KEY); File sqliteFile = diff --git a/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java b/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java --- a/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java +++ b/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java @@ -1,5 +1,3 @@ package app.comm.android.fbjni; -public class NetworkModule { - public static native void sendPong(); -} +public class NetworkModule {} diff --git a/native/cpp/CommonCpp/NativeModules/InternalModules/GlobalNetworkSingletonJNIHelper.h b/native/cpp/CommonCpp/NativeModules/InternalModules/GlobalNetworkSingletonJNIHelper.h --- a/native/cpp/CommonCpp/NativeModules/InternalModules/GlobalNetworkSingletonJNIHelper.h +++ b/native/cpp/CommonCpp/NativeModules/InternalModules/GlobalNetworkSingletonJNIHelper.h @@ -8,9 +8,6 @@ public: static auto constexpr kJavaDescriptor = "Lapp/comm/android/fbjni/NetworkModule;"; - - static void - sendPong(facebook::jni::alias_ref jThis); static void registerNatives(); }; } // namespace comm diff --git a/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.h b/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.h --- a/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.h +++ b/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.h @@ -14,7 +14,6 @@ const std::string &userId, const std::string &deviceToken, const std::string &hostname = ""); - void sendPong(); grpc::Status send( std::string sessionID, std::string toDeviceID, diff --git a/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.cpp b/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.cpp --- a/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.cpp +++ b/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.cpp @@ -19,10 +19,6 @@ new network::Client(host, "50051", credentials, userId, deviceToken)); } -void NetworkModule::sendPong() { - this->networkClient->sendPong(); -} - void NetworkModule::get(std::string sessionID) { if (!this->networkClient) { return; diff --git a/native/cpp/CommonCpp/grpc/Client.h b/native/cpp/CommonCpp/grpc/Client.h --- a/native/cpp/CommonCpp/grpc/Client.h +++ b/native/cpp/CommonCpp/grpc/Client.h @@ -30,10 +30,6 @@ const std::string id, const std::string deviceToken); - CheckResponseType checkIfPrimaryDeviceOnline(); - bool becomeNewPrimaryDevice(); - void sendPong(); - grpc::Status send( std::string sessionID, std::string toDeviceID, diff --git a/native/cpp/CommonCpp/grpc/Client.cpp b/native/cpp/CommonCpp/grpc/Client.cpp --- a/native/cpp/CommonCpp/grpc/Client.cpp +++ b/native/cpp/CommonCpp/grpc/Client.cpp @@ -17,55 +17,6 @@ this->stub_ = TunnelbrokerService::NewStub(channel); } -tunnelbroker::CheckResponseType Client::checkIfPrimaryDeviceOnline() { - grpc::ClientContext context; - tunnelbroker::CheckRequest request; - tunnelbroker::CheckResponse response; - - request.set_userid(this->id); - request.set_devicetoken(this->deviceToken); - - grpc::Status status = - stub_->CheckIfPrimaryDeviceOnline(&context, request, &response); - if (!status.ok()) { - throw std::runtime_error(status.error_message()); - } - return response.checkresponsetype(); -} - -bool Client::becomeNewPrimaryDevice() { - grpc::ClientContext context; - tunnelbroker::NewPrimaryRequest request; - tunnelbroker::NewPrimaryResponse response; - - request.set_userid(this->id); - request.set_devicetoken(this->deviceToken); - - grpc::Status status = - stub_->BecomeNewPrimaryDevice(&context, request, &response); - if (!status.ok()) { - throw std::runtime_error(status.error_message()); - } - return response.success(); -} - -void Client::sendPong() { - grpc::ClientContext context; - tunnelbroker::PongRequest request; - google::protobuf::Empty response; - - request.set_userid(this->id); - request.set_devicetoken(this->deviceToken); - - Logger::log("Sending PONG"); - grpc::Status status = this->stub_->SendPong(&context, request, &response); - if (!status.ok()) { - std::ostringstream errorMsg; - errorMsg << "Sending PONG failed: " << status.error_message() << std::endl; - Logger::log(errorMsg.str()); - } -} - grpc::Status Client::send( std::string sessionID, std::string toDeviceID, diff --git a/native/ios/Comm/AppDelegate.mm b/native/ios/Comm/AppDelegate.mm --- a/native/ios/Comm/AppDelegate.mm +++ b/native/ios/Comm/AppDelegate.mm @@ -152,17 +152,7 @@ - (BOOL)handleBackgroundNotification:(NSDictionary *)notification fetchCompletionHandler: (void (^)(UIBackgroundFetchResult))completionHandler { - if ([notification[backgroundNotificationTypeKey] isEqualToString:@"PING"]) { - comm::GlobalNetworkSingleton::instance.scheduleOrRun( - [=](comm::NetworkModule &networkModule) { - networkModule.sendPong(); - dispatch_async(dispatch_get_main_queue(), ^{ - completionHandler(UIBackgroundFetchResultNewData); - }); - }); - return YES; - } else if ([notification[backgroundNotificationTypeKey] - isEqualToString:@"CLEAR"]) { + if ([notification[backgroundNotificationTypeKey] isEqualToString:@"CLEAR"]) { if (notification[setUnreadStatusKey] && notification[@"threadID"]) { std::string threadID = std::string([notification[@"threadID"] UTF8String]); diff --git a/services/tunnelbroker/src/server/mod.rs b/services/tunnelbroker/src/server/mod.rs --- a/services/tunnelbroker/src/server/mod.rs +++ b/services/tunnelbroker/src/server/mod.rs @@ -45,27 +45,6 @@ // These empty old API handlers are deprecated and should be removed. // They are implemented only to fix the building process. - async fn check_if_primary_device_online( - &self, - _request: Request, - ) -> Result, Status> { - Err(Status::cancelled("Deprecated")) - } - - async fn become_new_primary_device( - &self, - _request: Request, - ) -> Result, Status> { - Err(Status::cancelled("Deprecated")) - } - - async fn send_pong( - &self, - _request: Request, - ) -> Result, Status> { - Err(Status::cancelled("Deprecated")) - } - async fn send( &self, _request: Request, diff --git a/shared/protos/_generated/tunnelbroker.grpc.pb.h b/shared/protos/_generated/tunnelbroker.grpc.pb.h --- a/shared/protos/_generated/tunnelbroker.grpc.pb.h +++ b/shared/protos/_generated/tunnelbroker.grpc.pb.h @@ -35,31 +35,6 @@ class StubInterface { public: virtual ~StubInterface() {} - // The old API service methods - // to support the native client build - // until we switch to the new one - // - virtual ::grpc::Status CheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::tunnelbroker::CheckResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::CheckResponse>> AsyncCheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::CheckResponse>>(AsyncCheckIfPrimaryDeviceOnlineRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::CheckResponse>> PrepareAsyncCheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::CheckResponse>>(PrepareAsyncCheckIfPrimaryDeviceOnlineRaw(context, request, cq)); - } - virtual ::grpc::Status BecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::tunnelbroker::NewPrimaryResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::NewPrimaryResponse>> AsyncBecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::NewPrimaryResponse>>(AsyncBecomeNewPrimaryDeviceRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::NewPrimaryResponse>> PrepareAsyncBecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::NewPrimaryResponse>>(PrepareAsyncBecomeNewPrimaryDeviceRaw(context, request, cq)); - } - virtual ::grpc::Status SendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::google::protobuf::Empty* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> AsyncSendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(AsyncSendPongRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> PrepareAsyncSendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(PrepareAsyncSendPongRaw(context, request, cq)); - } // New API service methods // virtual ::grpc::Status SessionSignature(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest& request, ::tunnelbroker::SessionSignatureResponse* response) = 0; @@ -107,16 +82,6 @@ class async_interface { public: virtual ~async_interface() {} - // The old API service methods - // to support the native client build - // until we switch to the new one - // - virtual void CheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest* request, ::tunnelbroker::CheckResponse* response, std::function) = 0; - virtual void CheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest* request, ::tunnelbroker::CheckResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void BecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest* request, ::tunnelbroker::NewPrimaryResponse* response, std::function) = 0; - virtual void BecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest* request, ::tunnelbroker::NewPrimaryResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void SendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest* request, ::google::protobuf::Empty* response, std::function) = 0; - virtual void SendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) = 0; // New API service methods // virtual void SessionSignature(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest* request, ::tunnelbroker::SessionSignatureResponse* response, std::function) = 0; @@ -135,12 +100,6 @@ virtual class async_interface* async() { return nullptr; } class async_interface* experimental_async() { return async(); } private: - virtual ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::CheckResponse>* AsyncCheckIfPrimaryDeviceOnlineRaw(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::CheckResponse>* PrepareAsyncCheckIfPrimaryDeviceOnlineRaw(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::NewPrimaryResponse>* AsyncBecomeNewPrimaryDeviceRaw(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::NewPrimaryResponse>* PrepareAsyncBecomeNewPrimaryDeviceRaw(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* AsyncSendPongRaw(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* PrepareAsyncSendPongRaw(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::SessionSignatureResponse>* AsyncSessionSignatureRaw(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::SessionSignatureResponse>* PrepareAsyncSessionSignatureRaw(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::tunnelbroker::NewSessionResponse>* AsyncNewSessionRaw(::grpc::ClientContext* context, const ::tunnelbroker::NewSessionRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -157,27 +116,6 @@ class Stub final : public StubInterface { public: Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); - ::grpc::Status CheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::tunnelbroker::CheckResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::CheckResponse>> AsyncCheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::CheckResponse>>(AsyncCheckIfPrimaryDeviceOnlineRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::CheckResponse>> PrepareAsyncCheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::CheckResponse>>(PrepareAsyncCheckIfPrimaryDeviceOnlineRaw(context, request, cq)); - } - ::grpc::Status BecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::tunnelbroker::NewPrimaryResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::NewPrimaryResponse>> AsyncBecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::NewPrimaryResponse>>(AsyncBecomeNewPrimaryDeviceRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::NewPrimaryResponse>> PrepareAsyncBecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::NewPrimaryResponse>>(PrepareAsyncBecomeNewPrimaryDeviceRaw(context, request, cq)); - } - ::grpc::Status SendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::google::protobuf::Empty* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> AsyncSendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(AsyncSendPongRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> PrepareAsyncSendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(PrepareAsyncSendPongRaw(context, request, cq)); - } ::grpc::Status SessionSignature(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest& request, ::tunnelbroker::SessionSignatureResponse* response) override; std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::SessionSignatureResponse>> AsyncSessionSignature(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::tunnelbroker::SessionSignatureResponse>>(AsyncSessionSignatureRaw(context, request, cq)); @@ -220,12 +158,6 @@ class async final : public StubInterface::async_interface { public: - void CheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest* request, ::tunnelbroker::CheckResponse* response, std::function) override; - void CheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest* request, ::tunnelbroker::CheckResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void BecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest* request, ::tunnelbroker::NewPrimaryResponse* response, std::function) override; - void BecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest* request, ::tunnelbroker::NewPrimaryResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void SendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest* request, ::google::protobuf::Empty* response, std::function) override; - void SendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) override; void SessionSignature(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest* request, ::tunnelbroker::SessionSignatureResponse* response, std::function) override; void SessionSignature(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest* request, ::tunnelbroker::SessionSignatureResponse* response, ::grpc::ClientUnaryReactor* reactor) override; void NewSession(::grpc::ClientContext* context, const ::tunnelbroker::NewSessionRequest* request, ::tunnelbroker::NewSessionResponse* response, std::function) override; @@ -245,12 +177,6 @@ private: std::shared_ptr< ::grpc::ChannelInterface> channel_; class async async_stub_{this}; - ::grpc::ClientAsyncResponseReader< ::tunnelbroker::CheckResponse>* AsyncCheckIfPrimaryDeviceOnlineRaw(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::tunnelbroker::CheckResponse>* PrepareAsyncCheckIfPrimaryDeviceOnlineRaw(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::tunnelbroker::NewPrimaryResponse>* AsyncBecomeNewPrimaryDeviceRaw(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::tunnelbroker::NewPrimaryResponse>* PrepareAsyncBecomeNewPrimaryDeviceRaw(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* AsyncSendPongRaw(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* PrepareAsyncSendPongRaw(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::tunnelbroker::SessionSignatureResponse>* AsyncSessionSignatureRaw(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::tunnelbroker::SessionSignatureResponse>* PrepareAsyncSessionSignatureRaw(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::tunnelbroker::NewSessionResponse>* AsyncNewSessionRaw(::grpc::ClientContext* context, const ::tunnelbroker::NewSessionRequest& request, ::grpc::CompletionQueue* cq) override; @@ -263,9 +189,6 @@ ::grpc::ClientReaderWriter< ::tunnelbroker::MessageToTunnelbroker, ::tunnelbroker::MessageToClient>* MessagesStreamRaw(::grpc::ClientContext* context) override; ::grpc::ClientAsyncReaderWriter< ::tunnelbroker::MessageToTunnelbroker, ::tunnelbroker::MessageToClient>* AsyncMessagesStreamRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReaderWriter< ::tunnelbroker::MessageToTunnelbroker, ::tunnelbroker::MessageToClient>* PrepareAsyncMessagesStreamRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_CheckIfPrimaryDeviceOnline_; - const ::grpc::internal::RpcMethod rpcmethod_BecomeNewPrimaryDevice_; - const ::grpc::internal::RpcMethod rpcmethod_SendPong_; const ::grpc::internal::RpcMethod rpcmethod_SessionSignature_; const ::grpc::internal::RpcMethod rpcmethod_NewSession_; const ::grpc::internal::RpcMethod rpcmethod_Send_; @@ -278,13 +201,6 @@ public: Service(); virtual ~Service(); - // The old API service methods - // to support the native client build - // until we switch to the new one - // - virtual ::grpc::Status CheckIfPrimaryDeviceOnline(::grpc::ServerContext* context, const ::tunnelbroker::CheckRequest* request, ::tunnelbroker::CheckResponse* response); - virtual ::grpc::Status BecomeNewPrimaryDevice(::grpc::ServerContext* context, const ::tunnelbroker::NewPrimaryRequest* request, ::tunnelbroker::NewPrimaryResponse* response); - virtual ::grpc::Status SendPong(::grpc::ServerContext* context, const ::tunnelbroker::PongRequest* request, ::google::protobuf::Empty* response); // New API service methods // virtual ::grpc::Status SessionSignature(::grpc::ServerContext* context, const ::tunnelbroker::SessionSignatureRequest* request, ::tunnelbroker::SessionSignatureResponse* response); @@ -297,72 +213,12 @@ virtual ::grpc::Status MessagesStream(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::tunnelbroker::MessageToClient, ::tunnelbroker::MessageToTunnelbroker>* stream); }; template - class WithAsyncMethod_CheckIfPrimaryDeviceOnline : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_CheckIfPrimaryDeviceOnline() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_CheckIfPrimaryDeviceOnline() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CheckIfPrimaryDeviceOnline(::grpc::ServerContext* /*context*/, const ::tunnelbroker::CheckRequest* /*request*/, ::tunnelbroker::CheckResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCheckIfPrimaryDeviceOnline(::grpc::ServerContext* context, ::tunnelbroker::CheckRequest* request, ::grpc::ServerAsyncResponseWriter< ::tunnelbroker::CheckResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_BecomeNewPrimaryDevice : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_BecomeNewPrimaryDevice() { - ::grpc::Service::MarkMethodAsync(1); - } - ~WithAsyncMethod_BecomeNewPrimaryDevice() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status BecomeNewPrimaryDevice(::grpc::ServerContext* /*context*/, const ::tunnelbroker::NewPrimaryRequest* /*request*/, ::tunnelbroker::NewPrimaryResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestBecomeNewPrimaryDevice(::grpc::ServerContext* context, ::tunnelbroker::NewPrimaryRequest* request, ::grpc::ServerAsyncResponseWriter< ::tunnelbroker::NewPrimaryResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_SendPong : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_SendPong() { - ::grpc::Service::MarkMethodAsync(2); - } - ~WithAsyncMethod_SendPong() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SendPong(::grpc::ServerContext* /*context*/, const ::tunnelbroker::PongRequest* /*request*/, ::google::protobuf::Empty* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSendPong(::grpc::ServerContext* context, ::tunnelbroker::PongRequest* request, ::grpc::ServerAsyncResponseWriter< ::google::protobuf::Empty>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template class WithAsyncMethod_SessionSignature : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SessionSignature() { - ::grpc::Service::MarkMethodAsync(3); + ::grpc::Service::MarkMethodAsync(0); } ~WithAsyncMethod_SessionSignature() override { BaseClassMustBeDerivedFromService(this); @@ -373,7 +229,7 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSessionSignature(::grpc::ServerContext* context, ::tunnelbroker::SessionSignatureRequest* request, ::grpc::ServerAsyncResponseWriter< ::tunnelbroker::SessionSignatureResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -382,7 +238,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_NewSession() { - ::grpc::Service::MarkMethodAsync(4); + ::grpc::Service::MarkMethodAsync(1); } ~WithAsyncMethod_NewSession() override { BaseClassMustBeDerivedFromService(this); @@ -393,7 +249,7 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestNewSession(::grpc::ServerContext* context, ::tunnelbroker::NewSessionRequest* request, ::grpc::ServerAsyncResponseWriter< ::tunnelbroker::NewSessionResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -402,7 +258,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Send() { - ::grpc::Service::MarkMethodAsync(5); + ::grpc::Service::MarkMethodAsync(2); } ~WithAsyncMethod_Send() override { BaseClassMustBeDerivedFromService(this); @@ -413,7 +269,7 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSend(::grpc::ServerContext* context, ::tunnelbroker::SendRequest* request, ::grpc::ServerAsyncResponseWriter< ::google::protobuf::Empty>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -422,7 +278,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_Get() { - ::grpc::Service::MarkMethodAsync(6); + ::grpc::Service::MarkMethodAsync(3); } ~WithAsyncMethod_Get() override { BaseClassMustBeDerivedFromService(this); @@ -433,7 +289,7 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestGet(::grpc::ServerContext* context, ::tunnelbroker::GetRequest* request, ::grpc::ServerAsyncWriter< ::tunnelbroker::GetResponse>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(6, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(3, context, request, writer, new_call_cq, notification_cq, tag); } }; template @@ -442,7 +298,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_MessagesStream() { - ::grpc::Service::MarkMethodAsync(7); + ::grpc::Service::MarkMethodAsync(4); } ~WithAsyncMethod_MessagesStream() override { BaseClassMustBeDerivedFromService(this); @@ -453,104 +309,23 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestMessagesStream(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::tunnelbroker::MessageToClient, ::tunnelbroker::MessageToTunnelbroker>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncBidiStreaming(7, context, stream, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncBidiStreaming(4, context, stream, new_call_cq, notification_cq, tag); } }; - typedef WithAsyncMethod_CheckIfPrimaryDeviceOnline > > > > > > > AsyncService; - template - class WithCallbackMethod_CheckIfPrimaryDeviceOnline : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_CheckIfPrimaryDeviceOnline() { - ::grpc::Service::MarkMethodCallback(0, - new ::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::CheckRequest, ::tunnelbroker::CheckResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::tunnelbroker::CheckRequest* request, ::tunnelbroker::CheckResponse* response) { return this->CheckIfPrimaryDeviceOnline(context, request, response); }));} - void SetMessageAllocatorFor_CheckIfPrimaryDeviceOnline( - ::grpc::MessageAllocator< ::tunnelbroker::CheckRequest, ::tunnelbroker::CheckResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); - static_cast<::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::CheckRequest, ::tunnelbroker::CheckResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_CheckIfPrimaryDeviceOnline() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CheckIfPrimaryDeviceOnline(::grpc::ServerContext* /*context*/, const ::tunnelbroker::CheckRequest* /*request*/, ::tunnelbroker::CheckResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* CheckIfPrimaryDeviceOnline( - ::grpc::CallbackServerContext* /*context*/, const ::tunnelbroker::CheckRequest* /*request*/, ::tunnelbroker::CheckResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_BecomeNewPrimaryDevice : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_BecomeNewPrimaryDevice() { - ::grpc::Service::MarkMethodCallback(1, - new ::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::NewPrimaryRequest, ::tunnelbroker::NewPrimaryResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::tunnelbroker::NewPrimaryRequest* request, ::tunnelbroker::NewPrimaryResponse* response) { return this->BecomeNewPrimaryDevice(context, request, response); }));} - void SetMessageAllocatorFor_BecomeNewPrimaryDevice( - ::grpc::MessageAllocator< ::tunnelbroker::NewPrimaryRequest, ::tunnelbroker::NewPrimaryResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); - static_cast<::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::NewPrimaryRequest, ::tunnelbroker::NewPrimaryResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_BecomeNewPrimaryDevice() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status BecomeNewPrimaryDevice(::grpc::ServerContext* /*context*/, const ::tunnelbroker::NewPrimaryRequest* /*request*/, ::tunnelbroker::NewPrimaryResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* BecomeNewPrimaryDevice( - ::grpc::CallbackServerContext* /*context*/, const ::tunnelbroker::NewPrimaryRequest* /*request*/, ::tunnelbroker::NewPrimaryResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_SendPong : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_SendPong() { - ::grpc::Service::MarkMethodCallback(2, - new ::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::PongRequest, ::google::protobuf::Empty>( - [this]( - ::grpc::CallbackServerContext* context, const ::tunnelbroker::PongRequest* request, ::google::protobuf::Empty* response) { return this->SendPong(context, request, response); }));} - void SetMessageAllocatorFor_SendPong( - ::grpc::MessageAllocator< ::tunnelbroker::PongRequest, ::google::protobuf::Empty>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); - static_cast<::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::PongRequest, ::google::protobuf::Empty>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_SendPong() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SendPong(::grpc::ServerContext* /*context*/, const ::tunnelbroker::PongRequest* /*request*/, ::google::protobuf::Empty* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* SendPong( - ::grpc::CallbackServerContext* /*context*/, const ::tunnelbroker::PongRequest* /*request*/, ::google::protobuf::Empty* /*response*/) { return nullptr; } - }; + typedef WithAsyncMethod_SessionSignature > > > > AsyncService; template class WithCallbackMethod_SessionSignature : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SessionSignature() { - ::grpc::Service::MarkMethodCallback(3, + ::grpc::Service::MarkMethodCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::SessionSignatureRequest, ::tunnelbroker::SessionSignatureResponse>( [this]( ::grpc::CallbackServerContext* context, const ::tunnelbroker::SessionSignatureRequest* request, ::tunnelbroker::SessionSignatureResponse* response) { return this->SessionSignature(context, request, response); }));} void SetMessageAllocatorFor_SessionSignature( ::grpc::MessageAllocator< ::tunnelbroker::SessionSignatureRequest, ::tunnelbroker::SessionSignatureResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); static_cast<::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::SessionSignatureRequest, ::tunnelbroker::SessionSignatureResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -571,13 +346,13 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_NewSession() { - ::grpc::Service::MarkMethodCallback(4, + ::grpc::Service::MarkMethodCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::NewSessionRequest, ::tunnelbroker::NewSessionResponse>( [this]( ::grpc::CallbackServerContext* context, const ::tunnelbroker::NewSessionRequest* request, ::tunnelbroker::NewSessionResponse* response) { return this->NewSession(context, request, response); }));} void SetMessageAllocatorFor_NewSession( ::grpc::MessageAllocator< ::tunnelbroker::NewSessionRequest, ::tunnelbroker::NewSessionResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); static_cast<::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::NewSessionRequest, ::tunnelbroker::NewSessionResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -598,13 +373,13 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_Send() { - ::grpc::Service::MarkMethodCallback(5, + ::grpc::Service::MarkMethodCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::SendRequest, ::google::protobuf::Empty>( [this]( ::grpc::CallbackServerContext* context, const ::tunnelbroker::SendRequest* request, ::google::protobuf::Empty* response) { return this->Send(context, request, response); }));} void SetMessageAllocatorFor_Send( ::grpc::MessageAllocator< ::tunnelbroker::SendRequest, ::google::protobuf::Empty>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(5); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); static_cast<::grpc::internal::CallbackUnaryHandler< ::tunnelbroker::SendRequest, ::google::protobuf::Empty>*>(handler) ->SetMessageAllocator(allocator); } @@ -625,7 +400,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_Get() { - ::grpc::Service::MarkMethodCallback(6, + ::grpc::Service::MarkMethodCallback(3, new ::grpc::internal::CallbackServerStreamingHandler< ::tunnelbroker::GetRequest, ::tunnelbroker::GetResponse>( [this]( ::grpc::CallbackServerContext* context, const ::tunnelbroker::GetRequest* request) { return this->Get(context, request); })); @@ -647,7 +422,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_MessagesStream() { - ::grpc::Service::MarkMethodCallback(7, + ::grpc::Service::MarkMethodCallback(4, new ::grpc::internal::CallbackBidiHandler< ::tunnelbroker::MessageToTunnelbroker, ::tunnelbroker::MessageToClient>( [this]( ::grpc::CallbackServerContext* context) { return this->MessagesStream(context); })); @@ -664,66 +439,15 @@ ::grpc::CallbackServerContext* /*context*/) { return nullptr; } }; - typedef WithCallbackMethod_CheckIfPrimaryDeviceOnline > > > > > > > CallbackService; + typedef WithCallbackMethod_SessionSignature > > > > CallbackService; typedef CallbackService ExperimentalCallbackService; template - class WithGenericMethod_CheckIfPrimaryDeviceOnline : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_CheckIfPrimaryDeviceOnline() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_CheckIfPrimaryDeviceOnline() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CheckIfPrimaryDeviceOnline(::grpc::ServerContext* /*context*/, const ::tunnelbroker::CheckRequest* /*request*/, ::tunnelbroker::CheckResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_BecomeNewPrimaryDevice : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_BecomeNewPrimaryDevice() { - ::grpc::Service::MarkMethodGeneric(1); - } - ~WithGenericMethod_BecomeNewPrimaryDevice() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status BecomeNewPrimaryDevice(::grpc::ServerContext* /*context*/, const ::tunnelbroker::NewPrimaryRequest* /*request*/, ::tunnelbroker::NewPrimaryResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_SendPong : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_SendPong() { - ::grpc::Service::MarkMethodGeneric(2); - } - ~WithGenericMethod_SendPong() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SendPong(::grpc::ServerContext* /*context*/, const ::tunnelbroker::PongRequest* /*request*/, ::google::protobuf::Empty* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template class WithGenericMethod_SessionSignature : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SessionSignature() { - ::grpc::Service::MarkMethodGeneric(3); + ::grpc::Service::MarkMethodGeneric(0); } ~WithGenericMethod_SessionSignature() override { BaseClassMustBeDerivedFromService(this); @@ -740,7 +464,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_NewSession() { - ::grpc::Service::MarkMethodGeneric(4); + ::grpc::Service::MarkMethodGeneric(1); } ~WithGenericMethod_NewSession() override { BaseClassMustBeDerivedFromService(this); @@ -757,7 +481,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Send() { - ::grpc::Service::MarkMethodGeneric(5); + ::grpc::Service::MarkMethodGeneric(2); } ~WithGenericMethod_Send() override { BaseClassMustBeDerivedFromService(this); @@ -774,7 +498,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_Get() { - ::grpc::Service::MarkMethodGeneric(6); + ::grpc::Service::MarkMethodGeneric(3); } ~WithGenericMethod_Get() override { BaseClassMustBeDerivedFromService(this); @@ -791,7 +515,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_MessagesStream() { - ::grpc::Service::MarkMethodGeneric(7); + ::grpc::Service::MarkMethodGeneric(4); } ~WithGenericMethod_MessagesStream() override { BaseClassMustBeDerivedFromService(this); @@ -803,72 +527,12 @@ } }; template - class WithRawMethod_CheckIfPrimaryDeviceOnline : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_CheckIfPrimaryDeviceOnline() { - ::grpc::Service::MarkMethodRaw(0); - } - ~WithRawMethod_CheckIfPrimaryDeviceOnline() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CheckIfPrimaryDeviceOnline(::grpc::ServerContext* /*context*/, const ::tunnelbroker::CheckRequest* /*request*/, ::tunnelbroker::CheckResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCheckIfPrimaryDeviceOnline(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_BecomeNewPrimaryDevice : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_BecomeNewPrimaryDevice() { - ::grpc::Service::MarkMethodRaw(1); - } - ~WithRawMethod_BecomeNewPrimaryDevice() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status BecomeNewPrimaryDevice(::grpc::ServerContext* /*context*/, const ::tunnelbroker::NewPrimaryRequest* /*request*/, ::tunnelbroker::NewPrimaryResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestBecomeNewPrimaryDevice(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_SendPong : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_SendPong() { - ::grpc::Service::MarkMethodRaw(2); - } - ~WithRawMethod_SendPong() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SendPong(::grpc::ServerContext* /*context*/, const ::tunnelbroker::PongRequest* /*request*/, ::google::protobuf::Empty* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSendPong(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template class WithRawMethod_SessionSignature : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SessionSignature() { - ::grpc::Service::MarkMethodRaw(3); + ::grpc::Service::MarkMethodRaw(0); } ~WithRawMethod_SessionSignature() override { BaseClassMustBeDerivedFromService(this); @@ -879,7 +543,7 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSessionSignature(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -888,7 +552,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_NewSession() { - ::grpc::Service::MarkMethodRaw(4); + ::grpc::Service::MarkMethodRaw(1); } ~WithRawMethod_NewSession() override { BaseClassMustBeDerivedFromService(this); @@ -899,7 +563,7 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestNewSession(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -908,7 +572,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Send() { - ::grpc::Service::MarkMethodRaw(5); + ::grpc::Service::MarkMethodRaw(2); } ~WithRawMethod_Send() override { BaseClassMustBeDerivedFromService(this); @@ -919,7 +583,7 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSend(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -928,7 +592,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_Get() { - ::grpc::Service::MarkMethodRaw(6); + ::grpc::Service::MarkMethodRaw(3); } ~WithRawMethod_Get() override { BaseClassMustBeDerivedFromService(this); @@ -939,7 +603,7 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestGet(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(6, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(3, context, request, writer, new_call_cq, notification_cq, tag); } }; template @@ -948,7 +612,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_MessagesStream() { - ::grpc::Service::MarkMethodRaw(7); + ::grpc::Service::MarkMethodRaw(4); } ~WithRawMethod_MessagesStream() override { BaseClassMustBeDerivedFromService(this); @@ -959,82 +623,16 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestMessagesStream(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncBidiStreaming(7, context, stream, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncBidiStreaming(4, context, stream, new_call_cq, notification_cq, tag); } }; template - class WithRawCallbackMethod_CheckIfPrimaryDeviceOnline : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_CheckIfPrimaryDeviceOnline() { - ::grpc::Service::MarkMethodRawCallback(0, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->CheckIfPrimaryDeviceOnline(context, request, response); })); - } - ~WithRawCallbackMethod_CheckIfPrimaryDeviceOnline() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CheckIfPrimaryDeviceOnline(::grpc::ServerContext* /*context*/, const ::tunnelbroker::CheckRequest* /*request*/, ::tunnelbroker::CheckResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* CheckIfPrimaryDeviceOnline( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_BecomeNewPrimaryDevice : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_BecomeNewPrimaryDevice() { - ::grpc::Service::MarkMethodRawCallback(1, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->BecomeNewPrimaryDevice(context, request, response); })); - } - ~WithRawCallbackMethod_BecomeNewPrimaryDevice() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status BecomeNewPrimaryDevice(::grpc::ServerContext* /*context*/, const ::tunnelbroker::NewPrimaryRequest* /*request*/, ::tunnelbroker::NewPrimaryResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* BecomeNewPrimaryDevice( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_SendPong : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_SendPong() { - ::grpc::Service::MarkMethodRawCallback(2, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SendPong(context, request, response); })); - } - ~WithRawCallbackMethod_SendPong() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SendPong(::grpc::ServerContext* /*context*/, const ::tunnelbroker::PongRequest* /*request*/, ::google::protobuf::Empty* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* SendPong( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template class WithRawCallbackMethod_SessionSignature : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SessionSignature() { - ::grpc::Service::MarkMethodRawCallback(3, + ::grpc::Service::MarkMethodRawCallback(0, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SessionSignature(context, request, response); })); @@ -1056,7 +654,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_NewSession() { - ::grpc::Service::MarkMethodRawCallback(4, + ::grpc::Service::MarkMethodRawCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->NewSession(context, request, response); })); @@ -1078,7 +676,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_Send() { - ::grpc::Service::MarkMethodRawCallback(5, + ::grpc::Service::MarkMethodRawCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Send(context, request, response); })); @@ -1100,7 +698,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_Get() { - ::grpc::Service::MarkMethodRawCallback(6, + ::grpc::Service::MarkMethodRawCallback(3, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->Get(context, request); })); @@ -1122,7 +720,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_MessagesStream() { - ::grpc::Service::MarkMethodRawCallback(7, + ::grpc::Service::MarkMethodRawCallback(4, new ::grpc::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context) { return this->MessagesStream(context); })); @@ -1140,93 +738,12 @@ { return nullptr; } }; template - class WithStreamedUnaryMethod_CheckIfPrimaryDeviceOnline : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_CheckIfPrimaryDeviceOnline() { - ::grpc::Service::MarkMethodStreamed(0, - new ::grpc::internal::StreamedUnaryHandler< - ::tunnelbroker::CheckRequest, ::tunnelbroker::CheckResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::tunnelbroker::CheckRequest, ::tunnelbroker::CheckResponse>* streamer) { - return this->StreamedCheckIfPrimaryDeviceOnline(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_CheckIfPrimaryDeviceOnline() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status CheckIfPrimaryDeviceOnline(::grpc::ServerContext* /*context*/, const ::tunnelbroker::CheckRequest* /*request*/, ::tunnelbroker::CheckResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCheckIfPrimaryDeviceOnline(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::tunnelbroker::CheckRequest,::tunnelbroker::CheckResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_BecomeNewPrimaryDevice : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_BecomeNewPrimaryDevice() { - ::grpc::Service::MarkMethodStreamed(1, - new ::grpc::internal::StreamedUnaryHandler< - ::tunnelbroker::NewPrimaryRequest, ::tunnelbroker::NewPrimaryResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::tunnelbroker::NewPrimaryRequest, ::tunnelbroker::NewPrimaryResponse>* streamer) { - return this->StreamedBecomeNewPrimaryDevice(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_BecomeNewPrimaryDevice() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status BecomeNewPrimaryDevice(::grpc::ServerContext* /*context*/, const ::tunnelbroker::NewPrimaryRequest* /*request*/, ::tunnelbroker::NewPrimaryResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedBecomeNewPrimaryDevice(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::tunnelbroker::NewPrimaryRequest,::tunnelbroker::NewPrimaryResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_SendPong : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_SendPong() { - ::grpc::Service::MarkMethodStreamed(2, - new ::grpc::internal::StreamedUnaryHandler< - ::tunnelbroker::PongRequest, ::google::protobuf::Empty>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::tunnelbroker::PongRequest, ::google::protobuf::Empty>* streamer) { - return this->StreamedSendPong(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_SendPong() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status SendPong(::grpc::ServerContext* /*context*/, const ::tunnelbroker::PongRequest* /*request*/, ::google::protobuf::Empty* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedSendPong(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::tunnelbroker::PongRequest,::google::protobuf::Empty>* server_unary_streamer) = 0; - }; - template class WithStreamedUnaryMethod_SessionSignature : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_SessionSignature() { - ::grpc::Service::MarkMethodStreamed(3, + ::grpc::Service::MarkMethodStreamed(0, new ::grpc::internal::StreamedUnaryHandler< ::tunnelbroker::SessionSignatureRequest, ::tunnelbroker::SessionSignatureResponse>( [this](::grpc::ServerContext* context, @@ -1253,7 +770,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_NewSession() { - ::grpc::Service::MarkMethodStreamed(4, + ::grpc::Service::MarkMethodStreamed(1, new ::grpc::internal::StreamedUnaryHandler< ::tunnelbroker::NewSessionRequest, ::tunnelbroker::NewSessionResponse>( [this](::grpc::ServerContext* context, @@ -1280,7 +797,7 @@ void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_Send() { - ::grpc::Service::MarkMethodStreamed(5, + ::grpc::Service::MarkMethodStreamed(2, new ::grpc::internal::StreamedUnaryHandler< ::tunnelbroker::SendRequest, ::google::protobuf::Empty>( [this](::grpc::ServerContext* context, @@ -1301,14 +818,14 @@ // replace default version of method with streamed unary virtual ::grpc::Status StreamedSend(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::tunnelbroker::SendRequest,::google::protobuf::Empty>* server_unary_streamer) = 0; }; - typedef WithStreamedUnaryMethod_CheckIfPrimaryDeviceOnline > > > > > StreamedUnaryService; + typedef WithStreamedUnaryMethod_SessionSignature > > StreamedUnaryService; template class WithSplitStreamingMethod_Get : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithSplitStreamingMethod_Get() { - ::grpc::Service::MarkMethodStreamed(6, + ::grpc::Service::MarkMethodStreamed(3, new ::grpc::internal::SplitServerStreamingHandler< ::tunnelbroker::GetRequest, ::tunnelbroker::GetResponse>( [this](::grpc::ServerContext* context, @@ -1330,7 +847,7 @@ virtual ::grpc::Status StreamedGet(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::tunnelbroker::GetRequest,::tunnelbroker::GetResponse>* server_split_streamer) = 0; }; typedef WithSplitStreamingMethod_Get SplitStreamedService; - typedef WithStreamedUnaryMethod_CheckIfPrimaryDeviceOnline > > > > > > StreamedService; + typedef WithStreamedUnaryMethod_SessionSignature > > > StreamedService; }; } // namespace tunnelbroker diff --git a/shared/protos/_generated/tunnelbroker.grpc.pb.cc b/shared/protos/_generated/tunnelbroker.grpc.pb.cc --- a/shared/protos/_generated/tunnelbroker.grpc.pb.cc +++ b/shared/protos/_generated/tunnelbroker.grpc.pb.cc @@ -22,9 +22,6 @@ namespace tunnelbroker { static const char* TunnelbrokerService_method_names[] = { - "/tunnelbroker.TunnelbrokerService/CheckIfPrimaryDeviceOnline", - "/tunnelbroker.TunnelbrokerService/BecomeNewPrimaryDevice", - "/tunnelbroker.TunnelbrokerService/SendPong", "/tunnelbroker.TunnelbrokerService/SessionSignature", "/tunnelbroker.TunnelbrokerService/NewSession", "/tunnelbroker.TunnelbrokerService/Send", @@ -39,85 +36,13 @@ } TunnelbrokerService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) - : channel_(channel), rpcmethod_CheckIfPrimaryDeviceOnline_(TunnelbrokerService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_BecomeNewPrimaryDevice_(TunnelbrokerService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SendPong_(TunnelbrokerService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SessionSignature_(TunnelbrokerService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_NewSession_(TunnelbrokerService_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Send_(TunnelbrokerService_method_names[5], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Get_(TunnelbrokerService_method_names[6], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) - , rpcmethod_MessagesStream_(TunnelbrokerService_method_names[7], options.suffix_for_stats(),::grpc::internal::RpcMethod::BIDI_STREAMING, channel) + : channel_(channel), rpcmethod_SessionSignature_(TunnelbrokerService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_NewSession_(TunnelbrokerService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Send_(TunnelbrokerService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Get_(TunnelbrokerService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + , rpcmethod_MessagesStream_(TunnelbrokerService_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::BIDI_STREAMING, channel) {} -::grpc::Status TunnelbrokerService::Stub::CheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::tunnelbroker::CheckResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::tunnelbroker::CheckRequest, ::tunnelbroker::CheckResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_CheckIfPrimaryDeviceOnline_, context, request, response); -} - -void TunnelbrokerService::Stub::async::CheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest* request, ::tunnelbroker::CheckResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::tunnelbroker::CheckRequest, ::tunnelbroker::CheckResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CheckIfPrimaryDeviceOnline_, context, request, response, std::move(f)); -} - -void TunnelbrokerService::Stub::async::CheckIfPrimaryDeviceOnline(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest* request, ::tunnelbroker::CheckResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_CheckIfPrimaryDeviceOnline_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::tunnelbroker::CheckResponse>* TunnelbrokerService::Stub::PrepareAsyncCheckIfPrimaryDeviceOnlineRaw(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::tunnelbroker::CheckResponse, ::tunnelbroker::CheckRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_CheckIfPrimaryDeviceOnline_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::tunnelbroker::CheckResponse>* TunnelbrokerService::Stub::AsyncCheckIfPrimaryDeviceOnlineRaw(::grpc::ClientContext* context, const ::tunnelbroker::CheckRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncCheckIfPrimaryDeviceOnlineRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status TunnelbrokerService::Stub::BecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::tunnelbroker::NewPrimaryResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::tunnelbroker::NewPrimaryRequest, ::tunnelbroker::NewPrimaryResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_BecomeNewPrimaryDevice_, context, request, response); -} - -void TunnelbrokerService::Stub::async::BecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest* request, ::tunnelbroker::NewPrimaryResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::tunnelbroker::NewPrimaryRequest, ::tunnelbroker::NewPrimaryResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_BecomeNewPrimaryDevice_, context, request, response, std::move(f)); -} - -void TunnelbrokerService::Stub::async::BecomeNewPrimaryDevice(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest* request, ::tunnelbroker::NewPrimaryResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_BecomeNewPrimaryDevice_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::tunnelbroker::NewPrimaryResponse>* TunnelbrokerService::Stub::PrepareAsyncBecomeNewPrimaryDeviceRaw(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::tunnelbroker::NewPrimaryResponse, ::tunnelbroker::NewPrimaryRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_BecomeNewPrimaryDevice_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::tunnelbroker::NewPrimaryResponse>* TunnelbrokerService::Stub::AsyncBecomeNewPrimaryDeviceRaw(::grpc::ClientContext* context, const ::tunnelbroker::NewPrimaryRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncBecomeNewPrimaryDeviceRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status TunnelbrokerService::Stub::SendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::google::protobuf::Empty* response) { - return ::grpc::internal::BlockingUnaryCall< ::tunnelbroker::PongRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SendPong_, context, request, response); -} - -void TunnelbrokerService::Stub::async::SendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest* request, ::google::protobuf::Empty* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::tunnelbroker::PongRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SendPong_, context, request, response, std::move(f)); -} - -void TunnelbrokerService::Stub::async::SendPong(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SendPong_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* TunnelbrokerService::Stub::PrepareAsyncSendPongRaw(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::tunnelbroker::PongRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_SendPong_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* TunnelbrokerService::Stub::AsyncSendPongRaw(::grpc::ClientContext* context, const ::tunnelbroker::PongRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncSendPongRaw(context, request, cq); - result->StartCall(); - return result; -} - ::grpc::Status TunnelbrokerService::Stub::SessionSignature(::grpc::ClientContext* context, const ::tunnelbroker::SessionSignatureRequest& request, ::tunnelbroker::SessionSignatureResponse* response) { return ::grpc::internal::BlockingUnaryCall< ::tunnelbroker::SessionSignatureRequest, ::tunnelbroker::SessionSignatureResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SessionSignature_, context, request, response); } @@ -223,36 +148,6 @@ AddMethod(new ::grpc::internal::RpcServiceMethod( TunnelbrokerService_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< TunnelbrokerService::Service, ::tunnelbroker::CheckRequest, ::tunnelbroker::CheckResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](TunnelbrokerService::Service* service, - ::grpc::ServerContext* ctx, - const ::tunnelbroker::CheckRequest* req, - ::tunnelbroker::CheckResponse* resp) { - return service->CheckIfPrimaryDeviceOnline(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - TunnelbrokerService_method_names[1], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< TunnelbrokerService::Service, ::tunnelbroker::NewPrimaryRequest, ::tunnelbroker::NewPrimaryResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](TunnelbrokerService::Service* service, - ::grpc::ServerContext* ctx, - const ::tunnelbroker::NewPrimaryRequest* req, - ::tunnelbroker::NewPrimaryResponse* resp) { - return service->BecomeNewPrimaryDevice(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - TunnelbrokerService_method_names[2], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< TunnelbrokerService::Service, ::tunnelbroker::PongRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](TunnelbrokerService::Service* service, - ::grpc::ServerContext* ctx, - const ::tunnelbroker::PongRequest* req, - ::google::protobuf::Empty* resp) { - return service->SendPong(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - TunnelbrokerService_method_names[3], - ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TunnelbrokerService::Service, ::tunnelbroker::SessionSignatureRequest, ::tunnelbroker::SessionSignatureResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TunnelbrokerService::Service* service, ::grpc::ServerContext* ctx, @@ -261,7 +156,7 @@ return service->SessionSignature(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TunnelbrokerService_method_names[4], + TunnelbrokerService_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TunnelbrokerService::Service, ::tunnelbroker::NewSessionRequest, ::tunnelbroker::NewSessionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TunnelbrokerService::Service* service, @@ -271,7 +166,7 @@ return service->NewSession(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TunnelbrokerService_method_names[5], + TunnelbrokerService_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< TunnelbrokerService::Service, ::tunnelbroker::SendRequest, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](TunnelbrokerService::Service* service, @@ -281,7 +176,7 @@ return service->Send(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TunnelbrokerService_method_names[6], + TunnelbrokerService_method_names[3], ::grpc::internal::RpcMethod::SERVER_STREAMING, new ::grpc::internal::ServerStreamingHandler< TunnelbrokerService::Service, ::tunnelbroker::GetRequest, ::tunnelbroker::GetResponse>( [](TunnelbrokerService::Service* service, @@ -291,7 +186,7 @@ return service->Get(ctx, req, writer); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - TunnelbrokerService_method_names[7], + TunnelbrokerService_method_names[4], ::grpc::internal::RpcMethod::BIDI_STREAMING, new ::grpc::internal::BidiStreamingHandler< TunnelbrokerService::Service, ::tunnelbroker::MessageToTunnelbroker, ::tunnelbroker::MessageToClient>( [](TunnelbrokerService::Service* service, @@ -305,27 +200,6 @@ TunnelbrokerService::Service::~Service() { } -::grpc::Status TunnelbrokerService::Service::CheckIfPrimaryDeviceOnline(::grpc::ServerContext* context, const ::tunnelbroker::CheckRequest* request, ::tunnelbroker::CheckResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status TunnelbrokerService::Service::BecomeNewPrimaryDevice(::grpc::ServerContext* context, const ::tunnelbroker::NewPrimaryRequest* request, ::tunnelbroker::NewPrimaryResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status TunnelbrokerService::Service::SendPong(::grpc::ServerContext* context, const ::tunnelbroker::PongRequest* request, ::google::protobuf::Empty* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - ::grpc::Status TunnelbrokerService::Service::SessionSignature(::grpc::ServerContext* context, const ::tunnelbroker::SessionSignatureRequest* request, ::tunnelbroker::SessionSignatureResponse* response) { (void) context; (void) request; diff --git a/shared/protos/_generated/tunnelbroker.pb.cc b/shared/protos/_generated/tunnelbroker.pb.cc --- a/shared/protos/_generated/tunnelbroker.pb.cc +++ b/shared/protos/_generated/tunnelbroker.pb.cc @@ -547,31 +547,25 @@ "\022\023\n\013deviceToken\030\002 \001(\t*n\n\021CheckResponseTy" "pe\022\030\n\024PRIMARY_DOESNT_EXIST\020\000\022\022\n\016PRIMARY_" "ONLINE\020\001\022\023\n\017PRIMARY_OFFLINE\020\002\022\026\n\022CURRENT" - "_IS_PRIMARY\020\0032\237\005\n\023TunnelbrokerService\022W\n" - "\032CheckIfPrimaryDeviceOnline\022\032.tunnelbrok" - "er.CheckRequest\032\033.tunnelbroker.CheckResp" - "onse\"\000\022]\n\026BecomeNewPrimaryDevice\022\037.tunne" - "lbroker.NewPrimaryRequest\032 .tunnelbroker" - ".NewPrimaryResponse\"\000\022\?\n\010SendPong\022\031.tunn" - "elbroker.PongRequest\032\026.google.protobuf.E" - "mpty\"\000\022c\n\020SessionSignature\022%.tunnelbroke" - "r.SessionSignatureRequest\032&.tunnelbroker" - ".SessionSignatureResponse\"\000\022Q\n\nNewSessio" - "n\022\037.tunnelbroker.NewSessionRequest\032 .tun" - "nelbroker.NewSessionResponse\"\000\022;\n\004Send\022\031" - ".tunnelbroker.SendRequest\032\026.google.proto" - "buf.Empty\"\000\022>\n\003Get\022\030.tunnelbroker.GetReq" - "uest\032\031.tunnelbroker.GetResponse\"\0000\001\022Z\n\016M" - "essagesStream\022#.tunnelbroker.MessageToTu" - "nnelbroker\032\035.tunnelbroker.MessageToClien" - "t\"\000(\0010\001b\006proto3" + "_IS_PRIMARY\020\0032\246\003\n\023TunnelbrokerService\022c\n" + "\020SessionSignature\022%.tunnelbroker.Session" + "SignatureRequest\032&.tunnelbroker.SessionS" + "ignatureResponse\"\000\022Q\n\nNewSession\022\037.tunne" + "lbroker.NewSessionRequest\032 .tunnelbroker" + ".NewSessionResponse\"\000\022;\n\004Send\022\031.tunnelbr" + "oker.SendRequest\032\026.google.protobuf.Empty" + "\"\000\022>\n\003Get\022\030.tunnelbroker.GetRequest\032\031.tu" + "nnelbroker.GetResponse\"\0000\001\022Z\n\016MessagesSt" + "ream\022#.tunnelbroker.MessageToTunnelbroke" + "r\032\035.tunnelbroker.MessageToClient\"\000(\0010\001b\006" + "proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tunnelbroker_2eproto_deps[1] = { &::descriptor_table_google_2fprotobuf_2fempty_2eproto, }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tunnelbroker_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tunnelbroker_2eproto = { - false, false, 2815, descriptor_table_protodef_tunnelbroker_2eproto, "tunnelbroker.proto", + false, false, 2566, descriptor_table_protodef_tunnelbroker_2eproto, "tunnelbroker.proto", &descriptor_table_tunnelbroker_2eproto_once, descriptor_table_tunnelbroker_2eproto_deps, 1, 20, schemas, file_default_instances, TableStruct_tunnelbroker_2eproto::offsets, file_level_metadata_tunnelbroker_2eproto, file_level_enum_descriptors_tunnelbroker_2eproto, file_level_service_descriptors_tunnelbroker_2eproto, diff --git a/shared/protos/tunnelbroker.proto b/shared/protos/tunnelbroker.proto --- a/shared/protos/tunnelbroker.proto +++ b/shared/protos/tunnelbroker.proto @@ -6,14 +6,6 @@ service TunnelbrokerService { - // The old API service methods - // to support the native client build - // until we switch to the new one - - rpc CheckIfPrimaryDeviceOnline(CheckRequest) returns (CheckResponse) {} - rpc BecomeNewPrimaryDevice(NewPrimaryRequest) returns (NewPrimaryResponse) {} - rpc SendPong (PongRequest) returns (google.protobuf.Empty) {} - // New API service methods rpc SessionSignature(SessionSignatureRequest) returns (SessionSignatureResponse) {}