diff --git a/.gradle/6.7/executionHistory/executionHistory.bin b/.gradle/6.7/executionHistory/executionHistory.bin index 8b76bebf6b0eb3006cf18d0096f6ae2e44f62c25..15d6e50f0cf9092a043c07cc46d11fd1b2e6ed0b 100644 Binary files a/.gradle/6.7/executionHistory/executionHistory.bin and b/.gradle/6.7/executionHistory/executionHistory.bin differ diff --git a/.gradle/6.7/executionHistory/executionHistory.lock b/.gradle/6.7/executionHistory/executionHistory.lock index 214f0511d88b18585fa4eaf0eacb27308d6dc49c..833a11f06de0c5c4111a7d8010c667692c68a3ba 100644 Binary files a/.gradle/6.7/executionHistory/executionHistory.lock and b/.gradle/6.7/executionHistory/executionHistory.lock differ diff --git a/.gradle/6.7/fileHashes/fileHashes.bin b/.gradle/6.7/fileHashes/fileHashes.bin index b6122204a165f9369d785682a97e8d753c83054e..cf17b56e5482dbc1bab8c3f57353b6f484960862 100644 Binary files a/.gradle/6.7/fileHashes/fileHashes.bin and b/.gradle/6.7/fileHashes/fileHashes.bin differ diff --git a/.gradle/6.7/fileHashes/fileHashes.lock b/.gradle/6.7/fileHashes/fileHashes.lock index 50f7d7d30dd434b481b9a5c0d729c98764f9db9d..4e20f9d36b57208c05cd2685cd8e88a457a4ceee 100644 Binary files a/.gradle/6.7/fileHashes/fileHashes.lock and b/.gradle/6.7/fileHashes/fileHashes.lock differ diff --git a/.gradle/6.7/javaCompile/classAnalysis.bin b/.gradle/6.7/javaCompile/classAnalysis.bin index 11ebbf40a4f1cc1f78734008e1dbd75ce4d92636..7ae4f6289a9a196809b6e33dee15aa498621a31d 100644 Binary files a/.gradle/6.7/javaCompile/classAnalysis.bin and b/.gradle/6.7/javaCompile/classAnalysis.bin differ diff --git a/.gradle/6.7/javaCompile/javaCompile.lock b/.gradle/6.7/javaCompile/javaCompile.lock index 36323a7a9a153fba18e24aaecc90a1d469f51e00..bf0aa479a8efab66e54ffab9799ce4425eba8532 100644 Binary files a/.gradle/6.7/javaCompile/javaCompile.lock and b/.gradle/6.7/javaCompile/javaCompile.lock differ diff --git a/.gradle/6.7/javaCompile/taskHistory.bin b/.gradle/6.7/javaCompile/taskHistory.bin index 3e481a7890961ed527ef38371ddae7a2b67a0996..3f0a2ab397f3502ab05462d81225c0dfea6dbaa7 100644 Binary files a/.gradle/6.7/javaCompile/taskHistory.bin and b/.gradle/6.7/javaCompile/taskHistory.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 85792efb77fc144813a7f1d3bc4c7ce3a22670d1..8a94ba51e1255010e7e41786440fafb5c948eaa9 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index 4dc7724f4565305c24cc538c8b1470fe0da37297..f35392861bb87e938206764462141da42dec3f9b 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/checksums/checksums.lock b/.gradle/checksums/checksums.lock index a8953acfd73c514101ed16d3303209d005bebf91..572e13f7e456314af8ca4080dc47c780cc50ff38 100644 Binary files a/.gradle/checksums/checksums.lock and b/.gradle/checksums/checksums.lock differ diff --git a/.gradle/checksums/sha1-checksums.bin b/.gradle/checksums/sha1-checksums.bin new file mode 100644 index 0000000000000000000000000000000000000000..8bfa616889aeec12608c50fefcf4c9a804626e0b Binary files /dev/null and b/.gradle/checksums/sha1-checksums.bin differ diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..bdbb77cf16f77b688228e73250761e34551def2e --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/build/classes/java/main/actor/Server.class b/build/classes/java/main/actor/Server.class index e27c9b14cda68aabaecad3fde189b735bd3ee441..e2562631f6bac6d03ae7466e64c02d50bb91f675 100644 Binary files a/build/classes/java/main/actor/Server.class and b/build/classes/java/main/actor/Server.class differ diff --git a/build/classes/java/main/bidirectional/BidirectionalServiceImpl$1.class b/build/classes/java/main/bidirectional/BidirectionalServiceImpl$1.class new file mode 100644 index 0000000000000000000000000000000000000000..e04e1854f195ed1219ebd4e0304e0104aa211b0a Binary files /dev/null and b/build/classes/java/main/bidirectional/BidirectionalServiceImpl$1.class differ diff --git a/build/classes/java/main/bidirectional/BidirectionalServiceImpl.class b/build/classes/java/main/bidirectional/BidirectionalServiceImpl.class new file mode 100644 index 0000000000000000000000000000000000000000..bf047975a4c2d1689e8895a0dcf7586d3a60beec Binary files /dev/null and b/build/classes/java/main/bidirectional/BidirectionalServiceImpl.class differ diff --git a/build/classes/java/main/bidirectional/Client$1.class b/build/classes/java/main/bidirectional/Client$1.class new file mode 100644 index 0000000000000000000000000000000000000000..86973eba92d4f6ea4cc36cd106cda4a4e73940ec Binary files /dev/null and b/build/classes/java/main/bidirectional/Client$1.class differ diff --git a/build/classes/java/main/bidirectional/Client.class b/build/classes/java/main/bidirectional/Client.class new file mode 100644 index 0000000000000000000000000000000000000000..86c3f3c80f5cff17ad8082a1b70ae7154ca38b84 Binary files /dev/null and b/build/classes/java/main/bidirectional/Client.class differ diff --git a/build/classes/java/main/bidirectional/Server.class b/build/classes/java/main/bidirectional/Server.class new file mode 100644 index 0000000000000000000000000000000000000000..6069d353ef25f68dba879aecf29abf98508eaa2d Binary files /dev/null and b/build/classes/java/main/bidirectional/Server.class differ diff --git a/build/classes/java/main/chat/ChatServiceImpl$1.class b/build/classes/java/main/chat/ChatServiceImpl$1.class index dbd6e605dcb767ed33b641db9e55cfed1c3c48a6..05b62eef2b8f2adf0ee2b464804e83979b4bc9d0 100644 Binary files a/build/classes/java/main/chat/ChatServiceImpl$1.class and b/build/classes/java/main/chat/ChatServiceImpl$1.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$1.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$1.class new file mode 100644 index 0000000000000000000000000000000000000000..1e95650175f709dcfbf8c1401ece7c118d77cc03 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$1.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceBaseDescriptorSupplier.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceBaseDescriptorSupplier.class new file mode 100644 index 0000000000000000000000000000000000000000..3f84a1b4d9a66f76e89df7a3ad769ee55ee56a4b Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceBaseDescriptorSupplier.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceBlockingStub.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceBlockingStub.class new file mode 100644 index 0000000000000000000000000000000000000000..a54ce4834cfb45134366cfb5885053a6a4084394 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceBlockingStub.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceFileDescriptorSupplier.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceFileDescriptorSupplier.class new file mode 100644 index 0000000000000000000000000000000000000000..89afef552aa61713b2aba53a9a9cbad25749e5cd Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceFileDescriptorSupplier.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceFutureStub.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceFutureStub.class new file mode 100644 index 0000000000000000000000000000000000000000..bec9e4e514dc97a3f1f2f24bf41929ce4528f15d Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceFutureStub.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceImplBase.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceImplBase.class new file mode 100644 index 0000000000000000000000000000000000000000..b942167e37e547177cc81060a376320a1023e4c9 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceImplBase.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceMethodDescriptorSupplier.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceMethodDescriptorSupplier.class new file mode 100644 index 0000000000000000000000000000000000000000..dbd3e2b8b32f743d263a7fefa91c28f3788ce547 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceMethodDescriptorSupplier.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceStub.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceStub.class new file mode 100644 index 0000000000000000000000000000000000000000..e150504c693f0241d8465ea2901decdd1c2bf08d Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$BidirectionalServiceStub.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$MethodHandlers.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$MethodHandlers.class new file mode 100644 index 0000000000000000000000000000000000000000..e1224610828c35347140495d4f8ed5a589d930f7 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc$MethodHandlers.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc.class new file mode 100644 index 0000000000000000000000000000000000000000..7837f44fe47fd541a9299cfcceb070ecb7ae5283 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceGrpc.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$1.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$1.class new file mode 100644 index 0000000000000000000000000000000000000000..6e5c34dfb283e8d8eb9691fdf4244e2bfe1540c9 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$1.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequest$1.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequest$1.class new file mode 100644 index 0000000000000000000000000000000000000000..1ba744253ed8fdd19d6c8a5e7eee57052486529c Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequest$1.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequest$Builder.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequest$Builder.class new file mode 100644 index 0000000000000000000000000000000000000000..fa4158b8e048547838205b57f5c495d33b612ef3 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequest$Builder.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequest.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequest.class new file mode 100644 index 0000000000000000000000000000000000000000..1fa9d3eb2f4ece9f43e426c289f021ef8826291e Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequest.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequestOrBuilder.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequestOrBuilder.class new file mode 100644 index 0000000000000000000000000000000000000000..ec456579eac01960f10a52da7041951cb137ba18 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ClientRequestOrBuilder.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponse$1.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponse$1.class new file mode 100644 index 0000000000000000000000000000000000000000..025621c383988432aeee80db94a4ca80c86fe6bd Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponse$1.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponse$Builder.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponse$Builder.class new file mode 100644 index 0000000000000000000000000000000000000000..dbf784db0113d0be890013a15694db6cd7238ef2 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponse$Builder.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponse.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponse.class new file mode 100644 index 0000000000000000000000000000000000000000..f688d04925194f2691fc6c6c9abf3782a00c2e55 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponse.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponseOrBuilder.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponseOrBuilder.class new file mode 100644 index 0000000000000000000000000000000000000000..975c43bc1fea2a38bbd84460c4a7d3ac15a538bd Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass$ServerResponseOrBuilder.class differ diff --git a/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass.class b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass.class new file mode 100644 index 0000000000000000000000000000000000000000..14487bf11ec8086ac22222b46a1f0d1eebe84db9 Binary files /dev/null and b/build/classes/java/main/com/example/grpc/BidirectionalServiceOuterClass.class differ diff --git a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest$1.class b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest$1.class index dc6e64e8acb18cb099f7af6c502580f3e7906932..a297259c3d57db967017e8d12c2db9ed88dff2bd 100644 Binary files a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest$1.class and b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest$1.class differ diff --git a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest$Builder.class b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest$Builder.class index 319ccb23e062db84dd6d04982e32e4af2d78b030..51fc7d8b5d349711062f122f94d3ef104a5f0775 100644 Binary files a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest$Builder.class and b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest$Builder.class differ diff --git a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest.class b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest.class index 4359e3c89db26394ddccfc63f7cd33bbb5b78e50..71b11ae2a5edea5b56c15ff0d3c1205ec67ef7be 100644 Binary files a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest.class and b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloRequest.class differ diff --git a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse$1.class b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse$1.class index 66ca880bef33f9bf864f8e0b2a2445f8a93d48e9..0250481b5681aa81fd3ad926283b58ad2fbe8b26 100644 Binary files a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse$1.class and b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse$1.class differ diff --git a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse$Builder.class b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse$Builder.class index 4f24296adcb1ec1fa90f0f6979694ddc470afa0a..0978fd3a82b3a914b4252e6b75d5523c2df1a627 100644 Binary files a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse$Builder.class and b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse$Builder.class differ diff --git a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse.class b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse.class index cc97d47036081492da57acd7a12186fd704190a5..6ccf6ce27e2b6d70a0cbcf4cab7320d04c0fed08 100644 Binary files a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse.class and b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass$HelloResponse.class differ diff --git a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass.class b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass.class index 9c038d40caa3b1d06822b680ee2837d4dfb468bb..ca186fd1d61f053c3f4c2e358f7bc791bbb279c4 100644 Binary files a/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass.class and b/build/classes/java/main/com/example/grpc/GreetingServiceOuterClass.class differ diff --git a/build/extracted-include-protos/test/BidirectionalService.proto b/build/extracted-include-protos/test/BidirectionalService.proto new file mode 100644 index 0000000000000000000000000000000000000000..28d4c455578dd8c1f98510096a1b86d9f2a11cfc --- /dev/null +++ b/build/extracted-include-protos/test/BidirectionalService.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package com.example.grpc; + +// Request payload +message ClientRequest { + string stringRequest = 1; +} + +message ServerResponse { + string stringResponse = 1; +} + +service BidirectionalService { + + rpc bidirectional(stream ClientRequest) returns (stream ServerResponse); + +} diff --git a/build/extracted-include-protos/test/GreetingService.proto b/build/extracted-include-protos/test/GreetingService.proto index 90a39b1a624c5f2dceafb13af0406c3938ed1454..28d05e7f6556e9ec89f1adb745baa7c3c427a38c 100644 --- a/build/extracted-include-protos/test/GreetingService.proto +++ b/build/extracted-include-protos/test/GreetingService.proto @@ -3,17 +3,8 @@ package com.example.grpc; // Request payload message HelloRequest { - // Each message attribute is strongly typed. - // You also must assign a "tag" number. - // Each tag number is unique within the message. string name = 1; - - // This defines a strongly typed list of String repeated string hobbies = 2; - - // There are many more basics types, like Enum, Map - // See https://developers.google.com/protocol-buffers/docs/proto3 - // for more information. } message HelloResponse { diff --git a/build/generated/source/proto/main/grpc/com/example/grpc/BidirectionalServiceGrpc.java b/build/generated/source/proto/main/grpc/com/example/grpc/BidirectionalServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..1be5480ebf63af6e7f3989260d511e5e2e43291c --- /dev/null +++ b/build/generated/source/proto/main/grpc/com/example/grpc/BidirectionalServiceGrpc.java @@ -0,0 +1,263 @@ +package com.example.grpc; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.25.0)", + comments = "Source: BidirectionalService.proto") +public final class BidirectionalServiceGrpc { + + private BidirectionalServiceGrpc() {} + + public static final String SERVICE_NAME = "com.example.grpc.BidirectionalService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getBidirectionalMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "bidirectional", + requestType = com.example.grpc.BidirectionalServiceOuterClass.ClientRequest.class, + responseType = com.example.grpc.BidirectionalServiceOuterClass.ServerResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getBidirectionalMethod() { + io.grpc.MethodDescriptor getBidirectionalMethod; + if ((getBidirectionalMethod = BidirectionalServiceGrpc.getBidirectionalMethod) == null) { + synchronized (BidirectionalServiceGrpc.class) { + if ((getBidirectionalMethod = BidirectionalServiceGrpc.getBidirectionalMethod) == null) { + BidirectionalServiceGrpc.getBidirectionalMethod = getBidirectionalMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "bidirectional")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.example.grpc.BidirectionalServiceOuterClass.ClientRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.example.grpc.BidirectionalServiceOuterClass.ServerResponse.getDefaultInstance())) + .setSchemaDescriptor(new BidirectionalServiceMethodDescriptorSupplier("bidirectional")) + .build(); + } + } + } + return getBidirectionalMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static BidirectionalServiceStub newStub(io.grpc.Channel channel) { + return new BidirectionalServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static BidirectionalServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new BidirectionalServiceBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static BidirectionalServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + return new BidirectionalServiceFutureStub(channel); + } + + /** + */ + public static abstract class BidirectionalServiceImplBase implements io.grpc.BindableService { + + /** + */ + public io.grpc.stub.StreamObserver bidirectional( + io.grpc.stub.StreamObserver responseObserver) { + return asyncUnimplementedStreamingCall(getBidirectionalMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getBidirectionalMethod(), + asyncBidiStreamingCall( + new MethodHandlers< + com.example.grpc.BidirectionalServiceOuterClass.ClientRequest, + com.example.grpc.BidirectionalServiceOuterClass.ServerResponse>( + this, METHODID_BIDIRECTIONAL))) + .build(); + } + } + + /** + */ + public static final class BidirectionalServiceStub extends io.grpc.stub.AbstractStub { + private BidirectionalServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private BidirectionalServiceStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BidirectionalServiceStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new BidirectionalServiceStub(channel, callOptions); + } + + /** + */ + public io.grpc.stub.StreamObserver bidirectional( + io.grpc.stub.StreamObserver responseObserver) { + return asyncBidiStreamingCall( + getChannel().newCall(getBidirectionalMethod(), getCallOptions()), responseObserver); + } + } + + /** + */ + public static final class BidirectionalServiceBlockingStub extends io.grpc.stub.AbstractStub { + private BidirectionalServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private BidirectionalServiceBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BidirectionalServiceBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new BidirectionalServiceBlockingStub(channel, callOptions); + } + } + + /** + */ + public static final class BidirectionalServiceFutureStub extends io.grpc.stub.AbstractStub { + private BidirectionalServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private BidirectionalServiceFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BidirectionalServiceFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new BidirectionalServiceFutureStub(channel, callOptions); + } + } + + private static final int METHODID_BIDIRECTIONAL = 0; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final BidirectionalServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(BidirectionalServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_BIDIRECTIONAL: + return (io.grpc.stub.StreamObserver) serviceImpl.bidirectional( + (io.grpc.stub.StreamObserver) responseObserver); + default: + throw new AssertionError(); + } + } + } + + private static abstract class BidirectionalServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + BidirectionalServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.example.grpc.BidirectionalServiceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("BidirectionalService"); + } + } + + private static final class BidirectionalServiceFileDescriptorSupplier + extends BidirectionalServiceBaseDescriptorSupplier { + BidirectionalServiceFileDescriptorSupplier() {} + } + + private static final class BidirectionalServiceMethodDescriptorSupplier + extends BidirectionalServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + BidirectionalServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (BidirectionalServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new BidirectionalServiceFileDescriptorSupplier()) + .addMethod(getBidirectionalMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/build/generated/source/proto/main/java/com/example/grpc/BidirectionalServiceOuterClass.java b/build/generated/source/proto/main/java/com/example/grpc/BidirectionalServiceOuterClass.java new file mode 100644 index 0000000000000000000000000000000000000000..dfe48d9878b1dbc3513b1b3069738adbdfba50c5 --- /dev/null +++ b/build/generated/source/proto/main/java/com/example/grpc/BidirectionalServiceOuterClass.java @@ -0,0 +1,1195 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: BidirectionalService.proto + +package com.example.grpc; + +public final class BidirectionalServiceOuterClass { + private BidirectionalServiceOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ClientRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.example.grpc.ClientRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string stringRequest = 1; + * @return The stringRequest. + */ + java.lang.String getStringRequest(); + /** + * string stringRequest = 1; + * @return The bytes for stringRequest. + */ + com.google.protobuf.ByteString + getStringRequestBytes(); + } + /** + * Protobuf type {@code com.example.grpc.ClientRequest} + */ + public static final class ClientRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.example.grpc.ClientRequest) + ClientRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClientRequest.newBuilder() to construct. + private ClientRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ClientRequest() { + stringRequest_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ClientRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ClientRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + stringRequest_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ClientRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ClientRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.grpc.BidirectionalServiceOuterClass.ClientRequest.class, com.example.grpc.BidirectionalServiceOuterClass.ClientRequest.Builder.class); + } + + public static final int STRINGREQUEST_FIELD_NUMBER = 1; + private volatile java.lang.Object stringRequest_; + /** + * string stringRequest = 1; + * @return The stringRequest. + */ + public java.lang.String getStringRequest() { + java.lang.Object ref = stringRequest_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stringRequest_ = s; + return s; + } + } + /** + * string stringRequest = 1; + * @return The bytes for stringRequest. + */ + public com.google.protobuf.ByteString + getStringRequestBytes() { + java.lang.Object ref = stringRequest_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stringRequest_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getStringRequestBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, stringRequest_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStringRequestBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, stringRequest_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.example.grpc.BidirectionalServiceOuterClass.ClientRequest)) { + return super.equals(obj); + } + com.example.grpc.BidirectionalServiceOuterClass.ClientRequest other = (com.example.grpc.BidirectionalServiceOuterClass.ClientRequest) obj; + + if (!getStringRequest() + .equals(other.getStringRequest())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STRINGREQUEST_FIELD_NUMBER; + hash = (53 * hash) + getStringRequest().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.example.grpc.BidirectionalServiceOuterClass.ClientRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.example.grpc.ClientRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.example.grpc.ClientRequest) + com.example.grpc.BidirectionalServiceOuterClass.ClientRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ClientRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ClientRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.grpc.BidirectionalServiceOuterClass.ClientRequest.class, com.example.grpc.BidirectionalServiceOuterClass.ClientRequest.Builder.class); + } + + // Construct using com.example.grpc.BidirectionalServiceOuterClass.ClientRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + stringRequest_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ClientRequest_descriptor; + } + + @java.lang.Override + public com.example.grpc.BidirectionalServiceOuterClass.ClientRequest getDefaultInstanceForType() { + return com.example.grpc.BidirectionalServiceOuterClass.ClientRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.example.grpc.BidirectionalServiceOuterClass.ClientRequest build() { + com.example.grpc.BidirectionalServiceOuterClass.ClientRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.grpc.BidirectionalServiceOuterClass.ClientRequest buildPartial() { + com.example.grpc.BidirectionalServiceOuterClass.ClientRequest result = new com.example.grpc.BidirectionalServiceOuterClass.ClientRequest(this); + result.stringRequest_ = stringRequest_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.grpc.BidirectionalServiceOuterClass.ClientRequest) { + return mergeFrom((com.example.grpc.BidirectionalServiceOuterClass.ClientRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.grpc.BidirectionalServiceOuterClass.ClientRequest other) { + if (other == com.example.grpc.BidirectionalServiceOuterClass.ClientRequest.getDefaultInstance()) return this; + if (!other.getStringRequest().isEmpty()) { + stringRequest_ = other.stringRequest_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.example.grpc.BidirectionalServiceOuterClass.ClientRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.example.grpc.BidirectionalServiceOuterClass.ClientRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object stringRequest_ = ""; + /** + * string stringRequest = 1; + * @return The stringRequest. + */ + public java.lang.String getStringRequest() { + java.lang.Object ref = stringRequest_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stringRequest_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string stringRequest = 1; + * @return The bytes for stringRequest. + */ + public com.google.protobuf.ByteString + getStringRequestBytes() { + java.lang.Object ref = stringRequest_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stringRequest_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string stringRequest = 1; + * @param value The stringRequest to set. + * @return This builder for chaining. + */ + public Builder setStringRequest( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + stringRequest_ = value; + onChanged(); + return this; + } + /** + * string stringRequest = 1; + * @return This builder for chaining. + */ + public Builder clearStringRequest() { + + stringRequest_ = getDefaultInstance().getStringRequest(); + onChanged(); + return this; + } + /** + * string stringRequest = 1; + * @param value The bytes for stringRequest to set. + * @return This builder for chaining. + */ + public Builder setStringRequestBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + stringRequest_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.example.grpc.ClientRequest) + } + + // @@protoc_insertion_point(class_scope:com.example.grpc.ClientRequest) + private static final com.example.grpc.BidirectionalServiceOuterClass.ClientRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.grpc.BidirectionalServiceOuterClass.ClientRequest(); + } + + public static com.example.grpc.BidirectionalServiceOuterClass.ClientRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.example.grpc.BidirectionalServiceOuterClass.ClientRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServerResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.example.grpc.ServerResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * string stringResponse = 1; + * @return The stringResponse. + */ + java.lang.String getStringResponse(); + /** + * string stringResponse = 1; + * @return The bytes for stringResponse. + */ + com.google.protobuf.ByteString + getStringResponseBytes(); + } + /** + * Protobuf type {@code com.example.grpc.ServerResponse} + */ + public static final class ServerResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.example.grpc.ServerResponse) + ServerResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServerResponse.newBuilder() to construct. + private ServerResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServerResponse() { + stringResponse_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServerResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServerResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + stringResponse_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ServerResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ServerResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.grpc.BidirectionalServiceOuterClass.ServerResponse.class, com.example.grpc.BidirectionalServiceOuterClass.ServerResponse.Builder.class); + } + + public static final int STRINGRESPONSE_FIELD_NUMBER = 1; + private volatile java.lang.Object stringResponse_; + /** + * string stringResponse = 1; + * @return The stringResponse. + */ + public java.lang.String getStringResponse() { + java.lang.Object ref = stringResponse_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stringResponse_ = s; + return s; + } + } + /** + * string stringResponse = 1; + * @return The bytes for stringResponse. + */ + public com.google.protobuf.ByteString + getStringResponseBytes() { + java.lang.Object ref = stringResponse_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stringResponse_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getStringResponseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, stringResponse_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStringResponseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, stringResponse_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.example.grpc.BidirectionalServiceOuterClass.ServerResponse)) { + return super.equals(obj); + } + com.example.grpc.BidirectionalServiceOuterClass.ServerResponse other = (com.example.grpc.BidirectionalServiceOuterClass.ServerResponse) obj; + + if (!getStringResponse() + .equals(other.getStringResponse())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STRINGRESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getStringResponse().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.example.grpc.BidirectionalServiceOuterClass.ServerResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.example.grpc.ServerResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.example.grpc.ServerResponse) + com.example.grpc.BidirectionalServiceOuterClass.ServerResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ServerResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ServerResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.grpc.BidirectionalServiceOuterClass.ServerResponse.class, com.example.grpc.BidirectionalServiceOuterClass.ServerResponse.Builder.class); + } + + // Construct using com.example.grpc.BidirectionalServiceOuterClass.ServerResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + stringResponse_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.grpc.BidirectionalServiceOuterClass.internal_static_com_example_grpc_ServerResponse_descriptor; + } + + @java.lang.Override + public com.example.grpc.BidirectionalServiceOuterClass.ServerResponse getDefaultInstanceForType() { + return com.example.grpc.BidirectionalServiceOuterClass.ServerResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.example.grpc.BidirectionalServiceOuterClass.ServerResponse build() { + com.example.grpc.BidirectionalServiceOuterClass.ServerResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.grpc.BidirectionalServiceOuterClass.ServerResponse buildPartial() { + com.example.grpc.BidirectionalServiceOuterClass.ServerResponse result = new com.example.grpc.BidirectionalServiceOuterClass.ServerResponse(this); + result.stringResponse_ = stringResponse_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.grpc.BidirectionalServiceOuterClass.ServerResponse) { + return mergeFrom((com.example.grpc.BidirectionalServiceOuterClass.ServerResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.grpc.BidirectionalServiceOuterClass.ServerResponse other) { + if (other == com.example.grpc.BidirectionalServiceOuterClass.ServerResponse.getDefaultInstance()) return this; + if (!other.getStringResponse().isEmpty()) { + stringResponse_ = other.stringResponse_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.example.grpc.BidirectionalServiceOuterClass.ServerResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.example.grpc.BidirectionalServiceOuterClass.ServerResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object stringResponse_ = ""; + /** + * string stringResponse = 1; + * @return The stringResponse. + */ + public java.lang.String getStringResponse() { + java.lang.Object ref = stringResponse_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stringResponse_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string stringResponse = 1; + * @return The bytes for stringResponse. + */ + public com.google.protobuf.ByteString + getStringResponseBytes() { + java.lang.Object ref = stringResponse_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stringResponse_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string stringResponse = 1; + * @param value The stringResponse to set. + * @return This builder for chaining. + */ + public Builder setStringResponse( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + stringResponse_ = value; + onChanged(); + return this; + } + /** + * string stringResponse = 1; + * @return This builder for chaining. + */ + public Builder clearStringResponse() { + + stringResponse_ = getDefaultInstance().getStringResponse(); + onChanged(); + return this; + } + /** + * string stringResponse = 1; + * @param value The bytes for stringResponse to set. + * @return This builder for chaining. + */ + public Builder setStringResponseBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + stringResponse_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.example.grpc.ServerResponse) + } + + // @@protoc_insertion_point(class_scope:com.example.grpc.ServerResponse) + private static final com.example.grpc.BidirectionalServiceOuterClass.ServerResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.grpc.BidirectionalServiceOuterClass.ServerResponse(); + } + + public static com.example.grpc.BidirectionalServiceOuterClass.ServerResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServerResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServerResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.example.grpc.BidirectionalServiceOuterClass.ServerResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_example_grpc_ClientRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_example_grpc_ClientRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_example_grpc_ServerResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_example_grpc_ServerResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\032BidirectionalService.proto\022\020com.exampl" + + "e.grpc\"&\n\rClientRequest\022\025\n\rstringRequest" + + "\030\001 \001(\t\"(\n\016ServerResponse\022\026\n\016stringRespon" + + "se\030\001 \001(\t2n\n\024BidirectionalService\022V\n\rbidi" + + "rectional\022\037.com.example.grpc.ClientReque" + + "st\032 .com.example.grpc.ServerResponse(\0010\001" + + "b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_com_example_grpc_ClientRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_example_grpc_ClientRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_example_grpc_ClientRequest_descriptor, + new java.lang.String[] { "StringRequest", }); + internal_static_com_example_grpc_ServerResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_com_example_grpc_ServerResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_example_grpc_ServerResponse_descriptor, + new java.lang.String[] { "StringResponse", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/build/generated/source/proto/main/java/com/example/grpc/GreetingServiceOuterClass.java b/build/generated/source/proto/main/java/com/example/grpc/GreetingServiceOuterClass.java index 99a990bf6d713dfb3bf0577ef37000ca1818ad72..12ba566ef39956c386c91784142a758514dc9c06 100644 --- a/build/generated/source/proto/main/java/com/example/grpc/GreetingServiceOuterClass.java +++ b/build/generated/source/proto/main/java/com/example/grpc/GreetingServiceOuterClass.java @@ -19,23 +19,11 @@ public final class GreetingServiceOuterClass { com.google.protobuf.MessageOrBuilder { /** - *
-     * Each message attribute is strongly typed.
-     * You also must assign a "tag" number.
-     * Each tag number is unique within the message.
-     * 
- * * string name = 1; * @return The name. */ java.lang.String getName(); /** - *
-     * Each message attribute is strongly typed.
-     * You also must assign a "tag" number.
-     * Each tag number is unique within the message.
-     * 
- * * string name = 1; * @return The bytes for name. */ @@ -43,39 +31,23 @@ public final class GreetingServiceOuterClass { getNameBytes(); /** - *
-     * This defines a strongly typed list of String
-     * 
- * * repeated string hobbies = 2; * @return A list containing the hobbies. */ java.util.List getHobbiesList(); /** - *
-     * This defines a strongly typed list of String
-     * 
- * * repeated string hobbies = 2; * @return The count of hobbies. */ int getHobbiesCount(); /** - *
-     * This defines a strongly typed list of String
-     * 
- * * repeated string hobbies = 2; * @param index The index of the element to return. * @return The hobbies at the given index. */ java.lang.String getHobbies(int index); /** - *
-     * This defines a strongly typed list of String
-     * 
- * * repeated string hobbies = 2; * @param index The index of the value to return. * @return The bytes of the hobbies at the given index. @@ -188,12 +160,6 @@ public final class GreetingServiceOuterClass { public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** - *
-     * Each message attribute is strongly typed.
-     * You also must assign a "tag" number.
-     * Each tag number is unique within the message.
-     * 
- * * string name = 1; * @return The name. */ @@ -210,12 +176,6 @@ public final class GreetingServiceOuterClass { } } /** - *
-     * Each message attribute is strongly typed.
-     * You also must assign a "tag" number.
-     * Each tag number is unique within the message.
-     * 
- * * string name = 1; * @return The bytes for name. */ @@ -236,10 +196,6 @@ public final class GreetingServiceOuterClass { public static final int HOBBIES_FIELD_NUMBER = 2; private com.google.protobuf.LazyStringList hobbies_; /** - *
-     * This defines a strongly typed list of String
-     * 
- * * repeated string hobbies = 2; * @return A list containing the hobbies. */ @@ -248,10 +204,6 @@ public final class GreetingServiceOuterClass { return hobbies_; } /** - *
-     * This defines a strongly typed list of String
-     * 
- * * repeated string hobbies = 2; * @return The count of hobbies. */ @@ -259,10 +211,6 @@ public final class GreetingServiceOuterClass { return hobbies_.size(); } /** - *
-     * This defines a strongly typed list of String
-     * 
- * * repeated string hobbies = 2; * @param index The index of the element to return. * @return The hobbies at the given index. @@ -271,10 +219,6 @@ public final class GreetingServiceOuterClass { return hobbies_.get(index); } /** - *
-     * This defines a strongly typed list of String
-     * 
- * * repeated string hobbies = 2; * @param index The index of the value to return. * @return The bytes of the hobbies at the given index. @@ -628,12 +572,6 @@ public final class GreetingServiceOuterClass { private java.lang.Object name_ = ""; /** - *
-       * Each message attribute is strongly typed.
-       * You also must assign a "tag" number.
-       * Each tag number is unique within the message.
-       * 
- * * string name = 1; * @return The name. */ @@ -650,12 +588,6 @@ public final class GreetingServiceOuterClass { } } /** - *
-       * Each message attribute is strongly typed.
-       * You also must assign a "tag" number.
-       * Each tag number is unique within the message.
-       * 
- * * string name = 1; * @return The bytes for name. */ @@ -673,12 +605,6 @@ public final class GreetingServiceOuterClass { } } /** - *
-       * Each message attribute is strongly typed.
-       * You also must assign a "tag" number.
-       * Each tag number is unique within the message.
-       * 
- * * string name = 1; * @param value The name to set. * @return This builder for chaining. @@ -694,12 +620,6 @@ public final class GreetingServiceOuterClass { return this; } /** - *
-       * Each message attribute is strongly typed.
-       * You also must assign a "tag" number.
-       * Each tag number is unique within the message.
-       * 
- * * string name = 1; * @return This builder for chaining. */ @@ -710,12 +630,6 @@ public final class GreetingServiceOuterClass { return this; } /** - *
-       * Each message attribute is strongly typed.
-       * You also must assign a "tag" number.
-       * Each tag number is unique within the message.
-       * 
- * * string name = 1; * @param value The bytes for name to set. * @return This builder for chaining. @@ -740,10 +654,6 @@ public final class GreetingServiceOuterClass { } } /** - *
-       * This defines a strongly typed list of String
-       * 
- * * repeated string hobbies = 2; * @return A list containing the hobbies. */ @@ -752,10 +662,6 @@ public final class GreetingServiceOuterClass { return hobbies_.getUnmodifiableView(); } /** - *
-       * This defines a strongly typed list of String
-       * 
- * * repeated string hobbies = 2; * @return The count of hobbies. */ @@ -763,10 +669,6 @@ public final class GreetingServiceOuterClass { return hobbies_.size(); } /** - *
-       * This defines a strongly typed list of String
-       * 
- * * repeated string hobbies = 2; * @param index The index of the element to return. * @return The hobbies at the given index. @@ -775,10 +677,6 @@ public final class GreetingServiceOuterClass { return hobbies_.get(index); } /** - *
-       * This defines a strongly typed list of String
-       * 
- * * repeated string hobbies = 2; * @param index The index of the value to return. * @return The bytes of the hobbies at the given index. @@ -788,10 +686,6 @@ public final class GreetingServiceOuterClass { return hobbies_.getByteString(index); } /** - *
-       * This defines a strongly typed list of String
-       * 
- * * repeated string hobbies = 2; * @param index The index to set the value at. * @param value The hobbies to set. @@ -808,10 +702,6 @@ public final class GreetingServiceOuterClass { return this; } /** - *
-       * This defines a strongly typed list of String
-       * 
- * * repeated string hobbies = 2; * @param value The hobbies to add. * @return This builder for chaining. @@ -827,10 +717,6 @@ public final class GreetingServiceOuterClass { return this; } /** - *
-       * This defines a strongly typed list of String
-       * 
- * * repeated string hobbies = 2; * @param values The hobbies to add. * @return This builder for chaining. @@ -844,10 +730,6 @@ public final class GreetingServiceOuterClass { return this; } /** - *
-       * This defines a strongly typed list of String
-       * 
- * * repeated string hobbies = 2; * @return This builder for chaining. */ @@ -858,10 +740,6 @@ public final class GreetingServiceOuterClass { return this; } /** - *
-       * This defines a strongly typed list of String
-       * 
- * * repeated string hobbies = 2; * @param value The bytes of the hobbies to add. * @return This builder for chaining. diff --git a/build/resources/main/BidirectionalService.proto b/build/resources/main/BidirectionalService.proto new file mode 100644 index 0000000000000000000000000000000000000000..e7910e309ce06d42e2019c28e92a464fd75efbbb --- /dev/null +++ b/build/resources/main/BidirectionalService.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package com.example.grpc; + +message ClientRequest { + string stringRequest = 1; +} + +message ServerResponse { + string stringResponse = 1; +} + +service BidirectionalService { + rpc bidirectional(stream ClientRequest) returns (stream ServerResponse); +} diff --git a/build/resources/main/GreetingService.proto b/build/resources/main/GreetingService.proto index 90a39b1a624c5f2dceafb13af0406c3938ed1454..28d05e7f6556e9ec89f1adb745baa7c3c427a38c 100644 --- a/build/resources/main/GreetingService.proto +++ b/build/resources/main/GreetingService.proto @@ -3,17 +3,8 @@ package com.example.grpc; // Request payload message HelloRequest { - // Each message attribute is strongly typed. - // You also must assign a "tag" number. - // Each tag number is unique within the message. string name = 1; - - // This defines a strongly typed list of String repeated string hobbies = 2; - - // There are many more basics types, like Enum, Map - // See https://developers.google.com/protocol-buffers/docs/proto3 - // for more information. } message HelloResponse { diff --git a/build/tmp/compileJava/source-classes-mapping.txt b/build/tmp/compileJava/source-classes-mapping.txt index 4d2c24ca8ba0596c72385ea051af71e06c4cb5c2..c32d68a75d76ba4d8fe067a61e901077f4752db8 100644 --- a/build/tmp/compileJava/source-classes-mapping.txt +++ b/build/tmp/compileJava/source-classes-mapping.txt @@ -10,6 +10,9 @@ com/example/chat/ChatServiceOuterClass.java chat/ChatClient.java chat.ChatClient chat.ChatClient$1 +bidirectional/BidirectionalServiceImpl.java + bidirectional.BidirectionalServiceImpl + bidirectional.BidirectionalServiceImpl$1 chat/ChatServiceImpl.java chat.ChatServiceImpl chat.ChatServiceImpl$1 @@ -26,6 +29,17 @@ com/example/grpc/GreetingServiceGrpc.java com.example.grpc.GreetingServiceGrpc$GreetingServiceMethodDescriptorSupplier com.example.grpc.GreetingServiceGrpc$GreetingServiceStub com.example.grpc.GreetingServiceGrpc$MethodHandlers +com/example/grpc/BidirectionalServiceGrpc.java + com.example.grpc.BidirectionalServiceGrpc + com.example.grpc.BidirectionalServiceGrpc$1 + com.example.grpc.BidirectionalServiceGrpc$BidirectionalServiceBaseDescriptorSupplier + com.example.grpc.BidirectionalServiceGrpc$BidirectionalServiceBlockingStub + com.example.grpc.BidirectionalServiceGrpc$BidirectionalServiceFileDescriptorSupplier + com.example.grpc.BidirectionalServiceGrpc$BidirectionalServiceFutureStub + com.example.grpc.BidirectionalServiceGrpc$BidirectionalServiceImplBase + com.example.grpc.BidirectionalServiceGrpc$BidirectionalServiceMethodDescriptorSupplier + com.example.grpc.BidirectionalServiceGrpc$BidirectionalServiceStub + com.example.grpc.BidirectionalServiceGrpc$MethodHandlers com/example/grpc/GreetingServiceOuterClass.java com.example.grpc.GreetingServiceOuterClass com.example.grpc.GreetingServiceOuterClass$1 @@ -37,6 +51,8 @@ com/example/grpc/GreetingServiceOuterClass.java com.example.grpc.GreetingServiceOuterClass$HelloResponse$1 com.example.grpc.GreetingServiceOuterClass$HelloResponse$Builder com.example.grpc.GreetingServiceOuterClass$HelloResponseOrBuilder +bidirectional/Server.java + bidirectional.Server com/example/chat/ChatServiceGrpc.java com.example.chat.ChatServiceGrpc com.example.chat.ChatServiceGrpc$1 @@ -48,6 +64,9 @@ com/example/chat/ChatServiceGrpc.java com.example.chat.ChatServiceGrpc$ChatServiceMethodDescriptorSupplier com.example.chat.ChatServiceGrpc$ChatServiceStub com.example.chat.ChatServiceGrpc$MethodHandlers +bidirectional/Client.java + bidirectional.Client + bidirectional.Client$1 grpchelloserver/App.java grpchelloserver.App it/ewlab/actor/ActorOuterClass.java @@ -63,10 +82,21 @@ it/ewlab/actor/ActorOuterClass.java it.ewlab.actor.ActorOuterClass$Actor$Sex it.ewlab.actor.ActorOuterClass$Actor$Sex$1 it.ewlab.actor.ActorOuterClass$ActorOrBuilder +com/example/grpc/BidirectionalServiceOuterClass.java + com.example.grpc.BidirectionalServiceOuterClass + com.example.grpc.BidirectionalServiceOuterClass$1 + com.example.grpc.BidirectionalServiceOuterClass$ClientRequest + com.example.grpc.BidirectionalServiceOuterClass$ClientRequest$1 + com.example.grpc.BidirectionalServiceOuterClass$ClientRequest$Builder + com.example.grpc.BidirectionalServiceOuterClass$ClientRequestOrBuilder + com.example.grpc.BidirectionalServiceOuterClass$ServerResponse + com.example.grpc.BidirectionalServiceOuterClass$ServerResponse$1 + com.example.grpc.BidirectionalServiceOuterClass$ServerResponse$Builder + com.example.grpc.BidirectionalServiceOuterClass$ServerResponseOrBuilder grpchelloserver/GreetingServiceImpl.java grpchelloserver.GreetingServiceImpl -actor/Server.java - actor.Server grpchelloserver/GreetingServiceClient.java grpchelloserver.GreetingServiceClient grpchelloserver.GreetingServiceClient$1 +actor/Server.java + actor.Server diff --git a/src/main/java/actor/Server.java b/src/main/java/actor/Server.java index 7cf83013388faaa9a1ee9cd3ed0fc4ea5947f06c..d5922b9cd50ae9dc35bb84ebb6e16cebb470066c 100644 --- a/src/main/java/actor/Server.java +++ b/src/main/java/actor/Server.java @@ -10,6 +10,7 @@ public class Server { public static void main(String[] args) throws IOException { + System.out.println("The server is running...\n"); ServerSocket serverSocket = new ServerSocket(9999); diff --git a/src/main/java/bidirectional/BidirectionalServiceImpl.java b/src/main/java/bidirectional/BidirectionalServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..07e541242abe45d5fcb4802cc9de98fca0159d95 --- /dev/null +++ b/src/main/java/bidirectional/BidirectionalServiceImpl.java @@ -0,0 +1,34 @@ +package bidirectional; + +import com.example.grpc.BidirectionalServiceGrpc.*; +import com.example.grpc.BidirectionalServiceOuterClass.*; +import io.grpc.stub.StreamObserver; + + +public class BidirectionalServiceImpl extends BidirectionalServiceImplBase { + @Override + public StreamObserver bidirectional(StreamObserver responseObserver){ + + //it returns the stream that will be used by the clients to send messages. The client will write on this stream + return new StreamObserver() { + //receiving a message from the client + public void onNext(ClientRequest clientRequest) { + String clientStringRequest = clientRequest.getStringRequest(); + System.out.println("[FROM CLIENT] " + clientStringRequest); + + // sending the response to the client + System.out.println("Sending the response to the client...\n"); + responseObserver.onNext(ServerResponse.newBuilder().setStringResponse("I've received this message: '" + clientStringRequest + "'").build()); + } + + public void onError(Throwable throwable) { + } + + public void onCompleted() { + } + }; + } +} + + + diff --git a/src/main/java/bidirectional/Client.java b/src/main/java/bidirectional/Client.java new file mode 100644 index 0000000000000000000000000000000000000000..81678d665e2bbb44acd724e3350cb1f14c8eaf98 --- /dev/null +++ b/src/main/java/bidirectional/Client.java @@ -0,0 +1,63 @@ +package bidirectional; + +import com.example.grpc.BidirectionalServiceGrpc.*; +import com.example.grpc.BidirectionalServiceGrpc; +import com.example.grpc.BidirectionalServiceOuterClass.*; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.util.concurrent.TimeUnit; + + +public class Client { + public final static String IP = "localhost"; + public final static int PORT = 8888; + + public static void main(String[] args) throws IOException { + //opening a connection with server + final ManagedChannel channel = ManagedChannelBuilder.forTarget(IP+":"+PORT).usePlaintext().build(); + + //creating the asynchronous stub + BidirectionalServiceStub stub = BidirectionalServiceGrpc.newStub(channel); + + //the stub returns a stream to communicate with the server. + //the argument is the stream of messages which are transmitted by the server. + StreamObserver serverStream = stub.bidirectional(new StreamObserver() { + //remember: all the methods here are CALLBACKS which are handled in an asynchronous manner. + + //we define what to do when a message from the server arrives (just print the message) + public void onNext(ServerResponse serverResponse) { + System.out.println("[FROM SERVER] " + serverResponse.getStringResponse()); + } + + public void onError(Throwable throwable) { + } + + public void onCompleted() { + } + }); + + String msg = "First request from the client"; + System.out.println("Sending the message '" + msg + "' to the server..."); + serverStream.onNext(ClientRequest.newBuilder().setStringRequest(msg).build()); + + msg = "Second request from the client"; + System.out.println("Sending the message '" + msg + "' to the server..."); + serverStream.onNext(ClientRequest.newBuilder().setStringRequest(msg).build()); + + msg = "Third request from the client"; + System.out.println("Sending the message '" + msg + "' to the server..."); + serverStream.onNext(ClientRequest.newBuilder().setStringRequest(msg).build()); + + + + try { + //you need this. otherwise the method will terminate before that answers from the server are received + channel.awaitTermination(10, TimeUnit.SECONDS); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/bidirectional/Server.java b/src/main/java/bidirectional/Server.java new file mode 100644 index 0000000000000000000000000000000000000000..cda90a739229cba9cd4ded16481b5273736a376c --- /dev/null +++ b/src/main/java/bidirectional/Server.java @@ -0,0 +1,19 @@ +package bidirectional; + +import io.grpc.ServerBuilder; +import java.io.IOException; + +public class Server { + public static void main( String[] args ) { + try { + io.grpc.Server server = ServerBuilder.forPort(8888).addService(new BidirectionalServiceImpl()).build(); + server.start(); + System.out.println("Server started!\n"); + server.awaitTermination(); + } catch (IOException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/proto/BidirectionalService.proto b/src/main/proto/BidirectionalService.proto new file mode 100644 index 0000000000000000000000000000000000000000..e7910e309ce06d42e2019c28e92a464fd75efbbb --- /dev/null +++ b/src/main/proto/BidirectionalService.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package com.example.grpc; + +message ClientRequest { + string stringRequest = 1; +} + +message ServerResponse { + string stringResponse = 1; +} + +service BidirectionalService { + rpc bidirectional(stream ClientRequest) returns (stream ServerResponse); +} diff --git a/src/main/proto/GreetingService.proto b/src/main/proto/GreetingService.proto index 90a39b1a624c5f2dceafb13af0406c3938ed1454..28d05e7f6556e9ec89f1adb745baa7c3c427a38c 100644 --- a/src/main/proto/GreetingService.proto +++ b/src/main/proto/GreetingService.proto @@ -3,17 +3,8 @@ package com.example.grpc; // Request payload message HelloRequest { - // Each message attribute is strongly typed. - // You also must assign a "tag" number. - // Each tag number is unique within the message. string name = 1; - - // This defines a strongly typed list of String repeated string hobbies = 2; - - // There are many more basics types, like Enum, Map - // See https://developers.google.com/protocol-buffers/docs/proto3 - // for more information. } message HelloResponse {