1 #region Copyright notice and license 2 3 // Copyright 2018 The gRPC Authors 4 // 5 // Licensed under the Apache License, Version 2.0 (the "License"); 6 // you may not use this file except in compliance with the License. 7 // You may obtain a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, software 12 // distributed under the License is distributed on an "AS IS" BASIS, 13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 // See the License for the specific language governing permissions and 15 // limitations under the License. 16 17 #endregion 18 19 using System; 20 using System.Collections.Generic; 21 using System.Collections.ObjectModel; 22 using System.Linq; 23 using Grpc.Core.Utils; 24 25 namespace Grpc.Core 26 { 27 /// <summary> 28 /// Allows binding server-side method implementations in alternative serving stacks. 29 /// Instances of this class are usually populated by the <c>BindService</c> method 30 /// that is part of the autogenerated code for a protocol buffers service definition. 31 /// </summary> 32 public class ServiceBinderBase 33 { 34 /// <summary> 35 /// Adds a definition for a single request - single response method. 36 /// </summary> 37 /// <typeparam name="TRequest">The request message class.</typeparam> 38 /// <typeparam name="TResponse">The response message class.</typeparam> 39 /// <param name="method">The method.</param> 40 /// <param name="handler">The method handler.</param> 41 public virtual void AddMethod<TRequest, TResponse>( 42 Method<TRequest, TResponse> method, 43 UnaryServerMethod<TRequest, TResponse> handler) 44 where TRequest : class 45 where TResponse : class 46 { NotImplementedException()47 throw new NotImplementedException(); 48 } 49 50 /// <summary> 51 /// Adds a definition for a client streaming method. 52 /// </summary> 53 /// <typeparam name="TRequest">The request message class.</typeparam> 54 /// <typeparam name="TResponse">The response message class.</typeparam> 55 /// <param name="method">The method.</param> 56 /// <param name="handler">The method handler.</param> 57 public virtual void AddMethod<TRequest, TResponse>( 58 Method<TRequest, TResponse> method, 59 ClientStreamingServerMethod<TRequest, TResponse> handler) 60 where TRequest : class 61 where TResponse : class 62 { NotImplementedException()63 throw new NotImplementedException(); 64 } 65 66 /// <summary> 67 /// Adds a definition for a server streaming method. 68 /// </summary> 69 /// <typeparam name="TRequest">The request message class.</typeparam> 70 /// <typeparam name="TResponse">The response message class.</typeparam> 71 /// <param name="method">The method.</param> 72 /// <param name="handler">The method handler.</param> 73 public virtual void AddMethod<TRequest, TResponse>( 74 Method<TRequest, TResponse> method, 75 ServerStreamingServerMethod<TRequest, TResponse> handler) 76 where TRequest : class 77 where TResponse : class 78 { NotImplementedException()79 throw new NotImplementedException(); 80 } 81 82 /// <summary> 83 /// Adds a definition for a bidirectional streaming method. 84 /// </summary> 85 /// <typeparam name="TRequest">The request message class.</typeparam> 86 /// <typeparam name="TResponse">The response message class.</typeparam> 87 /// <param name="method">The method.</param> 88 /// <param name="handler">The method handler.</param> 89 public virtual void AddMethod<TRequest, TResponse>( 90 Method<TRequest, TResponse> method, 91 DuplexStreamingServerMethod<TRequest, TResponse> handler) 92 where TRequest : class 93 where TResponse : class 94 { NotImplementedException()95 throw new NotImplementedException(); 96 } 97 } 98 } 99