mirror of https://github.com/grpc/grpc-java.git
Removing all references to "stubby"
This commit is contained in:
parent
aeeebb7cdb
commit
f83145865a
30
README.md
30
README.md
|
|
@ -11,7 +11,7 @@ datamodel/IDL/interface you are adapting. An example is provided of a binding to
|
||||||
|
|
||||||
#### Key Interfaces
|
#### Key Interfaces
|
||||||
|
|
||||||
[Stream Observer](https://github.com/google/grpc-java/blob/master/stub/src/main/java/com/google/net/stubby/stub/StreamObserver.java)
|
[Stream Observer](https://github.com/google/grpc-java/blob/master/stub/src/main/java/io/grpc/stub/StreamObserver.java)
|
||||||
|
|
||||||
|
|
||||||
## Channel
|
## Channel
|
||||||
|
|
@ -20,17 +20,17 @@ The 'channel' layer is an abstraction over transport handling that is suitable f
|
||||||
|
|
||||||
#### Common
|
#### Common
|
||||||
|
|
||||||
* [Metadata - headers & trailers](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/Metadata.java)
|
* [Metadata - headers & trailers](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/Metadata.java)
|
||||||
* [Status - error code namespace & handling](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/Status.java)
|
* [Status - error code namespace & handling](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/Status.java)
|
||||||
|
|
||||||
#### Client
|
#### Client
|
||||||
* [Channel - client side binding](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/Channel.java)
|
* [Channel - client side binding](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/Channel.java)
|
||||||
* [Call](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/Call.java)
|
* [Call](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/Call.java)
|
||||||
* [Client Interceptor](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/ClientInterceptor.java)
|
* [Client Interceptor](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/ClientInterceptor.java)
|
||||||
|
|
||||||
#### Server
|
#### Server
|
||||||
* [Server call handler - analog to Channel on server](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/ServerCallHandler.java)
|
* [Server call handler - analog to Channel on server](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/ServerCallHandler.java)
|
||||||
* [Server Call](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/ServerCall.java)
|
* [Server Call](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/ServerCall.java)
|
||||||
|
|
||||||
|
|
||||||
## Transport
|
## Transport
|
||||||
|
|
@ -39,20 +39,20 @@ The 'transport' layer does the heavy lifting of putting & taking bytes off the w
|
||||||
|
|
||||||
#### Common
|
#### Common
|
||||||
|
|
||||||
* [Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/Stream.java)
|
* [Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/Stream.java)
|
||||||
* [Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/StreamListener.java)
|
* [Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/StreamListener.java)
|
||||||
|
|
||||||
#### Client
|
#### Client
|
||||||
|
|
||||||
* [Client Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/ClientStream.java)
|
* [Client Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/ClientStream.java)
|
||||||
* [Client Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/ClientStreamListener.java)
|
* [Client Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/ClientStreamListener.java)
|
||||||
|
|
||||||
#### Server
|
#### Server
|
||||||
|
|
||||||
* [Server Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/ServerStream.java)
|
* [Server Stream](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/ServerStream.java)
|
||||||
* [Server Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/com/google/net/stubby/transport/ServerStreamListener.java)
|
* [Server Stream Listener](https://github.com/google/grpc-java/blob/master/core/src/main/java/io/grpc/transport/ServerStreamListener.java)
|
||||||
|
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
Tests showing how these layers are composed to execute calls using protobuf messages can be found here https://github.com/google/grpc-java/tree/master/integration-testing/src/main/java/com/google/net/stubby/testing/integration
|
Tests showing how these layers are composed to execute calls using protobuf messages can be found here https://github.com/google/grpc-java/tree/master/integration-testing/src/main/java/io/grpc/testing/integration
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
description = "Stubby: All"
|
description = "gRPC: All"
|
||||||
|
|
||||||
// Make sure that no transitive dependencies are included.
|
// Make sure that no transitive dependencies are included.
|
||||||
configurations.compile.transitive = false
|
configurations.compile.transitive = false
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':stubby-core'),
|
compile project(':grpc-core'),
|
||||||
project(':stubby-stub'),
|
project(':grpc-stub'),
|
||||||
project(':stubby-auth'),
|
project(':grpc-auth'),
|
||||||
project(':stubby-netty'),
|
project(':grpc-netty'),
|
||||||
project(':stubby-okhttp')
|
project(':grpc-okhttp')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a fat jar containing only the direct dependencies
|
// Create a fat jar containing only the direct dependencies
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ plugins {
|
||||||
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
|
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "Stubby: Auth"
|
description = "gRpc: Auth"
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':stubby-core'),
|
compile project(':grpc-core'),
|
||||||
libraries.oauth_client,
|
libraries.oauth_client,
|
||||||
libraries.javaee_api
|
libraries.javaee_api
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.auth;
|
package io.grpc.auth;
|
||||||
|
|
||||||
import com.google.api.client.auth.oauth2.Credential;
|
import com.google.api.client.auth.oauth2.Credential;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
@ -29,15 +29,16 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.auth;
|
package io.grpc.auth;
|
||||||
|
|
||||||
import com.google.api.client.auth.oauth2.Credential;
|
import com.google.api.client.auth.oauth2.Credential;
|
||||||
import com.google.net.stubby.Call;
|
|
||||||
import com.google.net.stubby.Channel;
|
import io.grpc.Call;
|
||||||
import com.google.net.stubby.ClientInterceptor;
|
import io.grpc.Channel;
|
||||||
import com.google.net.stubby.ClientInterceptors.ForwardingCall;
|
import io.grpc.ClientInterceptor;
|
||||||
import com.google.net.stubby.Metadata;
|
import io.grpc.ClientInterceptors.ForwardingCall;
|
||||||
import com.google.net.stubby.MethodDescriptor;
|
import io.grpc.Metadata;
|
||||||
|
import io.grpc.MethodDescriptor;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
|
@ -3,7 +3,7 @@ subprojects {
|
||||||
apply plugin: "maven"
|
apply plugin: "maven"
|
||||||
apply plugin: "idea"
|
apply plugin: "idea"
|
||||||
|
|
||||||
group = "com.google.net.stubby"
|
group = "io.grpc"
|
||||||
version = "0.1.0-SNAPSHOT"
|
version = "0.1.0-SNAPSHOT"
|
||||||
|
|
||||||
sourceCompatibility = 1.6
|
sourceCompatibility = 1.6
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,6 @@ GOLDEN_FILE="$TEST_SRC_DIR/TestService.java.txt"
|
||||||
protoc --plugin=protoc-gen-java_rpc=build/binaries/java_pluginExecutable/java_plugin \
|
protoc --plugin=protoc-gen-java_rpc=build/binaries/java_pluginExecutable/java_plugin \
|
||||||
--java_rpc_out="$OUTPUT_FILE" --proto_path="$TEST_SRC_DIR" "$INPUT_FILE" && \
|
--java_rpc_out="$OUTPUT_FILE" --proto_path="$TEST_SRC_DIR" "$INPUT_FILE" && \
|
||||||
unzip -o -d "$TEST_TMP_DIR" "$OUTPUT_FILE" && \
|
unzip -o -d "$TEST_TMP_DIR" "$OUTPUT_FILE" && \
|
||||||
diff "$TEST_TMP_DIR/com/google/net/stubby/testing/integration/TestServiceGrpc.java" \
|
diff "$TEST_TMP_DIR/io/grpc/testing/integration/TestServiceGrpc.java" \
|
||||||
"$GOLDEN_FILE" && \
|
"$GOLDEN_FILE" && \
|
||||||
echo "PASS"
|
echo "PASS"
|
||||||
|
|
|
||||||
|
|
@ -470,11 +470,11 @@ static void PrintBindServiceMethod(const ServiceDescriptor* service,
|
||||||
if (client_streaming) {
|
if (client_streaming) {
|
||||||
(*vars)["calls_method"] = "asyncStreamingRequestCall";
|
(*vars)["calls_method"] = "asyncStreamingRequestCall";
|
||||||
(*vars)["invocation_class"] =
|
(*vars)["invocation_class"] =
|
||||||
"com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod";
|
"io.grpc.stub.ServerCalls.StreamingRequestMethod";
|
||||||
} else {
|
} else {
|
||||||
(*vars)["calls_method"] = "asyncUnaryRequestCall";
|
(*vars)["calls_method"] = "asyncUnaryRequestCall";
|
||||||
(*vars)["invocation_class"] =
|
(*vars)["invocation_class"] =
|
||||||
"com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod";
|
"io.grpc.stub.ServerCalls.UnaryRequestMethod";
|
||||||
}
|
}
|
||||||
p->Print(*vars, ".addMethod(createMethodDefinition(\n");
|
p->Print(*vars, ".addMethod(createMethodDefinition(\n");
|
||||||
p->Indent();
|
p->Indent();
|
||||||
|
|
@ -586,27 +586,27 @@ static void PrintService(const ServiceDescriptor* service,
|
||||||
void PrintImports(Printer* p) {
|
void PrintImports(Printer* p) {
|
||||||
p->Print(
|
p->Print(
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.Calls.createMethodDescriptor;\n"
|
"io.grpc.stub.Calls.createMethodDescriptor;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.Calls.asyncUnaryCall;\n"
|
"io.grpc.stub.Calls.asyncUnaryCall;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.Calls.asyncServerStreamingCall;\n"
|
"io.grpc.stub.Calls.asyncServerStreamingCall;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.Calls.asyncClientStreamingCall;\n"
|
"io.grpc.stub.Calls.asyncClientStreamingCall;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.Calls.duplexStreamingCall;\n"
|
"io.grpc.stub.Calls.duplexStreamingCall;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.Calls.blockingUnaryCall;\n"
|
"io.grpc.stub.Calls.blockingUnaryCall;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.Calls.blockingServerStreamingCall;\n"
|
"io.grpc.stub.Calls.blockingServerStreamingCall;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.Calls.unaryFutureCall;\n"
|
"io.grpc.stub.Calls.unaryFutureCall;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.ServerCalls.createMethodDefinition;\n"
|
"io.grpc.stub.ServerCalls.createMethodDefinition;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.ServerCalls.asyncUnaryRequestCall;\n"
|
"io.grpc.stub.ServerCalls.asyncUnaryRequestCall;\n"
|
||||||
"import static "
|
"import static "
|
||||||
"com.google.net.stubby.stub.ServerCalls.asyncStreamingRequestCall;\n\n");
|
"io.grpc.stub.ServerCalls.asyncStreamingRequestCall;\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenerateService(const ServiceDescriptor* service,
|
void GenerateService(const ServiceDescriptor* service,
|
||||||
|
|
@ -616,18 +616,18 @@ void GenerateService(const ServiceDescriptor* service,
|
||||||
map<string, string> vars;
|
map<string, string> vars;
|
||||||
vars["String"] = "java.lang.String";
|
vars["String"] = "java.lang.String";
|
||||||
vars["Override"] = "java.lang.Override";
|
vars["Override"] = "java.lang.Override";
|
||||||
vars["Channel"] = "com.google.net.stubby.Channel";
|
vars["Channel"] = "io.grpc.Channel";
|
||||||
vars["MethodType"] = "com.google.net.stubby.MethodType";
|
vars["MethodType"] = "io.grpc.MethodType";
|
||||||
vars["ServerServiceDefinition"] =
|
vars["ServerServiceDefinition"] =
|
||||||
"com.google.net.stubby.ServerServiceDefinition";
|
"io.grpc.ServerServiceDefinition";
|
||||||
vars["AbstractStub"] = "com.google.net.stubby.stub.AbstractStub";
|
vars["AbstractStub"] = "io.grpc.stub.AbstractStub";
|
||||||
vars["Method"] = "com.google.net.stubby.stub.Method";
|
vars["Method"] = "io.grpc.stub.Method";
|
||||||
vars["AbstractServiceDescriptor"] =
|
vars["AbstractServiceDescriptor"] =
|
||||||
"com.google.net.stubby.stub.AbstractServiceDescriptor";
|
"io.grpc.stub.AbstractServiceDescriptor";
|
||||||
vars["ImmutableList"] = "com.google.common.collect.ImmutableList";
|
vars["ImmutableList"] = "com.google.common.collect.ImmutableList";
|
||||||
vars["MethodDescriptor"] = "com.google.net.stubby.MethodDescriptor";
|
vars["MethodDescriptor"] = "io.grpc.MethodDescriptor";
|
||||||
vars["ProtoUtils"] = "com.google.net.stubby.proto.ProtoUtils";
|
vars["ProtoUtils"] = "io.grpc.proto.ProtoUtils";
|
||||||
vars["StreamObserver"] = "com.google.net.stubby.stub.StreamObserver";
|
vars["StreamObserver"] = "io.grpc.stub.StreamObserver";
|
||||||
vars["Iterator"] = "java.util.Iterator";
|
vars["Iterator"] = "java.util.Iterator";
|
||||||
vars["Map"] = "java.util.Map";
|
vars["Map"] = "java.util.Map";
|
||||||
vars["TimeUnit"] = "java.util.concurrent.TimeUnit";
|
vars["TimeUnit"] = "java.util.concurrent.TimeUnit";
|
||||||
|
|
|
||||||
|
|
@ -1,62 +1,62 @@
|
||||||
package com.google.net.stubby.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import static com.google.net.stubby.stub.Calls.createMethodDescriptor;
|
import static io.grpc.stub.Calls.createMethodDescriptor;
|
||||||
import static com.google.net.stubby.stub.Calls.asyncUnaryCall;
|
import static io.grpc.stub.Calls.asyncUnaryCall;
|
||||||
import static com.google.net.stubby.stub.Calls.asyncServerStreamingCall;
|
import static io.grpc.stub.Calls.asyncServerStreamingCall;
|
||||||
import static com.google.net.stubby.stub.Calls.asyncClientStreamingCall;
|
import static io.grpc.stub.Calls.asyncClientStreamingCall;
|
||||||
import static com.google.net.stubby.stub.Calls.duplexStreamingCall;
|
import static io.grpc.stub.Calls.duplexStreamingCall;
|
||||||
import static com.google.net.stubby.stub.Calls.blockingUnaryCall;
|
import static io.grpc.stub.Calls.blockingUnaryCall;
|
||||||
import static com.google.net.stubby.stub.Calls.blockingServerStreamingCall;
|
import static io.grpc.stub.Calls.blockingServerStreamingCall;
|
||||||
import static com.google.net.stubby.stub.Calls.unaryFutureCall;
|
import static io.grpc.stub.Calls.unaryFutureCall;
|
||||||
import static com.google.net.stubby.stub.ServerCalls.createMethodDefinition;
|
import static io.grpc.stub.ServerCalls.createMethodDefinition;
|
||||||
import static com.google.net.stubby.stub.ServerCalls.asyncUnaryRequestCall;
|
import static io.grpc.stub.ServerCalls.asyncUnaryRequestCall;
|
||||||
import static com.google.net.stubby.stub.ServerCalls.asyncStreamingRequestCall;
|
import static io.grpc.stub.ServerCalls.asyncStreamingRequestCall;
|
||||||
|
|
||||||
@javax.annotation.Generated("by gRPC proto compiler")
|
@javax.annotation.Generated("by gRPC proto compiler")
|
||||||
public class TestServiceGrpc {
|
public class TestServiceGrpc {
|
||||||
|
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.SimpleRequest,
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.SimpleRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL =
|
io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL =
|
||||||
com.google.net.stubby.stub.Method.create(
|
io.grpc.stub.Method.create(
|
||||||
com.google.net.stubby.MethodType.UNARY, "UnaryCall",
|
io.grpc.MethodType.UNARY, "UnaryCall",
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.SimpleRequest.PARSER),
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.PARSER),
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.SimpleResponse.PARSER));
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.PARSER));
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
|
||||||
com.google.net.stubby.stub.Method.create(
|
io.grpc.stub.Method.create(
|
||||||
com.google.net.stubby.MethodType.SERVER_STREAMING, "StreamingOutputCall",
|
io.grpc.MethodType.SERVER_STREAMING, "StreamingOutputCall",
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest.PARSER),
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER),
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse.PARSER));
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER));
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest,
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.StreamingInputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
|
io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
|
||||||
com.google.net.stubby.stub.Method.create(
|
io.grpc.stub.Method.create(
|
||||||
com.google.net.stubby.MethodType.CLIENT_STREAMING, "StreamingInputCall",
|
io.grpc.MethodType.CLIENT_STREAMING, "StreamingInputCall",
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest.PARSER),
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.PARSER),
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse.PARSER));
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.PARSER));
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
|
||||||
com.google.net.stubby.stub.Method.create(
|
io.grpc.stub.Method.create(
|
||||||
com.google.net.stubby.MethodType.DUPLEX_STREAMING, "FullDuplexCall",
|
io.grpc.MethodType.DUPLEX_STREAMING, "FullDuplexCall",
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest.PARSER),
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER),
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse.PARSER));
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER));
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
|
||||||
com.google.net.stubby.stub.Method.create(
|
io.grpc.stub.Method.create(
|
||||||
com.google.net.stubby.MethodType.DUPLEX_STREAMING, "HalfDuplexCall",
|
io.grpc.MethodType.DUPLEX_STREAMING, "HalfDuplexCall",
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest.PARSER),
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER),
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse.PARSER));
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER));
|
||||||
|
|
||||||
public static TestServiceStub newStub(com.google.net.stubby.Channel channel) {
|
public static TestServiceStub newStub(io.grpc.Channel channel) {
|
||||||
return new TestServiceStub(channel, CONFIG);
|
return new TestServiceStub(channel, CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TestServiceBlockingStub newBlockingStub(
|
public static TestServiceBlockingStub newBlockingStub(
|
||||||
com.google.net.stubby.Channel channel) {
|
io.grpc.Channel channel) {
|
||||||
return new TestServiceBlockingStub(channel, CONFIG);
|
return new TestServiceBlockingStub(channel, CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TestServiceFutureStub newFutureStub(
|
public static TestServiceFutureStub newFutureStub(
|
||||||
com.google.net.stubby.Channel channel) {
|
io.grpc.Channel channel) {
|
||||||
return new TestServiceFutureStub(channel, CONFIG);
|
return new TestServiceFutureStub(channel, CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,17 +65,17 @@ public class TestServiceGrpc {
|
||||||
|
|
||||||
@javax.annotation.concurrent.Immutable
|
@javax.annotation.concurrent.Immutable
|
||||||
public static class TestServiceServiceDescriptor extends
|
public static class TestServiceServiceDescriptor extends
|
||||||
com.google.net.stubby.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
|
io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.SimpleRequest,
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.SimpleResponse> unaryCall;
|
io.grpc.testing.integration.Test.SimpleResponse> unaryCall;
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall;
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall;
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest,
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> streamingInputCall;
|
io.grpc.testing.integration.Test.StreamingInputCallResponse> streamingInputCall;
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall;
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall;
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall;
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall;
|
||||||
|
|
||||||
private TestServiceServiceDescriptor() {
|
private TestServiceServiceDescriptor() {
|
||||||
unaryCall = createMethodDescriptor(
|
unaryCall = createMethodDescriptor(
|
||||||
|
|
@ -91,33 +91,33 @@ public class TestServiceGrpc {
|
||||||
}
|
}
|
||||||
|
|
||||||
private TestServiceServiceDescriptor(
|
private TestServiceServiceDescriptor(
|
||||||
java.util.Map<java.lang.String, com.google.net.stubby.MethodDescriptor<?, ?>> methodMap) {
|
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
|
||||||
unaryCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.SimpleRequest,
|
unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.SimpleResponse>) methodMap.get(
|
io.grpc.testing.integration.Test.SimpleResponse>) methodMap.get(
|
||||||
CONFIG.unaryCall.getName());
|
CONFIG.unaryCall.getName());
|
||||||
streamingOutputCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
|
||||||
CONFIG.streamingOutputCall.getName());
|
CONFIG.streamingOutputCall.getName());
|
||||||
streamingInputCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest,
|
streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse>) methodMap.get(
|
io.grpc.testing.integration.Test.StreamingInputCallResponse>) methodMap.get(
|
||||||
CONFIG.streamingInputCall.getName());
|
CONFIG.streamingInputCall.getName());
|
||||||
fullDuplexCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
|
||||||
CONFIG.fullDuplexCall.getName());
|
CONFIG.fullDuplexCall.getName());
|
||||||
halfDuplexCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
|
||||||
CONFIG.halfDuplexCall.getName());
|
CONFIG.halfDuplexCall.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
protected TestServiceServiceDescriptor build(
|
protected TestServiceServiceDescriptor build(
|
||||||
java.util.Map<java.lang.String, com.google.net.stubby.MethodDescriptor<?, ?>> methodMap) {
|
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
|
||||||
return new TestServiceServiceDescriptor(methodMap);
|
return new TestServiceServiceDescriptor(methodMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.common.collect.ImmutableList<com.google.net.stubby.MethodDescriptor<?, ?>> methods() {
|
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||||
return com.google.common.collect.ImmutableList.<com.google.net.stubby.MethodDescriptor<?, ?>>of(
|
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
|
||||||
unaryCall,
|
unaryCall,
|
||||||
streamingOutputCall,
|
streamingOutputCall,
|
||||||
streamingInputCall,
|
streamingInputCall,
|
||||||
|
|
@ -128,198 +128,198 @@ public class TestServiceGrpc {
|
||||||
|
|
||||||
public static interface TestService {
|
public static interface TestService {
|
||||||
|
|
||||||
public void unaryCall(com.google.net.stubby.testing.integration.Test.SimpleRequest request,
|
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.SimpleResponse> responseObserver);
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver);
|
||||||
|
|
||||||
public void streamingOutputCall(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request,
|
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
|
||||||
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> responseObserver);
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver);
|
||||||
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
|
||||||
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface TestServiceBlockingClient {
|
public static interface TestServiceBlockingClient {
|
||||||
|
|
||||||
public com.google.net.stubby.testing.integration.Test.SimpleResponse unaryCall(com.google.net.stubby.testing.integration.Test.SimpleRequest request);
|
public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request);
|
||||||
|
|
||||||
public java.util.Iterator<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
|
public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request);
|
io.grpc.testing.integration.Test.StreamingOutputCallRequest request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface TestServiceFutureClient {
|
public static interface TestServiceFutureClient {
|
||||||
|
|
||||||
public com.google.common.util.concurrent.ListenableFuture<com.google.net.stubby.testing.integration.Test.SimpleResponse> unaryCall(
|
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
|
||||||
com.google.net.stubby.testing.integration.Test.SimpleRequest request);
|
io.grpc.testing.integration.Test.SimpleRequest request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TestServiceStub extends
|
public static class TestServiceStub extends
|
||||||
com.google.net.stubby.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
|
io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
|
||||||
implements TestService {
|
implements TestService {
|
||||||
private TestServiceStub(com.google.net.stubby.Channel channel,
|
private TestServiceStub(io.grpc.Channel channel,
|
||||||
TestServiceServiceDescriptor config) {
|
TestServiceServiceDescriptor config) {
|
||||||
super(channel, config);
|
super(channel, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
protected TestServiceStub build(com.google.net.stubby.Channel channel,
|
protected TestServiceStub build(io.grpc.Channel channel,
|
||||||
TestServiceServiceDescriptor config) {
|
TestServiceServiceDescriptor config) {
|
||||||
return new TestServiceStub(channel, config);
|
return new TestServiceStub(channel, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public void unaryCall(com.google.net.stubby.testing.integration.Test.SimpleRequest request,
|
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.SimpleResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
|
||||||
asyncUnaryCall(
|
asyncUnaryCall(
|
||||||
channel.newCall(config.unaryCall), request, responseObserver);
|
channel.newCall(config.unaryCall), request, responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public void streamingOutputCall(com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request,
|
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
||||||
asyncServerStreamingCall(
|
asyncServerStreamingCall(
|
||||||
channel.newCall(config.streamingOutputCall), request, responseObserver);
|
channel.newCall(config.streamingOutputCall), request, responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
|
||||||
return asyncClientStreamingCall(
|
return asyncClientStreamingCall(
|
||||||
channel.newCall(config.streamingInputCall), responseObserver);
|
channel.newCall(config.streamingInputCall), responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
||||||
return duplexStreamingCall(
|
return duplexStreamingCall(
|
||||||
channel.newCall(config.fullDuplexCall), responseObserver);
|
channel.newCall(config.fullDuplexCall), responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
||||||
return duplexStreamingCall(
|
return duplexStreamingCall(
|
||||||
channel.newCall(config.halfDuplexCall), responseObserver);
|
channel.newCall(config.halfDuplexCall), responseObserver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TestServiceBlockingStub extends
|
public static class TestServiceBlockingStub extends
|
||||||
com.google.net.stubby.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
|
io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
|
||||||
implements TestServiceBlockingClient {
|
implements TestServiceBlockingClient {
|
||||||
private TestServiceBlockingStub(com.google.net.stubby.Channel channel,
|
private TestServiceBlockingStub(io.grpc.Channel channel,
|
||||||
TestServiceServiceDescriptor config) {
|
TestServiceServiceDescriptor config) {
|
||||||
super(channel, config);
|
super(channel, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
protected TestServiceBlockingStub build(com.google.net.stubby.Channel channel,
|
protected TestServiceBlockingStub build(io.grpc.Channel channel,
|
||||||
TestServiceServiceDescriptor config) {
|
TestServiceServiceDescriptor config) {
|
||||||
return new TestServiceBlockingStub(channel, config);
|
return new TestServiceBlockingStub(channel, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.net.stubby.testing.integration.Test.SimpleResponse unaryCall(com.google.net.stubby.testing.integration.Test.SimpleRequest request) {
|
public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) {
|
||||||
return blockingUnaryCall(
|
return blockingUnaryCall(
|
||||||
channel.newCall(config.unaryCall), request);
|
channel.newCall(config.unaryCall), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public java.util.Iterator<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
|
public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request) {
|
io.grpc.testing.integration.Test.StreamingOutputCallRequest request) {
|
||||||
return blockingServerStreamingCall(
|
return blockingServerStreamingCall(
|
||||||
channel.newCall(config.streamingOutputCall), request);
|
channel.newCall(config.streamingOutputCall), request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TestServiceFutureStub extends
|
public static class TestServiceFutureStub extends
|
||||||
com.google.net.stubby.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
|
io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
|
||||||
implements TestServiceFutureClient {
|
implements TestServiceFutureClient {
|
||||||
private TestServiceFutureStub(com.google.net.stubby.Channel channel,
|
private TestServiceFutureStub(io.grpc.Channel channel,
|
||||||
TestServiceServiceDescriptor config) {
|
TestServiceServiceDescriptor config) {
|
||||||
super(channel, config);
|
super(channel, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
protected TestServiceFutureStub build(com.google.net.stubby.Channel channel,
|
protected TestServiceFutureStub build(io.grpc.Channel channel,
|
||||||
TestServiceServiceDescriptor config) {
|
TestServiceServiceDescriptor config) {
|
||||||
return new TestServiceFutureStub(channel, config);
|
return new TestServiceFutureStub(channel, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.common.util.concurrent.ListenableFuture<com.google.net.stubby.testing.integration.Test.SimpleResponse> unaryCall(
|
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
|
||||||
com.google.net.stubby.testing.integration.Test.SimpleRequest request) {
|
io.grpc.testing.integration.Test.SimpleRequest request) {
|
||||||
return unaryFutureCall(
|
return unaryFutureCall(
|
||||||
channel.newCall(config.unaryCall), request);
|
channel.newCall(config.unaryCall), request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static com.google.net.stubby.ServerServiceDefinition bindService(
|
public static io.grpc.ServerServiceDefinition bindService(
|
||||||
final TestService serviceImpl) {
|
final TestService serviceImpl) {
|
||||||
return com.google.net.stubby.ServerServiceDefinition.builder("grpc.testing.TestService")
|
return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService")
|
||||||
.addMethod(createMethodDefinition(
|
.addMethod(createMethodDefinition(
|
||||||
METHOD_UNARY_CALL,
|
METHOD_UNARY_CALL,
|
||||||
asyncUnaryRequestCall(
|
asyncUnaryRequestCall(
|
||||||
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
|
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
|
||||||
com.google.net.stubby.testing.integration.Test.SimpleRequest,
|
io.grpc.testing.integration.Test.SimpleRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.SimpleResponse>() {
|
io.grpc.testing.integration.Test.SimpleResponse>() {
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public void invoke(
|
public void invoke(
|
||||||
com.google.net.stubby.testing.integration.Test.SimpleRequest request,
|
io.grpc.testing.integration.Test.SimpleRequest request,
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.SimpleResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
|
||||||
serviceImpl.unaryCall(request, responseObserver);
|
serviceImpl.unaryCall(request, responseObserver);
|
||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
.addMethod(createMethodDefinition(
|
.addMethod(createMethodDefinition(
|
||||||
METHOD_STREAMING_OUTPUT_CALL,
|
METHOD_STREAMING_OUTPUT_CALL,
|
||||||
asyncUnaryRequestCall(
|
asyncUnaryRequestCall(
|
||||||
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
|
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>() {
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public void invoke(
|
public void invoke(
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest request,
|
io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
||||||
serviceImpl.streamingOutputCall(request, responseObserver);
|
serviceImpl.streamingOutputCall(request, responseObserver);
|
||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
.addMethod(createMethodDefinition(
|
.addMethod(createMethodDefinition(
|
||||||
METHOD_STREAMING_INPUT_CALL,
|
METHOD_STREAMING_INPUT_CALL,
|
||||||
asyncStreamingRequestCall(
|
asyncStreamingRequestCall(
|
||||||
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
|
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest,
|
io.grpc.testing.integration.Test.StreamingInputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse>() {
|
io.grpc.testing.integration.Test.StreamingInputCallResponse>() {
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallRequest> invoke(
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke(
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
|
||||||
return serviceImpl.streamingInputCall(responseObserver);
|
return serviceImpl.streamingInputCall(responseObserver);
|
||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
.addMethod(createMethodDefinition(
|
.addMethod(createMethodDefinition(
|
||||||
METHOD_FULL_DUPLEX_CALL,
|
METHOD_FULL_DUPLEX_CALL,
|
||||||
asyncStreamingRequestCall(
|
asyncStreamingRequestCall(
|
||||||
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
|
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>() {
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> invoke(
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
||||||
return serviceImpl.fullDuplexCall(responseObserver);
|
return serviceImpl.fullDuplexCall(responseObserver);
|
||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
.addMethod(createMethodDefinition(
|
.addMethod(createMethodDefinition(
|
||||||
METHOD_HALF_DUPLEX_CALL,
|
METHOD_HALF_DUPLEX_CALL,
|
||||||
asyncStreamingRequestCall(
|
asyncStreamingRequestCall(
|
||||||
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
|
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest,
|
io.grpc.testing.integration.Test.StreamingOutputCallRequest,
|
||||||
com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse>() {
|
io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallRequest> invoke(
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
|
||||||
return serviceImpl.halfDuplexCall(responseObserver);
|
return serviceImpl.halfDuplexCall(responseObserver);
|
||||||
}
|
}
|
||||||
}))).build();
|
}))).build();
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ syntax = "proto2";
|
||||||
|
|
||||||
package grpc.testing;
|
package grpc.testing;
|
||||||
|
|
||||||
option java_package = "com.google.net.stubby.testing.integration";
|
option java_package = "io.grpc.testing.integration";
|
||||||
|
|
||||||
message SimpleRequest {
|
message SimpleRequest {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ plugins {
|
||||||
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
|
id "be.insaneprogramming.gradle.animalsniffer" version "1.4.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
description = 'Stubby: Core'
|
description = 'gRPC: Core'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile libraries.protobuf,
|
compile libraries.protobuf,
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,13 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import com.google.net.stubby.SharedResourceHolder.Resource;
|
|
||||||
import com.google.net.stubby.transport.ClientTransportFactory;
|
import io.grpc.SharedResourceHolder.Resource;
|
||||||
|
import io.grpc.transport.ClientTransportFactory;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|
@ -29,13 +29,14 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import static com.google.net.stubby.AbstractChannelBuilder.DEFAULT_EXECUTOR;
|
import static io.grpc.AbstractChannelBuilder.DEFAULT_EXECUTOR;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.util.concurrent.Service;
|
import com.google.common.util.concurrent.Service;
|
||||||
import com.google.net.stubby.transport.ServerListener;
|
|
||||||
|
import io.grpc.transport.ServerListener;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
|
||||||
|
|
@ -29,17 +29,18 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.base.Throwables;
|
import com.google.common.base.Throwables;
|
||||||
import com.google.common.util.concurrent.MoreExecutors;
|
import com.google.common.util.concurrent.MoreExecutors;
|
||||||
import com.google.common.util.concurrent.Service.Listener;
|
import com.google.common.util.concurrent.Service.Listener;
|
||||||
import com.google.common.util.concurrent.Service.State;
|
import com.google.common.util.concurrent.Service.State;
|
||||||
import com.google.net.stubby.transport.ClientStream;
|
|
||||||
import com.google.net.stubby.transport.ClientStreamListener;
|
import io.grpc.transport.ClientStream;
|
||||||
import com.google.net.stubby.transport.ClientTransport;
|
import io.grpc.transport.ClientStreamListener;
|
||||||
import com.google.net.stubby.transport.ClientTransportFactory;
|
import io.grpc.transport.ClientTransport;
|
||||||
|
import io.grpc.transport.ClientTransportFactory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
@ -142,8 +142,8 @@ public class ClientInterceptors {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link com.google.net.stubby.Call.Listener} which forwards all of its methods to another
|
* A {@link io.grpc.Call.Listener} which forwards all of its methods to another
|
||||||
* {@link com.google.net.stubby.Call.Listener}.
|
* {@link io.grpc.Call.Listener}.
|
||||||
*/
|
*/
|
||||||
public static class ForwardingListener<T> extends Call.Listener<T> {
|
public static class ForwardingListener<T> extends Call.Listener<T> {
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common constants and utilities for GRPC protocol framing.
|
* Common constants and utilities for GRPC protocol framing.
|
||||||
|
|
@ -29,10 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.net.stubby.ServerMethodDefinition;
|
|
||||||
import com.google.net.stubby.ServerServiceDefinition;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.US_ASCII;
|
import static com.google.common.base.Charsets.US_ASCII;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The call type of a method.
|
* The call type of a method.
|
||||||
|
|
@ -29,9 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.net.stubby.ServerServiceDefinition;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
|
||||||
|
|
@ -29,21 +29,21 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.base.Throwables;
|
import com.google.common.base.Throwables;
|
||||||
import com.google.common.util.concurrent.MoreExecutors;
|
import com.google.common.util.concurrent.MoreExecutors;
|
||||||
import com.google.common.util.concurrent.Service;
|
import com.google.common.util.concurrent.Service;
|
||||||
import com.google.net.stubby.transport.ServerListener;
|
|
||||||
import com.google.net.stubby.transport.ServerStream;
|
import io.grpc.transport.ServerListener;
|
||||||
import com.google.net.stubby.transport.ServerStreamListener;
|
import io.grpc.transport.ServerStream;
|
||||||
import com.google.net.stubby.transport.ServerTransportListener;
|
import io.grpc.transport.ServerStreamListener;
|
||||||
|
import io.grpc.transport.ServerTransportListener;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
|
@ -29,13 +29,14 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.proto;
|
package io.grpc.proto;
|
||||||
|
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import com.google.net.stubby.DeferredInputStream;
|
|
||||||
import com.google.protobuf.CodedOutputStream;
|
import com.google.protobuf.CodedOutputStream;
|
||||||
import com.google.protobuf.MessageLite;
|
import com.google.protobuf.MessageLite;
|
||||||
|
|
||||||
|
import io.grpc.DeferredInputStream;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
@ -43,7 +44,7 @@ import java.io.OutputStream;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of {@link com.google.net.stubby.DeferredInputStream} backed by a protobuf.
|
* Implementation of {@link io.grpc.DeferredInputStream} backed by a protobuf.
|
||||||
*/
|
*/
|
||||||
public class DeferredProtoInputStream extends DeferredInputStream<MessageLite> {
|
public class DeferredProtoInputStream extends DeferredInputStream<MessageLite> {
|
||||||
|
|
||||||
|
|
@ -29,16 +29,17 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.proto;
|
package io.grpc.proto;
|
||||||
|
|
||||||
import com.google.net.stubby.Marshaller;
|
|
||||||
import com.google.net.stubby.Metadata;
|
|
||||||
import com.google.net.stubby.Status;
|
|
||||||
import com.google.protobuf.InvalidProtocolBufferException;
|
import com.google.protobuf.InvalidProtocolBufferException;
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
import com.google.protobuf.MessageLite;
|
import com.google.protobuf.MessageLite;
|
||||||
import com.google.protobuf.Parser;
|
import com.google.protobuf.Parser;
|
||||||
|
|
||||||
|
import io.grpc.Marshaller;
|
||||||
|
import io.grpc.Metadata;
|
||||||
|
import io.grpc.Status;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract base class for {@link Buffer} implementations.
|
* Abstract base class for {@link Buffer} implementations.
|
||||||
|
|
@ -29,12 +29,13 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.net.stubby.Metadata;
|
|
||||||
import com.google.net.stubby.Status;
|
import io.grpc.Metadata;
|
||||||
|
import io.grpc.Status;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
@ -98,7 +99,7 @@ public abstract class AbstractClientStream<IdT> extends AbstractStream<IdT>
|
||||||
* Called by transport implementations when they receive headers. When receiving headers
|
* Called by transport implementations when they receive headers. When receiving headers
|
||||||
* a transport may determine that there is an error in the protocol at this phase which is
|
* a transport may determine that there is an error in the protocol at this phase which is
|
||||||
* why this method takes an error {@link Status}. If a transport reports an
|
* why this method takes an error {@link Status}. If a transport reports an
|
||||||
* {@link com.google.net.stubby.Status.Code#INTERNAL} error
|
* {@link io.grpc.Status.Code#INTERNAL} error
|
||||||
*
|
*
|
||||||
* @param headers the parsed headers
|
* @param headers the parsed headers
|
||||||
*/
|
*/
|
||||||
|
|
@ -29,12 +29,13 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.util.concurrent.AbstractService;
|
import com.google.common.util.concurrent.AbstractService;
|
||||||
import com.google.net.stubby.Metadata;
|
|
||||||
import com.google.net.stubby.MethodDescriptor;
|
import io.grpc.Metadata;
|
||||||
|
import io.grpc.MethodDescriptor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract base class for all {@link ClientTransport} implementations. Implements the
|
* Abstract base class for all {@link ClientTransport} implementations. Implements the
|
||||||
|
|
@ -29,11 +29,12 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.net.stubby.Metadata;
|
|
||||||
import com.google.net.stubby.Status;
|
import io.grpc.Metadata;
|
||||||
|
import io.grpc.Status;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.UTF_8;
|
import static com.google.common.base.Charsets.UTF_8;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link Stream} to support client-side termination semantics.
|
* Extension of {@link Stream} to support client-side termination semantics.
|
||||||
|
|
@ -29,10 +29,10 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.net.stubby.Metadata;
|
import io.grpc.Metadata;
|
||||||
import com.google.net.stubby.Status;
|
import io.grpc.Status;
|
||||||
|
|
||||||
/** An observer of client-side stream events. */
|
/** An observer of client-side stream events. */
|
||||||
public interface ClientStreamListener extends StreamListener {
|
public interface ClientStreamListener extends StreamListener {
|
||||||
|
|
@ -40,7 +40,7 @@ public interface ClientStreamListener extends StreamListener {
|
||||||
* Called upon receiving all header information from the remote end-point. Note that transports
|
* Called upon receiving all header information from the remote end-point. Note that transports
|
||||||
* are not required to call this method if no header information is received, this would occur
|
* are not required to call this method if no header information is received, this would occur
|
||||||
* when a stream immediately terminates with an error and only
|
* when a stream immediately terminates with an error and only
|
||||||
* {@link #closed(com.google.net.stubby.Status, Metadata.Trailers)} is called.
|
* {@link #closed(io.grpc.Status, Metadata.Trailers)} is called.
|
||||||
*
|
*
|
||||||
* <p>This method should return quickly, as the same thread may be used to process other streams.
|
* <p>This method should return quickly, as the same thread may be used to process other streams.
|
||||||
*
|
*
|
||||||
|
|
@ -50,7 +50,7 @@ public interface ClientStreamListener extends StreamListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the stream is fully closed. {@link
|
* Called when the stream is fully closed. {@link
|
||||||
* com.google.net.stubby.Status.Code#OK} is the only status code that is guaranteed
|
* io.grpc.Status.Code#OK} is the only status code that is guaranteed
|
||||||
* to have been sent from the remote server. Any other status code may have been caused by
|
* to have been sent from the remote server. Any other status code may have been caused by
|
||||||
* abnormal stream termination. This is guaranteed to always be the final call on a listener. No
|
* abnormal stream termination. This is guaranteed to always be the final call on a listener. No
|
||||||
* further callbacks will be issued.
|
* further callbacks will be issued.
|
||||||
|
|
@ -29,11 +29,12 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.Service;
|
import com.google.common.util.concurrent.Service;
|
||||||
import com.google.net.stubby.Metadata;
|
|
||||||
import com.google.net.stubby.MethodDescriptor;
|
import io.grpc.Metadata;
|
||||||
|
import io.grpc.MethodDescriptor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client-side transport encapsulating a single connection to a remote server. Allows creation
|
* The client-side transport encapsulating a single connection to a remote server. Allows creation
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
/** Pre-configured factory for creating {@link ClientTransport} instances. */
|
/** Pre-configured factory for creating {@link ClientTransport} instances. */
|
||||||
public interface ClientTransportFactory {
|
public interface ClientTransportFactory {
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
|
|
@ -29,12 +29,13 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.net.stubby.Metadata;
|
|
||||||
import com.google.net.stubby.Status;
|
import io.grpc.Metadata;
|
||||||
|
import io.grpc.Status;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
|
|
@ -29,10 +29,10 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.net.stubby.Metadata;
|
import io.grpc.Metadata;
|
||||||
import com.google.net.stubby.Status;
|
import io.grpc.Status;
|
||||||
|
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
|
|
||||||
|
|
@ -29,11 +29,12 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import com.google.net.stubby.Status;
|
|
||||||
|
import io.grpc.Status;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
|
|
@ -29,11 +29,12 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import com.google.net.stubby.DeferredInputStream;
|
|
||||||
|
import io.grpc.DeferredInputStream;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.Service;
|
import com.google.common.util.concurrent.Service;
|
||||||
|
|
||||||
|
|
@ -29,10 +29,10 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.net.stubby.Metadata;
|
import io.grpc.Metadata;
|
||||||
import com.google.net.stubby.Status;
|
import io.grpc.Status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link Stream} to support server-side termination semantics.
|
* Extension of {@link Stream} to support server-side termination semantics.
|
||||||
|
|
@ -50,7 +50,7 @@ public interface ServerStream extends Stream {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the stream for both reading and writing. A status code of
|
* Closes the stream for both reading and writing. A status code of
|
||||||
* {@link com.google.net.stubby.Status.Code#OK} implies normal termination of the
|
* {@link io.grpc.Status.Code#OK} implies normal termination of the
|
||||||
* stream. Any other value implies abnormal termination.
|
* stream. Any other value implies abnormal termination.
|
||||||
*
|
*
|
||||||
* @param status details of the closure
|
* @param status details of the closure
|
||||||
|
|
@ -29,9 +29,9 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.net.stubby.Status;
|
import io.grpc.Status;
|
||||||
|
|
||||||
/** An observer of server-side stream events. */
|
/** An observer of server-side stream events. */
|
||||||
public interface ServerStreamListener extends StreamListener {
|
public interface ServerStreamListener extends StreamListener {
|
||||||
|
|
@ -45,7 +45,7 @@ public interface ServerStreamListener extends StreamListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the stream is fully closed. A status code of {@link
|
* Called when the stream is fully closed. A status code of {@link
|
||||||
* com.google.net.stubby.Status.Code#OK} implies normal termination of the stream.
|
* io.grpc.Status.Code#OK} implies normal termination of the stream.
|
||||||
* Any other value implies abnormal termination. Since clients cannot send status, the passed
|
* Any other value implies abnormal termination. Since clients cannot send status, the passed
|
||||||
* status is always library-generated and only is concerned with transport-level stream shutdown
|
* status is always library-generated and only is concerned with transport-level stream shutdown
|
||||||
* (the call itself may have had a failing status, but if the stream terminated cleanly with the
|
* (the call itself may have had a failing status, but if the stream terminated cleanly with the
|
||||||
|
|
@ -29,9 +29,9 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import com.google.net.stubby.Metadata;
|
import io.grpc.Metadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A observer of a server-side transport for stream creation events.
|
* A observer of a server-side transport for stream creation events.
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
|
@ -29,12 +29,13 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.US_ASCII;
|
import static com.google.common.base.Charsets.US_ASCII;
|
||||||
|
|
||||||
import com.google.common.io.BaseEncoding;
|
import com.google.common.io.BaseEncoding;
|
||||||
import com.google.net.stubby.Metadata;
|
|
||||||
|
import io.grpc.Metadata;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -29,21 +29,20 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertSame;
|
import static org.junit.Assert.assertSame;
|
||||||
|
import static org.mockito.Matchers.same;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.same;
|
|
||||||
import static org.mockito.Mockito.spy;
|
import static org.mockito.Mockito.spy;
|
||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import io.grpc.ClientInterceptors.ForwardingCall;
|
||||||
import com.google.net.stubby.ClientInterceptors.ForwardingCall;
|
import io.grpc.ClientInterceptors.ForwardingListener;
|
||||||
import com.google.net.stubby.ClientInterceptors.ForwardingListener;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.US_ASCII;
|
import static com.google.common.base.Charsets.US_ASCII;
|
||||||
import static com.google.common.base.Charsets.UTF_8;
|
import static com.google.common.base.Charsets.UTF_8;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
@ -38,10 +38,7 @@ import static org.junit.Assert.assertSame;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
import com.google.net.stubby.ServerMethodDefinition;
|
import io.grpc.HandlerRegistry.Method;
|
||||||
import com.google.net.stubby.ServerCallHandler;
|
|
||||||
import com.google.net.stubby.ServerServiceDefinition;
|
|
||||||
import com.google.net.stubby.HandlerRegistry.Method;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.UTF_8;
|
import static com.google.common.base.Charsets.UTF_8;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
@ -49,9 +49,10 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import com.google.common.util.concurrent.AbstractService;
|
import com.google.common.util.concurrent.AbstractService;
|
||||||
import com.google.common.util.concurrent.Service;
|
import com.google.common.util.concurrent.Service;
|
||||||
import com.google.net.stubby.transport.ServerStream;
|
|
||||||
import com.google.net.stubby.transport.ServerStreamListener;
|
import io.grpc.transport.ServerStream;
|
||||||
import com.google.net.stubby.transport.ServerTransportListener;
|
import io.grpc.transport.ServerStreamListener;
|
||||||
|
import io.grpc.transport.ServerTransportListener;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
@ -60,7 +61,6 @@ import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.JUnit4;
|
import org.junit.runners.JUnit4;
|
||||||
import org.mockito.ArgumentCaptor;
|
import org.mockito.ArgumentCaptor;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.Mockito;
|
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
|
@ -29,18 +29,18 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertSame;
|
import static org.junit.Assert.assertSame;
|
||||||
|
import static org.mockito.Matchers.same;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.same;
|
|
||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
import static org.mockito.Mockito.verifyZeroInteractions;
|
import static org.mockito.Mockito.verifyZeroInteractions;
|
||||||
|
|
||||||
import com.google.net.stubby.Metadata.Headers;
|
import io.grpc.Metadata.Headers;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
@ -51,8 +51,8 @@ import org.mockito.Mock;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/** Unit tests for {@link ServerInterceptors}. */
|
/** Unit tests for {@link ServerInterceptors}. */
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby;
|
package io.grpc;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
|
@ -38,13 +38,12 @@ import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertSame;
|
import static org.junit.Assert.assertSame;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
import static org.mockito.Mockito.any;
|
import static org.mockito.Matchers.any;
|
||||||
import static org.mockito.Mockito.anyLong;
|
import static org.mockito.Matchers.anyLong;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.timeout;
|
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import com.google.net.stubby.SharedResourceHolder.Resource;
|
import io.grpc.SharedResourceHolder.Resource;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.UTF_8;
|
import static com.google.common.base.Charsets.UTF_8;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
@ -29,10 +29,10 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.UTF_8;
|
import static com.google.common.base.Charsets.UTF_8;
|
||||||
import static com.google.net.stubby.transport.Buffers.wrap;
|
import static io.grpc.transport.Buffers.wrap;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertSame;
|
import static org.junit.Assert.assertSame;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.UTF_8;
|
import static com.google.common.base.Charsets.UTF_8;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.UTF_8;
|
import static com.google.common.base.Charsets.UTF_8;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
@ -42,7 +42,8 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
|
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import com.google.common.primitives.Bytes;
|
import com.google.common.primitives.Bytes;
|
||||||
import com.google.net.stubby.transport.MessageDeframer.Listener;
|
|
||||||
|
import io.grpc.transport.MessageDeframer.Listener;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
@ -29,20 +29,21 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.transport;
|
package io.grpc.transport;
|
||||||
|
|
||||||
import static com.google.common.base.Charsets.US_ASCII;
|
import static com.google.common.base.Charsets.US_ASCII;
|
||||||
import static com.google.common.base.Charsets.UTF_8;
|
import static com.google.common.base.Charsets.UTF_8;
|
||||||
import static com.google.net.stubby.Metadata.ASCII_STRING_MARSHALLER;
|
import static io.grpc.Metadata.ASCII_STRING_MARSHALLER;
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import com.google.common.io.BaseEncoding;
|
import com.google.common.io.BaseEncoding;
|
||||||
import com.google.net.stubby.Metadata.BinaryMarshaller;
|
|
||||||
import com.google.net.stubby.Metadata.Headers;
|
import io.grpc.Metadata.BinaryMarshaller;
|
||||||
import com.google.net.stubby.Metadata.Key;
|
import io.grpc.Metadata.Headers;
|
||||||
|
import io.grpc.Metadata.Key;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
@ -29,13 +29,9 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.examples;
|
package io.grpc.examples;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.SettableFuture;
|
import com.google.common.util.concurrent.SettableFuture;
|
||||||
import com.google.net.stubby.ChannelImpl;
|
|
||||||
import com.google.net.stubby.stub.StreamObserver;
|
|
||||||
import com.google.net.stubby.transport.netty.NegotiationType;
|
|
||||||
import com.google.net.stubby.transport.netty.NettyChannelBuilder;
|
|
||||||
import com.google.protos.net.stubby.examples.CalcGrpc;
|
import com.google.protos.net.stubby.examples.CalcGrpc;
|
||||||
import com.google.protos.net.stubby.examples.CalcGrpc.CalcBlockingStub;
|
import com.google.protos.net.stubby.examples.CalcGrpc.CalcBlockingStub;
|
||||||
import com.google.protos.net.stubby.examples.CalcGrpc.CalcStub;
|
import com.google.protos.net.stubby.examples.CalcGrpc.CalcStub;
|
||||||
|
|
@ -44,6 +40,11 @@ import com.google.protos.net.stubby.examples.Math.DivReply;
|
||||||
import com.google.protos.net.stubby.examples.Math.FibArgs;
|
import com.google.protos.net.stubby.examples.Math.FibArgs;
|
||||||
import com.google.protos.net.stubby.examples.Math.Num;
|
import com.google.protos.net.stubby.examples.Math.Num;
|
||||||
|
|
||||||
|
import io.grpc.ChannelImpl;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import io.grpc.transport.netty.NegotiationType;
|
||||||
|
import io.grpc.transport.netty.NettyChannelBuilder;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
|
@ -29,17 +29,18 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.examples;
|
package io.grpc.examples;
|
||||||
|
|
||||||
import com.google.net.stubby.ServerImpl;
|
|
||||||
import com.google.net.stubby.stub.StreamObserver;
|
|
||||||
import com.google.net.stubby.transport.netty.NettyServerBuilder;
|
|
||||||
import com.google.protos.net.stubby.examples.CalcGrpc;
|
import com.google.protos.net.stubby.examples.CalcGrpc;
|
||||||
import com.google.protos.net.stubby.examples.Math.DivArgs;
|
import com.google.protos.net.stubby.examples.Math.DivArgs;
|
||||||
import com.google.protos.net.stubby.examples.Math.DivReply;
|
import com.google.protos.net.stubby.examples.Math.DivReply;
|
||||||
import com.google.protos.net.stubby.examples.Math.FibArgs;
|
import com.google.protos.net.stubby.examples.Math.FibArgs;
|
||||||
import com.google.protos.net.stubby.examples.Math.Num;
|
import com.google.protos.net.stubby.examples.Math.Num;
|
||||||
|
|
||||||
|
import io.grpc.ServerImpl;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import io.grpc.transport.netty.NettyServerBuilder;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
|
@ -29,18 +29,19 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.examples;
|
package io.grpc.examples;
|
||||||
|
|
||||||
import com.google.net.stubby.ChannelImpl;
|
|
||||||
import com.google.net.stubby.stub.StreamObserver;
|
|
||||||
import com.google.net.stubby.transport.netty.NegotiationType;
|
|
||||||
import com.google.net.stubby.transport.netty.NettyChannelBuilder;
|
|
||||||
import com.google.protos.net.stubby.examples.StockGrpc;
|
import com.google.protos.net.stubby.examples.StockGrpc;
|
||||||
import com.google.protos.net.stubby.examples.StockGrpc.StockBlockingStub;
|
import com.google.protos.net.stubby.examples.StockGrpc.StockBlockingStub;
|
||||||
import com.google.protos.net.stubby.examples.StockGrpc.StockStub;
|
import com.google.protos.net.stubby.examples.StockGrpc.StockStub;
|
||||||
import com.google.protos.net.stubby.examples.StockOuterClass.StockReply;
|
import com.google.protos.net.stubby.examples.StockOuterClass.StockReply;
|
||||||
import com.google.protos.net.stubby.examples.StockOuterClass.StockRequest;
|
import com.google.protos.net.stubby.examples.StockOuterClass.StockRequest;
|
||||||
|
|
||||||
|
import io.grpc.ChannelImpl;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import io.grpc.transport.netty.NegotiationType;
|
||||||
|
import io.grpc.transport.netty.NettyChannelBuilder;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
@ -29,15 +29,16 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.examples;
|
package io.grpc.examples;
|
||||||
|
|
||||||
import com.google.net.stubby.ServerImpl;
|
|
||||||
import com.google.net.stubby.stub.StreamObserver;
|
|
||||||
import com.google.net.stubby.transport.netty.NettyServerBuilder;
|
|
||||||
import com.google.protos.net.stubby.examples.StockGrpc;
|
import com.google.protos.net.stubby.examples.StockGrpc;
|
||||||
import com.google.protos.net.stubby.examples.StockOuterClass.StockReply;
|
import com.google.protos.net.stubby.examples.StockOuterClass.StockReply;
|
||||||
import com.google.protos.net.stubby.examples.StockOuterClass.StockRequest;
|
import com.google.protos.net.stubby.examples.StockOuterClass.StockRequest;
|
||||||
|
|
||||||
|
import io.grpc.ServerImpl;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import io.grpc.transport.netty.NettyServerBuilder;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
syntax = "proto2";
|
syntax = "proto2";
|
||||||
|
|
||||||
package net.stubby.examples;
|
package io.grpc.examples;
|
||||||
option java_outer_classname = "Math";
|
option java_outer_classname = "Math";
|
||||||
|
|
||||||
message DivArgs {
|
message DivArgs {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
syntax = "proto2";
|
syntax = "proto2";
|
||||||
|
|
||||||
package net.stubby.examples;
|
package io.grpc.examples;
|
||||||
|
|
||||||
// Protocol type definitions
|
// Protocol type definitions
|
||||||
message StockRequest {
|
message StockRequest {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
apply plugin: 'protobuf'
|
apply plugin: 'protobuf'
|
||||||
apply plugin:'application'
|
apply plugin:'application'
|
||||||
|
|
||||||
description = "Stubby: Integration Testing"
|
description = "gRPC: Integration Testing"
|
||||||
|
|
||||||
// Add dependency on the protobuf plugin
|
// Add dependency on the protobuf plugin
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|
@ -18,11 +18,11 @@ configurations {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':stubby-core'),
|
compile project(':grpc-core'),
|
||||||
project(':stubby-netty'),
|
project(':grpc-netty'),
|
||||||
project(':stubby-okhttp'),
|
project(':grpc-okhttp'),
|
||||||
project(':stubby-stub'),
|
project(':grpc-stub'),
|
||||||
project(':stubby-testing'),
|
project(':grpc-testing'),
|
||||||
libraries.junit,
|
libraries.junit,
|
||||||
libraries.mockito
|
libraries.mockito
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,382 +0,0 @@
|
||||||
package com.google.net.stubby.testing.integration;
|
|
||||||
|
|
||||||
import static com.google.net.stubby.stub.Calls.createMethodDescriptor;
|
|
||||||
import static com.google.net.stubby.stub.Calls.asyncUnaryCall;
|
|
||||||
import static com.google.net.stubby.stub.Calls.asyncServerStreamingCall;
|
|
||||||
import static com.google.net.stubby.stub.Calls.asyncClientStreamingCall;
|
|
||||||
import static com.google.net.stubby.stub.Calls.duplexStreamingCall;
|
|
||||||
import static com.google.net.stubby.stub.Calls.blockingUnaryCall;
|
|
||||||
import static com.google.net.stubby.stub.Calls.blockingServerStreamingCall;
|
|
||||||
import static com.google.net.stubby.stub.Calls.unaryFutureCall;
|
|
||||||
import static com.google.net.stubby.stub.ServerCalls.createMethodDefinition;
|
|
||||||
import static com.google.net.stubby.stub.ServerCalls.asyncUnaryRequestCall;
|
|
||||||
import static com.google.net.stubby.stub.ServerCalls.asyncStreamingRequestCall;
|
|
||||||
|
|
||||||
@javax.annotation.Generated("by gRPC proto compiler")
|
|
||||||
public class TestServiceGrpc {
|
|
||||||
|
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.protobuf.EmptyProtos.Empty,
|
|
||||||
com.google.protobuf.EmptyProtos.Empty> METHOD_EMPTY_CALL =
|
|
||||||
com.google.net.stubby.stub.Method.create(
|
|
||||||
com.google.net.stubby.MethodType.UNARY, "EmptyCall",
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER),
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER));
|
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.SimpleRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.SimpleResponse> METHOD_UNARY_CALL =
|
|
||||||
com.google.net.stubby.stub.Method.create(
|
|
||||||
com.google.net.stubby.MethodType.UNARY, "UnaryCall",
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.SimpleRequest.PARSER),
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.SimpleResponse.PARSER));
|
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
|
|
||||||
com.google.net.stubby.stub.Method.create(
|
|
||||||
com.google.net.stubby.MethodType.SERVER_STREAMING, "StreamingOutputCall",
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
|
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
|
|
||||||
com.google.net.stubby.stub.Method.create(
|
|
||||||
com.google.net.stubby.MethodType.CLIENT_STREAMING, "StreamingInputCall",
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest.PARSER),
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse.PARSER));
|
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
|
|
||||||
com.google.net.stubby.stub.Method.create(
|
|
||||||
com.google.net.stubby.MethodType.DUPLEX_STREAMING, "FullDuplexCall",
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
|
|
||||||
private static final com.google.net.stubby.stub.Method<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
|
|
||||||
com.google.net.stubby.stub.Method.create(
|
|
||||||
com.google.net.stubby.MethodType.DUPLEX_STREAMING, "HalfDuplexCall",
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
|
|
||||||
com.google.net.stubby.proto.ProtoUtils.marshaller(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
|
|
||||||
|
|
||||||
public static TestServiceStub newStub(com.google.net.stubby.Channel channel) {
|
|
||||||
return new TestServiceStub(channel, CONFIG);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TestServiceBlockingStub newBlockingStub(
|
|
||||||
com.google.net.stubby.Channel channel) {
|
|
||||||
return new TestServiceBlockingStub(channel, CONFIG);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TestServiceFutureStub newFutureStub(
|
|
||||||
com.google.net.stubby.Channel channel) {
|
|
||||||
return new TestServiceFutureStub(channel, CONFIG);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final TestServiceServiceDescriptor CONFIG =
|
|
||||||
new TestServiceServiceDescriptor();
|
|
||||||
|
|
||||||
@javax.annotation.concurrent.Immutable
|
|
||||||
public static class TestServiceServiceDescriptor extends
|
|
||||||
com.google.net.stubby.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
|
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.protobuf.EmptyProtos.Empty,
|
|
||||||
com.google.protobuf.EmptyProtos.Empty> emptyCall;
|
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.SimpleRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.SimpleResponse> unaryCall;
|
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall;
|
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> streamingInputCall;
|
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> fullDuplexCall;
|
|
||||||
public final com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> halfDuplexCall;
|
|
||||||
|
|
||||||
private TestServiceServiceDescriptor() {
|
|
||||||
emptyCall = createMethodDescriptor(
|
|
||||||
"grpc.testing.TestService", METHOD_EMPTY_CALL);
|
|
||||||
unaryCall = createMethodDescriptor(
|
|
||||||
"grpc.testing.TestService", METHOD_UNARY_CALL);
|
|
||||||
streamingOutputCall = createMethodDescriptor(
|
|
||||||
"grpc.testing.TestService", METHOD_STREAMING_OUTPUT_CALL);
|
|
||||||
streamingInputCall = createMethodDescriptor(
|
|
||||||
"grpc.testing.TestService", METHOD_STREAMING_INPUT_CALL);
|
|
||||||
fullDuplexCall = createMethodDescriptor(
|
|
||||||
"grpc.testing.TestService", METHOD_FULL_DUPLEX_CALL);
|
|
||||||
halfDuplexCall = createMethodDescriptor(
|
|
||||||
"grpc.testing.TestService", METHOD_HALF_DUPLEX_CALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
private TestServiceServiceDescriptor(
|
|
||||||
java.util.Map<java.lang.String, com.google.net.stubby.MethodDescriptor<?, ?>> methodMap) {
|
|
||||||
emptyCall = (com.google.net.stubby.MethodDescriptor<com.google.protobuf.EmptyProtos.Empty,
|
|
||||||
com.google.protobuf.EmptyProtos.Empty>) methodMap.get(
|
|
||||||
CONFIG.emptyCall.getName());
|
|
||||||
unaryCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.SimpleRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.SimpleResponse>) methodMap.get(
|
|
||||||
CONFIG.unaryCall.getName());
|
|
||||||
streamingOutputCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
|
|
||||||
CONFIG.streamingOutputCall.getName());
|
|
||||||
streamingInputCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse>) methodMap.get(
|
|
||||||
CONFIG.streamingInputCall.getName());
|
|
||||||
fullDuplexCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
|
|
||||||
CONFIG.fullDuplexCall.getName());
|
|
||||||
halfDuplexCall = (com.google.net.stubby.MethodDescriptor<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
|
|
||||||
CONFIG.halfDuplexCall.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
protected TestServiceServiceDescriptor build(
|
|
||||||
java.util.Map<java.lang.String, com.google.net.stubby.MethodDescriptor<?, ?>> methodMap) {
|
|
||||||
return new TestServiceServiceDescriptor(methodMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.common.collect.ImmutableList<com.google.net.stubby.MethodDescriptor<?, ?>> methods() {
|
|
||||||
return com.google.common.collect.ImmutableList.<com.google.net.stubby.MethodDescriptor<?, ?>>of(
|
|
||||||
emptyCall,
|
|
||||||
unaryCall,
|
|
||||||
streamingOutputCall,
|
|
||||||
streamingInputCall,
|
|
||||||
fullDuplexCall,
|
|
||||||
halfDuplexCall);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface TestService {
|
|
||||||
|
|
||||||
public void emptyCall(com.google.protobuf.EmptyProtos.Empty request,
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver);
|
|
||||||
|
|
||||||
public void unaryCall(com.google.net.stubby.testing.integration.Messages.SimpleRequest request,
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.SimpleResponse> responseObserver);
|
|
||||||
|
|
||||||
public void streamingOutputCall(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request,
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
|
|
||||||
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest> streamingInputCall(
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> responseObserver);
|
|
||||||
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> fullDuplexCall(
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
|
|
||||||
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> halfDuplexCall(
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface TestServiceBlockingClient {
|
|
||||||
|
|
||||||
public com.google.protobuf.EmptyProtos.Empty emptyCall(com.google.protobuf.EmptyProtos.Empty request);
|
|
||||||
|
|
||||||
public com.google.net.stubby.testing.integration.Messages.SimpleResponse unaryCall(com.google.net.stubby.testing.integration.Messages.SimpleRequest request);
|
|
||||||
|
|
||||||
public java.util.Iterator<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall(
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface TestServiceFutureClient {
|
|
||||||
|
|
||||||
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.EmptyProtos.Empty> emptyCall(
|
|
||||||
com.google.protobuf.EmptyProtos.Empty request);
|
|
||||||
|
|
||||||
public com.google.common.util.concurrent.ListenableFuture<com.google.net.stubby.testing.integration.Messages.SimpleResponse> unaryCall(
|
|
||||||
com.google.net.stubby.testing.integration.Messages.SimpleRequest request);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TestServiceStub extends
|
|
||||||
com.google.net.stubby.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
|
|
||||||
implements TestService {
|
|
||||||
private TestServiceStub(com.google.net.stubby.Channel channel,
|
|
||||||
TestServiceServiceDescriptor config) {
|
|
||||||
super(channel, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
protected TestServiceStub build(com.google.net.stubby.Channel channel,
|
|
||||||
TestServiceServiceDescriptor config) {
|
|
||||||
return new TestServiceStub(channel, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public void emptyCall(com.google.protobuf.EmptyProtos.Empty request,
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver) {
|
|
||||||
asyncUnaryCall(
|
|
||||||
channel.newCall(config.emptyCall), request, responseObserver);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public void unaryCall(com.google.net.stubby.testing.integration.Messages.SimpleRequest request,
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.SimpleResponse> responseObserver) {
|
|
||||||
asyncUnaryCall(
|
|
||||||
channel.newCall(config.unaryCall), request, responseObserver);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public void streamingOutputCall(com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request,
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
|
||||||
asyncServerStreamingCall(
|
|
||||||
channel.newCall(config.streamingOutputCall), request, responseObserver);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest> streamingInputCall(
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> responseObserver) {
|
|
||||||
return asyncClientStreamingCall(
|
|
||||||
channel.newCall(config.streamingInputCall), responseObserver);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> fullDuplexCall(
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
|
||||||
return duplexStreamingCall(
|
|
||||||
channel.newCall(config.fullDuplexCall), responseObserver);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> halfDuplexCall(
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
|
||||||
return duplexStreamingCall(
|
|
||||||
channel.newCall(config.halfDuplexCall), responseObserver);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TestServiceBlockingStub extends
|
|
||||||
com.google.net.stubby.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
|
|
||||||
implements TestServiceBlockingClient {
|
|
||||||
private TestServiceBlockingStub(com.google.net.stubby.Channel channel,
|
|
||||||
TestServiceServiceDescriptor config) {
|
|
||||||
super(channel, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
protected TestServiceBlockingStub build(com.google.net.stubby.Channel channel,
|
|
||||||
TestServiceServiceDescriptor config) {
|
|
||||||
return new TestServiceBlockingStub(channel, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.protobuf.EmptyProtos.Empty emptyCall(com.google.protobuf.EmptyProtos.Empty request) {
|
|
||||||
return blockingUnaryCall(
|
|
||||||
channel.newCall(config.emptyCall), request);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.net.stubby.testing.integration.Messages.SimpleResponse unaryCall(com.google.net.stubby.testing.integration.Messages.SimpleRequest request) {
|
|
||||||
return blockingUnaryCall(
|
|
||||||
channel.newCall(config.unaryCall), request);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public java.util.Iterator<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall(
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request) {
|
|
||||||
return blockingServerStreamingCall(
|
|
||||||
channel.newCall(config.streamingOutputCall), request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TestServiceFutureStub extends
|
|
||||||
com.google.net.stubby.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
|
|
||||||
implements TestServiceFutureClient {
|
|
||||||
private TestServiceFutureStub(com.google.net.stubby.Channel channel,
|
|
||||||
TestServiceServiceDescriptor config) {
|
|
||||||
super(channel, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
protected TestServiceFutureStub build(com.google.net.stubby.Channel channel,
|
|
||||||
TestServiceServiceDescriptor config) {
|
|
||||||
return new TestServiceFutureStub(channel, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.EmptyProtos.Empty> emptyCall(
|
|
||||||
com.google.protobuf.EmptyProtos.Empty request) {
|
|
||||||
return unaryFutureCall(
|
|
||||||
channel.newCall(config.emptyCall), request);
|
|
||||||
}
|
|
||||||
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.common.util.concurrent.ListenableFuture<com.google.net.stubby.testing.integration.Messages.SimpleResponse> unaryCall(
|
|
||||||
com.google.net.stubby.testing.integration.Messages.SimpleRequest request) {
|
|
||||||
return unaryFutureCall(
|
|
||||||
channel.newCall(config.unaryCall), request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static com.google.net.stubby.ServerServiceDefinition bindService(
|
|
||||||
final TestService serviceImpl) {
|
|
||||||
return com.google.net.stubby.ServerServiceDefinition.builder("grpc.testing.TestService")
|
|
||||||
.addMethod(createMethodDefinition(
|
|
||||||
METHOD_EMPTY_CALL,
|
|
||||||
asyncUnaryRequestCall(
|
|
||||||
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
|
|
||||||
com.google.protobuf.EmptyProtos.Empty,
|
|
||||||
com.google.protobuf.EmptyProtos.Empty>() {
|
|
||||||
@java.lang.Override
|
|
||||||
public void invoke(
|
|
||||||
com.google.protobuf.EmptyProtos.Empty request,
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver) {
|
|
||||||
serviceImpl.emptyCall(request, responseObserver);
|
|
||||||
}
|
|
||||||
})))
|
|
||||||
.addMethod(createMethodDefinition(
|
|
||||||
METHOD_UNARY_CALL,
|
|
||||||
asyncUnaryRequestCall(
|
|
||||||
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
|
|
||||||
com.google.net.stubby.testing.integration.Messages.SimpleRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.SimpleResponse>() {
|
|
||||||
@java.lang.Override
|
|
||||||
public void invoke(
|
|
||||||
com.google.net.stubby.testing.integration.Messages.SimpleRequest request,
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.SimpleResponse> responseObserver) {
|
|
||||||
serviceImpl.unaryCall(request, responseObserver);
|
|
||||||
}
|
|
||||||
})))
|
|
||||||
.addMethod(createMethodDefinition(
|
|
||||||
METHOD_STREAMING_OUTPUT_CALL,
|
|
||||||
asyncUnaryRequestCall(
|
|
||||||
new com.google.net.stubby.stub.ServerCalls.UnaryRequestMethod<
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>() {
|
|
||||||
@java.lang.Override
|
|
||||||
public void invoke(
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest request,
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
|
||||||
serviceImpl.streamingOutputCall(request, responseObserver);
|
|
||||||
}
|
|
||||||
})))
|
|
||||||
.addMethod(createMethodDefinition(
|
|
||||||
METHOD_STREAMING_INPUT_CALL,
|
|
||||||
asyncStreamingRequestCall(
|
|
||||||
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse>() {
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest> invoke(
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse> responseObserver) {
|
|
||||||
return serviceImpl.streamingInputCall(responseObserver);
|
|
||||||
}
|
|
||||||
})))
|
|
||||||
.addMethod(createMethodDefinition(
|
|
||||||
METHOD_FULL_DUPLEX_CALL,
|
|
||||||
asyncStreamingRequestCall(
|
|
||||||
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>() {
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> invoke(
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
|
||||||
return serviceImpl.fullDuplexCall(responseObserver);
|
|
||||||
}
|
|
||||||
})))
|
|
||||||
.addMethod(createMethodDefinition(
|
|
||||||
METHOD_HALF_DUPLEX_CALL,
|
|
||||||
asyncStreamingRequestCall(
|
|
||||||
new com.google.net.stubby.stub.ServerCalls.StreamingRequestMethod<
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest,
|
|
||||||
com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse>() {
|
|
||||||
@java.lang.Override
|
|
||||||
public com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest> invoke(
|
|
||||||
com.google.net.stubby.stub.StreamObserver<com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
|
||||||
return serviceImpl.halfDuplexCall(responseObserver);
|
|
||||||
}
|
|
||||||
}))).build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -29,10 +29,10 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import static com.google.net.stubby.testing.integration.Messages.PayloadType.COMPRESSABLE;
|
import static io.grpc.testing.integration.Messages.PayloadType.COMPRESSABLE;
|
||||||
import static com.google.net.stubby.testing.integration.Util.assertEquals;
|
import static io.grpc.testing.integration.Util.assertEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.timeout;
|
import static org.mockito.Mockito.timeout;
|
||||||
|
|
@ -41,30 +41,31 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.SettableFuture;
|
import com.google.common.util.concurrent.SettableFuture;
|
||||||
import com.google.common.util.concurrent.Uninterruptibles;
|
import com.google.common.util.concurrent.Uninterruptibles;
|
||||||
import com.google.net.stubby.AbstractServerBuilder;
|
|
||||||
import com.google.net.stubby.Call;
|
|
||||||
import com.google.net.stubby.ChannelImpl;
|
|
||||||
import com.google.net.stubby.Metadata;
|
|
||||||
import com.google.net.stubby.ServerImpl;
|
|
||||||
import com.google.net.stubby.ServerInterceptors;
|
|
||||||
import com.google.net.stubby.Status;
|
|
||||||
import com.google.net.stubby.proto.ProtoUtils;
|
|
||||||
import com.google.net.stubby.stub.MetadataUtils;
|
|
||||||
import com.google.net.stubby.stub.StreamObserver;
|
|
||||||
import com.google.net.stubby.stub.StreamRecorder;
|
|
||||||
import com.google.net.stubby.testing.TestUtils;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.Payload;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.PayloadType;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.ResponseParameters;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.SimpleRequest;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.SimpleResponse;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse;
|
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
import com.google.protobuf.EmptyProtos.Empty;
|
import com.google.protobuf.EmptyProtos.Empty;
|
||||||
|
|
||||||
|
import io.grpc.AbstractServerBuilder;
|
||||||
|
import io.grpc.Call;
|
||||||
|
import io.grpc.ChannelImpl;
|
||||||
|
import io.grpc.Metadata;
|
||||||
|
import io.grpc.ServerImpl;
|
||||||
|
import io.grpc.ServerInterceptors;
|
||||||
|
import io.grpc.Status;
|
||||||
|
import io.grpc.proto.ProtoUtils;
|
||||||
|
import io.grpc.stub.MetadataUtils;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import io.grpc.stub.StreamRecorder;
|
||||||
|
import io.grpc.testing.TestUtils;
|
||||||
|
import io.grpc.testing.integration.Messages.Payload;
|
||||||
|
import io.grpc.testing.integration.Messages.PayloadType;
|
||||||
|
import io.grpc.testing.integration.Messages.ResponseParameters;
|
||||||
|
import io.grpc.testing.integration.Messages.SimpleRequest;
|
||||||
|
import io.grpc.testing.integration.Messages.SimpleResponse;
|
||||||
|
import io.grpc.testing.integration.Messages.StreamingInputCallRequest;
|
||||||
|
import io.grpc.testing.integration.Messages.StreamingInputCallResponse;
|
||||||
|
import io.grpc.testing.integration.Messages.StreamingOutputCallRequest;
|
||||||
|
import io.grpc.testing.integration.Messages.StreamingOutputCallResponse;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
@ -29,13 +29,12 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import com.google.net.stubby.ChannelImpl;
|
|
||||||
import com.google.net.stubby.transport.netty.NegotiationType;
|
|
||||||
import com.google.net.stubby.transport.netty.NettyChannelBuilder;
|
|
||||||
import com.google.net.stubby.transport.okhttp.OkHttpChannelBuilder;
|
|
||||||
|
|
||||||
|
import io.grpc.ChannelImpl;
|
||||||
|
import io.grpc.transport.netty.NegotiationType;
|
||||||
|
import io.grpc.transport.netty.NettyChannelBuilder;
|
||||||
|
import io.grpc.transport.okhttp.OkHttpChannelBuilder;
|
||||||
import io.netty.handler.ssl.SslContext;
|
import io.netty.handler.ssl.SslContext;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
@ -0,0 +1,382 @@
|
||||||
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
|
import static io.grpc.stub.Calls.asyncClientStreamingCall;
|
||||||
|
import static io.grpc.stub.Calls.asyncServerStreamingCall;
|
||||||
|
import static io.grpc.stub.Calls.asyncUnaryCall;
|
||||||
|
import static io.grpc.stub.Calls.blockingServerStreamingCall;
|
||||||
|
import static io.grpc.stub.Calls.blockingUnaryCall;
|
||||||
|
import static io.grpc.stub.Calls.createMethodDescriptor;
|
||||||
|
import static io.grpc.stub.Calls.duplexStreamingCall;
|
||||||
|
import static io.grpc.stub.Calls.unaryFutureCall;
|
||||||
|
import static io.grpc.stub.ServerCalls.asyncStreamingRequestCall;
|
||||||
|
import static io.grpc.stub.ServerCalls.asyncUnaryRequestCall;
|
||||||
|
import static io.grpc.stub.ServerCalls.createMethodDefinition;
|
||||||
|
|
||||||
|
@javax.annotation.Generated("by gRPC proto compiler")
|
||||||
|
public class TestServiceGrpc {
|
||||||
|
|
||||||
|
private static final io.grpc.stub.Method<com.google.protobuf.EmptyProtos.Empty,
|
||||||
|
com.google.protobuf.EmptyProtos.Empty> METHOD_EMPTY_CALL =
|
||||||
|
io.grpc.stub.Method.create(
|
||||||
|
io.grpc.MethodType.UNARY, "EmptyCall",
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER),
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(com.google.protobuf.EmptyProtos.Empty.PARSER));
|
||||||
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.SimpleRequest,
|
||||||
|
io.grpc.testing.integration.Messages.SimpleResponse> METHOD_UNARY_CALL =
|
||||||
|
io.grpc.stub.Method.create(
|
||||||
|
io.grpc.MethodType.UNARY, "UnaryCall",
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleRequest.PARSER),
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.SimpleResponse.PARSER));
|
||||||
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
|
||||||
|
io.grpc.stub.Method.create(
|
||||||
|
io.grpc.MethodType.SERVER_STREAMING, "StreamingOutputCall",
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
|
||||||
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.StreamingInputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
|
||||||
|
io.grpc.stub.Method.create(
|
||||||
|
io.grpc.MethodType.CLIENT_STREAMING, "StreamingInputCall",
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallRequest.PARSER),
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingInputCallResponse.PARSER));
|
||||||
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
|
||||||
|
io.grpc.stub.Method.create(
|
||||||
|
io.grpc.MethodType.DUPLEX_STREAMING, "FullDuplexCall",
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
|
||||||
|
private static final io.grpc.stub.Method<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
|
||||||
|
io.grpc.stub.Method.create(
|
||||||
|
io.grpc.MethodType.DUPLEX_STREAMING, "HalfDuplexCall",
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallRequest.PARSER),
|
||||||
|
io.grpc.proto.ProtoUtils.marshaller(io.grpc.testing.integration.Messages.StreamingOutputCallResponse.PARSER));
|
||||||
|
|
||||||
|
public static TestServiceStub newStub(io.grpc.Channel channel) {
|
||||||
|
return new TestServiceStub(channel, CONFIG);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TestServiceBlockingStub newBlockingStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
return new TestServiceBlockingStub(channel, CONFIG);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TestServiceFutureStub newFutureStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
return new TestServiceFutureStub(channel, CONFIG);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final TestServiceServiceDescriptor CONFIG =
|
||||||
|
new TestServiceServiceDescriptor();
|
||||||
|
|
||||||
|
@javax.annotation.concurrent.Immutable
|
||||||
|
public static class TestServiceServiceDescriptor extends
|
||||||
|
io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
|
||||||
|
public final io.grpc.MethodDescriptor<com.google.protobuf.EmptyProtos.Empty,
|
||||||
|
com.google.protobuf.EmptyProtos.Empty> emptyCall;
|
||||||
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.SimpleRequest,
|
||||||
|
io.grpc.testing.integration.Messages.SimpleResponse> unaryCall;
|
||||||
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall;
|
||||||
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingInputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingInputCallResponse> streamingInputCall;
|
||||||
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> fullDuplexCall;
|
||||||
|
public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse> halfDuplexCall;
|
||||||
|
|
||||||
|
private TestServiceServiceDescriptor() {
|
||||||
|
emptyCall = createMethodDescriptor(
|
||||||
|
"grpc.testing.TestService", METHOD_EMPTY_CALL);
|
||||||
|
unaryCall = createMethodDescriptor(
|
||||||
|
"grpc.testing.TestService", METHOD_UNARY_CALL);
|
||||||
|
streamingOutputCall = createMethodDescriptor(
|
||||||
|
"grpc.testing.TestService", METHOD_STREAMING_OUTPUT_CALL);
|
||||||
|
streamingInputCall = createMethodDescriptor(
|
||||||
|
"grpc.testing.TestService", METHOD_STREAMING_INPUT_CALL);
|
||||||
|
fullDuplexCall = createMethodDescriptor(
|
||||||
|
"grpc.testing.TestService", METHOD_FULL_DUPLEX_CALL);
|
||||||
|
halfDuplexCall = createMethodDescriptor(
|
||||||
|
"grpc.testing.TestService", METHOD_HALF_DUPLEX_CALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
private TestServiceServiceDescriptor(
|
||||||
|
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
|
||||||
|
emptyCall = (io.grpc.MethodDescriptor<com.google.protobuf.EmptyProtos.Empty,
|
||||||
|
com.google.protobuf.EmptyProtos.Empty>) methodMap.get(
|
||||||
|
CONFIG.emptyCall.getName());
|
||||||
|
unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.SimpleRequest,
|
||||||
|
io.grpc.testing.integration.Messages.SimpleResponse>) methodMap.get(
|
||||||
|
CONFIG.unaryCall.getName());
|
||||||
|
streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
|
||||||
|
CONFIG.streamingOutputCall.getName());
|
||||||
|
streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingInputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingInputCallResponse>) methodMap.get(
|
||||||
|
CONFIG.streamingInputCall.getName());
|
||||||
|
fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
|
||||||
|
CONFIG.fullDuplexCall.getName());
|
||||||
|
halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>) methodMap.get(
|
||||||
|
CONFIG.halfDuplexCall.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected TestServiceServiceDescriptor build(
|
||||||
|
java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
|
||||||
|
return new TestServiceServiceDescriptor(methodMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||||
|
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
|
||||||
|
emptyCall,
|
||||||
|
unaryCall,
|
||||||
|
streamingOutputCall,
|
||||||
|
streamingInputCall,
|
||||||
|
fullDuplexCall,
|
||||||
|
halfDuplexCall);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static interface TestService {
|
||||||
|
|
||||||
|
public void emptyCall(com.google.protobuf.EmptyProtos.Empty request,
|
||||||
|
io.grpc.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver);
|
||||||
|
|
||||||
|
public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse> responseObserver);
|
||||||
|
|
||||||
|
public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
|
||||||
|
|
||||||
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallRequest> streamingInputCall(
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallResponse> responseObserver);
|
||||||
|
|
||||||
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> fullDuplexCall(
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
|
||||||
|
|
||||||
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> halfDuplexCall(
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static interface TestServiceBlockingClient {
|
||||||
|
|
||||||
|
public com.google.protobuf.EmptyProtos.Empty emptyCall(com.google.protobuf.EmptyProtos.Empty request);
|
||||||
|
|
||||||
|
public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request);
|
||||||
|
|
||||||
|
public java.util.Iterator<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall(
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallRequest request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static interface TestServiceFutureClient {
|
||||||
|
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.EmptyProtos.Empty> emptyCall(
|
||||||
|
com.google.protobuf.EmptyProtos.Empty request);
|
||||||
|
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Messages.SimpleResponse> unaryCall(
|
||||||
|
io.grpc.testing.integration.Messages.SimpleRequest request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TestServiceStub extends
|
||||||
|
io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
|
||||||
|
implements TestService {
|
||||||
|
private TestServiceStub(io.grpc.Channel channel,
|
||||||
|
TestServiceServiceDescriptor config) {
|
||||||
|
super(channel, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected TestServiceStub build(io.grpc.Channel channel,
|
||||||
|
TestServiceServiceDescriptor config) {
|
||||||
|
return new TestServiceStub(channel, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public void emptyCall(com.google.protobuf.EmptyProtos.Empty request,
|
||||||
|
io.grpc.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver) {
|
||||||
|
asyncUnaryCall(
|
||||||
|
channel.newCall(config.emptyCall), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public void unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse> responseObserver) {
|
||||||
|
asyncUnaryCall(
|
||||||
|
channel.newCall(config.unaryCall), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
||||||
|
asyncServerStreamingCall(
|
||||||
|
channel.newCall(config.streamingOutputCall), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallRequest> streamingInputCall(
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallResponse> responseObserver) {
|
||||||
|
return asyncClientStreamingCall(
|
||||||
|
channel.newCall(config.streamingInputCall), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> fullDuplexCall(
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
||||||
|
return duplexStreamingCall(
|
||||||
|
channel.newCall(config.fullDuplexCall), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> halfDuplexCall(
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
||||||
|
return duplexStreamingCall(
|
||||||
|
channel.newCall(config.halfDuplexCall), responseObserver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TestServiceBlockingStub extends
|
||||||
|
io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
|
||||||
|
implements TestServiceBlockingClient {
|
||||||
|
private TestServiceBlockingStub(io.grpc.Channel channel,
|
||||||
|
TestServiceServiceDescriptor config) {
|
||||||
|
super(channel, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected TestServiceBlockingStub build(io.grpc.Channel channel,
|
||||||
|
TestServiceServiceDescriptor config) {
|
||||||
|
return new TestServiceBlockingStub(channel, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.EmptyProtos.Empty emptyCall(com.google.protobuf.EmptyProtos.Empty request) {
|
||||||
|
return blockingUnaryCall(
|
||||||
|
channel.newCall(config.emptyCall), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public io.grpc.testing.integration.Messages.SimpleResponse unaryCall(io.grpc.testing.integration.Messages.SimpleRequest request) {
|
||||||
|
return blockingUnaryCall(
|
||||||
|
channel.newCall(config.unaryCall), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public java.util.Iterator<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> streamingOutputCall(
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallRequest request) {
|
||||||
|
return blockingServerStreamingCall(
|
||||||
|
channel.newCall(config.streamingOutputCall), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TestServiceFutureStub extends
|
||||||
|
io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
|
||||||
|
implements TestServiceFutureClient {
|
||||||
|
private TestServiceFutureStub(io.grpc.Channel channel,
|
||||||
|
TestServiceServiceDescriptor config) {
|
||||||
|
super(channel, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected TestServiceFutureStub build(io.grpc.Channel channel,
|
||||||
|
TestServiceServiceDescriptor config) {
|
||||||
|
return new TestServiceFutureStub(channel, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.EmptyProtos.Empty> emptyCall(
|
||||||
|
com.google.protobuf.EmptyProtos.Empty request) {
|
||||||
|
return unaryFutureCall(
|
||||||
|
channel.newCall(config.emptyCall), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Messages.SimpleResponse> unaryCall(
|
||||||
|
io.grpc.testing.integration.Messages.SimpleRequest request) {
|
||||||
|
return unaryFutureCall(
|
||||||
|
channel.newCall(config.unaryCall), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static io.grpc.ServerServiceDefinition bindService(
|
||||||
|
final TestService serviceImpl) {
|
||||||
|
return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService")
|
||||||
|
.addMethod(createMethodDefinition(
|
||||||
|
METHOD_EMPTY_CALL,
|
||||||
|
asyncUnaryRequestCall(
|
||||||
|
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
|
||||||
|
com.google.protobuf.EmptyProtos.Empty,
|
||||||
|
com.google.protobuf.EmptyProtos.Empty>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public void invoke(
|
||||||
|
com.google.protobuf.EmptyProtos.Empty request,
|
||||||
|
io.grpc.stub.StreamObserver<com.google.protobuf.EmptyProtos.Empty> responseObserver) {
|
||||||
|
serviceImpl.emptyCall(request, responseObserver);
|
||||||
|
}
|
||||||
|
})))
|
||||||
|
.addMethod(createMethodDefinition(
|
||||||
|
METHOD_UNARY_CALL,
|
||||||
|
asyncUnaryRequestCall(
|
||||||
|
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
|
||||||
|
io.grpc.testing.integration.Messages.SimpleRequest,
|
||||||
|
io.grpc.testing.integration.Messages.SimpleResponse>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public void invoke(
|
||||||
|
io.grpc.testing.integration.Messages.SimpleRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.SimpleResponse> responseObserver) {
|
||||||
|
serviceImpl.unaryCall(request, responseObserver);
|
||||||
|
}
|
||||||
|
})))
|
||||||
|
.addMethod(createMethodDefinition(
|
||||||
|
METHOD_STREAMING_OUTPUT_CALL,
|
||||||
|
asyncUnaryRequestCall(
|
||||||
|
new io.grpc.stub.ServerCalls.UnaryRequestMethod<
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public void invoke(
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
||||||
|
serviceImpl.streamingOutputCall(request, responseObserver);
|
||||||
|
}
|
||||||
|
})))
|
||||||
|
.addMethod(createMethodDefinition(
|
||||||
|
METHOD_STREAMING_INPUT_CALL,
|
||||||
|
asyncStreamingRequestCall(
|
||||||
|
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
|
||||||
|
io.grpc.testing.integration.Messages.StreamingInputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingInputCallResponse>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallRequest> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingInputCallResponse> responseObserver) {
|
||||||
|
return serviceImpl.streamingInputCall(responseObserver);
|
||||||
|
}
|
||||||
|
})))
|
||||||
|
.addMethod(createMethodDefinition(
|
||||||
|
METHOD_FULL_DUPLEX_CALL,
|
||||||
|
asyncStreamingRequestCall(
|
||||||
|
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
||||||
|
return serviceImpl.fullDuplexCall(responseObserver);
|
||||||
|
}
|
||||||
|
})))
|
||||||
|
.addMethod(createMethodDefinition(
|
||||||
|
METHOD_HALF_DUPLEX_CALL,
|
||||||
|
asyncStreamingRequestCall(
|
||||||
|
new io.grpc.stub.ServerCalls.StreamingRequestMethod<
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallRequest,
|
||||||
|
io.grpc.testing.integration.Messages.StreamingOutputCallResponse>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallRequest> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> responseObserver) {
|
||||||
|
return serviceImpl.halfDuplexCall(responseObserver);
|
||||||
|
}
|
||||||
|
}))).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -29,22 +29,23 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import com.google.common.collect.Queues;
|
import com.google.common.collect.Queues;
|
||||||
import com.google.net.stubby.stub.StreamObserver;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.Payload;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.PayloadType;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.ResponseParameters;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.SimpleRequest;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.SimpleResponse;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.StreamingInputCallRequest;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.StreamingInputCallResponse;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.StreamingOutputCallRequest;
|
|
||||||
import com.google.net.stubby.testing.integration.Messages.StreamingOutputCallResponse;
|
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
import com.google.protobuf.EmptyProtos;
|
import com.google.protobuf.EmptyProtos;
|
||||||
|
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import io.grpc.testing.integration.Messages.Payload;
|
||||||
|
import io.grpc.testing.integration.Messages.PayloadType;
|
||||||
|
import io.grpc.testing.integration.Messages.ResponseParameters;
|
||||||
|
import io.grpc.testing.integration.Messages.SimpleRequest;
|
||||||
|
import io.grpc.testing.integration.Messages.SimpleResponse;
|
||||||
|
import io.grpc.testing.integration.Messages.StreamingInputCallRequest;
|
||||||
|
import io.grpc.testing.integration.Messages.StreamingInputCallResponse;
|
||||||
|
import io.grpc.testing.integration.Messages.StreamingOutputCallRequest;
|
||||||
|
import io.grpc.testing.integration.Messages.StreamingOutputCallResponse;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
@ -59,7 +60,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
*/
|
*/
|
||||||
public class TestServiceImpl implements TestServiceGrpc.TestService {
|
public class TestServiceImpl implements TestServiceGrpc.TestService {
|
||||||
private static final String UNCOMPRESSABLE_FILE =
|
private static final String UNCOMPRESSABLE_FILE =
|
||||||
"/com/google/net/stubby/testing/integration/testdata/uncompressable.bin";
|
"/io/grpc/testing/integration/testdata/uncompressable.bin";
|
||||||
private final Random random = new Random();
|
private final Random random = new Random();
|
||||||
|
|
||||||
private final ScheduledExecutorService executor;
|
private final ScheduledExecutorService executor;
|
||||||
|
|
@ -29,14 +29,14 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.MoreExecutors;
|
import com.google.common.util.concurrent.MoreExecutors;
|
||||||
import com.google.net.stubby.ServerImpl;
|
|
||||||
import com.google.net.stubby.ServerInterceptors;
|
|
||||||
import com.google.net.stubby.testing.TestUtils;
|
|
||||||
import com.google.net.stubby.transport.netty.NettyServerBuilder;
|
|
||||||
|
|
||||||
|
import io.grpc.ServerImpl;
|
||||||
|
import io.grpc.ServerInterceptors;
|
||||||
|
import io.grpc.testing.TestUtils;
|
||||||
|
import io.grpc.transport.netty.NettyServerBuilder;
|
||||||
import io.netty.handler.ssl.SslContext;
|
import io.netty.handler.ssl.SslContext;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
@ -29,12 +29,13 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import com.google.net.stubby.Metadata;
|
|
||||||
import com.google.net.stubby.proto.ProtoUtils;
|
|
||||||
import com.google.protobuf.MessageLite;
|
import com.google.protobuf.MessageLite;
|
||||||
|
|
||||||
|
import io.grpc.Metadata;
|
||||||
|
import io.grpc.proto.ProtoUtils;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -8,9 +8,9 @@ syntax = "proto2";
|
||||||
|
|
||||||
package stubby.testing;
|
package stubby.testing;
|
||||||
|
|
||||||
import "stubby/testing/integration/message_set.proto";
|
import "io/grpc/testing/integration/message_set.proto";
|
||||||
|
|
||||||
option java_package = "com.google.net.stubby.testing.integration";
|
option java_package = "io.grpc.testing.integration";
|
||||||
|
|
||||||
// The type of payload that should be returned.
|
// The type of payload that should be returned.
|
||||||
enum PayloadType {
|
enum PayloadType {
|
||||||
|
|
@ -29,14 +29,14 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.stub;
|
package io.grpc.stub;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import com.google.net.stubby.Call;
|
import io.grpc.Call;
|
||||||
import com.google.net.stubby.Channel;
|
import io.grpc.Channel;
|
||||||
import com.google.net.stubby.MethodDescriptor;
|
import io.grpc.MethodDescriptor;
|
||||||
import com.google.net.stubby.testing.integration.TestServiceGrpc;
|
import io.grpc.testing.integration.TestServiceGrpc;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
@ -29,12 +29,12 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import com.google.net.stubby.ChannelImpl;
|
import io.grpc.ChannelImpl;
|
||||||
import com.google.net.stubby.transport.netty.NegotiationType;
|
import io.grpc.transport.netty.NegotiationType;
|
||||||
import com.google.net.stubby.transport.netty.NettyChannelBuilder;
|
import io.grpc.transport.netty.NettyChannelBuilder;
|
||||||
import com.google.net.stubby.transport.netty.NettyServerBuilder;
|
import io.grpc.transport.netty.NettyServerBuilder;
|
||||||
|
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
|
@ -29,11 +29,11 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.net.stubby.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
import com.google.net.stubby.ChannelImpl;
|
import io.grpc.ChannelImpl;
|
||||||
import com.google.net.stubby.transport.netty.NettyServerBuilder;
|
import io.grpc.transport.netty.NettyServerBuilder;
|
||||||
import com.google.net.stubby.transport.okhttp.OkHttpChannelBuilder;
|
import io.grpc.transport.okhttp.OkHttpChannelBuilder;
|
||||||
|
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
description = "Stubby: Netty"
|
description = "gRPC: Netty"
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':stubby-core'),
|
compile project(':grpc-core'),
|
||||||
libraries.hpack,
|
libraries.hpack,
|
||||||
libraries.netty
|
libraries.netty
|
||||||
|
|
||||||
// Tests depend on base class defined by core module.
|
// Tests depend on base class defined by core module.
|
||||||
testCompile project(':stubby-core').sourceSets.test.output
|
testCompile project(':grpc-core').sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue