diff --git a/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java b/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java index 662b6ff3e0c..6e6fdd8f00b 100644 --- a/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java +++ b/alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java @@ -92,7 +92,7 @@ public HandshakerServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.Call /** */ - public static abstract class HandshakerServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -104,27 +104,28 @@ public static abstract class HandshakerServiceImplBase implements io.grpc.Bindab
      * response before sending next request.
      * 
*/ - public io.grpc.stub.StreamObserver doHandshake( + default io.grpc.stub.StreamObserver doHandshake( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDoHandshakeMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service HandshakerService. + */ + public static abstract class HandshakerServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getDoHandshakeMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.alts.internal.HandshakerReq, - io.grpc.alts.internal.HandshakerResp>( - this, METHODID_DO_HANDSHAKE))) - .build(); + return HandshakerServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service HandshakerService. */ - public static final class HandshakerServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class HandshakerServiceStub + extends io.grpc.stub.AbstractAsyncStub { private HandshakerServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -154,8 +155,10 @@ public io.grpc.stub.StreamObserver doHandsh } /** + * A stub to allow clients to do synchronous rpc calls to service HandshakerService. */ - public static final class HandshakerServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class HandshakerServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private HandshakerServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -169,8 +172,10 @@ protected HandshakerServiceBlockingStub build( } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service HandshakerService. */ - public static final class HandshakerServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class HandshakerServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private HandshakerServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -190,10 +195,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final HandshakerServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(HandshakerServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -221,6 +226,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDoHandshakeMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.alts.internal.HandshakerReq, + io.grpc.alts.internal.HandshakerResp>( + service, METHODID_DO_HANDSHAKE))) + .build(); + } + private static abstract class HandshakerServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { HandshakerServiceBaseDescriptorSupplier() {} diff --git a/alts/src/test/java/io/grpc/alts/HandshakerServiceChannelTest.java b/alts/src/test/java/io/grpc/alts/HandshakerServiceChannelTest.java index dc297492fe3..a3937904cd7 100644 --- a/alts/src/test/java/io/grpc/alts/HandshakerServiceChannelTest.java +++ b/alts/src/test/java/io/grpc/alts/HandshakerServiceChannelTest.java @@ -46,7 +46,7 @@ public void unaryRpc(SimpleRequest request, StreamObserver so) { so.onCompleted(); } }) - .build()); + .build()); private Resource resource; @Before diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java index cd2bf958508..24c8d6189cc 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java @@ -127,14 +127,14 @@ public LoadBalancerStatsServiceFutureStub newStub(io.grpc.Channel channel, io.gr * A service used to obtain stats for verifying LB behavior. * */ - public static abstract class LoadBalancerStatsServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Gets the backend distribution for RPCs sent by a test client.
      * 
*/ - public void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request, + default void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClientStatsMethod(), responseObserver); } @@ -144,37 +144,34 @@ public void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStat * Gets the accumulated stats for RPCs sent by a test client. * */ - public void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request, + default void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClientAccumulatedStatsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service LoadBalancerStatsService. + *
+   * A service used to obtain stats for verifying LB behavior.
+   * 
+ */ + public static abstract class LoadBalancerStatsServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetClientStatsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.LoadBalancerStatsRequest, - io.grpc.testing.integration.Messages.LoadBalancerStatsResponse>( - this, METHODID_GET_CLIENT_STATS))) - .addMethod( - getGetClientAccumulatedStatsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest, - io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse>( - this, METHODID_GET_CLIENT_ACCUMULATED_STATS))) - .build(); + return LoadBalancerStatsServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service LoadBalancerStatsService. *
    * A service used to obtain stats for verifying LB behavior.
    * 
*/ - public static final class LoadBalancerStatsServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class LoadBalancerStatsServiceStub + extends io.grpc.stub.AbstractAsyncStub { private LoadBalancerStatsServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -210,11 +207,13 @@ public void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadB } /** + * A stub to allow clients to do synchronous rpc calls to service LoadBalancerStatsService. *
    * A service used to obtain stats for verifying LB behavior.
    * 
*/ - public static final class LoadBalancerStatsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class LoadBalancerStatsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private LoadBalancerStatsServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -248,11 +247,13 @@ public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service LoadBalancerStatsService. *
    * A service used to obtain stats for verifying LB behavior.
    * 
*/ - public static final class LoadBalancerStatsServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class LoadBalancerStatsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private LoadBalancerStatsServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -295,10 +296,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final LoadBalancerStatsServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(LoadBalancerStatsServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -331,6 +332,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetClientStatsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.LoadBalancerStatsRequest, + io.grpc.testing.integration.Messages.LoadBalancerStatsResponse>( + service, METHODID_GET_CLIENT_STATS))) + .addMethod( + getGetClientAccumulatedStatsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest, + io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse>( + service, METHODID_GET_CLIENT_ACCUMULATED_STATS))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java index e3e9bc1dc35..0fc49afb5ea 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java @@ -121,7 +121,7 @@ public MetricsServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOpt /** */ - public static abstract class MetricsServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -129,7 +129,7 @@ public static abstract class MetricsServiceImplBase implements io.grpc.BindableS
      * the service
      * 
*/ - public void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage request, + default void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAllGaugesMethod(), responseObserver); } @@ -139,34 +139,28 @@ public void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage reques * Returns the value of one gauge * */ - public void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, + default void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetGaugeMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service MetricsService. + */ + public static abstract class MetricsServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetAllGaugesMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Metrics.EmptyMessage, - io.grpc.testing.integration.Metrics.GaugeResponse>( - this, METHODID_GET_ALL_GAUGES))) - .addMethod( - getGetGaugeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Metrics.GaugeRequest, - io.grpc.testing.integration.Metrics.GaugeResponse>( - this, METHODID_GET_GAUGE))) - .build(); + return MetricsServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service MetricsService. */ - public static final class MetricsServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class MetricsServiceStub + extends io.grpc.stub.AbstractAsyncStub { private MetricsServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -203,8 +197,10 @@ public void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service MetricsService. */ - public static final class MetricsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class MetricsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private MetricsServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -240,8 +236,10 @@ public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testin } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service MetricsService. */ - public static final class MetricsServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class MetricsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private MetricsServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -273,10 +271,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final MetricsServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(MetricsServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -309,6 +307,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetAllGaugesMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Metrics.EmptyMessage, + io.grpc.testing.integration.Metrics.GaugeResponse>( + service, METHODID_GET_ALL_GAUGES))) + .addMethod( + getGetGaugeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Metrics.GaugeRequest, + io.grpc.testing.integration.Metrics.GaugeResponse>( + service, METHODID_GET_GAUGE))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index 476e9cc03a1..93f97349e83 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -127,48 +127,45 @@ public ReconnectServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallO * A service used to control reconnect server. * */ - public static abstract class ReconnectServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void start(io.grpc.testing.integration.Messages.ReconnectParams request, + default void start(io.grpc.testing.integration.Messages.ReconnectParams request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartMethod(), responseObserver); } /** */ - public void stop(io.grpc.testing.integration.EmptyProtos.Empty request, + default void stop(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ReconnectService. + *
+   * A service used to control reconnect server.
+   * 
+ */ + public static abstract class ReconnectServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStartMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.ReconnectParams, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_START))) - .addMethod( - getStopMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.Messages.ReconnectInfo>( - this, METHODID_STOP))) - .build(); + return ReconnectServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ReconnectService. *
    * A service used to control reconnect server.
    * 
*/ - public static final class ReconnectServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ReconnectServiceStub + extends io.grpc.stub.AbstractAsyncStub { private ReconnectServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -198,11 +195,13 @@ public void stop(io.grpc.testing.integration.EmptyProtos.Empty request, } /** + * A stub to allow clients to do synchronous rpc calls to service ReconnectService. *
    * A service used to control reconnect server.
    * 
*/ - public static final class ReconnectServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ReconnectServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ReconnectServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -230,11 +229,13 @@ public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.i } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ReconnectService. *
    * A service used to control reconnect server.
    * 
*/ - public static final class ReconnectServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ReconnectServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ReconnectServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -271,10 +272,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ReconnectServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ReconnectServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -307,6 +308,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStartMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.ReconnectParams, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_START))) + .addMethod( + getStopMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.Messages.ReconnectInfo>( + service, METHODID_STOP))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java index 3569dbc5292..8b9c3c899fd 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -309,14 +309,14 @@ public TestServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOption * performance with various types of payload. * */ - public static abstract class TestServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * One empty request followed by one empty response.
      * 
*/ - public void emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request, + default void emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEmptyCallMethod(), responseObserver); } @@ -326,7 +326,7 @@ public void emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request, * One request followed by one response. * */ - public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, + default void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnaryCallMethod(), responseObserver); } @@ -338,7 +338,7 @@ public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request * satisfy subsequent requests. * */ - public void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, + default void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCacheableUnaryCallMethod(), responseObserver); } @@ -349,7 +349,7 @@ public void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleReques * The server returns the payload with client desired type and sizes. * */ - public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request, + default void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamingOutputCallMethod(), responseObserver); } @@ -360,7 +360,7 @@ public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOu * The server returns the aggregated size of client payload as the result. * */ - public io.grpc.stub.StreamObserver streamingInputCall( + default io.grpc.stub.StreamObserver streamingInputCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingInputCallMethod(), responseObserver); } @@ -372,7 +372,7 @@ public io.grpc.stub.StreamObserver */ - public io.grpc.stub.StreamObserver fullDuplexCall( + default io.grpc.stub.StreamObserver fullDuplexCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getFullDuplexCallMethod(), responseObserver); } @@ -385,7 +385,7 @@ public io.grpc.stub.StreamObserver */ - public io.grpc.stub.StreamObserver halfDuplexCall( + default io.grpc.stub.StreamObserver halfDuplexCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getHalfDuplexCallMethod(), responseObserver); } @@ -396,80 +396,36 @@ public io.grpc.stub.StreamObserver */ - public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, + default void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnimplementedCallMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service TestService. + *
+   * A simple service to test the various types of RPCs and experiment with
+   * performance with various types of payload.
+   * 
+ */ + public static abstract class TestServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getEmptyCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_EMPTY_CALL))) - .addMethod( - getUnaryCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.SimpleRequest, - io.grpc.testing.integration.Messages.SimpleResponse>( - this, METHODID_UNARY_CALL))) - .addMethod( - getCacheableUnaryCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.SimpleRequest, - io.grpc.testing.integration.Messages.SimpleResponse>( - this, METHODID_CACHEABLE_UNARY_CALL))) - .addMethod( - getStreamingOutputCallMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingOutputCallRequest, - io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( - this, METHODID_STREAMING_OUTPUT_CALL))) - .addMethod( - getStreamingInputCallMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingInputCallRequest, - io.grpc.testing.integration.Messages.StreamingInputCallResponse>( - this, METHODID_STREAMING_INPUT_CALL))) - .addMethod( - getFullDuplexCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingOutputCallRequest, - io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( - this, METHODID_FULL_DUPLEX_CALL))) - .addMethod( - getHalfDuplexCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingOutputCallRequest, - io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( - this, METHODID_HALF_DUPLEX_CALL))) - .addMethod( - getUnimplementedCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_UNIMPLEMENTED_CALL))) - .build(); + return TestServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service TestService. *
    * A simple service to test the various types of RPCs and experiment with
    * performance with various types of payload.
    * 
*/ - public static final class TestServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class TestServiceStub + extends io.grpc.stub.AbstractAsyncStub { private TestServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -581,12 +537,14 @@ public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty requ } /** + * A stub to allow clients to do synchronous rpc calls to service TestService. *
    * A simple service to test the various types of RPCs and experiment with
    * performance with various types of payload.
    * 
*/ - public static final class TestServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class TestServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private TestServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -655,12 +613,14 @@ public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.t } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service TestService. *
    * A simple service to test the various types of RPCs and experiment with
    * performance with various types of payload.
    * 
*/ - public static final class TestServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class TestServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private TestServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -734,10 +694,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final TestServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(TestServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -791,6 +751,67 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getEmptyCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_EMPTY_CALL))) + .addMethod( + getUnaryCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.SimpleRequest, + io.grpc.testing.integration.Messages.SimpleResponse>( + service, METHODID_UNARY_CALL))) + .addMethod( + getCacheableUnaryCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.SimpleRequest, + io.grpc.testing.integration.Messages.SimpleResponse>( + service, METHODID_CACHEABLE_UNARY_CALL))) + .addMethod( + getStreamingOutputCallMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingOutputCallRequest, + io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( + service, METHODID_STREAMING_OUTPUT_CALL))) + .addMethod( + getStreamingInputCallMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingInputCallRequest, + io.grpc.testing.integration.Messages.StreamingInputCallResponse>( + service, METHODID_STREAMING_INPUT_CALL))) + .addMethod( + getFullDuplexCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingOutputCallRequest, + io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( + service, METHODID_FULL_DUPLEX_CALL))) + .addMethod( + getHalfDuplexCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingOutputCallRequest, + io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( + service, METHODID_HALF_DUPLEX_CALL))) + .addMethod( + getUnimplementedCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_UNIMPLEMENTED_CALL))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index 77a8cd64ba8..2dc6495a6be 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -99,38 +99,43 @@ public UnimplementedServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.C * that case. * */ - public static abstract class UnimplementedServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * A call that no server should implement
      * 
*/ - public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, + default void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnimplementedCallMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service UnimplementedService. + *
+   * A simple service NOT implemented at servers so clients can test for
+   * that case.
+   * 
+ */ + public static abstract class UnimplementedServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getUnimplementedCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_UNIMPLEMENTED_CALL))) - .build(); + return UnimplementedServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service UnimplementedService. *
    * A simple service NOT implemented at servers so clients can test for
    * that case.
    * 
*/ - public static final class UnimplementedServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class UnimplementedServiceStub + extends io.grpc.stub.AbstractAsyncStub { private UnimplementedServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -155,12 +160,14 @@ public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty requ } /** + * A stub to allow clients to do synchronous rpc calls to service UnimplementedService. *
    * A simple service NOT implemented at servers so clients can test for
    * that case.
    * 
*/ - public static final class UnimplementedServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class UnimplementedServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private UnimplementedServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -184,12 +191,14 @@ public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.t } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service UnimplementedService. *
    * A simple service NOT implemented at servers so clients can test for
    * that case.
    * 
*/ - public static final class UnimplementedServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class UnimplementedServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private UnimplementedServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -220,10 +229,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final UnimplementedServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(UnimplementedServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -252,6 +261,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getUnimplementedCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_UNIMPLEMENTED_CALL))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java index ea7b6e1064e..bb966dcbc73 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java @@ -97,37 +97,41 @@ public XdsUpdateClientConfigureServiceFutureStub newStub(io.grpc.Channel channel * A service to dynamically update the configuration of an xDS test client. * */ - public static abstract class XdsUpdateClientConfigureServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Update the tes client's configuration.
      * 
*/ - public void configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request, + default void configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getConfigureMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service XdsUpdateClientConfigureService. + *
+   * A service to dynamically update the configuration of an xDS test client.
+   * 
+ */ + public static abstract class XdsUpdateClientConfigureServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getConfigureMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.ClientConfigureRequest, - io.grpc.testing.integration.Messages.ClientConfigureResponse>( - this, METHODID_CONFIGURE))) - .build(); + return XdsUpdateClientConfigureServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service XdsUpdateClientConfigureService. *
    * A service to dynamically update the configuration of an xDS test client.
    * 
*/ - public static final class XdsUpdateClientConfigureServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class XdsUpdateClientConfigureServiceStub + extends io.grpc.stub.AbstractAsyncStub { private XdsUpdateClientConfigureServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -152,11 +156,13 @@ public void configure(io.grpc.testing.integration.Messages.ClientConfigureReques } /** + * A stub to allow clients to do synchronous rpc calls to service XdsUpdateClientConfigureService. *
    * A service to dynamically update the configuration of an xDS test client.
    * 
*/ - public static final class XdsUpdateClientConfigureServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class XdsUpdateClientConfigureServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private XdsUpdateClientConfigureServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -180,11 +186,13 @@ public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service XdsUpdateClientConfigureService. *
    * A service to dynamically update the configuration of an xDS test client.
    * 
*/ - public static final class XdsUpdateClientConfigureServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class XdsUpdateClientConfigureServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private XdsUpdateClientConfigureServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -215,10 +223,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final XdsUpdateClientConfigureServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(XdsUpdateClientConfigureServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -247,6 +255,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getConfigureMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.ClientConfigureRequest, + io.grpc.testing.integration.Messages.ClientConfigureResponse>( + service, METHODID_CONFIGURE))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java index 55458ce2a42..57bf5365034 100644 --- a/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java +++ b/android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java @@ -127,48 +127,45 @@ public XdsUpdateHealthServiceFutureStub newStub(io.grpc.Channel channel, io.grpc * A service to remotely control health status of an xDS test server. * */ - public static abstract class XdsUpdateHealthServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void setServing(io.grpc.testing.integration.EmptyProtos.Empty request, + default void setServing(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetServingMethod(), responseObserver); } /** */ - public void setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request, + default void setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetNotServingMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service XdsUpdateHealthService. + *
+   * A service to remotely control health status of an xDS test server.
+   * 
+ */ + public static abstract class XdsUpdateHealthServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getSetServingMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_SET_SERVING))) - .addMethod( - getSetNotServingMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_SET_NOT_SERVING))) - .build(); + return XdsUpdateHealthServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service XdsUpdateHealthService. *
    * A service to remotely control health status of an xDS test server.
    * 
*/ - public static final class XdsUpdateHealthServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class XdsUpdateHealthServiceStub + extends io.grpc.stub.AbstractAsyncStub { private XdsUpdateHealthServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -198,11 +195,13 @@ public void setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request, } /** + * A stub to allow clients to do synchronous rpc calls to service XdsUpdateHealthService. *
    * A service to remotely control health status of an xDS test server.
    * 
*/ - public static final class XdsUpdateHealthServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class XdsUpdateHealthServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private XdsUpdateHealthServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -230,11 +229,13 @@ public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testi } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service XdsUpdateHealthService. *
    * A service to remotely control health status of an xDS test server.
    * 
*/ - public static final class XdsUpdateHealthServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class XdsUpdateHealthServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private XdsUpdateHealthServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -271,10 +272,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final XdsUpdateHealthServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(XdsUpdateHealthServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -307,6 +308,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSetServingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_SET_SERVING))) + .addMethod( + getSetNotServingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_SET_NOT_SERVING))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java index cd2bf958508..24c8d6189cc 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java @@ -127,14 +127,14 @@ public LoadBalancerStatsServiceFutureStub newStub(io.grpc.Channel channel, io.gr * A service used to obtain stats for verifying LB behavior. * */ - public static abstract class LoadBalancerStatsServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Gets the backend distribution for RPCs sent by a test client.
      * 
*/ - public void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request, + default void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClientStatsMethod(), responseObserver); } @@ -144,37 +144,34 @@ public void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStat * Gets the accumulated stats for RPCs sent by a test client. * */ - public void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request, + default void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClientAccumulatedStatsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service LoadBalancerStatsService. + *
+   * A service used to obtain stats for verifying LB behavior.
+   * 
+ */ + public static abstract class LoadBalancerStatsServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetClientStatsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.LoadBalancerStatsRequest, - io.grpc.testing.integration.Messages.LoadBalancerStatsResponse>( - this, METHODID_GET_CLIENT_STATS))) - .addMethod( - getGetClientAccumulatedStatsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest, - io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse>( - this, METHODID_GET_CLIENT_ACCUMULATED_STATS))) - .build(); + return LoadBalancerStatsServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service LoadBalancerStatsService. *
    * A service used to obtain stats for verifying LB behavior.
    * 
*/ - public static final class LoadBalancerStatsServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class LoadBalancerStatsServiceStub + extends io.grpc.stub.AbstractAsyncStub { private LoadBalancerStatsServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -210,11 +207,13 @@ public void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadB } /** + * A stub to allow clients to do synchronous rpc calls to service LoadBalancerStatsService. *
    * A service used to obtain stats for verifying LB behavior.
    * 
*/ - public static final class LoadBalancerStatsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class LoadBalancerStatsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private LoadBalancerStatsServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -248,11 +247,13 @@ public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service LoadBalancerStatsService. *
    * A service used to obtain stats for verifying LB behavior.
    * 
*/ - public static final class LoadBalancerStatsServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class LoadBalancerStatsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private LoadBalancerStatsServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -295,10 +296,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final LoadBalancerStatsServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(LoadBalancerStatsServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -331,6 +332,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetClientStatsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.LoadBalancerStatsRequest, + io.grpc.testing.integration.Messages.LoadBalancerStatsResponse>( + service, METHODID_GET_CLIENT_STATS))) + .addMethod( + getGetClientAccumulatedStatsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest, + io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse>( + service, METHODID_GET_CLIENT_ACCUMULATED_STATS))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java index e3e9bc1dc35..0fc49afb5ea 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java @@ -121,7 +121,7 @@ public MetricsServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOpt /** */ - public static abstract class MetricsServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -129,7 +129,7 @@ public static abstract class MetricsServiceImplBase implements io.grpc.BindableS
      * the service
      * 
*/ - public void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage request, + default void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAllGaugesMethod(), responseObserver); } @@ -139,34 +139,28 @@ public void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage reques * Returns the value of one gauge * */ - public void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, + default void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetGaugeMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service MetricsService. + */ + public static abstract class MetricsServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetAllGaugesMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Metrics.EmptyMessage, - io.grpc.testing.integration.Metrics.GaugeResponse>( - this, METHODID_GET_ALL_GAUGES))) - .addMethod( - getGetGaugeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Metrics.GaugeRequest, - io.grpc.testing.integration.Metrics.GaugeResponse>( - this, METHODID_GET_GAUGE))) - .build(); + return MetricsServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service MetricsService. */ - public static final class MetricsServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class MetricsServiceStub + extends io.grpc.stub.AbstractAsyncStub { private MetricsServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -203,8 +197,10 @@ public void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service MetricsService. */ - public static final class MetricsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class MetricsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private MetricsServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -240,8 +236,10 @@ public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testin } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service MetricsService. */ - public static final class MetricsServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class MetricsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private MetricsServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -273,10 +271,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final MetricsServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(MetricsServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -309,6 +307,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetAllGaugesMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Metrics.EmptyMessage, + io.grpc.testing.integration.Metrics.GaugeResponse>( + service, METHODID_GET_ALL_GAUGES))) + .addMethod( + getGetGaugeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Metrics.GaugeRequest, + io.grpc.testing.integration.Metrics.GaugeResponse>( + service, METHODID_GET_GAUGE))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index 476e9cc03a1..93f97349e83 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -127,48 +127,45 @@ public ReconnectServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallO * A service used to control reconnect server. * */ - public static abstract class ReconnectServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void start(io.grpc.testing.integration.Messages.ReconnectParams request, + default void start(io.grpc.testing.integration.Messages.ReconnectParams request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartMethod(), responseObserver); } /** */ - public void stop(io.grpc.testing.integration.EmptyProtos.Empty request, + default void stop(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ReconnectService. + *
+   * A service used to control reconnect server.
+   * 
+ */ + public static abstract class ReconnectServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStartMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.ReconnectParams, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_START))) - .addMethod( - getStopMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.Messages.ReconnectInfo>( - this, METHODID_STOP))) - .build(); + return ReconnectServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ReconnectService. *
    * A service used to control reconnect server.
    * 
*/ - public static final class ReconnectServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ReconnectServiceStub + extends io.grpc.stub.AbstractAsyncStub { private ReconnectServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -198,11 +195,13 @@ public void stop(io.grpc.testing.integration.EmptyProtos.Empty request, } /** + * A stub to allow clients to do synchronous rpc calls to service ReconnectService. *
    * A service used to control reconnect server.
    * 
*/ - public static final class ReconnectServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ReconnectServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ReconnectServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -230,11 +229,13 @@ public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.i } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ReconnectService. *
    * A service used to control reconnect server.
    * 
*/ - public static final class ReconnectServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ReconnectServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ReconnectServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -271,10 +272,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ReconnectServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ReconnectServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -307,6 +308,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStartMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.ReconnectParams, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_START))) + .addMethod( + getStopMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.Messages.ReconnectInfo>( + service, METHODID_STOP))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/TestServiceGrpc.java index 3569dbc5292..8b9c3c899fd 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -309,14 +309,14 @@ public TestServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOption * performance with various types of payload. * */ - public static abstract class TestServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * One empty request followed by one empty response.
      * 
*/ - public void emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request, + default void emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEmptyCallMethod(), responseObserver); } @@ -326,7 +326,7 @@ public void emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request, * One request followed by one response. * */ - public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, + default void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnaryCallMethod(), responseObserver); } @@ -338,7 +338,7 @@ public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request * satisfy subsequent requests. * */ - public void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, + default void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCacheableUnaryCallMethod(), responseObserver); } @@ -349,7 +349,7 @@ public void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleReques * The server returns the payload with client desired type and sizes. * */ - public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request, + default void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamingOutputCallMethod(), responseObserver); } @@ -360,7 +360,7 @@ public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOu * The server returns the aggregated size of client payload as the result. * */ - public io.grpc.stub.StreamObserver streamingInputCall( + default io.grpc.stub.StreamObserver streamingInputCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingInputCallMethod(), responseObserver); } @@ -372,7 +372,7 @@ public io.grpc.stub.StreamObserver */ - public io.grpc.stub.StreamObserver fullDuplexCall( + default io.grpc.stub.StreamObserver fullDuplexCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getFullDuplexCallMethod(), responseObserver); } @@ -385,7 +385,7 @@ public io.grpc.stub.StreamObserver */ - public io.grpc.stub.StreamObserver halfDuplexCall( + default io.grpc.stub.StreamObserver halfDuplexCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getHalfDuplexCallMethod(), responseObserver); } @@ -396,80 +396,36 @@ public io.grpc.stub.StreamObserver */ - public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, + default void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnimplementedCallMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service TestService. + *
+   * A simple service to test the various types of RPCs and experiment with
+   * performance with various types of payload.
+   * 
+ */ + public static abstract class TestServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getEmptyCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_EMPTY_CALL))) - .addMethod( - getUnaryCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.SimpleRequest, - io.grpc.testing.integration.Messages.SimpleResponse>( - this, METHODID_UNARY_CALL))) - .addMethod( - getCacheableUnaryCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.SimpleRequest, - io.grpc.testing.integration.Messages.SimpleResponse>( - this, METHODID_CACHEABLE_UNARY_CALL))) - .addMethod( - getStreamingOutputCallMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingOutputCallRequest, - io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( - this, METHODID_STREAMING_OUTPUT_CALL))) - .addMethod( - getStreamingInputCallMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingInputCallRequest, - io.grpc.testing.integration.Messages.StreamingInputCallResponse>( - this, METHODID_STREAMING_INPUT_CALL))) - .addMethod( - getFullDuplexCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingOutputCallRequest, - io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( - this, METHODID_FULL_DUPLEX_CALL))) - .addMethod( - getHalfDuplexCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingOutputCallRequest, - io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( - this, METHODID_HALF_DUPLEX_CALL))) - .addMethod( - getUnimplementedCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_UNIMPLEMENTED_CALL))) - .build(); + return TestServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service TestService. *
    * A simple service to test the various types of RPCs and experiment with
    * performance with various types of payload.
    * 
*/ - public static final class TestServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class TestServiceStub + extends io.grpc.stub.AbstractAsyncStub { private TestServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -581,12 +537,14 @@ public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty requ } /** + * A stub to allow clients to do synchronous rpc calls to service TestService. *
    * A simple service to test the various types of RPCs and experiment with
    * performance with various types of payload.
    * 
*/ - public static final class TestServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class TestServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private TestServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -655,12 +613,14 @@ public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.t } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service TestService. *
    * A simple service to test the various types of RPCs and experiment with
    * performance with various types of payload.
    * 
*/ - public static final class TestServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class TestServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private TestServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -734,10 +694,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final TestServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(TestServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -791,6 +751,67 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getEmptyCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_EMPTY_CALL))) + .addMethod( + getUnaryCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.SimpleRequest, + io.grpc.testing.integration.Messages.SimpleResponse>( + service, METHODID_UNARY_CALL))) + .addMethod( + getCacheableUnaryCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.SimpleRequest, + io.grpc.testing.integration.Messages.SimpleResponse>( + service, METHODID_CACHEABLE_UNARY_CALL))) + .addMethod( + getStreamingOutputCallMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingOutputCallRequest, + io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( + service, METHODID_STREAMING_OUTPUT_CALL))) + .addMethod( + getStreamingInputCallMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingInputCallRequest, + io.grpc.testing.integration.Messages.StreamingInputCallResponse>( + service, METHODID_STREAMING_INPUT_CALL))) + .addMethod( + getFullDuplexCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingOutputCallRequest, + io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( + service, METHODID_FULL_DUPLEX_CALL))) + .addMethod( + getHalfDuplexCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingOutputCallRequest, + io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( + service, METHODID_HALF_DUPLEX_CALL))) + .addMethod( + getUnimplementedCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_UNIMPLEMENTED_CALL))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index 77a8cd64ba8..2dc6495a6be 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -99,38 +99,43 @@ public UnimplementedServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.C * that case. * */ - public static abstract class UnimplementedServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * A call that no server should implement
      * 
*/ - public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, + default void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnimplementedCallMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service UnimplementedService. + *
+   * A simple service NOT implemented at servers so clients can test for
+   * that case.
+   * 
+ */ + public static abstract class UnimplementedServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getUnimplementedCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_UNIMPLEMENTED_CALL))) - .build(); + return UnimplementedServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service UnimplementedService. *
    * A simple service NOT implemented at servers so clients can test for
    * that case.
    * 
*/ - public static final class UnimplementedServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class UnimplementedServiceStub + extends io.grpc.stub.AbstractAsyncStub { private UnimplementedServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -155,12 +160,14 @@ public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty requ } /** + * A stub to allow clients to do synchronous rpc calls to service UnimplementedService. *
    * A simple service NOT implemented at servers so clients can test for
    * that case.
    * 
*/ - public static final class UnimplementedServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class UnimplementedServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private UnimplementedServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -184,12 +191,14 @@ public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.t } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service UnimplementedService. *
    * A simple service NOT implemented at servers so clients can test for
    * that case.
    * 
*/ - public static final class UnimplementedServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class UnimplementedServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private UnimplementedServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -220,10 +229,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final UnimplementedServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(UnimplementedServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -252,6 +261,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getUnimplementedCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_UNIMPLEMENTED_CALL))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java index ea7b6e1064e..bb966dcbc73 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java @@ -97,37 +97,41 @@ public XdsUpdateClientConfigureServiceFutureStub newStub(io.grpc.Channel channel * A service to dynamically update the configuration of an xDS test client. * */ - public static abstract class XdsUpdateClientConfigureServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Update the tes client's configuration.
      * 
*/ - public void configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request, + default void configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getConfigureMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service XdsUpdateClientConfigureService. + *
+   * A service to dynamically update the configuration of an xDS test client.
+   * 
+ */ + public static abstract class XdsUpdateClientConfigureServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getConfigureMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.ClientConfigureRequest, - io.grpc.testing.integration.Messages.ClientConfigureResponse>( - this, METHODID_CONFIGURE))) - .build(); + return XdsUpdateClientConfigureServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service XdsUpdateClientConfigureService. *
    * A service to dynamically update the configuration of an xDS test client.
    * 
*/ - public static final class XdsUpdateClientConfigureServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class XdsUpdateClientConfigureServiceStub + extends io.grpc.stub.AbstractAsyncStub { private XdsUpdateClientConfigureServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -152,11 +156,13 @@ public void configure(io.grpc.testing.integration.Messages.ClientConfigureReques } /** + * A stub to allow clients to do synchronous rpc calls to service XdsUpdateClientConfigureService. *
    * A service to dynamically update the configuration of an xDS test client.
    * 
*/ - public static final class XdsUpdateClientConfigureServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class XdsUpdateClientConfigureServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private XdsUpdateClientConfigureServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -180,11 +186,13 @@ public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service XdsUpdateClientConfigureService. *
    * A service to dynamically update the configuration of an xDS test client.
    * 
*/ - public static final class XdsUpdateClientConfigureServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class XdsUpdateClientConfigureServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private XdsUpdateClientConfigureServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -215,10 +223,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final XdsUpdateClientConfigureServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(XdsUpdateClientConfigureServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -247,6 +255,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getConfigureMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.ClientConfigureRequest, + io.grpc.testing.integration.Messages.ClientConfigureResponse>( + service, METHODID_CONFIGURE))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java index 55458ce2a42..57bf5365034 100644 --- a/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java +++ b/android-interop-testing/src/generated/release/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java @@ -127,48 +127,45 @@ public XdsUpdateHealthServiceFutureStub newStub(io.grpc.Channel channel, io.grpc * A service to remotely control health status of an xDS test server. * */ - public static abstract class XdsUpdateHealthServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void setServing(io.grpc.testing.integration.EmptyProtos.Empty request, + default void setServing(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetServingMethod(), responseObserver); } /** */ - public void setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request, + default void setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetNotServingMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service XdsUpdateHealthService. + *
+   * A service to remotely control health status of an xDS test server.
+   * 
+ */ + public static abstract class XdsUpdateHealthServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getSetServingMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_SET_SERVING))) - .addMethod( - getSetNotServingMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_SET_NOT_SERVING))) - .build(); + return XdsUpdateHealthServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service XdsUpdateHealthService. *
    * A service to remotely control health status of an xDS test server.
    * 
*/ - public static final class XdsUpdateHealthServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class XdsUpdateHealthServiceStub + extends io.grpc.stub.AbstractAsyncStub { private XdsUpdateHealthServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -198,11 +195,13 @@ public void setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request, } /** + * A stub to allow clients to do synchronous rpc calls to service XdsUpdateHealthService. *
    * A service to remotely control health status of an xDS test server.
    * 
*/ - public static final class XdsUpdateHealthServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class XdsUpdateHealthServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private XdsUpdateHealthServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -230,11 +229,13 @@ public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testi } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service XdsUpdateHealthService. *
    * A service to remotely control health status of an xDS test server.
    * 
*/ - public static final class XdsUpdateHealthServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class XdsUpdateHealthServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private XdsUpdateHealthServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -271,10 +272,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final XdsUpdateHealthServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(XdsUpdateHealthServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -307,6 +308,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSetServingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_SET_SERVING))) + .addMethod( + getSetNotServingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_SET_NOT_SERVING))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java index c9a0f385ab6..6fd21f2c037 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java @@ -216,7 +216,7 @@ public BenchmarkServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallO /** */ - public static abstract class BenchmarkServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -224,7 +224,7 @@ public static abstract class BenchmarkServiceImplBase implements io.grpc.Bindabl
      * The server returns the client payload as-is.
      * 
*/ - public void unaryCall(io.grpc.benchmarks.proto.Messages.SimpleRequest request, + default void unaryCall(io.grpc.benchmarks.proto.Messages.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnaryCallMethod(), responseObserver); } @@ -236,7 +236,7 @@ public void unaryCall(io.grpc.benchmarks.proto.Messages.SimpleRequest request, * The server returns the client payload as-is on each response * */ - public io.grpc.stub.StreamObserver streamingCall( + default io.grpc.stub.StreamObserver streamingCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingCallMethod(), responseObserver); } @@ -247,7 +247,7 @@ public io.grpc.stub.StreamObserver */ - public io.grpc.stub.StreamObserver streamingFromClient( + default io.grpc.stub.StreamObserver streamingFromClient( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingFromClientMethod(), responseObserver); } @@ -258,7 +258,7 @@ public io.grpc.stub.StreamObserver */ - public void streamingFromServer(io.grpc.benchmarks.proto.Messages.SimpleRequest request, + default void streamingFromServer(io.grpc.benchmarks.proto.Messages.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamingFromServerMethod(), responseObserver); } @@ -269,55 +269,28 @@ public void streamingFromServer(io.grpc.benchmarks.proto.Messages.SimpleRequest * Both sides send the content of their own choice to the other * */ - public io.grpc.stub.StreamObserver streamingBothWays( + default io.grpc.stub.StreamObserver streamingBothWays( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingBothWaysMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service BenchmarkService. + */ + public static abstract class BenchmarkServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getUnaryCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Messages.SimpleRequest, - io.grpc.benchmarks.proto.Messages.SimpleResponse>( - this, METHODID_UNARY_CALL))) - .addMethod( - getStreamingCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Messages.SimpleRequest, - io.grpc.benchmarks.proto.Messages.SimpleResponse>( - this, METHODID_STREAMING_CALL))) - .addMethod( - getStreamingFromClientMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Messages.SimpleRequest, - io.grpc.benchmarks.proto.Messages.SimpleResponse>( - this, METHODID_STREAMING_FROM_CLIENT))) - .addMethod( - getStreamingFromServerMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Messages.SimpleRequest, - io.grpc.benchmarks.proto.Messages.SimpleResponse>( - this, METHODID_STREAMING_FROM_SERVER))) - .addMethod( - getStreamingBothWaysMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Messages.SimpleRequest, - io.grpc.benchmarks.proto.Messages.SimpleResponse>( - this, METHODID_STREAMING_BOTH_WAYS))) - .build(); + return BenchmarkServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service BenchmarkService. */ - public static final class BenchmarkServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class BenchmarkServiceStub + extends io.grpc.stub.AbstractAsyncStub { private BenchmarkServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -392,8 +365,10 @@ public io.grpc.stub.StreamObserver { + public static final class BenchmarkServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private BenchmarkServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -430,8 +405,10 @@ public java.util.Iterator stre } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service BenchmarkService. */ - public static final class BenchmarkServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class BenchmarkServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private BenchmarkServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -467,10 +444,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final BenchmarkServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(BenchmarkServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -512,6 +489,46 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getUnaryCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Messages.SimpleRequest, + io.grpc.benchmarks.proto.Messages.SimpleResponse>( + service, METHODID_UNARY_CALL))) + .addMethod( + getStreamingCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Messages.SimpleRequest, + io.grpc.benchmarks.proto.Messages.SimpleResponse>( + service, METHODID_STREAMING_CALL))) + .addMethod( + getStreamingFromClientMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Messages.SimpleRequest, + io.grpc.benchmarks.proto.Messages.SimpleResponse>( + service, METHODID_STREAMING_FROM_CLIENT))) + .addMethod( + getStreamingFromServerMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Messages.SimpleRequest, + io.grpc.benchmarks.proto.Messages.SimpleResponse>( + service, METHODID_STREAMING_FROM_SERVER))) + .addMethod( + getStreamingBothWaysMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Messages.SimpleRequest, + io.grpc.benchmarks.proto.Messages.SimpleResponse>( + service, METHODID_STREAMING_BOTH_WAYS))) + .build(); + } + private static abstract class BenchmarkServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { BenchmarkServiceBaseDescriptorSupplier() {} diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java index 497d504b152..534ba40ed77 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/ReportQpsScenarioServiceGrpc.java @@ -92,34 +92,35 @@ public ReportQpsScenarioServiceFutureStub newStub(io.grpc.Channel channel, io.gr /** */ - public static abstract class ReportQpsScenarioServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Report results of a QPS test benchmark scenario.
      * 
*/ - public void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult request, + default void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReportScenarioMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ReportQpsScenarioService. + */ + public static abstract class ReportQpsScenarioServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getReportScenarioMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Control.ScenarioResult, - io.grpc.benchmarks.proto.Control.Void>( - this, METHODID_REPORT_SCENARIO))) - .build(); + return ReportQpsScenarioServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ReportQpsScenarioService. */ - public static final class ReportQpsScenarioServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ReportQpsScenarioServiceStub + extends io.grpc.stub.AbstractAsyncStub { private ReportQpsScenarioServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -144,8 +145,10 @@ public void reportScenario(io.grpc.benchmarks.proto.Control.ScenarioResult reque } /** + * A stub to allow clients to do synchronous rpc calls to service ReportQpsScenarioService. */ - public static final class ReportQpsScenarioServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ReportQpsScenarioServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ReportQpsScenarioServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -169,8 +172,10 @@ public io.grpc.benchmarks.proto.Control.Void reportScenario(io.grpc.benchmarks.p } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ReportQpsScenarioService. */ - public static final class ReportQpsScenarioServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ReportQpsScenarioServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ReportQpsScenarioServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -201,10 +206,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ReportQpsScenarioServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ReportQpsScenarioServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -233,6 +238,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getReportScenarioMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Control.ScenarioResult, + io.grpc.benchmarks.proto.Control.Void>( + service, METHODID_REPORT_SCENARIO))) + .build(); + } + private static abstract class ReportQpsScenarioServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ReportQpsScenarioServiceBaseDescriptorSupplier() {} diff --git a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java index 253320c5240..a1031d9f241 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/WorkerServiceGrpc.java @@ -185,7 +185,7 @@ public WorkerServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOpti /** */ - public static abstract class WorkerServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -197,7 +197,7 @@ public static abstract class WorkerServiceImplBase implements io.grpc.BindableSe
      * this RPC.
      * 
*/ - public io.grpc.stub.StreamObserver runServer( + default io.grpc.stub.StreamObserver runServer( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getRunServerMethod(), responseObserver); } @@ -212,7 +212,7 @@ public io.grpc.stub.StreamObserver * this RPC. * */ - public io.grpc.stub.StreamObserver runClient( + default io.grpc.stub.StreamObserver runClient( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getRunClientMethod(), responseObserver); } @@ -222,7 +222,7 @@ public io.grpc.stub.StreamObserver * Just return the core count - unary call * */ - public void coreCount(io.grpc.benchmarks.proto.Control.CoreRequest request, + default void coreCount(io.grpc.benchmarks.proto.Control.CoreRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCoreCountMethod(), responseObserver); } @@ -232,48 +232,28 @@ public void coreCount(io.grpc.benchmarks.proto.Control.CoreRequest request, * Quit this worker * */ - public void quitWorker(io.grpc.benchmarks.proto.Control.Void request, + default void quitWorker(io.grpc.benchmarks.proto.Control.Void request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getQuitWorkerMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service WorkerService. + */ + public static abstract class WorkerServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getRunServerMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Control.ServerArgs, - io.grpc.benchmarks.proto.Control.ServerStatus>( - this, METHODID_RUN_SERVER))) - .addMethod( - getRunClientMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Control.ClientArgs, - io.grpc.benchmarks.proto.Control.ClientStatus>( - this, METHODID_RUN_CLIENT))) - .addMethod( - getCoreCountMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Control.CoreRequest, - io.grpc.benchmarks.proto.Control.CoreResponse>( - this, METHODID_CORE_COUNT))) - .addMethod( - getQuitWorkerMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.benchmarks.proto.Control.Void, - io.grpc.benchmarks.proto.Control.Void>( - this, METHODID_QUIT_WORKER))) - .build(); + return WorkerServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service WorkerService. */ - public static final class WorkerServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class WorkerServiceStub + extends io.grpc.stub.AbstractAsyncStub { private WorkerServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -341,8 +321,10 @@ public void quitWorker(io.grpc.benchmarks.proto.Control.Void request, } /** + * A stub to allow clients to do synchronous rpc calls to service WorkerService. */ - public static final class WorkerServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class WorkerServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private WorkerServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -376,8 +358,10 @@ public io.grpc.benchmarks.proto.Control.Void quitWorker(io.grpc.benchmarks.proto } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service WorkerService. */ - public static final class WorkerServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class WorkerServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private WorkerServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -422,10 +406,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final WorkerServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(WorkerServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -464,6 +448,39 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getRunServerMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Control.ServerArgs, + io.grpc.benchmarks.proto.Control.ServerStatus>( + service, METHODID_RUN_SERVER))) + .addMethod( + getRunClientMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Control.ClientArgs, + io.grpc.benchmarks.proto.Control.ClientStatus>( + service, METHODID_RUN_CLIENT))) + .addMethod( + getCoreCountMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Control.CoreRequest, + io.grpc.benchmarks.proto.Control.CoreResponse>( + service, METHODID_CORE_COUNT))) + .addMethod( + getQuitWorkerMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.benchmarks.proto.Control.Void, + io.grpc.benchmarks.proto.Control.Void>( + service, METHODID_QUIT_WORKER))) + .build(); + } + private static abstract class WorkerServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { WorkerServiceBaseDescriptorSupplier() {} diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp index 0ab7a3eaca9..cde83237531 100644 --- a/compiler/src/java_plugin/cpp/java_generator.cpp +++ b/compiler/src/java_plugin/cpp/java_generator.cpp @@ -346,6 +346,24 @@ static std::vector GrpcGetDocLinesForDescriptor(const DescriptorTyp return GrpcGetDocLines(GrpcGetCommentsForDescriptor(descriptor)); } +enum StubType { + ASYNC_INTERFACE = 0, + BLOCKING_CLIENT_INTERFACE = 1, + FUTURE_CLIENT_INTERFACE = 2, + BLOCKING_SERVER_INTERFACE = 3, + ASYNC_CLIENT_IMPL = 4, + BLOCKING_CLIENT_IMPL = 5, + FUTURE_CLIENT_IMPL = 6, + ABSTRACT_CLASS = 7, + NONE = 8, +}; + +enum CallType { + ASYNC_CALL = 0, + BLOCKING_CALL = 1, + FUTURE_CALL = 2 +}; + // TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. static void GrpcWriteDocCommentBody(Printer* printer, const std::vector& lines, @@ -380,12 +398,30 @@ static void GrpcWriteDocComment(Printer* printer, const std::string& comments) { printer->Print(" */\n"); } -// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. +// For the non-interface classes add a description of use before the description from proto static void GrpcWriteServiceDocComment(Printer* printer, - const ServiceDescriptor* service) { - // Deviating from protobuf to avoid extraneous docs - // (see https://github.com/google/protobuf/issues/1406); + const ServiceDescriptor* service, + StubType type) { printer->Print("/**\n"); + + std::map vars = {{"service", service->name()}}; + switch (type) { + case ASYNC_CLIENT_IMPL: + printer->Print(vars, " * A stub to allow clients to do asynchronous rpc calls to service $service$.\n"); + break; + case BLOCKING_CLIENT_IMPL: + printer->Print(vars, " * A stub to allow clients to do synchronous rpc calls to service $service$.\n"); + break; + case FUTURE_CLIENT_IMPL: + printer->Print(vars, " * A stub to allow clients to do ListenableFuture-style rpc calls to service $service$.\n"); + break; + case ABSTRACT_CLASS: + printer->Print(vars, " * Base class for the server implementation of the service $service$.\n"); + break; + default: ; + // No extra description + } + std::vector lines = GrpcGetDocLinesForDescriptor(service); GrpcWriteDocCommentBody(printer, lines, true); printer->Print(" */\n"); @@ -499,24 +535,7 @@ static void PrintMethodFields( } } -enum StubType { - ASYNC_INTERFACE = 0, - BLOCKING_CLIENT_INTERFACE = 1, - FUTURE_CLIENT_INTERFACE = 2, - BLOCKING_SERVER_INTERFACE = 3, - ASYNC_CLIENT_IMPL = 4, - BLOCKING_CLIENT_IMPL = 5, - FUTURE_CLIENT_IMPL = 6, - ABSTRACT_CLASS = 7, -}; - -enum CallType { - ASYNC_CALL = 0, - BLOCKING_CALL = 1, - FUTURE_CALL = 2 -}; - -static void PrintBindServiceMethodBody(const ServiceDescriptor* service, +static void PrintBindServiceMethod(const ServiceDescriptor* service, std::map* vars, Printer* p); @@ -558,78 +577,64 @@ static void PrintStub( Printer* p, StubType type) { const std::string service_name = service->name(); (*vars)["service_name"] = service_name; - (*vars)["abstract_name"] = service_name + "ImplBase"; std::string stub_name = service_name; - std::string client_name = service_name; std::string stub_base_class_name = "AbstractStub"; CallType call_type; - bool impl_base = false; bool interface = false; switch (type) { - case ABSTRACT_CLASS: + case ASYNC_INTERFACE: call_type = ASYNC_CALL; - impl_base = true; + interface = true; + stub_name ="AsyncService"; break; case ASYNC_CLIENT_IMPL: call_type = ASYNC_CALL; stub_name += "Stub"; stub_base_class_name = "AbstractAsyncStub"; break; - case BLOCKING_CLIENT_INTERFACE: - interface = true; - FALLTHROUGH; case BLOCKING_CLIENT_IMPL: call_type = BLOCKING_CALL; stub_name += "BlockingStub"; - client_name += "BlockingClient"; stub_base_class_name = "AbstractBlockingStub"; break; - case FUTURE_CLIENT_INTERFACE: - interface = true; - FALLTHROUGH; case FUTURE_CLIENT_IMPL: call_type = FUTURE_CALL; stub_name += "FutureStub"; - client_name += "FutureClient"; stub_base_class_name = "AbstractFutureStub"; break; - case ASYNC_INTERFACE: - call_type = ASYNC_CALL; - interface = true; - stub_name += "Stub"; - stub_base_class_name = "AbstractAsyncStub"; + case BLOCKING_CLIENT_INTERFACE: + case FUTURE_CLIENT_INTERFACE: + GRPC_CODEGEN_FAIL << "Intentionally not creating StubType: " << type; break; + case ABSTRACT_CLASS: + GRPC_CODEGEN_FAIL << "Call PrintAbstractClassStub for ABSTRACT_CLASS"; default: GRPC_CODEGEN_FAIL << "Cannot determine class name for StubType: " << type; } (*vars)["stub_name"] = stub_name; - (*vars)["client_name"] = client_name; (*vars)["stub_base_class_name"] = (*vars)[stub_base_class_name]; // Class head - if (!interface) { - GrpcWriteServiceDocComment(p, service); - } + GrpcWriteServiceDocComment(p, service, type); if (service->options().deprecated()) { p->Print(*vars, "@$Deprecated$\n"); } - if (impl_base) { + if (interface) { p->Print( *vars, - "public static abstract class $abstract_name$" - " implements $BindableService$ {\n"); + "public interface $stub_name$ {\n"); } else { p->Print( *vars, - "public static final class $stub_name$" - " extends $stub_base_class_name$<$stub_name$> {\n"); + "public static final class $stub_name$\n" + " extends $stub_base_class_name$<$stub_name$> {\n"); } p->Indent(); // Constructor and build() method - if (!impl_base && !interface) { + if (!interface) { p->Print( *vars, "private $stub_name$(\n" @@ -676,15 +681,17 @@ static void PrintStub( // Method signature p->Print("\n"); // TODO(nmittler): Replace with WriteMethodDocComment once included by the protobuf distro. - if (!interface) { - GrpcWriteMethodDocComment(p, method); - } + GrpcWriteMethodDocComment(p, method); if (method->options().deprecated()) { p->Print(*vars, "@$Deprecated$\n"); } - p->Print("public "); + if (!interface) { + p->Print("public "); + } else { + p->Print("default "); + } switch (call_type) { case BLOCKING_CALL: GRPC_CODEGEN_CHECK(!client_streaming) @@ -729,32 +736,22 @@ static void PrintStub( break; } - if (interface) { - p->Print(";\n"); - continue; - } // Method body. p->Print(" {\n"); p->Indent(); - if (impl_base) { - switch (call_type) { - // NB: Skipping validation of service methods. If something is wrong, we wouldn't get to - // this point as compiler would return errors when generating service interface. - case ASYNC_CALL: - if (client_streaming) { - p->Print( - *vars, - "return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(" - "$method_method_name$(), responseObserver);\n"); - } else { - p->Print( - *vars, - "io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(" - "$method_method_name$(), responseObserver);\n"); - } - break; - default: - break; + if (interface && call_type == ASYNC_CALL) { + // NB: Skipping validation of service methods. If something is wrong, we wouldn't get to + // this point as compiler would return errors when generating service interface. + if (client_streaming) { + p->Print( + *vars, + "return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(" + "$method_method_name$(), responseObserver);\n"); + } else { + p->Print( + *vars, + "io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(" + "$method_method_name$(), responseObserver);\n"); } } else if (!interface) { switch (call_type) { @@ -809,25 +806,40 @@ static void PrintStub( " getChannel().newCall($method_method_name$(), getCallOptions()), request);\n"); break; } + } else { + GRPC_CODEGEN_FAIL << "Do not create Stub interfaces"; } p->Outdent(); p->Print("}\n"); } - if (impl_base) { - p->Print("\n"); - p->Print( - *vars, - "@$Override$ public final $ServerServiceDefinition$ bindService() {\n"); - (*vars)["instance"] = "this"; - PrintBindServiceMethodBody(service, vars, p); - p->Print("}\n"); - } - p->Outdent(); p->Print("}\n\n"); } + +static void PrintAbstractClassStub( + const ServiceDescriptor* service, + std::map* vars, + Printer* p) { + const std::string service_name = service->name(); + (*vars)["service_name"] = service_name; + + GrpcWriteServiceDocComment(p, service, ABSTRACT_CLASS); + if (service->options().deprecated()) { + p->Print(*vars, "@$Deprecated$\n"); + } + p->Print( + *vars, + "public static abstract class $service_name$ImplBase\n" + " implements $BindableService$, AsyncService {\n" + "\n" + " @$Override$ public final $ServerServiceDefinition$ bindService() {\n" + " return $service_class_name$.bindService(this);\n" + " }\n" + "}\n\n"); +} + static bool CompareMethodClientStreaming(const MethodDescriptor* method1, const MethodDescriptor* method2) { @@ -855,7 +867,6 @@ static void PrintMethodHandlerClass(const ServiceDescriptor* service, "private static final int $method_id_name$ = $method_id$;\n"); } p->Print("\n"); - (*vars)["service_name"] = service->name() + "ImplBase"; p->Print( *vars, "private static final class MethodHandlers implements\n" @@ -863,10 +874,10 @@ static void PrintMethodHandlerClass(const ServiceDescriptor* service, " io.grpc.stub.ServerCalls.ServerStreamingMethod,\n" " io.grpc.stub.ServerCalls.ClientStreamingMethod,\n" " io.grpc.stub.ServerCalls.BidiStreamingMethod {\n" - " private final $service_name$ serviceImpl;\n" + " private final AsyncService serviceImpl;\n" " private final int methodId;\n" "\n" - " MethodHandlers($service_name$ serviceImpl, int methodId) {\n" + " MethodHandlers(AsyncService serviceImpl, int methodId) {\n" " this.serviceImpl = serviceImpl;\n" " this.methodId = methodId;\n" " }\n\n"); @@ -1043,10 +1054,14 @@ static void PrintGetServiceDescriptorMethod(const ServiceDescriptor* service, p->Print("}\n"); } -static void PrintBindServiceMethodBody(const ServiceDescriptor* service, +static void PrintBindServiceMethod(const ServiceDescriptor* service, std::map* vars, Printer* p) { (*vars)["service_name"] = service->name(); + p->Print(*vars, + "public static final io.grpc.ServerServiceDefinition " + "bindService(AsyncService service) {\n"); + p->Indent(); p->Print(*vars, "return " @@ -1087,7 +1102,7 @@ static void PrintBindServiceMethodBody(const ServiceDescriptor* service, "new MethodHandlers<\n" " $input_type$,\n" " $output_type$>(\n" - " $instance$, $method_id_name$)))\n"); + " service, $method_id_name$)))\n"); p->Outdent(); p->Outdent(); } @@ -1095,6 +1110,7 @@ static void PrintBindServiceMethodBody(const ServiceDescriptor* service, p->Outdent(); p->Outdent(); p->Outdent(); + p->Print("}\n\n"); } static void PrintService(const ServiceDescriptor* service, @@ -1112,7 +1128,7 @@ static void PrintService(const ServiceDescriptor* service, } #endif // TODO(nmittler): Replace with WriteServiceDocComment once included by protobuf distro. - GrpcWriteServiceDocComment(p, service); + GrpcWriteServiceDocComment(p, service, NONE); p->Print( *vars, "@$Generated$(\n" @@ -1180,12 +1196,14 @@ static void PrintService(const ServiceDescriptor* service, p->Outdent(); p->Print("}\n\n"); - PrintStub(service, vars, p, ABSTRACT_CLASS); + PrintStub(service, vars, p, ASYNC_INTERFACE); + PrintAbstractClassStub(service, vars, p); PrintStub(service, vars, p, ASYNC_CLIENT_IMPL); PrintStub(service, vars, p, BLOCKING_CLIENT_IMPL); PrintStub(service, vars, p, FUTURE_CLIENT_IMPL); PrintMethodHandlerClass(service, vars, p); + PrintBindServiceMethod(service, vars, p); PrintGetServiceDescriptorMethod(service, vars, p, flavor); p->Outdent(); p->Print("}\n"); diff --git a/compiler/src/test/golden/TestDeprecatedService.java.txt b/compiler/src/test/golden/TestDeprecatedService.java.txt index d6283233160..b8e096c3918 100644 --- a/compiler/src/test/golden/TestDeprecatedService.java.txt +++ b/compiler/src/test/golden/TestDeprecatedService.java.txt @@ -100,7 +100,7 @@ public final class TestDeprecatedServiceGrpc { * */ @java.lang.Deprecated - public static abstract class TestDeprecatedServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -108,31 +108,36 @@ public final class TestDeprecatedServiceGrpc {
      * 
*/ @java.lang.Deprecated - public void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request, + default void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeprecatedMethodMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service TestDeprecatedService. + *
+   * Test service that has been deprecated and should generate with Java's @Deprecated annotation
+   * 
+ */ + @java.lang.Deprecated + public static abstract class TestDeprecatedServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getDeprecatedMethodMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.SimpleRequest, - io.grpc.testing.compiler.Test.SimpleResponse>( - this, METHODID_DEPRECATED_METHOD))) - .build(); + return TestDeprecatedServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service TestDeprecatedService. *
    * Test service that has been deprecated and should generate with Java's @Deprecated annotation
    * 
*/ @java.lang.Deprecated - public static final class TestDeprecatedServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class TestDeprecatedServiceStub + extends io.grpc.stub.AbstractAsyncStub { private TestDeprecatedServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -158,12 +163,14 @@ public final class TestDeprecatedServiceGrpc { } /** + * A stub to allow clients to do synchronous rpc calls to service TestDeprecatedService. *
    * Test service that has been deprecated and should generate with Java's @Deprecated annotation
    * 
*/ @java.lang.Deprecated - public static final class TestDeprecatedServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class TestDeprecatedServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private TestDeprecatedServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -188,12 +195,14 @@ public final class TestDeprecatedServiceGrpc { } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service TestDeprecatedService. *
    * Test service that has been deprecated and should generate with Java's @Deprecated annotation
    * 
*/ @java.lang.Deprecated - public static final class TestDeprecatedServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class TestDeprecatedServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private TestDeprecatedServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -225,10 +234,10 @@ public final class TestDeprecatedServiceGrpc { io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final TestDeprecatedServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(TestDeprecatedServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -257,6 +266,18 @@ public final class TestDeprecatedServiceGrpc { } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeprecatedMethodMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.SimpleRequest, + io.grpc.testing.compiler.Test.SimpleResponse>( + service, METHODID_DEPRECATED_METHOD))) + .build(); + } + private static abstract class TestDeprecatedServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { TestDeprecatedServiceBaseDescriptorSupplier() {} diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt index 505ab91d485..3fc81d6a1fc 100644 --- a/compiler/src/test/golden/TestService.java.txt +++ b/compiler/src/test/golden/TestService.java.txt @@ -317,7 +317,7 @@ public final class TestServiceGrpc { * Test service that supports all call types. * */ - public static abstract class TestServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -325,7 +325,7 @@ public final class TestServiceGrpc {
      * The server returns the client payload as-is.
      * 
*/ - public void unaryCall(io.grpc.testing.compiler.Test.SimpleRequest request, + default void unaryCall(io.grpc.testing.compiler.Test.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnaryCallMethod(), responseObserver); } @@ -336,7 +336,7 @@ public final class TestServiceGrpc { * The server returns the payload with client desired type and sizes. * */ - public void streamingOutputCall(io.grpc.testing.compiler.Test.StreamingOutputCallRequest request, + default void streamingOutputCall(io.grpc.testing.compiler.Test.StreamingOutputCallRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamingOutputCallMethod(), responseObserver); } @@ -347,7 +347,7 @@ public final class TestServiceGrpc { * The server returns the aggregated size of client payload as the result. * */ - public io.grpc.stub.StreamObserver streamingInputCall( + default io.grpc.stub.StreamObserver streamingInputCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingInputCallMethod(), responseObserver); } @@ -359,7 +359,7 @@ public final class TestServiceGrpc { * demonstrates the idea of full bidirectionality. * */ - public io.grpc.stub.StreamObserver fullBidiCall( + default io.grpc.stub.StreamObserver fullBidiCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getFullBidiCallMethod(), responseObserver); } @@ -372,7 +372,7 @@ public final class TestServiceGrpc { * first request. * */ - public io.grpc.stub.StreamObserver halfBidiCall( + default io.grpc.stub.StreamObserver halfBidiCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getHalfBidiCallMethod(), responseObserver); } @@ -383,7 +383,7 @@ public final class TestServiceGrpc { * method should have a '_' appended. * */ - public io.grpc.stub.StreamObserver import_( + default io.grpc.stub.StreamObserver import_( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getImportMethod(), responseObserver); } @@ -393,7 +393,7 @@ public final class TestServiceGrpc { * A unary call that is Safe. * */ - public void safeCall(io.grpc.testing.compiler.Test.SimpleRequest request, + default void safeCall(io.grpc.testing.compiler.Test.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSafeCallMethod(), responseObserver); } @@ -403,79 +403,34 @@ public final class TestServiceGrpc { * A unary call that is Idempotent. * */ - public void idempotentCall(io.grpc.testing.compiler.Test.SimpleRequest request, + default void idempotentCall(io.grpc.testing.compiler.Test.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getIdempotentCallMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service TestService. + *
+   * Test service that supports all call types.
+   * 
+ */ + public static abstract class TestServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getUnaryCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.SimpleRequest, - io.grpc.testing.compiler.Test.SimpleResponse>( - this, METHODID_UNARY_CALL))) - .addMethod( - getStreamingOutputCallMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingOutputCallRequest, - io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( - this, METHODID_STREAMING_OUTPUT_CALL))) - .addMethod( - getStreamingInputCallMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingInputCallRequest, - io.grpc.testing.compiler.Test.StreamingInputCallResponse>( - this, METHODID_STREAMING_INPUT_CALL))) - .addMethod( - getFullBidiCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingOutputCallRequest, - io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( - this, METHODID_FULL_BIDI_CALL))) - .addMethod( - getHalfBidiCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingOutputCallRequest, - io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( - this, METHODID_HALF_BIDI_CALL))) - .addMethod( - getImportMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingInputCallRequest, - io.grpc.testing.compiler.Test.StreamingInputCallResponse>( - this, METHODID_IMPORT))) - .addMethod( - getSafeCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.SimpleRequest, - io.grpc.testing.compiler.Test.SimpleResponse>( - this, METHODID_SAFE_CALL))) - .addMethod( - getIdempotentCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.SimpleRequest, - io.grpc.testing.compiler.Test.SimpleResponse>( - this, METHODID_IDEMPOTENT_CALL))) - .build(); + return TestServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service TestService. *
    * Test service that supports all call types.
    * 
*/ - public static final class TestServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class TestServiceStub + extends io.grpc.stub.AbstractAsyncStub { private TestServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -586,11 +541,13 @@ public final class TestServiceGrpc { } /** + * A stub to allow clients to do synchronous rpc calls to service TestService. *
    * Test service that supports all call types.
    * 
*/ - public static final class TestServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class TestServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private TestServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -647,11 +604,13 @@ public final class TestServiceGrpc { } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service TestService. *
    * Test service that supports all call types.
    * 
*/ - public static final class TestServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class TestServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private TestServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -712,10 +671,10 @@ public final class TestServiceGrpc { io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final TestServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(TestServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -768,6 +727,67 @@ public final class TestServiceGrpc { } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getUnaryCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.SimpleRequest, + io.grpc.testing.compiler.Test.SimpleResponse>( + service, METHODID_UNARY_CALL))) + .addMethod( + getStreamingOutputCallMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingOutputCallRequest, + io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( + service, METHODID_STREAMING_OUTPUT_CALL))) + .addMethod( + getStreamingInputCallMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingInputCallRequest, + io.grpc.testing.compiler.Test.StreamingInputCallResponse>( + service, METHODID_STREAMING_INPUT_CALL))) + .addMethod( + getFullBidiCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingOutputCallRequest, + io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( + service, METHODID_FULL_BIDI_CALL))) + .addMethod( + getHalfBidiCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingOutputCallRequest, + io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( + service, METHODID_HALF_BIDI_CALL))) + .addMethod( + getImportMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingInputCallRequest, + io.grpc.testing.compiler.Test.StreamingInputCallResponse>( + service, METHODID_IMPORT))) + .addMethod( + getSafeCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.SimpleRequest, + io.grpc.testing.compiler.Test.SimpleResponse>( + service, METHODID_SAFE_CALL))) + .addMethod( + getIdempotentCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.SimpleRequest, + io.grpc.testing.compiler.Test.SimpleResponse>( + service, METHODID_IDEMPOTENT_CALL))) + .build(); + } + private static abstract class TestServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { TestServiceBaseDescriptorSupplier() {} diff --git a/compiler/src/testLite/golden/TestDeprecatedService.java.txt b/compiler/src/testLite/golden/TestDeprecatedService.java.txt index de01872438e..9dde1617896 100644 --- a/compiler/src/testLite/golden/TestDeprecatedService.java.txt +++ b/compiler/src/testLite/golden/TestDeprecatedService.java.txt @@ -99,7 +99,7 @@ public final class TestDeprecatedServiceGrpc { * */ @java.lang.Deprecated - public static abstract class TestDeprecatedServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -107,31 +107,36 @@ public final class TestDeprecatedServiceGrpc {
      * 
*/ @java.lang.Deprecated - public void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request, + default void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeprecatedMethodMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service TestDeprecatedService. + *
+   * Test service that has been deprecated and should generate with Java's @Deprecated annotation
+   * 
+ */ + @java.lang.Deprecated + public static abstract class TestDeprecatedServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getDeprecatedMethodMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.SimpleRequest, - io.grpc.testing.compiler.Test.SimpleResponse>( - this, METHODID_DEPRECATED_METHOD))) - .build(); + return TestDeprecatedServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service TestDeprecatedService. *
    * Test service that has been deprecated and should generate with Java's @Deprecated annotation
    * 
*/ @java.lang.Deprecated - public static final class TestDeprecatedServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class TestDeprecatedServiceStub + extends io.grpc.stub.AbstractAsyncStub { private TestDeprecatedServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -157,12 +162,14 @@ public final class TestDeprecatedServiceGrpc { } /** + * A stub to allow clients to do synchronous rpc calls to service TestDeprecatedService. *
    * Test service that has been deprecated and should generate with Java's @Deprecated annotation
    * 
*/ @java.lang.Deprecated - public static final class TestDeprecatedServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class TestDeprecatedServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private TestDeprecatedServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -187,12 +194,14 @@ public final class TestDeprecatedServiceGrpc { } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service TestDeprecatedService. *
    * Test service that has been deprecated and should generate with Java's @Deprecated annotation
    * 
*/ @java.lang.Deprecated - public static final class TestDeprecatedServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class TestDeprecatedServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private TestDeprecatedServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -224,10 +233,10 @@ public final class TestDeprecatedServiceGrpc { io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final TestDeprecatedServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(TestDeprecatedServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -256,6 +265,18 @@ public final class TestDeprecatedServiceGrpc { } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeprecatedMethodMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.SimpleRequest, + io.grpc.testing.compiler.Test.SimpleResponse>( + service, METHODID_DEPRECATED_METHOD))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/compiler/src/testLite/golden/TestService.java.txt b/compiler/src/testLite/golden/TestService.java.txt index 3c2ab7c4515..412a2fcbfb0 100644 --- a/compiler/src/testLite/golden/TestService.java.txt +++ b/compiler/src/testLite/golden/TestService.java.txt @@ -309,7 +309,7 @@ public final class TestServiceGrpc { * Test service that supports all call types. * */ - public static abstract class TestServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -317,7 +317,7 @@ public final class TestServiceGrpc {
      * The server returns the client payload as-is.
      * 
*/ - public void unaryCall(io.grpc.testing.compiler.Test.SimpleRequest request, + default void unaryCall(io.grpc.testing.compiler.Test.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnaryCallMethod(), responseObserver); } @@ -328,7 +328,7 @@ public final class TestServiceGrpc { * The server returns the payload with client desired type and sizes. * */ - public void streamingOutputCall(io.grpc.testing.compiler.Test.StreamingOutputCallRequest request, + default void streamingOutputCall(io.grpc.testing.compiler.Test.StreamingOutputCallRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamingOutputCallMethod(), responseObserver); } @@ -339,7 +339,7 @@ public final class TestServiceGrpc { * The server returns the aggregated size of client payload as the result. * */ - public io.grpc.stub.StreamObserver streamingInputCall( + default io.grpc.stub.StreamObserver streamingInputCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingInputCallMethod(), responseObserver); } @@ -351,7 +351,7 @@ public final class TestServiceGrpc { * demonstrates the idea of full bidirectionality. * */ - public io.grpc.stub.StreamObserver fullBidiCall( + default io.grpc.stub.StreamObserver fullBidiCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getFullBidiCallMethod(), responseObserver); } @@ -364,7 +364,7 @@ public final class TestServiceGrpc { * first request. * */ - public io.grpc.stub.StreamObserver halfBidiCall( + default io.grpc.stub.StreamObserver halfBidiCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getHalfBidiCallMethod(), responseObserver); } @@ -375,7 +375,7 @@ public final class TestServiceGrpc { * method should have a '_' appended. * */ - public io.grpc.stub.StreamObserver import_( + default io.grpc.stub.StreamObserver import_( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getImportMethod(), responseObserver); } @@ -385,7 +385,7 @@ public final class TestServiceGrpc { * A unary call that is Safe. * */ - public void safeCall(io.grpc.testing.compiler.Test.SimpleRequest request, + default void safeCall(io.grpc.testing.compiler.Test.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSafeCallMethod(), responseObserver); } @@ -395,79 +395,34 @@ public final class TestServiceGrpc { * A unary call that is Idempotent. * */ - public void idempotentCall(io.grpc.testing.compiler.Test.SimpleRequest request, + default void idempotentCall(io.grpc.testing.compiler.Test.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getIdempotentCallMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service TestService. + *
+   * Test service that supports all call types.
+   * 
+ */ + public static abstract class TestServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getUnaryCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.SimpleRequest, - io.grpc.testing.compiler.Test.SimpleResponse>( - this, METHODID_UNARY_CALL))) - .addMethod( - getStreamingOutputCallMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingOutputCallRequest, - io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( - this, METHODID_STREAMING_OUTPUT_CALL))) - .addMethod( - getStreamingInputCallMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingInputCallRequest, - io.grpc.testing.compiler.Test.StreamingInputCallResponse>( - this, METHODID_STREAMING_INPUT_CALL))) - .addMethod( - getFullBidiCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingOutputCallRequest, - io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( - this, METHODID_FULL_BIDI_CALL))) - .addMethod( - getHalfBidiCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingOutputCallRequest, - io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( - this, METHODID_HALF_BIDI_CALL))) - .addMethod( - getImportMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.StreamingInputCallRequest, - io.grpc.testing.compiler.Test.StreamingInputCallResponse>( - this, METHODID_IMPORT))) - .addMethod( - getSafeCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.SimpleRequest, - io.grpc.testing.compiler.Test.SimpleResponse>( - this, METHODID_SAFE_CALL))) - .addMethod( - getIdempotentCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.compiler.Test.SimpleRequest, - io.grpc.testing.compiler.Test.SimpleResponse>( - this, METHODID_IDEMPOTENT_CALL))) - .build(); + return TestServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service TestService. *
    * Test service that supports all call types.
    * 
*/ - public static final class TestServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class TestServiceStub + extends io.grpc.stub.AbstractAsyncStub { private TestServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -578,11 +533,13 @@ public final class TestServiceGrpc { } /** + * A stub to allow clients to do synchronous rpc calls to service TestService. *
    * Test service that supports all call types.
    * 
*/ - public static final class TestServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class TestServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private TestServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -639,11 +596,13 @@ public final class TestServiceGrpc { } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service TestService. *
    * Test service that supports all call types.
    * 
*/ - public static final class TestServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class TestServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private TestServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -704,10 +663,10 @@ public final class TestServiceGrpc { io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final TestServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(TestServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -760,6 +719,67 @@ public final class TestServiceGrpc { } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getUnaryCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.SimpleRequest, + io.grpc.testing.compiler.Test.SimpleResponse>( + service, METHODID_UNARY_CALL))) + .addMethod( + getStreamingOutputCallMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingOutputCallRequest, + io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( + service, METHODID_STREAMING_OUTPUT_CALL))) + .addMethod( + getStreamingInputCallMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingInputCallRequest, + io.grpc.testing.compiler.Test.StreamingInputCallResponse>( + service, METHODID_STREAMING_INPUT_CALL))) + .addMethod( + getFullBidiCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingOutputCallRequest, + io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( + service, METHODID_FULL_BIDI_CALL))) + .addMethod( + getHalfBidiCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingOutputCallRequest, + io.grpc.testing.compiler.Test.StreamingOutputCallResponse>( + service, METHODID_HALF_BIDI_CALL))) + .addMethod( + getImportMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.StreamingInputCallRequest, + io.grpc.testing.compiler.Test.StreamingInputCallResponse>( + service, METHODID_IMPORT))) + .addMethod( + getSafeCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.SimpleRequest, + io.grpc.testing.compiler.Test.SimpleResponse>( + service, METHODID_SAFE_CALL))) + .addMethod( + getIdempotentCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.compiler.Test.SimpleRequest, + io.grpc.testing.compiler.Test.SimpleResponse>( + service, METHODID_IDEMPOTENT_CALL))) + .build(); + } + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { diff --git a/examples/example-gauth/pom.xml b/examples/example-gauth/pom.xml index 8795c2a38fc..f1c494d1e98 100644 --- a/examples/example-gauth/pom.xml +++ b/examples/example-gauth/pom.xml @@ -15,8 +15,8 @@ 1.54.0-SNAPSHOT 3.21.7 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/examples/example-hostname/pom.xml b/examples/example-hostname/pom.xml index 12f4dc0c63f..8030fa5a884 100644 --- a/examples/example-hostname/pom.xml +++ b/examples/example-hostname/pom.xml @@ -15,8 +15,8 @@ 1.54.0-SNAPSHOT 3.21.7 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/examples/example-jwt-auth/pom.xml b/examples/example-jwt-auth/pom.xml index 8d7a62ac180..d29b553fdf1 100644 --- a/examples/example-jwt-auth/pom.xml +++ b/examples/example-jwt-auth/pom.xml @@ -17,8 +17,8 @@ 3.21.7 3.21.7 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/examples/example-tls/pom.xml b/examples/example-tls/pom.xml index cd744a636cf..351f5876a8f 100644 --- a/examples/example-tls/pom.xml +++ b/examples/example-tls/pom.xml @@ -16,8 +16,8 @@ 3.21.7 2.0.56.Final - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/grpclb/src/generated/main/grpc/io/grpc/lb/v1/LoadBalancerGrpc.java b/grpclb/src/generated/main/grpc/io/grpc/lb/v1/LoadBalancerGrpc.java index ec56d9b6bfe..0415195bc3e 100644 --- a/grpclb/src/generated/main/grpc/io/grpc/lb/v1/LoadBalancerGrpc.java +++ b/grpclb/src/generated/main/grpc/io/grpc/lb/v1/LoadBalancerGrpc.java @@ -92,34 +92,35 @@ public LoadBalancerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptio /** */ - public static abstract class LoadBalancerImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Bidirectional rpc to get a list of servers.
      * 
*/ - public io.grpc.stub.StreamObserver balanceLoad( + default io.grpc.stub.StreamObserver balanceLoad( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getBalanceLoadMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service LoadBalancer. + */ + public static abstract class LoadBalancerImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getBalanceLoadMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.lb.v1.LoadBalanceRequest, - io.grpc.lb.v1.LoadBalanceResponse>( - this, METHODID_BALANCE_LOAD))) - .build(); + return LoadBalancerGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service LoadBalancer. */ - public static final class LoadBalancerStub extends io.grpc.stub.AbstractAsyncStub { + public static final class LoadBalancerStub + extends io.grpc.stub.AbstractAsyncStub { private LoadBalancerStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -144,8 +145,10 @@ public io.grpc.stub.StreamObserver balanceLoad } /** + * A stub to allow clients to do synchronous rpc calls to service LoadBalancer. */ - public static final class LoadBalancerBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class LoadBalancerBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private LoadBalancerBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -159,8 +162,10 @@ protected LoadBalancerBlockingStub build( } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service LoadBalancer. */ - public static final class LoadBalancerFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class LoadBalancerFutureStub + extends io.grpc.stub.AbstractFutureStub { private LoadBalancerFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -180,10 +185,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final LoadBalancerImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(LoadBalancerImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -211,6 +216,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getBalanceLoadMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.lb.v1.LoadBalanceRequest, + io.grpc.lb.v1.LoadBalanceResponse>( + service, METHODID_BALANCE_LOAD))) + .build(); + } + private static abstract class LoadBalancerBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { LoadBalancerBaseDescriptorSupplier() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java index 42db108ce7e..6cae73aa31c 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java @@ -129,14 +129,14 @@ public LoadBalancerStatsServiceFutureStub newStub(io.grpc.Channel channel, io.gr * A service used to obtain stats for verifying LB behavior. * */ - public static abstract class LoadBalancerStatsServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Gets the backend distribution for RPCs sent by a test client.
      * 
*/ - public void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request, + default void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStatsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClientStatsMethod(), responseObserver); } @@ -146,37 +146,34 @@ public void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStat * Gets the accumulated stats for RPCs sent by a test client. * */ - public void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request, + default void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClientAccumulatedStatsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service LoadBalancerStatsService. + *
+   * A service used to obtain stats for verifying LB behavior.
+   * 
+ */ + public static abstract class LoadBalancerStatsServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetClientStatsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.LoadBalancerStatsRequest, - io.grpc.testing.integration.Messages.LoadBalancerStatsResponse>( - this, METHODID_GET_CLIENT_STATS))) - .addMethod( - getGetClientAccumulatedStatsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest, - io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse>( - this, METHODID_GET_CLIENT_ACCUMULATED_STATS))) - .build(); + return LoadBalancerStatsServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service LoadBalancerStatsService. *
    * A service used to obtain stats for verifying LB behavior.
    * 
*/ - public static final class LoadBalancerStatsServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class LoadBalancerStatsServiceStub + extends io.grpc.stub.AbstractAsyncStub { private LoadBalancerStatsServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -212,11 +209,13 @@ public void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadB } /** + * A stub to allow clients to do synchronous rpc calls to service LoadBalancerStatsService. *
    * A service used to obtain stats for verifying LB behavior.
    * 
*/ - public static final class LoadBalancerStatsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class LoadBalancerStatsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private LoadBalancerStatsServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -250,11 +249,13 @@ public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service LoadBalancerStatsService. *
    * A service used to obtain stats for verifying LB behavior.
    * 
*/ - public static final class LoadBalancerStatsServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class LoadBalancerStatsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private LoadBalancerStatsServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -297,10 +298,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final LoadBalancerStatsServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(LoadBalancerStatsServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -333,6 +334,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetClientStatsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.LoadBalancerStatsRequest, + io.grpc.testing.integration.Messages.LoadBalancerStatsResponse>( + service, METHODID_GET_CLIENT_STATS))) + .addMethod( + getGetClientAccumulatedStatsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest, + io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse>( + service, METHODID_GET_CLIENT_ACCUMULATED_STATS))) + .build(); + } + private static abstract class LoadBalancerStatsServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { LoadBalancerStatsServiceBaseDescriptorSupplier() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java index 5cae4aa8183..c9e0251245f 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java @@ -123,7 +123,7 @@ public MetricsServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOpt /** */ - public static abstract class MetricsServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -131,7 +131,7 @@ public static abstract class MetricsServiceImplBase implements io.grpc.BindableS
      * the service
      * 
*/ - public void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage request, + default void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAllGaugesMethod(), responseObserver); } @@ -141,34 +141,28 @@ public void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage reques * Returns the value of one gauge * */ - public void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, + default void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetGaugeMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service MetricsService. + */ + public static abstract class MetricsServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetAllGaugesMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Metrics.EmptyMessage, - io.grpc.testing.integration.Metrics.GaugeResponse>( - this, METHODID_GET_ALL_GAUGES))) - .addMethod( - getGetGaugeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Metrics.GaugeRequest, - io.grpc.testing.integration.Metrics.GaugeResponse>( - this, METHODID_GET_GAUGE))) - .build(); + return MetricsServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service MetricsService. */ - public static final class MetricsServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class MetricsServiceStub + extends io.grpc.stub.AbstractAsyncStub { private MetricsServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -205,8 +199,10 @@ public void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service MetricsService. */ - public static final class MetricsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class MetricsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private MetricsServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -242,8 +238,10 @@ public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testin } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service MetricsService. */ - public static final class MetricsServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class MetricsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private MetricsServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -275,10 +273,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final MetricsServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(MetricsServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -311,6 +309,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetAllGaugesMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Metrics.EmptyMessage, + io.grpc.testing.integration.Metrics.GaugeResponse>( + service, METHODID_GET_ALL_GAUGES))) + .addMethod( + getGetGaugeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Metrics.GaugeRequest, + io.grpc.testing.integration.Metrics.GaugeResponse>( + service, METHODID_GET_GAUGE))) + .build(); + } + private static abstract class MetricsServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { MetricsServiceBaseDescriptorSupplier() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index be88c76b2fd..e79c42cb892 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -129,48 +129,45 @@ public ReconnectServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallO * A service used to control reconnect server. * */ - public static abstract class ReconnectServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void start(io.grpc.testing.integration.Messages.ReconnectParams request, + default void start(io.grpc.testing.integration.Messages.ReconnectParams request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartMethod(), responseObserver); } /** */ - public void stop(io.grpc.testing.integration.EmptyProtos.Empty request, + default void stop(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ReconnectService. + *
+   * A service used to control reconnect server.
+   * 
+ */ + public static abstract class ReconnectServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStartMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.ReconnectParams, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_START))) - .addMethod( - getStopMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.Messages.ReconnectInfo>( - this, METHODID_STOP))) - .build(); + return ReconnectServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ReconnectService. *
    * A service used to control reconnect server.
    * 
*/ - public static final class ReconnectServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ReconnectServiceStub + extends io.grpc.stub.AbstractAsyncStub { private ReconnectServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -200,11 +197,13 @@ public void stop(io.grpc.testing.integration.EmptyProtos.Empty request, } /** + * A stub to allow clients to do synchronous rpc calls to service ReconnectService. *
    * A service used to control reconnect server.
    * 
*/ - public static final class ReconnectServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ReconnectServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ReconnectServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -232,11 +231,13 @@ public io.grpc.testing.integration.Messages.ReconnectInfo stop(io.grpc.testing.i } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ReconnectService. *
    * A service used to control reconnect server.
    * 
*/ - public static final class ReconnectServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ReconnectServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ReconnectServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -273,10 +274,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ReconnectServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ReconnectServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -309,6 +310,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStartMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.ReconnectParams, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_START))) + .addMethod( + getStopMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.Messages.ReconnectInfo>( + service, METHODID_STOP))) + .build(); + } + private static abstract class ReconnectServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ReconnectServiceBaseDescriptorSupplier() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java index a380a5b6303..35ab8d72ed2 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -317,14 +317,14 @@ public TestServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOption * performance with various types of payload. * */ - public static abstract class TestServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * One empty request followed by one empty response.
      * 
*/ - public void emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request, + default void emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEmptyCallMethod(), responseObserver); } @@ -334,7 +334,7 @@ public void emptyCall(io.grpc.testing.integration.EmptyProtos.Empty request, * One request followed by one response. * */ - public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, + default void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnaryCallMethod(), responseObserver); } @@ -346,7 +346,7 @@ public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request * satisfy subsequent requests. * */ - public void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, + default void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCacheableUnaryCallMethod(), responseObserver); } @@ -357,7 +357,7 @@ public void cacheableUnaryCall(io.grpc.testing.integration.Messages.SimpleReques * The server returns the payload with client desired type and sizes. * */ - public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request, + default void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamingOutputCallMethod(), responseObserver); } @@ -368,7 +368,7 @@ public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOu * The server returns the aggregated size of client payload as the result. * */ - public io.grpc.stub.StreamObserver streamingInputCall( + default io.grpc.stub.StreamObserver streamingInputCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingInputCallMethod(), responseObserver); } @@ -380,7 +380,7 @@ public io.grpc.stub.StreamObserver */ - public io.grpc.stub.StreamObserver fullDuplexCall( + default io.grpc.stub.StreamObserver fullDuplexCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getFullDuplexCallMethod(), responseObserver); } @@ -393,7 +393,7 @@ public io.grpc.stub.StreamObserver */ - public io.grpc.stub.StreamObserver halfDuplexCall( + default io.grpc.stub.StreamObserver halfDuplexCall( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getHalfDuplexCallMethod(), responseObserver); } @@ -404,80 +404,36 @@ public io.grpc.stub.StreamObserver */ - public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, + default void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnimplementedCallMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service TestService. + *
+   * A simple service to test the various types of RPCs and experiment with
+   * performance with various types of payload.
+   * 
+ */ + public static abstract class TestServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getEmptyCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_EMPTY_CALL))) - .addMethod( - getUnaryCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.SimpleRequest, - io.grpc.testing.integration.Messages.SimpleResponse>( - this, METHODID_UNARY_CALL))) - .addMethod( - getCacheableUnaryCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.SimpleRequest, - io.grpc.testing.integration.Messages.SimpleResponse>( - this, METHODID_CACHEABLE_UNARY_CALL))) - .addMethod( - getStreamingOutputCallMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingOutputCallRequest, - io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( - this, METHODID_STREAMING_OUTPUT_CALL))) - .addMethod( - getStreamingInputCallMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingInputCallRequest, - io.grpc.testing.integration.Messages.StreamingInputCallResponse>( - this, METHODID_STREAMING_INPUT_CALL))) - .addMethod( - getFullDuplexCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingOutputCallRequest, - io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( - this, METHODID_FULL_DUPLEX_CALL))) - .addMethod( - getHalfDuplexCallMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.StreamingOutputCallRequest, - io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( - this, METHODID_HALF_DUPLEX_CALL))) - .addMethod( - getUnimplementedCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_UNIMPLEMENTED_CALL))) - .build(); + return TestServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service TestService. *
    * A simple service to test the various types of RPCs and experiment with
    * performance with various types of payload.
    * 
*/ - public static final class TestServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class TestServiceStub + extends io.grpc.stub.AbstractAsyncStub { private TestServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -589,12 +545,14 @@ public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty requ } /** + * A stub to allow clients to do synchronous rpc calls to service TestService. *
    * A simple service to test the various types of RPCs and experiment with
    * performance with various types of payload.
    * 
*/ - public static final class TestServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class TestServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private TestServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -663,12 +621,14 @@ public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.t } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service TestService. *
    * A simple service to test the various types of RPCs and experiment with
    * performance with various types of payload.
    * 
*/ - public static final class TestServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class TestServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private TestServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -742,10 +702,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final TestServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(TestServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -799,6 +759,67 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getEmptyCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_EMPTY_CALL))) + .addMethod( + getUnaryCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.SimpleRequest, + io.grpc.testing.integration.Messages.SimpleResponse>( + service, METHODID_UNARY_CALL))) + .addMethod( + getCacheableUnaryCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.SimpleRequest, + io.grpc.testing.integration.Messages.SimpleResponse>( + service, METHODID_CACHEABLE_UNARY_CALL))) + .addMethod( + getStreamingOutputCallMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingOutputCallRequest, + io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( + service, METHODID_STREAMING_OUTPUT_CALL))) + .addMethod( + getStreamingInputCallMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingInputCallRequest, + io.grpc.testing.integration.Messages.StreamingInputCallResponse>( + service, METHODID_STREAMING_INPUT_CALL))) + .addMethod( + getFullDuplexCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingOutputCallRequest, + io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( + service, METHODID_FULL_DUPLEX_CALL))) + .addMethod( + getHalfDuplexCallMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.StreamingOutputCallRequest, + io.grpc.testing.integration.Messages.StreamingOutputCallResponse>( + service, METHODID_HALF_DUPLEX_CALL))) + .addMethod( + getUnimplementedCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_UNIMPLEMENTED_CALL))) + .build(); + } + private static abstract class TestServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { TestServiceBaseDescriptorSupplier() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index d8e680cdf0a..d906409ea6e 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -100,38 +100,43 @@ public UnimplementedServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.C * that case. * */ - public static abstract class UnimplementedServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * A call that no server should implement
      * 
*/ - public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, + default void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnimplementedCallMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service UnimplementedService. + *
+   * A simple service NOT implemented at servers so clients can test for
+   * that case.
+   * 
+ */ + public static abstract class UnimplementedServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getUnimplementedCallMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_UNIMPLEMENTED_CALL))) - .build(); + return UnimplementedServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service UnimplementedService. *
    * A simple service NOT implemented at servers so clients can test for
    * that case.
    * 
*/ - public static final class UnimplementedServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class UnimplementedServiceStub + extends io.grpc.stub.AbstractAsyncStub { private UnimplementedServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -156,12 +161,14 @@ public void unimplementedCall(io.grpc.testing.integration.EmptyProtos.Empty requ } /** + * A stub to allow clients to do synchronous rpc calls to service UnimplementedService. *
    * A simple service NOT implemented at servers so clients can test for
    * that case.
    * 
*/ - public static final class UnimplementedServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class UnimplementedServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private UnimplementedServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -185,12 +192,14 @@ public io.grpc.testing.integration.EmptyProtos.Empty unimplementedCall(io.grpc.t } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service UnimplementedService. *
    * A simple service NOT implemented at servers so clients can test for
    * that case.
    * 
*/ - public static final class UnimplementedServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class UnimplementedServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private UnimplementedServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -221,10 +230,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final UnimplementedServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(UnimplementedServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -253,6 +262,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getUnimplementedCallMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_UNIMPLEMENTED_CALL))) + .build(); + } + private static abstract class UnimplementedServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { UnimplementedServiceBaseDescriptorSupplier() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java index 14e77497b64..f4c1c5dbf3a 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java @@ -98,37 +98,41 @@ public XdsUpdateClientConfigureServiceFutureStub newStub(io.grpc.Channel channel * A service to dynamically update the configuration of an xDS test client. * */ - public static abstract class XdsUpdateClientConfigureServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Update the tes client's configuration.
      * 
*/ - public void configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request, + default void configure(io.grpc.testing.integration.Messages.ClientConfigureRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getConfigureMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service XdsUpdateClientConfigureService. + *
+   * A service to dynamically update the configuration of an xDS test client.
+   * 
+ */ + public static abstract class XdsUpdateClientConfigureServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getConfigureMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.Messages.ClientConfigureRequest, - io.grpc.testing.integration.Messages.ClientConfigureResponse>( - this, METHODID_CONFIGURE))) - .build(); + return XdsUpdateClientConfigureServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service XdsUpdateClientConfigureService. *
    * A service to dynamically update the configuration of an xDS test client.
    * 
*/ - public static final class XdsUpdateClientConfigureServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class XdsUpdateClientConfigureServiceStub + extends io.grpc.stub.AbstractAsyncStub { private XdsUpdateClientConfigureServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -153,11 +157,13 @@ public void configure(io.grpc.testing.integration.Messages.ClientConfigureReques } /** + * A stub to allow clients to do synchronous rpc calls to service XdsUpdateClientConfigureService. *
    * A service to dynamically update the configuration of an xDS test client.
    * 
*/ - public static final class XdsUpdateClientConfigureServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class XdsUpdateClientConfigureServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private XdsUpdateClientConfigureServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -181,11 +187,13 @@ public io.grpc.testing.integration.Messages.ClientConfigureResponse configure(io } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service XdsUpdateClientConfigureService. *
    * A service to dynamically update the configuration of an xDS test client.
    * 
*/ - public static final class XdsUpdateClientConfigureServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class XdsUpdateClientConfigureServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private XdsUpdateClientConfigureServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -216,10 +224,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final XdsUpdateClientConfigureServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(XdsUpdateClientConfigureServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -248,6 +256,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getConfigureMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.Messages.ClientConfigureRequest, + io.grpc.testing.integration.Messages.ClientConfigureResponse>( + service, METHODID_CONFIGURE))) + .build(); + } + private static abstract class XdsUpdateClientConfigureServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { XdsUpdateClientConfigureServiceBaseDescriptorSupplier() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java index 946a3825bb1..3fab6b23592 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java @@ -129,48 +129,45 @@ public XdsUpdateHealthServiceFutureStub newStub(io.grpc.Channel channel, io.grpc * A service to remotely control health status of an xDS test server. * */ - public static abstract class XdsUpdateHealthServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void setServing(io.grpc.testing.integration.EmptyProtos.Empty request, + default void setServing(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetServingMethod(), responseObserver); } /** */ - public void setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request, + default void setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetNotServingMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service XdsUpdateHealthService. + *
+   * A service to remotely control health status of an xDS test server.
+   * 
+ */ + public static abstract class XdsUpdateHealthServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getSetServingMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_SET_SERVING))) - .addMethod( - getSetNotServingMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.integration.EmptyProtos.Empty, - io.grpc.testing.integration.EmptyProtos.Empty>( - this, METHODID_SET_NOT_SERVING))) - .build(); + return XdsUpdateHealthServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service XdsUpdateHealthService. *
    * A service to remotely control health status of an xDS test server.
    * 
*/ - public static final class XdsUpdateHealthServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class XdsUpdateHealthServiceStub + extends io.grpc.stub.AbstractAsyncStub { private XdsUpdateHealthServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -200,11 +197,13 @@ public void setNotServing(io.grpc.testing.integration.EmptyProtos.Empty request, } /** + * A stub to allow clients to do synchronous rpc calls to service XdsUpdateHealthService. *
    * A service to remotely control health status of an xDS test server.
    * 
*/ - public static final class XdsUpdateHealthServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class XdsUpdateHealthServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private XdsUpdateHealthServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -232,11 +231,13 @@ public io.grpc.testing.integration.EmptyProtos.Empty setNotServing(io.grpc.testi } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service XdsUpdateHealthService. *
    * A service to remotely control health status of an xDS test server.
    * 
*/ - public static final class XdsUpdateHealthServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class XdsUpdateHealthServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private XdsUpdateHealthServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -273,10 +274,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final XdsUpdateHealthServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(XdsUpdateHealthServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -309,6 +310,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSetServingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_SET_SERVING))) + .addMethod( + getSetNotServingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.integration.EmptyProtos.Empty, + io.grpc.testing.integration.EmptyProtos.Empty>( + service, METHODID_SET_NOT_SERVING))) + .build(); + } + private static abstract class XdsUpdateHealthServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { XdsUpdateHealthServiceBaseDescriptorSupplier() {} diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java index ea77f13892a..8fa272122d0 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java @@ -40,6 +40,7 @@ import io.grpc.testing.integration.Messages.StreamingOutputCallRequest; import io.grpc.testing.integration.Messages.StreamingOutputCallResponse; import io.grpc.testing.integration.Messages.TestOrcaReport; +import io.grpc.testing.integration.TestServiceGrpc.AsyncService; import java.util.ArrayDeque; import java.util.Arrays; import java.util.HashMap; @@ -59,7 +60,7 @@ * Implementation of the business logic for the TestService. Uses an executor to schedule chunks * sent in response streams. */ -public class TestServiceImpl extends TestServiceGrpc.TestServiceImplBase { +public class TestServiceImpl implements io.grpc.BindableService, AsyncService { private final Random random = new Random(); private final ScheduledExecutorService executor; @@ -80,6 +81,11 @@ public TestServiceImpl(ScheduledExecutorService executor) { this(executor, MetricRecorder.newInstance()); } + @Override + public final io.grpc.ServerServiceDefinition bindService() { + return TestServiceGrpc.bindService(this); + } + @Override public void emptyCall(EmptyProtos.Empty request, StreamObserver responseObserver) { @@ -419,7 +425,6 @@ private void scheduleNextChunk() { // TODO(ejona): cancel future if RPC is cancelled Future unused = executor.schedule(new LogExceptionRunnable(dispatchTask), nextChunk.delayMicroseconds, TimeUnit.MICROSECONDS); - return; } } } diff --git a/istio-interop-testing/src/generated/main/grpc/io/istio/test/EchoTestServiceGrpc.java b/istio-interop-testing/src/generated/main/grpc/io/istio/test/EchoTestServiceGrpc.java index 1c71469e01a..8134aee8809 100644 --- a/istio-interop-testing/src/generated/main/grpc/io/istio/test/EchoTestServiceGrpc.java +++ b/istio-interop-testing/src/generated/main/grpc/io/istio/test/EchoTestServiceGrpc.java @@ -123,45 +123,39 @@ public EchoTestServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOp /** */ - public static abstract class EchoTestServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void echo(io.istio.test.Echo.EchoRequest request, + default void echo(io.istio.test.Echo.EchoRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEchoMethod(), responseObserver); } /** */ - public void forwardEcho(io.istio.test.Echo.ForwardEchoRequest request, + default void forwardEcho(io.istio.test.Echo.ForwardEchoRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getForwardEchoMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service EchoTestService. + */ + public static abstract class EchoTestServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getEchoMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.istio.test.Echo.EchoRequest, - io.istio.test.Echo.EchoResponse>( - this, METHODID_ECHO))) - .addMethod( - getForwardEchoMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.istio.test.Echo.ForwardEchoRequest, - io.istio.test.Echo.ForwardEchoResponse>( - this, METHODID_FORWARD_ECHO))) - .build(); + return EchoTestServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service EchoTestService. */ - public static final class EchoTestServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class EchoTestServiceStub + extends io.grpc.stub.AbstractAsyncStub { private EchoTestServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -191,8 +185,10 @@ public void forwardEcho(io.istio.test.Echo.ForwardEchoRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service EchoTestService. */ - public static final class EchoTestServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class EchoTestServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private EchoTestServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -220,8 +216,10 @@ public io.istio.test.Echo.ForwardEchoResponse forwardEcho(io.istio.test.Echo.For } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service EchoTestService. */ - public static final class EchoTestServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class EchoTestServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private EchoTestServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -258,10 +256,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final EchoTestServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(EchoTestServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -294,6 +292,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getEchoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.istio.test.Echo.EchoRequest, + io.istio.test.Echo.EchoResponse>( + service, METHODID_ECHO))) + .addMethod( + getForwardEchoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.istio.test.Echo.ForwardEchoRequest, + io.istio.test.Echo.ForwardEchoResponse>( + service, METHODID_FORWARD_ECHO))) + .build(); + } + private static abstract class EchoTestServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { EchoTestServiceBaseDescriptorSupplier() {} diff --git a/rls/src/generated/main/grpc/io/grpc/lookup/v1/RouteLookupServiceGrpc.java b/rls/src/generated/main/grpc/io/grpc/lookup/v1/RouteLookupServiceGrpc.java index f1d8ce817a3..07a0e3ebdc8 100644 --- a/rls/src/generated/main/grpc/io/grpc/lookup/v1/RouteLookupServiceGrpc.java +++ b/rls/src/generated/main/grpc/io/grpc/lookup/v1/RouteLookupServiceGrpc.java @@ -92,34 +92,35 @@ public RouteLookupServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.Cal /** */ - public static abstract class RouteLookupServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Lookup returns a target for a single key.
      * 
*/ - public void routeLookup(io.grpc.lookup.v1.RouteLookupRequest request, + default void routeLookup(io.grpc.lookup.v1.RouteLookupRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRouteLookupMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service RouteLookupService. + */ + public static abstract class RouteLookupServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getRouteLookupMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.lookup.v1.RouteLookupRequest, - io.grpc.lookup.v1.RouteLookupResponse>( - this, METHODID_ROUTE_LOOKUP))) - .build(); + return RouteLookupServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service RouteLookupService. */ - public static final class RouteLookupServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class RouteLookupServiceStub + extends io.grpc.stub.AbstractAsyncStub { private RouteLookupServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -144,8 +145,10 @@ public void routeLookup(io.grpc.lookup.v1.RouteLookupRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service RouteLookupService. */ - public static final class RouteLookupServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class RouteLookupServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private RouteLookupServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -169,8 +172,10 @@ public io.grpc.lookup.v1.RouteLookupResponse routeLookup(io.grpc.lookup.v1.Route } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service RouteLookupService. */ - public static final class RouteLookupServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class RouteLookupServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private RouteLookupServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -201,10 +206,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final RouteLookupServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(RouteLookupServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -233,6 +238,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getRouteLookupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.lookup.v1.RouteLookupRequest, + io.grpc.lookup.v1.RouteLookupResponse>( + service, METHODID_ROUTE_LOOKUP))) + .build(); + } + private static abstract class RouteLookupServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { RouteLookupServiceBaseDescriptorSupplier() {} diff --git a/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java b/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java index e9753907e63..1b85f675676 100644 --- a/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/channelz/v1/ChannelzGrpc.java @@ -286,7 +286,7 @@ public ChannelzFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions c * information. * */ - public static abstract class ChannelzImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -294,7 +294,7 @@ public static abstract class ChannelzImplBase implements io.grpc.BindableService
      * created). This does not include subchannels nor non-top level channels.
      * 
*/ - public void getTopChannels(io.grpc.channelz.v1.GetTopChannelsRequest request, + default void getTopChannels(io.grpc.channelz.v1.GetTopChannelsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTopChannelsMethod(), responseObserver); } @@ -304,7 +304,7 @@ public void getTopChannels(io.grpc.channelz.v1.GetTopChannelsRequest request, * Gets all servers that exist in the process. * */ - public void getServers(io.grpc.channelz.v1.GetServersRequest request, + default void getServers(io.grpc.channelz.v1.GetServersRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetServersMethod(), responseObserver); } @@ -314,7 +314,7 @@ public void getServers(io.grpc.channelz.v1.GetServersRequest request, * Returns a single Server, or else a NOT_FOUND code. * */ - public void getServer(io.grpc.channelz.v1.GetServerRequest request, + default void getServer(io.grpc.channelz.v1.GetServerRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetServerMethod(), responseObserver); } @@ -324,7 +324,7 @@ public void getServer(io.grpc.channelz.v1.GetServerRequest request, * Gets all server sockets that exist in the process. * */ - public void getServerSockets(io.grpc.channelz.v1.GetServerSocketsRequest request, + default void getServerSockets(io.grpc.channelz.v1.GetServerSocketsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetServerSocketsMethod(), responseObserver); } @@ -334,7 +334,7 @@ public void getServerSockets(io.grpc.channelz.v1.GetServerSocketsRequest request * Returns a single Channel, or else a NOT_FOUND code. * */ - public void getChannel(io.grpc.channelz.v1.GetChannelRequest request, + default void getChannel(io.grpc.channelz.v1.GetChannelRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetChannelMethod(), responseObserver); } @@ -344,7 +344,7 @@ public void getChannel(io.grpc.channelz.v1.GetChannelRequest request, * Returns a single Subchannel, or else a NOT_FOUND code. * */ - public void getSubchannel(io.grpc.channelz.v1.GetSubchannelRequest request, + default void getSubchannel(io.grpc.channelz.v1.GetSubchannelRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSubchannelMethod(), responseObserver); } @@ -354,73 +354,36 @@ public void getSubchannel(io.grpc.channelz.v1.GetSubchannelRequest request, * Returns a single Socket or else a NOT_FOUND code. * */ - public void getSocket(io.grpc.channelz.v1.GetSocketRequest request, + default void getSocket(io.grpc.channelz.v1.GetSocketRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSocketMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Channelz. + *
+   * Channelz is a service exposed by gRPC servers that provides detailed debug
+   * information.
+   * 
+ */ + public static abstract class ChannelzImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetTopChannelsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.channelz.v1.GetTopChannelsRequest, - io.grpc.channelz.v1.GetTopChannelsResponse>( - this, METHODID_GET_TOP_CHANNELS))) - .addMethod( - getGetServersMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.channelz.v1.GetServersRequest, - io.grpc.channelz.v1.GetServersResponse>( - this, METHODID_GET_SERVERS))) - .addMethod( - getGetServerMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.channelz.v1.GetServerRequest, - io.grpc.channelz.v1.GetServerResponse>( - this, METHODID_GET_SERVER))) - .addMethod( - getGetServerSocketsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.channelz.v1.GetServerSocketsRequest, - io.grpc.channelz.v1.GetServerSocketsResponse>( - this, METHODID_GET_SERVER_SOCKETS))) - .addMethod( - getGetChannelMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.channelz.v1.GetChannelRequest, - io.grpc.channelz.v1.GetChannelResponse>( - this, METHODID_GET_CHANNEL))) - .addMethod( - getGetSubchannelMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.channelz.v1.GetSubchannelRequest, - io.grpc.channelz.v1.GetSubchannelResponse>( - this, METHODID_GET_SUBCHANNEL))) - .addMethod( - getGetSocketMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.channelz.v1.GetSocketRequest, - io.grpc.channelz.v1.GetSocketResponse>( - this, METHODID_GET_SOCKET))) - .build(); + return ChannelzGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service Channelz. *
    * Channelz is a service exposed by gRPC servers that provides detailed debug
    * information.
    * 
*/ - public static final class ChannelzStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ChannelzStub + extends io.grpc.stub.AbstractAsyncStub { private ChannelzStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -512,12 +475,14 @@ public void getSocket(io.grpc.channelz.v1.GetSocketRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service Channelz. *
    * Channelz is a service exposed by gRPC servers that provides detailed debug
    * information.
    * 
*/ - public static final class ChannelzBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ChannelzBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ChannelzBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -602,12 +567,14 @@ public io.grpc.channelz.v1.GetSocketResponse getSocket(io.grpc.channelz.v1.GetSo } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Channelz. *
    * Channelz is a service exposed by gRPC servers that provides detailed debug
    * information.
    * 
*/ - public static final class ChannelzFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ChannelzFutureStub + extends io.grpc.stub.AbstractFutureStub { private ChannelzFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -711,10 +678,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ChannelzImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ChannelzImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -767,6 +734,60 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetTopChannelsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.channelz.v1.GetTopChannelsRequest, + io.grpc.channelz.v1.GetTopChannelsResponse>( + service, METHODID_GET_TOP_CHANNELS))) + .addMethod( + getGetServersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.channelz.v1.GetServersRequest, + io.grpc.channelz.v1.GetServersResponse>( + service, METHODID_GET_SERVERS))) + .addMethod( + getGetServerMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.channelz.v1.GetServerRequest, + io.grpc.channelz.v1.GetServerResponse>( + service, METHODID_GET_SERVER))) + .addMethod( + getGetServerSocketsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.channelz.v1.GetServerSocketsRequest, + io.grpc.channelz.v1.GetServerSocketsResponse>( + service, METHODID_GET_SERVER_SOCKETS))) + .addMethod( + getGetChannelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.channelz.v1.GetChannelRequest, + io.grpc.channelz.v1.GetChannelResponse>( + service, METHODID_GET_CHANNEL))) + .addMethod( + getGetSubchannelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.channelz.v1.GetSubchannelRequest, + io.grpc.channelz.v1.GetSubchannelResponse>( + service, METHODID_GET_SUBCHANNEL))) + .addMethod( + getGetSocketMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.channelz.v1.GetSocketRequest, + io.grpc.channelz.v1.GetSocketResponse>( + service, METHODID_GET_SOCKET))) + .build(); + } + private static abstract class ChannelzBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ChannelzBaseDescriptorSupplier() {} diff --git a/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java b/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java index 7943efb4672..31bf9f0e20f 100644 --- a/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/health/v1/HealthGrpc.java @@ -123,7 +123,7 @@ public HealthFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions cal /** */ - public static abstract class HealthImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -131,7 +131,7 @@ public static abstract class HealthImplBase implements io.grpc.BindableService {
      * NOT_FOUND.
      * 
*/ - public void check(io.grpc.health.v1.HealthCheckRequest request, + default void check(io.grpc.health.v1.HealthCheckRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCheckMethod(), responseObserver); } @@ -153,34 +153,28 @@ public void check(io.grpc.health.v1.HealthCheckRequest request, * clients should retry the call with appropriate exponential backoff. * */ - public void watch(io.grpc.health.v1.HealthCheckRequest request, + default void watch(io.grpc.health.v1.HealthCheckRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWatchMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Health. + */ + public static abstract class HealthImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCheckMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.health.v1.HealthCheckRequest, - io.grpc.health.v1.HealthCheckResponse>( - this, METHODID_CHECK))) - .addMethod( - getWatchMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.health.v1.HealthCheckRequest, - io.grpc.health.v1.HealthCheckResponse>( - this, METHODID_WATCH))) - .build(); + return HealthGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service Health. */ - public static final class HealthStub extends io.grpc.stub.AbstractAsyncStub { + public static final class HealthStub + extends io.grpc.stub.AbstractAsyncStub { private HealthStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -229,8 +223,10 @@ public void watch(io.grpc.health.v1.HealthCheckRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service Health. */ - public static final class HealthBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class HealthBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private HealthBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -278,8 +274,10 @@ public java.util.Iterator watch( } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Health. */ - public static final class HealthFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class HealthFutureStub + extends io.grpc.stub.AbstractFutureStub { private HealthFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -312,10 +310,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final HealthImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(HealthImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -348,6 +346,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCheckMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.health.v1.HealthCheckRequest, + io.grpc.health.v1.HealthCheckResponse>( + service, METHODID_CHECK))) + .addMethod( + getWatchMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.health.v1.HealthCheckRequest, + io.grpc.health.v1.HealthCheckResponse>( + service, METHODID_WATCH))) + .build(); + } + private static abstract class HealthBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { HealthBaseDescriptorSupplier() {} diff --git a/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java b/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java index be933313bb0..ebe541e0e9b 100644 --- a/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java +++ b/services/src/generated/main/grpc/io/grpc/reflection/v1alpha/ServerReflectionGrpc.java @@ -92,7 +92,7 @@ public ServerReflectionFutureStub newStub(io.grpc.Channel channel, io.grpc.CallO /** */ - public static abstract class ServerReflectionImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -100,27 +100,28 @@ public static abstract class ServerReflectionImplBase implements io.grpc.Bindabl
      * all related requests go to a single server.
      * 
*/ - public io.grpc.stub.StreamObserver serverReflectionInfo( + default io.grpc.stub.StreamObserver serverReflectionInfo( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getServerReflectionInfoMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ServerReflection. + */ + public static abstract class ServerReflectionImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getServerReflectionInfoMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.reflection.v1alpha.ServerReflectionRequest, - io.grpc.reflection.v1alpha.ServerReflectionResponse>( - this, METHODID_SERVER_REFLECTION_INFO))) - .build(); + return ServerReflectionGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ServerReflection. */ - public static final class ServerReflectionStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ServerReflectionStub + extends io.grpc.stub.AbstractAsyncStub { private ServerReflectionStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -146,8 +147,10 @@ public io.grpc.stub.StreamObserver { + public static final class ServerReflectionBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ServerReflectionBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -161,8 +164,10 @@ protected ServerReflectionBlockingStub build( } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ServerReflection. */ - public static final class ServerReflectionFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ServerReflectionFutureStub + extends io.grpc.stub.AbstractFutureStub { private ServerReflectionFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -182,10 +187,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ServerReflectionImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ServerReflectionImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -213,6 +218,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getServerReflectionInfoMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.reflection.v1alpha.ServerReflectionRequest, + io.grpc.reflection.v1alpha.ServerReflectionResponse>( + service, METHODID_SERVER_REFLECTION_INFO))) + .build(); + } + private static abstract class ServerReflectionBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ServerReflectionBaseDescriptorSupplier() {} diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java index d4e910fd1a4..4e4c2fc517b 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherDynamicServiceGrpc.java @@ -98,37 +98,41 @@ public AnotherDynamicServiceFutureStub newStub(io.grpc.Channel channel, io.grpc. * AnotherDynamicService * */ - public static abstract class AnotherDynamicServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * A method
      * 
*/ - public void method(io.grpc.reflection.testing.DynamicRequest request, + default void method(io.grpc.reflection.testing.DynamicRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMethodMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service AnotherDynamicService. + *
+   * AnotherDynamicService
+   * 
+ */ + public static abstract class AnotherDynamicServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getMethodMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.reflection.testing.DynamicRequest, - io.grpc.reflection.testing.DynamicReply>( - this, METHODID_METHOD))) - .build(); + return AnotherDynamicServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service AnotherDynamicService. *
    * AnotherDynamicService
    * 
*/ - public static final class AnotherDynamicServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class AnotherDynamicServiceStub + extends io.grpc.stub.AbstractAsyncStub { private AnotherDynamicServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -153,11 +157,13 @@ public void method(io.grpc.reflection.testing.DynamicRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service AnotherDynamicService. *
    * AnotherDynamicService
    * 
*/ - public static final class AnotherDynamicServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class AnotherDynamicServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private AnotherDynamicServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -181,11 +187,13 @@ public io.grpc.reflection.testing.DynamicReply method(io.grpc.reflection.testing } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service AnotherDynamicService. *
    * AnotherDynamicService
    * 
*/ - public static final class AnotherDynamicServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class AnotherDynamicServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private AnotherDynamicServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -216,10 +224,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final AnotherDynamicServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(AnotherDynamicServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -248,6 +256,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getMethodMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.reflection.testing.DynamicRequest, + io.grpc.reflection.testing.DynamicReply>( + service, METHODID_METHOD))) + .build(); + } + private static abstract class AnotherDynamicServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { AnotherDynamicServiceBaseDescriptorSupplier() {} diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherReflectableServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherReflectableServiceGrpc.java index 6aee82f01ec..68d03ef4f69 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherReflectableServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/AnotherReflectableServiceGrpc.java @@ -92,31 +92,32 @@ public AnotherReflectableServiceFutureStub newStub(io.grpc.Channel channel, io.g /** */ - public static abstract class AnotherReflectableServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void method(io.grpc.reflection.testing.Request request, + default void method(io.grpc.reflection.testing.Request request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMethodMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service AnotherReflectableService. + */ + public static abstract class AnotherReflectableServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getMethodMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.reflection.testing.Request, - io.grpc.reflection.testing.Reply>( - this, METHODID_METHOD))) - .build(); + return AnotherReflectableServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service AnotherReflectableService. */ - public static final class AnotherReflectableServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class AnotherReflectableServiceStub + extends io.grpc.stub.AbstractAsyncStub { private AnotherReflectableServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -138,8 +139,10 @@ public void method(io.grpc.reflection.testing.Request request, } /** + * A stub to allow clients to do synchronous rpc calls to service AnotherReflectableService. */ - public static final class AnotherReflectableServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class AnotherReflectableServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private AnotherReflectableServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -160,8 +163,10 @@ public io.grpc.reflection.testing.Reply method(io.grpc.reflection.testing.Reques } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service AnotherReflectableService. */ - public static final class AnotherReflectableServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class AnotherReflectableServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private AnotherReflectableServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -189,10 +194,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final AnotherReflectableServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(AnotherReflectableServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -221,6 +226,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getMethodMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.reflection.testing.Request, + io.grpc.reflection.testing.Reply>( + service, METHODID_METHOD))) + .build(); + } + private static abstract class AnotherReflectableServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { AnotherReflectableServiceBaseDescriptorSupplier() {} diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java index f53cf02de1c..3fbc30db9e5 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/DynamicServiceGrpc.java @@ -98,37 +98,41 @@ public DynamicServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOpt * A DynamicService * */ - public static abstract class DynamicServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * A method
      * 
*/ - public void method(io.grpc.reflection.testing.DynamicRequest request, + default void method(io.grpc.reflection.testing.DynamicRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMethodMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service DynamicService. + *
+   * A DynamicService
+   * 
+ */ + public static abstract class DynamicServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getMethodMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.reflection.testing.DynamicRequest, - io.grpc.reflection.testing.DynamicReply>( - this, METHODID_METHOD))) - .build(); + return DynamicServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service DynamicService. *
    * A DynamicService
    * 
*/ - public static final class DynamicServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class DynamicServiceStub + extends io.grpc.stub.AbstractAsyncStub { private DynamicServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -153,11 +157,13 @@ public void method(io.grpc.reflection.testing.DynamicRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service DynamicService. *
    * A DynamicService
    * 
*/ - public static final class DynamicServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class DynamicServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private DynamicServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -181,11 +187,13 @@ public io.grpc.reflection.testing.DynamicReply method(io.grpc.reflection.testing } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service DynamicService. *
    * A DynamicService
    * 
*/ - public static final class DynamicServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class DynamicServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private DynamicServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -216,10 +224,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final DynamicServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(DynamicServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -248,6 +256,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getMethodMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.reflection.testing.DynamicRequest, + io.grpc.reflection.testing.DynamicReply>( + service, METHODID_METHOD))) + .build(); + } + private static abstract class DynamicServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { DynamicServiceBaseDescriptorSupplier() {} diff --git a/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java b/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java index 9bdff6205f6..b8e17ccf054 100644 --- a/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java +++ b/services/src/generated/test/grpc/io/grpc/reflection/testing/ReflectableServiceGrpc.java @@ -92,31 +92,32 @@ public ReflectableServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.Cal /** */ - public static abstract class ReflectableServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void method(io.grpc.reflection.testing.Request request, + default void method(io.grpc.reflection.testing.Request request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMethodMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ReflectableService. + */ + public static abstract class ReflectableServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getMethodMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.reflection.testing.Request, - io.grpc.reflection.testing.Reply>( - this, METHODID_METHOD))) - .build(); + return ReflectableServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ReflectableService. */ - public static final class ReflectableServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ReflectableServiceStub + extends io.grpc.stub.AbstractAsyncStub { private ReflectableServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -138,8 +139,10 @@ public void method(io.grpc.reflection.testing.Request request, } /** + * A stub to allow clients to do synchronous rpc calls to service ReflectableService. */ - public static final class ReflectableServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ReflectableServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ReflectableServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -160,8 +163,10 @@ public io.grpc.reflection.testing.Reply method(io.grpc.reflection.testing.Reques } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ReflectableService. */ - public static final class ReflectableServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ReflectableServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ReflectableServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -189,10 +194,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ReflectableServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ReflectableServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -221,6 +226,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getMethodMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.reflection.testing.Request, + io.grpc.reflection.testing.Reply>( + service, METHODID_METHOD))) + .build(); + } + private static abstract class ReflectableServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ReflectableServiceBaseDescriptorSupplier() {} diff --git a/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java b/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java index e0aa8936e7b..3dc0e9d3c52 100644 --- a/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java +++ b/testing-proto/src/generated/main/grpc/io/grpc/testing/protobuf/SimpleServiceGrpc.java @@ -191,14 +191,14 @@ public SimpleServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOpti * A simple service for test. * */ - public static abstract class SimpleServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * Simple unary RPC.
      * 
*/ - public void unaryRpc(io.grpc.testing.protobuf.SimpleRequest request, + default void unaryRpc(io.grpc.testing.protobuf.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnaryRpcMethod(), responseObserver); } @@ -208,7 +208,7 @@ public void unaryRpc(io.grpc.testing.protobuf.SimpleRequest request, * Simple client-to-server streaming RPC. * */ - public io.grpc.stub.StreamObserver clientStreamingRpc( + default io.grpc.stub.StreamObserver clientStreamingRpc( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getClientStreamingRpcMethod(), responseObserver); } @@ -218,7 +218,7 @@ public io.grpc.stub.StreamObserver clien * Simple server-to-client streaming RPC. * */ - public void serverStreamingRpc(io.grpc.testing.protobuf.SimpleRequest request, + default void serverStreamingRpc(io.grpc.testing.protobuf.SimpleRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getServerStreamingRpcMethod(), responseObserver); } @@ -228,51 +228,34 @@ public void serverStreamingRpc(io.grpc.testing.protobuf.SimpleRequest request, * Simple bidirectional streaming RPC. * */ - public io.grpc.stub.StreamObserver bidiStreamingRpc( + default io.grpc.stub.StreamObserver bidiStreamingRpc( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getBidiStreamingRpcMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service SimpleService. + *
+   * A simple service for test.
+   * 
+ */ + public static abstract class SimpleServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getUnaryRpcMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.grpc.testing.protobuf.SimpleRequest, - io.grpc.testing.protobuf.SimpleResponse>( - this, METHODID_UNARY_RPC))) - .addMethod( - getClientStreamingRpcMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - io.grpc.testing.protobuf.SimpleRequest, - io.grpc.testing.protobuf.SimpleResponse>( - this, METHODID_CLIENT_STREAMING_RPC))) - .addMethod( - getServerStreamingRpcMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - io.grpc.testing.protobuf.SimpleRequest, - io.grpc.testing.protobuf.SimpleResponse>( - this, METHODID_SERVER_STREAMING_RPC))) - .addMethod( - getBidiStreamingRpcMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.grpc.testing.protobuf.SimpleRequest, - io.grpc.testing.protobuf.SimpleResponse>( - this, METHODID_BIDI_STREAMING_RPC))) - .build(); + return SimpleServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service SimpleService. *
    * A simple service for test.
    * 
*/ - public static final class SimpleServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class SimpleServiceStub + extends io.grpc.stub.AbstractAsyncStub { private SimpleServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -330,11 +313,13 @@ public io.grpc.stub.StreamObserver bidiS } /** + * A stub to allow clients to do synchronous rpc calls to service SimpleService. *
    * A simple service for test.
    * 
*/ - public static final class SimpleServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class SimpleServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private SimpleServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -369,11 +354,13 @@ public java.util.Iterator serverStreami } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SimpleService. *
    * A simple service for test.
    * 
*/ - public static final class SimpleServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class SimpleServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private SimpleServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -407,10 +394,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final SimpleServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(SimpleServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -449,6 +436,39 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getUnaryRpcMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.grpc.testing.protobuf.SimpleRequest, + io.grpc.testing.protobuf.SimpleResponse>( + service, METHODID_UNARY_RPC))) + .addMethod( + getClientStreamingRpcMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + io.grpc.testing.protobuf.SimpleRequest, + io.grpc.testing.protobuf.SimpleResponse>( + service, METHODID_CLIENT_STREAMING_RPC))) + .addMethod( + getServerStreamingRpcMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.grpc.testing.protobuf.SimpleRequest, + io.grpc.testing.protobuf.SimpleResponse>( + service, METHODID_SERVER_STREAMING_RPC))) + .addMethod( + getBidiStreamingRpcMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.grpc.testing.protobuf.SimpleRequest, + io.grpc.testing.protobuf.SimpleResponse>( + service, METHODID_BIDI_STREAMING_RPC))) + .build(); + } + private static abstract class SimpleServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { SimpleServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/com/github/xds/service/orca/v3/OpenRcaServiceGrpc.java b/xds/src/generated/thirdparty/grpc/com/github/xds/service/orca/v3/OpenRcaServiceGrpc.java index 52ec6898808..cf9725f107b 100644 --- a/xds/src/generated/thirdparty/grpc/com/github/xds/service/orca/v3/OpenRcaServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/com/github/xds/service/orca/v3/OpenRcaServiceGrpc.java @@ -112,29 +112,39 @@ public OpenRcaServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOpt * a new call to change backend reporting frequency. * */ - public static abstract class OpenRcaServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportRequest request, + default void streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamCoreMetricsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service OpenRcaService. + *
+   * Out-of-band (OOB) load reporting service for the additional load reporting
+   * agent that does not sit in the request path. Reports are periodically sampled
+   * with sufficient frequency to provide temporal association with requests.
+   * OOB reporting compensates the limitation of in-band reporting in revealing
+   * costs for backends that do not provide a steady stream of telemetry such as
+   * long running stream operations and zero QPS services. This is a server
+   * streaming service, client needs to terminate current RPC and initiate
+   * a new call to change backend reporting frequency.
+   * 
+ */ + public static abstract class OpenRcaServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamCoreMetricsMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - com.github.xds.service.orca.v3.OrcaLoadReportRequest, - com.github.xds.data.orca.v3.OrcaLoadReport>( - this, METHODID_STREAM_CORE_METRICS))) - .build(); + return OpenRcaServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service OpenRcaService. *
    * Out-of-band (OOB) load reporting service for the additional load reporting
    * agent that does not sit in the request path. Reports are periodically sampled
@@ -146,7 +156,8 @@ public void streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportReque
    * a new call to change backend reporting frequency.
    * 
*/ - public static final class OpenRcaServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class OpenRcaServiceStub + extends io.grpc.stub.AbstractAsyncStub { private OpenRcaServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -168,6 +179,7 @@ public void streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportReque } /** + * A stub to allow clients to do synchronous rpc calls to service OpenRcaService. *
    * Out-of-band (OOB) load reporting service for the additional load reporting
    * agent that does not sit in the request path. Reports are periodically sampled
@@ -179,7 +191,8 @@ public void streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportReque
    * a new call to change backend reporting frequency.
    * 
*/ - public static final class OpenRcaServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class OpenRcaServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private OpenRcaServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -201,6 +214,7 @@ public java.util.Iterator streamCore } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service OpenRcaService. *
    * Out-of-band (OOB) load reporting service for the additional load reporting
    * agent that does not sit in the request path. Reports are periodically sampled
@@ -212,7 +226,8 @@ public java.util.Iterator streamCore
    * a new call to change backend reporting frequency.
    * 
*/ - public static final class OpenRcaServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class OpenRcaServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private OpenRcaServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -232,10 +247,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final OpenRcaServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(OpenRcaServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -264,6 +279,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamCoreMetricsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.github.xds.service.orca.v3.OrcaLoadReportRequest, + com.github.xds.data.orca.v3.OrcaLoadReport>( + service, METHODID_STREAM_CORE_METRICS))) + .build(); + } + private static abstract class OpenRcaServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { OpenRcaServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ClusterDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ClusterDiscoveryServiceGrpc.java index fbf9034a2b0..602c455437f 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ClusterDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ClusterDiscoveryServiceGrpc.java @@ -160,62 +160,52 @@ public ClusterDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.grp * Return list of all clusters this proxy will load balance to. * */ - public static abstract class ClusterDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public io.grpc.stub.StreamObserver streamClusters( + default io.grpc.stub.StreamObserver streamClusters( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamClustersMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver deltaClusters( + default io.grpc.stub.StreamObserver deltaClusters( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDeltaClustersMethod(), responseObserver); } /** */ - public void fetchClusters(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, + default void fetchClusters(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFetchClustersMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ClusterDiscoveryService. + *
+   * Return list of all clusters this proxy will load balance to.
+   * 
+ */ + public static abstract class ClusterDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamClustersMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_STREAM_CLUSTERS))) - .addMethod( - getDeltaClustersMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, - io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( - this, METHODID_DELTA_CLUSTERS))) - .addMethod( - getFetchClustersMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_FETCH_CLUSTERS))) - .build(); + return ClusterDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ClusterDiscoveryService. *
    * Return list of all clusters this proxy will load balance to.
    * 
*/ - public static final class ClusterDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ClusterDiscoveryServiceStub + extends io.grpc.stub.AbstractAsyncStub { private ClusterDiscoveryServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -253,11 +243,13 @@ public void fetchClusters(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service ClusterDiscoveryService. *
    * Return list of all clusters this proxy will load balance to.
    * 
*/ - public static final class ClusterDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ClusterDiscoveryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ClusterDiscoveryServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -278,11 +270,13 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchClusters(io.envoyproxy. } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ClusterDiscoveryService. *
    * Return list of all clusters this proxy will load balance to.
    * 
*/ - public static final class ClusterDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ClusterDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ClusterDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -312,10 +306,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ClusterDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ClusterDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -350,6 +344,32 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamClustersMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_STREAM_CLUSTERS))) + .addMethod( + getDeltaClustersMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( + service, METHODID_DELTA_CLUSTERS))) + .addMethod( + getFetchClustersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_FETCH_CLUSTERS))) + .build(); + } + private static abstract class ClusterDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ClusterDiscoveryServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/EndpointDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/EndpointDiscoveryServiceGrpc.java index ef31f860220..c1c5f3e989a 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/EndpointDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/EndpointDiscoveryServiceGrpc.java @@ -154,7 +154,7 @@ public EndpointDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.gr /** */ - public static abstract class EndpointDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -162,55 +162,42 @@ public static abstract class EndpointDiscoveryServiceImplBase implements io.grpc
      * to subscribe to updates for.
      * 
*/ - public io.grpc.stub.StreamObserver streamEndpoints( + default io.grpc.stub.StreamObserver streamEndpoints( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamEndpointsMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver deltaEndpoints( + default io.grpc.stub.StreamObserver deltaEndpoints( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDeltaEndpointsMethod(), responseObserver); } /** */ - public void fetchEndpoints(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, + default void fetchEndpoints(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFetchEndpointsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service EndpointDiscoveryService. + */ + public static abstract class EndpointDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamEndpointsMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_STREAM_ENDPOINTS))) - .addMethod( - getDeltaEndpointsMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, - io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( - this, METHODID_DELTA_ENDPOINTS))) - .addMethod( - getFetchEndpointsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_FETCH_ENDPOINTS))) - .build(); + return EndpointDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service EndpointDiscoveryService. */ - public static final class EndpointDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class EndpointDiscoveryServiceStub + extends io.grpc.stub.AbstractAsyncStub { private EndpointDiscoveryServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -252,8 +239,10 @@ public void fetchEndpoints(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service EndpointDiscoveryService. */ - public static final class EndpointDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class EndpointDiscoveryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private EndpointDiscoveryServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -274,8 +263,10 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchEndpoints(io.envoyproxy } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service EndpointDiscoveryService. */ - public static final class EndpointDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class EndpointDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private EndpointDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -305,10 +296,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final EndpointDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(EndpointDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -343,6 +334,32 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamEndpointsMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_STREAM_ENDPOINTS))) + .addMethod( + getDeltaEndpointsMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( + service, METHODID_DELTA_ENDPOINTS))) + .addMethod( + getFetchEndpointsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_FETCH_ENDPOINTS))) + .build(); + } + private static abstract class EndpointDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { EndpointDiscoveryServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ListenerDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ListenerDiscoveryServiceGrpc.java index 1f68672c4d2..9e5cd92f0cd 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ListenerDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ListenerDiscoveryServiceGrpc.java @@ -166,57 +166,49 @@ public ListenerDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.gr * allowed to drain from listeners that are no longer present. * */ - public static abstract class ListenerDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public io.grpc.stub.StreamObserver deltaListeners( + default io.grpc.stub.StreamObserver deltaListeners( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDeltaListenersMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver streamListeners( + default io.grpc.stub.StreamObserver streamListeners( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamListenersMethod(), responseObserver); } /** */ - public void fetchListeners(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, + default void fetchListeners(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFetchListenersMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ListenerDiscoveryService. + *
+   * The Envoy instance initiates an RPC at startup to discover a list of
+   * listeners. Updates are delivered via streaming from the LDS server and
+   * consist of a complete update of all listeners. Existing connections will be
+   * allowed to drain from listeners that are no longer present.
+   * 
+ */ + public static abstract class ListenerDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getDeltaListenersMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, - io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( - this, METHODID_DELTA_LISTENERS))) - .addMethod( - getStreamListenersMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_STREAM_LISTENERS))) - .addMethod( - getFetchListenersMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_FETCH_LISTENERS))) - .build(); + return ListenerDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ListenerDiscoveryService. *
    * The Envoy instance initiates an RPC at startup to discover a list of
    * listeners. Updates are delivered via streaming from the LDS server and
@@ -224,7 +216,8 @@ public void fetchListeners(io.envoyproxy.envoy.api.v2.DiscoveryRequest request,
    * allowed to drain from listeners that are no longer present.
    * 
*/ - public static final class ListenerDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ListenerDiscoveryServiceStub + extends io.grpc.stub.AbstractAsyncStub { private ListenerDiscoveryServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -262,6 +255,7 @@ public void fetchListeners(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service ListenerDiscoveryService. *
    * The Envoy instance initiates an RPC at startup to discover a list of
    * listeners. Updates are delivered via streaming from the LDS server and
@@ -269,7 +263,8 @@ public void fetchListeners(io.envoyproxy.envoy.api.v2.DiscoveryRequest request,
    * allowed to drain from listeners that are no longer present.
    * 
*/ - public static final class ListenerDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ListenerDiscoveryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ListenerDiscoveryServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -290,6 +285,7 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchListeners(io.envoyproxy } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ListenerDiscoveryService. *
    * The Envoy instance initiates an RPC at startup to discover a list of
    * listeners. Updates are delivered via streaming from the LDS server and
@@ -297,7 +293,8 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchListeners(io.envoyproxy
    * allowed to drain from listeners that are no longer present.
    * 
*/ - public static final class ListenerDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ListenerDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ListenerDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -327,10 +324,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ListenerDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ListenerDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -365,6 +362,32 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeltaListenersMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( + service, METHODID_DELTA_LISTENERS))) + .addMethod( + getStreamListenersMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_STREAM_LISTENERS))) + .addMethod( + getFetchListenersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_FETCH_LISTENERS))) + .build(); + } + private static abstract class ListenerDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ListenerDiscoveryServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/RouteDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/RouteDiscoveryServiceGrpc.java index 9f83d7862a5..fe1991f4883 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/RouteDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/RouteDiscoveryServiceGrpc.java @@ -168,57 +168,50 @@ public RouteDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.grpc. * a route table via this identifier. * */ - public static abstract class RouteDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public io.grpc.stub.StreamObserver streamRoutes( + default io.grpc.stub.StreamObserver streamRoutes( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamRoutesMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver deltaRoutes( + default io.grpc.stub.StreamObserver deltaRoutes( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDeltaRoutesMethod(), responseObserver); } /** */ - public void fetchRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, + default void fetchRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFetchRoutesMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service RouteDiscoveryService. + *
+   * The resource_names field in DiscoveryRequest specifies a route configuration.
+   * This allows an Envoy configuration with multiple HTTP listeners (and
+   * associated HTTP connection manager filters) to use different route
+   * configurations. Each listener will bind its HTTP connection manager filter to
+   * a route table via this identifier.
+   * 
+ */ + public static abstract class RouteDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamRoutesMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_STREAM_ROUTES))) - .addMethod( - getDeltaRoutesMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, - io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( - this, METHODID_DELTA_ROUTES))) - .addMethod( - getFetchRoutesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_FETCH_ROUTES))) - .build(); + return RouteDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service RouteDiscoveryService. *
    * The resource_names field in DiscoveryRequest specifies a route configuration.
    * This allows an Envoy configuration with multiple HTTP listeners (and
@@ -227,7 +220,8 @@ public void fetchRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest request,
    * a route table via this identifier.
    * 
*/ - public static final class RouteDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class RouteDiscoveryServiceStub + extends io.grpc.stub.AbstractAsyncStub { private RouteDiscoveryServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -265,6 +259,7 @@ public void fetchRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service RouteDiscoveryService. *
    * The resource_names field in DiscoveryRequest specifies a route configuration.
    * This allows an Envoy configuration with multiple HTTP listeners (and
@@ -273,7 +268,8 @@ public void fetchRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest request,
    * a route table via this identifier.
    * 
*/ - public static final class RouteDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class RouteDiscoveryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private RouteDiscoveryServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -294,6 +290,7 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchRoutes(io.envoyproxy.en } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service RouteDiscoveryService. *
    * The resource_names field in DiscoveryRequest specifies a route configuration.
    * This allows an Envoy configuration with multiple HTTP listeners (and
@@ -302,7 +299,8 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchRoutes(io.envoyproxy.en
    * a route table via this identifier.
    * 
*/ - public static final class RouteDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class RouteDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private RouteDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -332,10 +330,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final RouteDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(RouteDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -370,6 +368,32 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamRoutesMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_STREAM_ROUTES))) + .addMethod( + getDeltaRoutesMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( + service, METHODID_DELTA_ROUTES))) + .addMethod( + getFetchRoutesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_FETCH_ROUTES))) + .build(); + } + private static abstract class RouteDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { RouteDiscoveryServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ScopedRoutesDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ScopedRoutesDiscoveryServiceGrpc.java index 5c3b36407c7..ec23ffe0129 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ScopedRoutesDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/ScopedRoutesDiscoveryServiceGrpc.java @@ -172,57 +172,52 @@ public ScopedRoutesDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, i * HTTP request. * */ - public static abstract class ScopedRoutesDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public io.grpc.stub.StreamObserver streamScopedRoutes( + default io.grpc.stub.StreamObserver streamScopedRoutes( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamScopedRoutesMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver deltaScopedRoutes( + default io.grpc.stub.StreamObserver deltaScopedRoutes( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDeltaScopedRoutesMethod(), responseObserver); } /** */ - public void fetchScopedRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, + default void fetchScopedRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFetchScopedRoutesMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ScopedRoutesDiscoveryService. + *
+   * The Scoped Routes Discovery Service (SRDS) API distributes
+   * :ref:`ScopedRouteConfiguration<envoy_api_msg.ScopedRouteConfiguration>`
+   * resources. Each ScopedRouteConfiguration resource represents a "routing
+   * scope" containing a mapping that allows the HTTP connection manager to
+   * dynamically assign a routing table (specified via a
+   * :ref:`RouteConfiguration<envoy_api_msg_RouteConfiguration>` message) to each
+   * HTTP request.
+   * 
+ */ + public static abstract class ScopedRoutesDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamScopedRoutesMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_STREAM_SCOPED_ROUTES))) - .addMethod( - getDeltaScopedRoutesMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, - io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( - this, METHODID_DELTA_SCOPED_ROUTES))) - .addMethod( - getFetchScopedRoutesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_FETCH_SCOPED_ROUTES))) - .build(); + return ScopedRoutesDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ScopedRoutesDiscoveryService. *
    * The Scoped Routes Discovery Service (SRDS) API distributes
    * :ref:`ScopedRouteConfiguration<envoy_api_msg.ScopedRouteConfiguration>`
@@ -233,7 +228,8 @@ public void fetchScopedRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest reques
    * HTTP request.
    * 
*/ - public static final class ScopedRoutesDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ScopedRoutesDiscoveryServiceStub + extends io.grpc.stub.AbstractAsyncStub { private ScopedRoutesDiscoveryServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -271,6 +267,7 @@ public void fetchScopedRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest reques } /** + * A stub to allow clients to do synchronous rpc calls to service ScopedRoutesDiscoveryService. *
    * The Scoped Routes Discovery Service (SRDS) API distributes
    * :ref:`ScopedRouteConfiguration<envoy_api_msg.ScopedRouteConfiguration>`
@@ -281,7 +278,8 @@ public void fetchScopedRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest reques
    * HTTP request.
    * 
*/ - public static final class ScopedRoutesDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ScopedRoutesDiscoveryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ScopedRoutesDiscoveryServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -302,6 +300,7 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchScopedRoutes(io.envoypr } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ScopedRoutesDiscoveryService. *
    * The Scoped Routes Discovery Service (SRDS) API distributes
    * :ref:`ScopedRouteConfiguration<envoy_api_msg.ScopedRouteConfiguration>`
