All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.grpc.examples.serverstreaming.ServerStreamingGreeterGrpc Maven / Gradle / Ivy

There is a newer version: 1.0-9
Show newest version
package io.grpc.examples.serverstreaming;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 * 
 * The greeting service definition.
 * 
*/ @javax.annotation.Generated( value = "by gRPC proto compiler (version 1.8.0)", comments = "Source: down_streaming.proto") public final class ServerStreamingGreeterGrpc { private ServerStreamingGreeterGrpc() {} public static final String SERVICE_NAME = "tap.ServerStreamingGreeter"; // Static method descriptors that strictly reflect the proto. @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getSayHelloStreamingMethod()} instead. public static final io.grpc.MethodDescriptor METHOD_SAY_HELLO_STREAMING = getSayHelloStreamingMethod(); private static volatile io.grpc.MethodDescriptor getSayHelloStreamingMethod; @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static io.grpc.MethodDescriptor getSayHelloStreamingMethod() { io.grpc.MethodDescriptor getSayHelloStreamingMethod; if ((getSayHelloStreamingMethod = ServerStreamingGreeterGrpc.getSayHelloStreamingMethod) == null) { synchronized (ServerStreamingGreeterGrpc.class) { if ((getSayHelloStreamingMethod = ServerStreamingGreeterGrpc.getSayHelloStreamingMethod) == null) { ServerStreamingGreeterGrpc.getSayHelloStreamingMethod = getSayHelloStreamingMethod = io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) .setFullMethodName(generateFullMethodName( "tap.ServerStreamingGreeter", "SayHelloStreaming")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.grpc.examples.serverstreaming.TapHelloRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.grpc.examples.serverstreaming.TapHelloReply.getDefaultInstance())) .setSchemaDescriptor(new ServerStreamingGreeterMethodDescriptorSupplier("SayHelloStreaming")) .build(); } } } return getSayHelloStreamingMethod; } /** * Creates a new async stub that supports all call types for the service */ public static ServerStreamingGreeterStub newStub(io.grpc.Channel channel) { return new ServerStreamingGreeterStub(channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static ServerStreamingGreeterBlockingStub newBlockingStub( io.grpc.Channel channel) { return new ServerStreamingGreeterBlockingStub(channel); } /** * Creates a new ListenableFuture-style stub that supports unary calls on the service */ public static ServerStreamingGreeterFutureStub newFutureStub( io.grpc.Channel channel) { return new ServerStreamingGreeterFutureStub(channel); } /** *
   * The greeting service definition.
   * 
*/ public static abstract class ServerStreamingGreeterImplBase implements io.grpc.BindableService { /** *
     * Streams a many greetings
     * 
*/ public void sayHelloStreaming(io.grpc.examples.serverstreaming.TapHelloRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getSayHelloStreamingMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getSayHelloStreamingMethod(), asyncServerStreamingCall( new MethodHandlers< io.grpc.examples.serverstreaming.TapHelloRequest, io.grpc.examples.serverstreaming.TapHelloReply>( this, METHODID_SAY_HELLO_STREAMING))) .build(); } } /** *
   * The greeting service definition.
   * 
*/ public static final class ServerStreamingGreeterStub extends io.grpc.stub.AbstractStub { private ServerStreamingGreeterStub(io.grpc.Channel channel) { super(channel); } private ServerStreamingGreeterStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ServerStreamingGreeterStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ServerStreamingGreeterStub(channel, callOptions); } /** *
     * Streams a many greetings
     * 
*/ public void sayHelloStreaming(io.grpc.examples.serverstreaming.TapHelloRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncServerStreamingCall( getChannel().newCall(getSayHelloStreamingMethod(), getCallOptions()), request, responseObserver); } } /** *
   * The greeting service definition.
   * 
*/ public static final class ServerStreamingGreeterBlockingStub extends io.grpc.stub.AbstractStub { private ServerStreamingGreeterBlockingStub(io.grpc.Channel channel) { super(channel); } private ServerStreamingGreeterBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ServerStreamingGreeterBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ServerStreamingGreeterBlockingStub(channel, callOptions); } /** *
     * Streams a many greetings
     * 
*/ public java.util.Iterator sayHelloStreaming( io.grpc.examples.serverstreaming.TapHelloRequest request) { return blockingServerStreamingCall( getChannel(), getSayHelloStreamingMethod(), getCallOptions(), request); } } /** *
   * The greeting service definition.
   * 
*/ public static final class ServerStreamingGreeterFutureStub extends io.grpc.stub.AbstractStub { private ServerStreamingGreeterFutureStub(io.grpc.Channel channel) { super(channel); } private ServerStreamingGreeterFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ServerStreamingGreeterFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ServerStreamingGreeterFutureStub(channel, callOptions); } } private static final int METHODID_SAY_HELLO_STREAMING = 0; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { private final ServerStreamingGreeterImplBase serviceImpl; private final int methodId; MethodHandlers(ServerStreamingGreeterImplBase serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { case METHODID_SAY_HELLO_STREAMING: serviceImpl.sayHelloStreaming((io.grpc.examples.serverstreaming.TapHelloRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; default: throw new AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver invoke( io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { default: throw new AssertionError(); } } } private static abstract class ServerStreamingGreeterBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ServerStreamingGreeterBaseDescriptorSupplier() {} @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return io.grpc.examples.serverstreaming.DownStreamingProto.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("ServerStreamingGreeter"); } } private static final class ServerStreamingGreeterFileDescriptorSupplier extends ServerStreamingGreeterBaseDescriptorSupplier { ServerStreamingGreeterFileDescriptorSupplier() {} } private static final class ServerStreamingGreeterMethodDescriptorSupplier extends ServerStreamingGreeterBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final String methodName; ServerStreamingGreeterMethodDescriptorSupplier(String methodName) { this.methodName = methodName; } @java.lang.Override public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { return getServiceDescriptor().findMethodByName(methodName); } } private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor result = serviceDescriptor; if (result == null) { synchronized (ServerStreamingGreeterGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new ServerStreamingGreeterFileDescriptorSupplier()) .addMethod(getSayHelloStreamingMethod()) .build(); } } } return result; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy