From a93d63bf1a59cf9ae979d45792ad192d6538896c Mon Sep 17 00:00:00 2001 From: Deepankar Dixit <90280028+ddixit14@users.noreply.github.com> Date: Tue, 28 Mar 2023 18:00:54 +0000 Subject: [PATCH] chore: bumping grpc to 1.54.0 (#1570) --- gapic-generator-java-pom-parent/pom.xml | 2 +- gax-java/dependencies.properties | 2 +- .../showcase/v1beta1/ComplianceGrpc.java | 193 +++++++------ .../com/google/showcase/v1beta1/EchoGrpc.java | 177 ++++++------ .../google/showcase/v1beta1/IdentityGrpc.java | 113 ++++---- .../showcase/v1beta1/MessagingGrpc.java | 257 ++++++++++-------- .../showcase/v1beta1/SequenceServiceGrpc.java | 81 +++--- .../google/showcase/v1beta1/TestingGrpc.java | 161 ++++++----- 8 files changed, 544 insertions(+), 442 deletions(-) diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 82bb007741..efe1aaf567 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -26,7 +26,7 @@ 1.3.2 - 1.53.0 + 1.54.0 1.16.0 2.10.1 31.1-jre diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index a80fc797c9..be627a1db0 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -25,7 +25,7 @@ version.gax_httpjson=0.108.4-SNAPSHOT # with the sources. version.com_google_protobuf=3.21.10 version.google_java_format=1.15.0 -version.io_grpc=1.53.0 +version.io_grpc=1.54.0 # Maven artifacts. # Note, the actual name of each property matters (bazel build scripts depend on it). diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java index 31504f489d..7ae908a4af 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java @@ -371,157 +371,95 @@ public ComplianceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions /** */ - public static abstract class ComplianceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request, + default void repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyMethod(), responseObserver); } /** */ - public void repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request, + default void repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyInfoMethod(), responseObserver); } /** */ - public void repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request, + default void repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataQueryMethod(), responseObserver); } /** */ - public void repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request, + default void repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataSimplePathMethod(), responseObserver); } /** */ - public void repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request, + default void repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataPathResourceMethod(), responseObserver); } /** */ - public void repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request, + default void repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataPathTrailingResourceMethod(), responseObserver); } /** */ - public void repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request, + default void repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyPutMethod(), responseObserver); } /** */ - public void repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request, + default void repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyPatchMethod(), responseObserver); } /** */ - public void getEnum(com.google.showcase.v1beta1.EnumRequest request, + default void getEnum(com.google.showcase.v1beta1.EnumRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetEnumMethod(), responseObserver); } /** */ - public void verifyEnum(com.google.showcase.v1beta1.EnumResponse request, + default void verifyEnum(com.google.showcase.v1beta1.EnumResponse request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyEnumMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Compliance. + */ + public static abstract class ComplianceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getRepeatDataBodyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_BODY))) - .addMethod( - getRepeatDataBodyInfoMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_BODY_INFO))) - .addMethod( - getRepeatDataQueryMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_QUERY))) - .addMethod( - getRepeatDataSimplePathMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_SIMPLE_PATH))) - .addMethod( - getRepeatDataPathResourceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_PATH_RESOURCE))) - .addMethod( - getRepeatDataPathTrailingResourceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE))) - .addMethod( - getRepeatDataBodyPutMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_BODY_PUT))) - .addMethod( - getRepeatDataBodyPatchMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_BODY_PATCH))) - .addMethod( - getGetEnumMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.EnumRequest, - com.google.showcase.v1beta1.EnumResponse>( - this, METHODID_GET_ENUM))) - .addMethod( - getVerifyEnumMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.EnumResponse, - com.google.showcase.v1beta1.EnumResponse>( - this, METHODID_VERIFY_ENUM))) - .build(); + return ComplianceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service Compliance. */ - public static final class ComplianceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class ComplianceStub + extends io.grpc.stub.AbstractAsyncStub { private ComplianceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -615,8 +553,10 @@ public void verifyEnum(com.google.showcase.v1beta1.EnumResponse request, } /** + * A stub to allow clients to do synchronous rpc calls to service Compliance. */ - public static final class ComplianceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class ComplianceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private ComplianceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -700,8 +640,10 @@ public com.google.showcase.v1beta1.EnumResponse verifyEnum(com.google.showcase.v } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Compliance. */ - public static final class ComplianceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class ComplianceFutureStub + extends io.grpc.stub.AbstractFutureStub { private ComplianceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -810,10 +752,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ComplianceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(ComplianceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -878,6 +820,81 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getRepeatDataBodyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY))) + .addMethod( + getRepeatDataBodyInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_INFO))) + .addMethod( + getRepeatDataQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_QUERY))) + .addMethod( + getRepeatDataSimplePathMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_SIMPLE_PATH))) + .addMethod( + getRepeatDataPathResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_PATH_RESOURCE))) + .addMethod( + getRepeatDataPathTrailingResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE))) + .addMethod( + getRepeatDataBodyPutMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_PUT))) + .addMethod( + getRepeatDataBodyPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_PATCH))) + .addMethod( + getGetEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumResponse>( + service, METHODID_GET_ENUM))) + .addMethod( + getVerifyEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumResponse, + com.google.showcase.v1beta1.EnumResponse>( + service, METHODID_VERIFY_ENUM))) + .build(); + } + private static abstract class ComplianceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ComplianceBaseDescriptorSupplier() {} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java index fb0405e1ec..9c495e57f6 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java @@ -340,143 +340,88 @@ public EchoFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callO /** */ - public static abstract class EchoImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void echo(com.google.showcase.v1beta1.EchoRequest request, + default void echo(com.google.showcase.v1beta1.EchoRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEchoMethod(), responseObserver); } /** */ - public void expand(com.google.showcase.v1beta1.ExpandRequest request, + default void expand(com.google.showcase.v1beta1.ExpandRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExpandMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver collect( + default io.grpc.stub.StreamObserver collect( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getCollectMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver chat( + default io.grpc.stub.StreamObserver chat( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getChatMethod(), responseObserver); } /** */ - public void pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request, + default void pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPagedExpandMethod(), responseObserver); } /** */ - public void pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + default void pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPagedExpandLegacyMethod(), responseObserver); } /** */ - public void pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request, + default void pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPagedExpandLegacyMappedMethod(), responseObserver); } /** */ - public void wait(com.google.showcase.v1beta1.WaitRequest request, + default void wait(com.google.showcase.v1beta1.WaitRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWaitMethod(), responseObserver); } /** */ - public void block(com.google.showcase.v1beta1.BlockRequest request, + default void block(com.google.showcase.v1beta1.BlockRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getBlockMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Echo. + */ + public static abstract class EchoImplBase + 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< - com.google.showcase.v1beta1.EchoRequest, - com.google.showcase.v1beta1.EchoResponse>( - this, METHODID_ECHO))) - .addMethod( - getExpandMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.ExpandRequest, - com.google.showcase.v1beta1.EchoResponse>( - this, METHODID_EXPAND))) - .addMethod( - getCollectMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.EchoRequest, - com.google.showcase.v1beta1.EchoResponse>( - this, METHODID_COLLECT))) - .addMethod( - getChatMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.EchoRequest, - com.google.showcase.v1beta1.EchoResponse>( - this, METHODID_CHAT))) - .addMethod( - getPagedExpandMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.PagedExpandRequest, - com.google.showcase.v1beta1.PagedExpandResponse>( - this, METHODID_PAGED_EXPAND))) - .addMethod( - getPagedExpandLegacyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.PagedExpandLegacyRequest, - com.google.showcase.v1beta1.PagedExpandResponse>( - this, METHODID_PAGED_EXPAND_LEGACY))) - .addMethod( - getPagedExpandLegacyMappedMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.PagedExpandRequest, - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>( - this, METHODID_PAGED_EXPAND_LEGACY_MAPPED))) - .addMethod( - getWaitMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.WaitRequest, - com.google.longrunning.Operation>( - this, METHODID_WAIT))) - .addMethod( - getBlockMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.BlockRequest, - com.google.showcase.v1beta1.BlockResponse>( - this, METHODID_BLOCK))) - .build(); + return EchoGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service Echo. */ - public static final class EchoStub extends io.grpc.stub.AbstractAsyncStub { + public static final class EchoStub + extends io.grpc.stub.AbstractAsyncStub { private EchoStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -562,8 +507,10 @@ public void block(com.google.showcase.v1beta1.BlockRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service Echo. */ - public static final class EchoBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class EchoBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private EchoBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -627,8 +574,10 @@ public com.google.showcase.v1beta1.BlockResponse block(com.google.showcase.v1bet } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Echo. */ - public static final class EchoFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class EchoFutureStub + extends io.grpc.stub.AbstractFutureStub { private EchoFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -704,10 +653,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final EchoImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(EchoImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -766,6 +715,74 @@ 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< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>( + service, METHODID_ECHO))) + .addMethod( + getExpandMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ExpandRequest, + com.google.showcase.v1beta1.EchoResponse>( + service, METHODID_EXPAND))) + .addMethod( + getCollectMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>( + service, METHODID_COLLECT))) + .addMethod( + getChatMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>( + service, METHODID_CHAT))) + .addMethod( + getPagedExpandMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND))) + .addMethod( + getPagedExpandLegacyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND_LEGACY))) + .addMethod( + getPagedExpandLegacyMappedMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>( + service, METHODID_PAGED_EXPAND_LEGACY_MAPPED))) + .addMethod( + getWaitMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.WaitRequest, + com.google.longrunning.Operation>( + service, METHODID_WAIT))) + .addMethod( + getBlockMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.BlockRequest, + com.google.showcase.v1beta1.BlockResponse>( + service, METHODID_BLOCK))) + .build(); + } + private static abstract class EchoBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { EchoBaseDescriptorSupplier() {} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java index bcfa37a663..20af65d81c 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java @@ -216,87 +216,60 @@ public IdentityFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions c /** */ - public static abstract class IdentityImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void createUser(com.google.showcase.v1beta1.CreateUserRequest request, + default void createUser(com.google.showcase.v1beta1.CreateUserRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); } /** */ - public void getUser(com.google.showcase.v1beta1.GetUserRequest request, + default void getUser(com.google.showcase.v1beta1.GetUserRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); } /** */ - public void updateUser(com.google.showcase.v1beta1.UpdateUserRequest request, + default void updateUser(com.google.showcase.v1beta1.UpdateUserRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); } /** */ - public void deleteUser(com.google.showcase.v1beta1.DeleteUserRequest request, + default void deleteUser(com.google.showcase.v1beta1.DeleteUserRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); } /** */ - public void listUsers(com.google.showcase.v1beta1.ListUsersRequest request, + default void listUsers(com.google.showcase.v1beta1.ListUsersRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Identity. + */ + public static abstract class IdentityImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateUserMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateUserRequest, - com.google.showcase.v1beta1.User>( - this, METHODID_CREATE_USER))) - .addMethod( - getGetUserMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetUserRequest, - com.google.showcase.v1beta1.User>( - this, METHODID_GET_USER))) - .addMethod( - getUpdateUserMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.UpdateUserRequest, - com.google.showcase.v1beta1.User>( - this, METHODID_UPDATE_USER))) - .addMethod( - getDeleteUserMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteUserRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_USER))) - .addMethod( - getListUsersMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListUsersRequest, - com.google.showcase.v1beta1.ListUsersResponse>( - this, METHODID_LIST_USERS))) - .build(); + return IdentityGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service Identity. */ - public static final class IdentityStub extends io.grpc.stub.AbstractAsyncStub { + public static final class IdentityStub + extends io.grpc.stub.AbstractAsyncStub { private IdentityStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -350,8 +323,10 @@ public void listUsers(com.google.showcase.v1beta1.ListUsersRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service Identity. */ - public static final class IdentityBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class IdentityBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private IdentityBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -400,8 +375,10 @@ public com.google.showcase.v1beta1.ListUsersResponse listUsers(com.google.showca } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Identity. */ - public static final class IdentityFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class IdentityFutureStub + extends io.grpc.stub.AbstractFutureStub { private IdentityFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -465,10 +442,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final IdentityImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(IdentityImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -513,6 +490,46 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateUserRequest, + com.google.showcase.v1beta1.User>( + service, METHODID_CREATE_USER))) + .addMethod( + getGetUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetUserRequest, + com.google.showcase.v1beta1.User>( + service, METHODID_GET_USER))) + .addMethod( + getUpdateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateUserRequest, + com.google.showcase.v1beta1.User>( + service, METHODID_UPDATE_USER))) + .addMethod( + getDeleteUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteUserRequest, + com.google.protobuf.Empty>( + service, METHODID_DELETE_USER))) + .addMethod( + getListUsersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse>( + service, METHODID_LIST_USERS))) + .build(); + } + private static abstract class IdentityBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { IdentityBaseDescriptorSupplier() {} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java index 906dfe779e..c509c57d1a 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java @@ -495,213 +495,123 @@ public MessagingFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions /** */ - public static abstract class MessagingImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void createRoom(com.google.showcase.v1beta1.CreateRoomRequest request, + default void createRoom(com.google.showcase.v1beta1.CreateRoomRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateRoomMethod(), responseObserver); } /** */ - public void getRoom(com.google.showcase.v1beta1.GetRoomRequest request, + default void getRoom(com.google.showcase.v1beta1.GetRoomRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRoomMethod(), responseObserver); } /** */ - public void updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request, + default void updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateRoomMethod(), responseObserver); } /** */ - public void deleteRoom(com.google.showcase.v1beta1.DeleteRoomRequest request, + default void deleteRoom(com.google.showcase.v1beta1.DeleteRoomRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteRoomMethod(), responseObserver); } /** */ - public void listRooms(com.google.showcase.v1beta1.ListRoomsRequest request, + default void listRooms(com.google.showcase.v1beta1.ListRoomsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListRoomsMethod(), responseObserver); } /** */ - public void createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request, + default void createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateBlurbMethod(), responseObserver); } /** */ - public void getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request, + default void getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBlurbMethod(), responseObserver); } /** */ - public void updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request, + default void updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateBlurbMethod(), responseObserver); } /** */ - public void deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request, + default void deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteBlurbMethod(), responseObserver); } /** */ - public void listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request, + default void listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListBlurbsMethod(), responseObserver); } /** */ - public void searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request, + default void searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchBlurbsMethod(), responseObserver); } /** */ - public void streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request, + default void streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamBlurbsMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver sendBlurbs( + default io.grpc.stub.StreamObserver sendBlurbs( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSendBlurbsMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver connect( + default io.grpc.stub.StreamObserver connect( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getConnectMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Messaging. + */ + public static abstract class MessagingImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateRoomMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateRoomRequest, - com.google.showcase.v1beta1.Room>( - this, METHODID_CREATE_ROOM))) - .addMethod( - getGetRoomMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetRoomRequest, - com.google.showcase.v1beta1.Room>( - this, METHODID_GET_ROOM))) - .addMethod( - getUpdateRoomMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.UpdateRoomRequest, - com.google.showcase.v1beta1.Room>( - this, METHODID_UPDATE_ROOM))) - .addMethod( - getDeleteRoomMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteRoomRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_ROOM))) - .addMethod( - getListRoomsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListRoomsRequest, - com.google.showcase.v1beta1.ListRoomsResponse>( - this, METHODID_LIST_ROOMS))) - .addMethod( - getCreateBlurbMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateBlurbRequest, - com.google.showcase.v1beta1.Blurb>( - this, METHODID_CREATE_BLURB))) - .addMethod( - getGetBlurbMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetBlurbRequest, - com.google.showcase.v1beta1.Blurb>( - this, METHODID_GET_BLURB))) - .addMethod( - getUpdateBlurbMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.UpdateBlurbRequest, - com.google.showcase.v1beta1.Blurb>( - this, METHODID_UPDATE_BLURB))) - .addMethod( - getDeleteBlurbMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteBlurbRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_BLURB))) - .addMethod( - getListBlurbsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListBlurbsRequest, - com.google.showcase.v1beta1.ListBlurbsResponse>( - this, METHODID_LIST_BLURBS))) - .addMethod( - getSearchBlurbsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.SearchBlurbsRequest, - com.google.longrunning.Operation>( - this, METHODID_SEARCH_BLURBS))) - .addMethod( - getStreamBlurbsMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.StreamBlurbsRequest, - com.google.showcase.v1beta1.StreamBlurbsResponse>( - this, METHODID_STREAM_BLURBS))) - .addMethod( - getSendBlurbsMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateBlurbRequest, - com.google.showcase.v1beta1.SendBlurbsResponse>( - this, METHODID_SEND_BLURBS))) - .addMethod( - getConnectMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.ConnectRequest, - com.google.showcase.v1beta1.StreamBlurbsResponse>( - this, METHODID_CONNECT))) - .build(); + return MessagingGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service Messaging. */ - public static final class MessagingStub extends io.grpc.stub.AbstractAsyncStub { + public static final class MessagingStub + extends io.grpc.stub.AbstractAsyncStub { private MessagingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -827,8 +737,10 @@ public io.grpc.stub.StreamObserver c } /** + * A stub to allow clients to do synchronous rpc calls to service Messaging. */ - public static final class MessagingBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class MessagingBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private MessagingBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -927,8 +839,10 @@ public java.util.Iterator stre } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Messaging. */ - public static final class MessagingFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class MessagingFutureStub + extends io.grpc.stub.AbstractFutureStub { private MessagingFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -1049,10 +963,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final MessagingImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(MessagingImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -1131,6 +1045,109 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateRoomRequest, + com.google.showcase.v1beta1.Room>( + service, METHODID_CREATE_ROOM))) + .addMethod( + getGetRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetRoomRequest, + com.google.showcase.v1beta1.Room>( + service, METHODID_GET_ROOM))) + .addMethod( + getUpdateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateRoomRequest, + com.google.showcase.v1beta1.Room>( + service, METHODID_UPDATE_ROOM))) + .addMethod( + getDeleteRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteRoomRequest, + com.google.protobuf.Empty>( + service, METHODID_DELETE_ROOM))) + .addMethod( + getListRoomsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse>( + service, METHODID_LIST_ROOMS))) + .addMethod( + getCreateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.Blurb>( + service, METHODID_CREATE_BLURB))) + .addMethod( + getGetBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetBlurbRequest, + com.google.showcase.v1beta1.Blurb>( + service, METHODID_GET_BLURB))) + .addMethod( + getUpdateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateBlurbRequest, + com.google.showcase.v1beta1.Blurb>( + service, METHODID_UPDATE_BLURB))) + .addMethod( + getDeleteBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteBlurbRequest, + com.google.protobuf.Empty>( + service, METHODID_DELETE_BLURB))) + .addMethod( + getListBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse>( + service, METHODID_LIST_BLURBS))) + .addMethod( + getSearchBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.SearchBlurbsRequest, + com.google.longrunning.Operation>( + service, METHODID_SEARCH_BLURBS))) + .addMethod( + getStreamBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>( + service, METHODID_STREAM_BLURBS))) + .addMethod( + getSendBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse>( + service, METHODID_SEND_BLURBS))) + .addMethod( + getConnectMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>( + service, METHODID_CONNECT))) + .build(); + } + private static abstract class MessagingBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { MessagingBaseDescriptorSupplier() {} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java index 5c96630fef..a891daf387 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java @@ -154,59 +154,46 @@ public SequenceServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOp /** */ - public static abstract class SequenceServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request, + default void createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateSequenceMethod(), responseObserver); } /** */ - public void getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request, + default void getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSequenceReportMethod(), responseObserver); } /** */ - public void attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request, + default void attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getAttemptSequenceMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service SequenceService. + */ + public static abstract class SequenceServiceImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateSequenceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateSequenceRequest, - com.google.showcase.v1beta1.Sequence>( - this, METHODID_CREATE_SEQUENCE))) - .addMethod( - getGetSequenceReportMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetSequenceReportRequest, - com.google.showcase.v1beta1.SequenceReport>( - this, METHODID_GET_SEQUENCE_REPORT))) - .addMethod( - getAttemptSequenceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.AttemptSequenceRequest, - com.google.protobuf.Empty>( - this, METHODID_ATTEMPT_SEQUENCE))) - .build(); + return SequenceServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service SequenceService. */ - public static final class SequenceServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class SequenceServiceStub + extends io.grpc.stub.AbstractAsyncStub { private SequenceServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -244,8 +231,10 @@ public void attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest r } /** + * A stub to allow clients to do synchronous rpc calls to service SequenceService. */ - public static final class SequenceServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class SequenceServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private SequenceServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -280,8 +269,10 @@ public com.google.protobuf.Empty attemptSequence(com.google.showcase.v1beta1.Att } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SequenceService. */ - public static final class SequenceServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class SequenceServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { private SequenceServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -327,10 +318,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final SequenceServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(SequenceServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -367,6 +358,32 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSequenceRequest, + com.google.showcase.v1beta1.Sequence>( + service, METHODID_CREATE_SEQUENCE))) + .addMethod( + getGetSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport>( + service, METHODID_GET_SEQUENCE_REPORT))) + .addMethod( + getAttemptSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptSequenceRequest, + com.google.protobuf.Empty>( + service, METHODID_ATTEMPT_SEQUENCE))) + .build(); + } + private static abstract class SequenceServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { SequenceServiceBaseDescriptorSupplier() {} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java index e238c85867..642eed0b7b 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java @@ -309,129 +309,81 @@ public TestingFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions ca /** */ - public static abstract class TestingImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void createSession(com.google.showcase.v1beta1.CreateSessionRequest request, + default void createSession(com.google.showcase.v1beta1.CreateSessionRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateSessionMethod(), responseObserver); } /** */ - public void getSession(com.google.showcase.v1beta1.GetSessionRequest request, + default void getSession(com.google.showcase.v1beta1.GetSessionRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSessionMethod(), responseObserver); } /** */ - public void listSessions(com.google.showcase.v1beta1.ListSessionsRequest request, + default void listSessions(com.google.showcase.v1beta1.ListSessionsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSessionsMethod(), responseObserver); } /** */ - public void deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request, + default void deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteSessionMethod(), responseObserver); } /** */ - public void reportSession(com.google.showcase.v1beta1.ReportSessionRequest request, + default void reportSession(com.google.showcase.v1beta1.ReportSessionRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReportSessionMethod(), responseObserver); } /** */ - public void listTests(com.google.showcase.v1beta1.ListTestsRequest request, + default void listTests(com.google.showcase.v1beta1.ListTestsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTestsMethod(), responseObserver); } /** */ - public void deleteTest(com.google.showcase.v1beta1.DeleteTestRequest request, + default void deleteTest(com.google.showcase.v1beta1.DeleteTestRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTestMethod(), responseObserver); } /** */ - public void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, + default void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyTestMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Testing. + */ + public static abstract class TestingImplBase + implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateSessionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateSessionRequest, - com.google.showcase.v1beta1.Session>( - this, METHODID_CREATE_SESSION))) - .addMethod( - getGetSessionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetSessionRequest, - com.google.showcase.v1beta1.Session>( - this, METHODID_GET_SESSION))) - .addMethod( - getListSessionsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListSessionsRequest, - com.google.showcase.v1beta1.ListSessionsResponse>( - this, METHODID_LIST_SESSIONS))) - .addMethod( - getDeleteSessionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteSessionRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_SESSION))) - .addMethod( - getReportSessionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ReportSessionRequest, - com.google.showcase.v1beta1.ReportSessionResponse>( - this, METHODID_REPORT_SESSION))) - .addMethod( - getListTestsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListTestsRequest, - com.google.showcase.v1beta1.ListTestsResponse>( - this, METHODID_LIST_TESTS))) - .addMethod( - getDeleteTestMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteTestRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_TEST))) - .addMethod( - getVerifyTestMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.VerifyTestRequest, - com.google.showcase.v1beta1.VerifyTestResponse>( - this, METHODID_VERIFY_TEST))) - .build(); + return TestingGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service Testing. */ - public static final class TestingStub extends io.grpc.stub.AbstractAsyncStub { + public static final class TestingStub + extends io.grpc.stub.AbstractAsyncStub { private TestingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -509,8 +461,10 @@ public void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, } /** + * A stub to allow clients to do synchronous rpc calls to service Testing. */ - public static final class TestingBlockingStub extends io.grpc.stub.AbstractBlockingStub { + public static final class TestingBlockingStub + extends io.grpc.stub.AbstractBlockingStub { private TestingBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -580,8 +534,10 @@ public com.google.showcase.v1beta1.VerifyTestResponse verifyTest(com.google.show } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Testing. */ - public static final class TestingFutureStub extends io.grpc.stub.AbstractFutureStub { + public static final class TestingFutureStub + extends io.grpc.stub.AbstractFutureStub { private TestingFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -672,10 +628,10 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final TestingImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(TestingImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -732,6 +688,67 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSessionRequest, + com.google.showcase.v1beta1.Session>( + service, METHODID_CREATE_SESSION))) + .addMethod( + getGetSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSessionRequest, + com.google.showcase.v1beta1.Session>( + service, METHODID_GET_SESSION))) + .addMethod( + getListSessionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse>( + service, METHODID_LIST_SESSIONS))) + .addMethod( + getDeleteSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteSessionRequest, + com.google.protobuf.Empty>( + service, METHODID_DELETE_SESSION))) + .addMethod( + getReportSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse>( + service, METHODID_REPORT_SESSION))) + .addMethod( + getListTestsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse>( + service, METHODID_LIST_TESTS))) + .addMethod( + getDeleteTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteTestRequest, + com.google.protobuf.Empty>( + service, METHODID_DELETE_TEST))) + .addMethod( + getVerifyTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse>( + service, METHODID_VERIFY_TEST))) + .build(); + } + private static abstract class TestingBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { TestingBaseDescriptorSupplier() {}