@@ -312,7 +311,8 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchScopedRoutes(io.envoypr
    * HTTP request.
    * 
*/ - public static final class ScopedRoutesDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ScopedRoutesDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ScopedRoutesDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -342,10 +342,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ScopedRoutesDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ScopedRoutesDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -380,6 +380,32 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamScopedRoutesMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_STREAM_SCOPED_ROUTES))) + .addMethod( + getDeltaScopedRoutesMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( + service, METHODID_DELTA_SCOPED_ROUTES))) + .addMethod( + getFetchScopedRoutesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_FETCH_SCOPED_ROUTES))) + .build(); + } + private static abstract class ScopedRoutesDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ScopedRoutesDiscoveryServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/VirtualHostDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/VirtualHostDiscoveryServiceGrpc.java index 02ce1c0735a..45f0fed18fb 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/VirtualHostDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/api/v2/VirtualHostDiscoveryServiceGrpc.java @@ -116,29 +116,41 @@ public VirtualHostDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io * <xds_protocol_unsubscribe>` from the routing table associated with the RouteConfiguration. * */ - public static abstract class VirtualHostDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public io.grpc.stub.StreamObserver deltaVirtualHosts( + default io.grpc.stub.StreamObserver deltaVirtualHosts( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDeltaVirtualHostsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service VirtualHostDiscoveryService. + *
+   * Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
+   * a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggered
+   * during the processing of an HTTP request if a route for the request cannot be resolved. The
+   * :ref:`resource_names_subscribe <envoy_api_field_DeltaDiscoveryRequest.resource_names_subscribe>`
+   * field contains a list of virtual host names or aliases to track. The contents of an alias would
+   * be the contents of a *host* or *authority* header used to make an http request. An xDS server
+   * will match an alias to a virtual host based on the content of :ref:`domains'
+   * <envoy_api_field_route.VirtualHost.domains>` field. The *resource_names_unsubscribe* field
+   * contains a list of virtual host names that have been :ref:`unsubscribed
+   * <xds_protocol_unsubscribe>` from the routing table associated with the RouteConfiguration.
+   * 
+ */ + public static abstract class VirtualHostDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getDeltaVirtualHostsMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, - io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( - this, METHODID_DELTA_VIRTUAL_HOSTS))) - .build(); + return VirtualHostDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service VirtualHostDiscoveryService. *
    * Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
    * a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggered
@@ -152,7 +164,8 @@ public io.grpc.stub.StreamObserver
    */
-  public static final class VirtualHostDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub {
+  public static final class VirtualHostDiscoveryServiceStub
+      extends io.grpc.stub.AbstractAsyncStub {
     private VirtualHostDiscoveryServiceStub(
         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
       super(channel, callOptions);
@@ -174,6 +187,7 @@ public io.grpc.stub.StreamObserver
    * Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
    * a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggered
@@ -187,7 +201,8 @@ public io.grpc.stub.StreamObserver
    */
-  public static final class VirtualHostDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
+  public static final class VirtualHostDiscoveryServiceBlockingStub
+      extends io.grpc.stub.AbstractBlockingStub {
     private VirtualHostDiscoveryServiceBlockingStub(
         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
       super(channel, callOptions);
@@ -201,6 +216,7 @@ protected VirtualHostDiscoveryServiceBlockingStub build(
   }
 
   /**
+   * A stub to allow clients to do ListenableFuture-style rpc calls to service VirtualHostDiscoveryService.
    * 
    * Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
    * a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggered
@@ -214,7 +230,8 @@ protected VirtualHostDiscoveryServiceBlockingStub build(
    * <xds_protocol_unsubscribe>` from the routing table associated with the RouteConfiguration.
    * 
*/ - public static final class VirtualHostDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class VirtualHostDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private VirtualHostDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -234,10 +251,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final VirtualHostDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(VirtualHostDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -265,6 +282,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeltaVirtualHostsMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( + service, METHODID_DELTA_VIRTUAL_HOSTS))) + .build(); + } + private static abstract class VirtualHostDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { VirtualHostDiscoveryServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v2/AggregatedDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v2/AggregatedDiscoveryServiceGrpc.java index 971a9faf5cc..947b6795478 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v2/AggregatedDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v2/AggregatedDiscoveryServiceGrpc.java @@ -139,46 +139,47 @@ public AggregatedDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io. * the multiplexed singleton APIs at the Envoy instance and management server. *
*/ - public static abstract class AggregatedDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * This is a gRPC-only API.
      * 
*/ - public io.grpc.stub.StreamObserver streamAggregatedResources( + default io.grpc.stub.StreamObserver streamAggregatedResources( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamAggregatedResourcesMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver deltaAggregatedResources( + default io.grpc.stub.StreamObserver deltaAggregatedResources( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDeltaAggregatedResourcesMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service AggregatedDiscoveryService. + *
+   * See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
+   * ADS and how it is intended to be used by a management server. ADS requests
+   * have the same structure as their singleton xDS counterparts, but can
+   * multiplex many resource types on a single stream. The type_url in the
+   * DiscoveryRequest/DiscoveryResponse provides sufficient information to recover
+   * the multiplexed singleton APIs at the Envoy instance and management server.
+   * 
+ */ + public static abstract class AggregatedDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamAggregatedResourcesMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_STREAM_AGGREGATED_RESOURCES))) - .addMethod( - getDeltaAggregatedResourcesMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, - io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( - this, METHODID_DELTA_AGGREGATED_RESOURCES))) - .build(); + return AggregatedDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service AggregatedDiscoveryService. *
    * See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
    * ADS and how it is intended to be used by a management server. ADS requests
@@ -188,7 +189,8 @@ public io.grpc.stub.StreamObserver
    */
-  public static final class AggregatedDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub {
+  public static final class AggregatedDiscoveryServiceStub
+      extends io.grpc.stub.AbstractAsyncStub {
     private AggregatedDiscoveryServiceStub(
         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
       super(channel, callOptions);
@@ -221,6 +223,7 @@ public io.grpc.stub.StreamObserver
    * See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
    * ADS and how it is intended to be used by a management server. ADS requests
@@ -230,7 +233,8 @@ public io.grpc.stub.StreamObserver
    */
-  public static final class AggregatedDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
+  public static final class AggregatedDiscoveryServiceBlockingStub
+      extends io.grpc.stub.AbstractBlockingStub {
     private AggregatedDiscoveryServiceBlockingStub(
         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
       super(channel, callOptions);
@@ -244,6 +248,7 @@ protected AggregatedDiscoveryServiceBlockingStub build(
   }
 
   /**
+   * A stub to allow clients to do ListenableFuture-style rpc calls to service AggregatedDiscoveryService.
    * 
    * See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
    * ADS and how it is intended to be used by a management server. ADS requests
@@ -253,7 +258,8 @@ protected AggregatedDiscoveryServiceBlockingStub build(
    * the multiplexed singleton APIs at the Envoy instance and management server.
    * 
*/ - public static final class AggregatedDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class AggregatedDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private AggregatedDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -274,10 +280,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final AggregatedDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(AggregatedDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -308,6 +314,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamAggregatedResourcesMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_STREAM_AGGREGATED_RESOURCES))) + .addMethod( + getDeltaAggregatedResourcesMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( + service, METHODID_DELTA_AGGREGATED_RESOURCES))) + .build(); + } + private static abstract class AggregatedDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { AggregatedDiscoveryServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v2/SecretDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v2/SecretDiscoveryServiceGrpc.java index a5c41a905d8..b83bdf3eeb7 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v2/SecretDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v2/SecretDiscoveryServiceGrpc.java @@ -154,59 +154,46 @@ public SecretDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.grpc /** */ - public static abstract class SecretDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public io.grpc.stub.StreamObserver deltaSecrets( + default io.grpc.stub.StreamObserver deltaSecrets( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDeltaSecretsMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver streamSecrets( + default io.grpc.stub.StreamObserver streamSecrets( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamSecretsMethod(), responseObserver); } /** */ - public void fetchSecrets(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, + default void fetchSecrets(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFetchSecretsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service SecretDiscoveryService. + */ + public static abstract class SecretDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getDeltaSecretsMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, - io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( - this, METHODID_DELTA_SECRETS))) - .addMethod( - getStreamSecretsMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_STREAM_SECRETS))) - .addMethod( - getFetchSecretsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.api.v2.DiscoveryRequest, - io.envoyproxy.envoy.api.v2.DiscoveryResponse>( - this, METHODID_FETCH_SECRETS))) - .build(); + return SecretDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service SecretDiscoveryService. */ - public static final class SecretDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class SecretDiscoveryServiceStub + extends io.grpc.stub.AbstractAsyncStub { private SecretDiscoveryServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -244,8 +231,10 @@ public void fetchSecrets(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service SecretDiscoveryService. */ - public static final class SecretDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class SecretDiscoveryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private SecretDiscoveryServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -266,8 +255,10 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchSecrets(io.envoyproxy.e } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SecretDiscoveryService. */ - public static final class SecretDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class SecretDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private SecretDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -297,10 +288,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final SecretDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(SecretDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -335,6 +326,32 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeltaSecretsMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( + service, METHODID_DELTA_SECRETS))) + .addMethod( + getStreamSecretsMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_STREAM_SECRETS))) + .addMethod( + getFetchSecretsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + service, METHODID_FETCH_SECRETS))) + .build(); + } + private static abstract class SecretDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { SecretDiscoveryServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v3/AggregatedDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v3/AggregatedDiscoveryServiceGrpc.java index 0cb84f8d277..73070b21368 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v3/AggregatedDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/discovery/v3/AggregatedDiscoveryServiceGrpc.java @@ -139,46 +139,47 @@ public AggregatedDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io. * the multiplexed singleton APIs at the Envoy instance and management server. *
*/ - public static abstract class AggregatedDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
      * This is a gRPC-only API.
      * 
*/ - public io.grpc.stub.StreamObserver streamAggregatedResources( + default io.grpc.stub.StreamObserver streamAggregatedResources( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamAggregatedResourcesMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver deltaAggregatedResources( + default io.grpc.stub.StreamObserver deltaAggregatedResources( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDeltaAggregatedResourcesMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service AggregatedDiscoveryService. + *
+   * See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
+   * ADS and how it is intended to be used by a management server. ADS requests
+   * have the same structure as their singleton xDS counterparts, but can
+   * multiplex many resource types on a single stream. The type_url in the
+   * DiscoveryRequest/DiscoveryResponse provides sufficient information to recover
+   * the multiplexed singleton APIs at the Envoy instance and management server.
+   * 
+ */ + public static abstract class AggregatedDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamAggregatedResourcesMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_STREAM_AGGREGATED_RESOURCES))) - .addMethod( - getDeltaAggregatedResourcesMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryResponse>( - this, METHODID_DELTA_AGGREGATED_RESOURCES))) - .build(); + return AggregatedDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service AggregatedDiscoveryService. *
    * See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
    * ADS and how it is intended to be used by a management server. ADS requests
@@ -188,7 +189,8 @@ public io.grpc.stub.StreamObserver
    */
-  public static final class AggregatedDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub {
+  public static final class AggregatedDiscoveryServiceStub
+      extends io.grpc.stub.AbstractAsyncStub {
     private AggregatedDiscoveryServiceStub(
         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
       super(channel, callOptions);
@@ -221,6 +223,7 @@ public io.grpc.stub.StreamObserver
    * See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
    * ADS and how it is intended to be used by a management server. ADS requests
@@ -230,7 +233,8 @@ public io.grpc.stub.StreamObserver
    */
-  public static final class AggregatedDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
+  public static final class AggregatedDiscoveryServiceBlockingStub
+      extends io.grpc.stub.AbstractBlockingStub {
     private AggregatedDiscoveryServiceBlockingStub(
         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
       super(channel, callOptions);
@@ -244,6 +248,7 @@ protected AggregatedDiscoveryServiceBlockingStub build(
   }
 
   /**
+   * A stub to allow clients to do ListenableFuture-style rpc calls to service AggregatedDiscoveryService.
    * 
    * See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
    * ADS and how it is intended to be used by a management server. ADS requests
@@ -253,7 +258,8 @@ protected AggregatedDiscoveryServiceBlockingStub build(
    * the multiplexed singleton APIs at the Envoy instance and management server.
    * 
*/ - public static final class AggregatedDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class AggregatedDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private AggregatedDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -274,10 +280,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final AggregatedDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(AggregatedDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -308,6 +314,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamAggregatedResourcesMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, + io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( + service, METHODID_STREAM_AGGREGATED_RESOURCES))) + .addMethod( + getDeltaAggregatedResourcesMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest, + io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryResponse>( + service, METHODID_DELTA_AGGREGATED_RESOURCES))) + .build(); + } + private static abstract class AggregatedDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { AggregatedDiscoveryServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/load_stats/v2/LoadReportingServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/load_stats/v2/LoadReportingServiceGrpc.java index df19f5d066a..370c844f6e6 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/load_stats/v2/LoadReportingServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/load_stats/v2/LoadReportingServiceGrpc.java @@ -92,7 +92,7 @@ public LoadReportingServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.C /** */ - public static abstract class LoadReportingServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -125,27 +125,28 @@ public static abstract class LoadReportingServiceImplBase implements io.grpc.Bin
      *    assignment destined for each zone Envoys are located in. Goto 2.
      * 
*/ - public io.grpc.stub.StreamObserver streamLoadStats( + default io.grpc.stub.StreamObserver streamLoadStats( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamLoadStatsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service LoadReportingService. + */ + public static abstract class LoadReportingServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamLoadStatsMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.load_stats.v2.LoadStatsRequest, - io.envoyproxy.envoy.service.load_stats.v2.LoadStatsResponse>( - this, METHODID_STREAM_LOAD_STATS))) - .build(); + return LoadReportingServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service LoadReportingService. */ - public static final class LoadReportingServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class LoadReportingServiceStub + extends io.grpc.stub.AbstractAsyncStub { private LoadReportingServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -196,8 +197,10 @@ public io.grpc.stub.StreamObserver { + public static final class LoadReportingServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private LoadReportingServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -211,8 +214,10 @@ protected LoadReportingServiceBlockingStub build( } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service LoadReportingService. */ - public static final class LoadReportingServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class LoadReportingServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private LoadReportingServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -232,10 +237,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final LoadReportingServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(LoadReportingServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -263,6 +268,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamLoadStatsMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.service.load_stats.v2.LoadStatsRequest, + io.envoyproxy.envoy.service.load_stats.v2.LoadStatsResponse>( + service, METHODID_STREAM_LOAD_STATS))) + .build(); + } + private static abstract class LoadReportingServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { LoadReportingServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/load_stats/v3/LoadReportingServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/load_stats/v3/LoadReportingServiceGrpc.java index 80c7f910cee..be1c2ab7d4f 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/load_stats/v3/LoadReportingServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/load_stats/v3/LoadReportingServiceGrpc.java @@ -92,7 +92,7 @@ public LoadReportingServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.C /** */ - public static abstract class LoadReportingServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** *
@@ -125,27 +125,28 @@ public static abstract class LoadReportingServiceImplBase implements io.grpc.Bin
      *    assignment destined for each zone Envoys are located in. Goto 2.
      * 
*/ - public io.grpc.stub.StreamObserver streamLoadStats( + default io.grpc.stub.StreamObserver streamLoadStats( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamLoadStatsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service LoadReportingService. + */ + public static abstract class LoadReportingServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamLoadStatsMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.load_stats.v3.LoadStatsRequest, - io.envoyproxy.envoy.service.load_stats.v3.LoadStatsResponse>( - this, METHODID_STREAM_LOAD_STATS))) - .build(); + return LoadReportingServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service LoadReportingService. */ - public static final class LoadReportingServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class LoadReportingServiceStub + extends io.grpc.stub.AbstractAsyncStub { private LoadReportingServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -196,8 +197,10 @@ public io.grpc.stub.StreamObserver { + public static final class LoadReportingServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private LoadReportingServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -211,8 +214,10 @@ protected LoadReportingServiceBlockingStub build( } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service LoadReportingService. */ - public static final class LoadReportingServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class LoadReportingServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private LoadReportingServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -232,10 +237,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final LoadReportingServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(LoadReportingServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -263,6 +268,18 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamLoadStatsMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.service.load_stats.v3.LoadStatsRequest, + io.envoyproxy.envoy.service.load_stats.v3.LoadStatsResponse>( + service, METHODID_STREAM_LOAD_STATS))) + .build(); + } + private static abstract class LoadReportingServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { LoadReportingServiceBaseDescriptorSupplier() {} diff --git a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/status/v3/ClientStatusDiscoveryServiceGrpc.java b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/status/v3/ClientStatusDiscoveryServiceGrpc.java index 2b5bc69bae7..95fd294c1ab 100644 --- a/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/status/v3/ClientStatusDiscoveryServiceGrpc.java +++ b/xds/src/generated/thirdparty/grpc/io/envoyproxy/envoy/service/status/v3/ClientStatusDiscoveryServiceGrpc.java @@ -133,50 +133,49 @@ public ClientStatusDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, i * also be used to get the current xDS states directly from the client. *
*/ - public static abstract class ClientStatusDiscoveryServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public io.grpc.stub.StreamObserver streamClientStatus( + default io.grpc.stub.StreamObserver streamClientStatus( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamClientStatusMethod(), responseObserver); } /** */ - public void fetchClientStatus(io.envoyproxy.envoy.service.status.v3.ClientStatusRequest request, + default void fetchClientStatus(io.envoyproxy.envoy.service.status.v3.ClientStatusRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getFetchClientStatusMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service ClientStatusDiscoveryService. + *
+   * CSDS is Client Status Discovery Service. It can be used to get the status of
+   * an xDS-compliant client from the management server's point of view. It can
+   * also be used to get the current xDS states directly from the client.
+   * 
+ */ + public static abstract class ClientStatusDiscoveryServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamClientStatusMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.status.v3.ClientStatusRequest, - io.envoyproxy.envoy.service.status.v3.ClientStatusResponse>( - this, METHODID_STREAM_CLIENT_STATUS))) - .addMethod( - getFetchClientStatusMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.service.status.v3.ClientStatusRequest, - io.envoyproxy.envoy.service.status.v3.ClientStatusResponse>( - this, METHODID_FETCH_CLIENT_STATUS))) - .build(); + return ClientStatusDiscoveryServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service ClientStatusDiscoveryService. *
    * CSDS is Client Status Discovery Service. It can be used to get the status of
    * an xDS-compliant client from the management server's point of view. It can
    * also be used to get the current xDS states directly from the client.
    * 
*/ - public static final class ClientStatusDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ClientStatusDiscoveryServiceStub + extends io.grpc.stub.AbstractAsyncStub { private ClientStatusDiscoveryServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -206,13 +205,15 @@ public void fetchClientStatus(io.envoyproxy.envoy.service.status.v3.ClientStatus } /** + * A stub to allow clients to do synchronous rpc calls to service ClientStatusDiscoveryService. *
    * CSDS is Client Status Discovery Service. It can be used to get the status of
    * an xDS-compliant client from the management server's point of view. It can
    * also be used to get the current xDS states directly from the client.
    * 
*/ - public static final class ClientStatusDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ClientStatusDiscoveryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ClientStatusDiscoveryServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -233,13 +234,15 @@ public io.envoyproxy.envoy.service.status.v3.ClientStatusResponse fetchClientSta } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ClientStatusDiscoveryService. *
    * CSDS is Client Status Discovery Service. It can be used to get the status of
    * an xDS-compliant client from the management server's point of view. It can
    * also be used to get the current xDS states directly from the client.
    * 
*/ - public static final class ClientStatusDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ClientStatusDiscoveryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ClientStatusDiscoveryServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -268,10 +271,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ClientStatusDiscoveryServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ClientStatusDiscoveryServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -303,6 +306,25 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamClientStatusMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.service.status.v3.ClientStatusRequest, + io.envoyproxy.envoy.service.status.v3.ClientStatusResponse>( + service, METHODID_STREAM_CLIENT_STATUS))) + .addMethod( + getFetchClientStatusMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.envoyproxy.envoy.service.status.v3.ClientStatusRequest, + io.envoyproxy.envoy.service.status.v3.ClientStatusResponse>( + service, METHODID_FETCH_CLIENT_STATUS))) + .build(); + } + private static abstract class ClientStatusDiscoveryServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ClientStatusDiscoveryServiceBaseDescriptorSupplier() {}