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

io.grpc.examples.helloworld.GreeterGrpc Maven / Gradle / Ivy

Go to download

gRPC integration that uses the brave api to submit client and server side span information.

There is a newer version: 4.1.1
Show newest version
package io.grpc.examples.helloworld;

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

/**
 * 
 * The greeting service definition.
 * 
*/ @javax.annotation.Generated( value = "by gRPC proto compiler (version 0.15.0)", comments = "Source: helloworld.proto") public class GreeterGrpc { private GreeterGrpc() {} public static final String SERVICE_NAME = "helloworld.Greeter"; // Static method descriptors that strictly reflect the proto. @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_SAY_HELLO = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "helloworld.Greeter", "SayHello"), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloReply.getDefaultInstance())); /** * Creates a new async stub that supports all call types for the service */ public static GreeterStub newStub(io.grpc.Channel channel) { return new GreeterStub(channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static GreeterBlockingStub newBlockingStub( io.grpc.Channel channel) { return new GreeterBlockingStub(channel); } /** * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service */ public static GreeterFutureStub newFutureStub( io.grpc.Channel channel) { return new GreeterFutureStub(channel); } /** *
   * The greeting service definition.
   * 
*/ @java.lang.Deprecated public static interface Greeter { /** *
     * Sends a greeting
     * 
*/ public void sayHello(io.grpc.examples.helloworld.HelloRequest request, io.grpc.stub.StreamObserver responseObserver); } @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1469") public static abstract class GreeterImplBase implements Greeter, io.grpc.BindableService { @java.lang.Override public void sayHello(io.grpc.examples.helloworld.HelloRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_SAY_HELLO, responseObserver); } @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { return GreeterGrpc.bindService(this); } } /** *
   * The greeting service definition.
   * 
*/ @java.lang.Deprecated public static interface GreeterBlockingClient { /** *
     * Sends a greeting
     * 
*/ public io.grpc.examples.helloworld.HelloReply sayHello(io.grpc.examples.helloworld.HelloRequest request); } /** *
   * The greeting service definition.
   * 
*/ @java.lang.Deprecated public static interface GreeterFutureClient { /** *
     * Sends a greeting
     * 
*/ public com.google.common.util.concurrent.ListenableFuture sayHello( io.grpc.examples.helloworld.HelloRequest request); } public static class GreeterStub extends io.grpc.stub.AbstractStub implements Greeter { private GreeterStub(io.grpc.Channel channel) { super(channel); } private GreeterStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected GreeterStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new GreeterStub(channel, callOptions); } @java.lang.Override public void sayHello(io.grpc.examples.helloworld.HelloRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request, responseObserver); } } public static class GreeterBlockingStub extends io.grpc.stub.AbstractStub implements GreeterBlockingClient { private GreeterBlockingStub(io.grpc.Channel channel) { super(channel); } private GreeterBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected GreeterBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new GreeterBlockingStub(channel, callOptions); } @java.lang.Override public io.grpc.examples.helloworld.HelloReply sayHello(io.grpc.examples.helloworld.HelloRequest request) { return blockingUnaryCall( getChannel(), METHOD_SAY_HELLO, getCallOptions(), request); } } public static class GreeterFutureStub extends io.grpc.stub.AbstractStub implements GreeterFutureClient { private GreeterFutureStub(io.grpc.Channel channel) { super(channel); } private GreeterFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected GreeterFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new GreeterFutureStub(channel, callOptions); } @java.lang.Override public com.google.common.util.concurrent.ListenableFuture sayHello( io.grpc.examples.helloworld.HelloRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request); } } @java.lang.Deprecated public static abstract class AbstractGreeter extends GreeterImplBase {} private static final int METHODID_SAY_HELLO = 0; private static 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 Greeter serviceImpl; private final int methodId; public MethodHandlers(Greeter 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: serviceImpl.sayHello((io.grpc.examples.helloworld.HelloRequest) 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(); } } } public static io.grpc.ServiceDescriptor getServiceDescriptor() { return new io.grpc.ServiceDescriptor(SERVICE_NAME, METHOD_SAY_HELLO); } @java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService( final Greeter serviceImpl) { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( METHOD_SAY_HELLO, asyncUnaryCall( new MethodHandlers< io.grpc.examples.helloworld.HelloRequest, io.grpc.examples.helloworld.HelloReply>( serviceImpl, METHODID_SAY_HELLO))) .build(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy