com.redick.example.protocol.FileServiceGrpc Maven / Gradle / Ivy
package com.redick.example.protocol;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.26.0)",
comments = "Source: message.proto")
public final class FileServiceGrpc {
private FileServiceGrpc() {}
public static final String SERVICE_NAME = "protocol.FileService";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getGetFileMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "getFile",
requestType = com.redick.example.protocol.User.class,
responseType = com.redick.example.protocol.FileOuterClass.File.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getGetFileMethod() {
io.grpc.MethodDescriptor getGetFileMethod;
if ((getGetFileMethod = FileServiceGrpc.getGetFileMethod) == null) {
synchronized (FileServiceGrpc.class) {
if ((getGetFileMethod = FileServiceGrpc.getGetFileMethod) == null) {
FileServiceGrpc.getGetFileMethod = getGetFileMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "getFile"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.redick.example.protocol.User.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.redick.example.protocol.FileOuterClass.File.getDefaultInstance()))
.setSchemaDescriptor(new FileServiceMethodDescriptorSupplier("getFile"))
.build();
}
}
}
return getGetFileMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static FileServiceStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public FileServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new FileServiceStub(channel, callOptions);
}
};
return FileServiceStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static FileServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public FileServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new FileServiceBlockingStub(channel, callOptions);
}
};
return FileServiceBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static FileServiceFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public FileServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new FileServiceFutureStub(channel, callOptions);
}
};
return FileServiceFutureStub.newStub(factory, channel);
}
/**
*/
public static abstract class FileServiceImplBase implements io.grpc.BindableService {
/**
*/
public void getFile(com.redick.example.protocol.User request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getGetFileMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getGetFileMethod(),
asyncUnaryCall(
new MethodHandlers<
com.redick.example.protocol.User,
com.redick.example.protocol.FileOuterClass.File>(
this, METHODID_GET_FILE)))
.build();
}
}
/**
*/
public static final class FileServiceStub extends io.grpc.stub.AbstractAsyncStub {
private FileServiceStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected FileServiceStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new FileServiceStub(channel, callOptions);
}
/**
*/
public void getFile(com.redick.example.protocol.User request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(getGetFileMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*/
public static final class FileServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
private FileServiceBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected FileServiceBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new FileServiceBlockingStub(channel, callOptions);
}
/**
*/
public com.redick.example.protocol.FileOuterClass.File getFile(com.redick.example.protocol.User request) {
return blockingUnaryCall(
getChannel(), getGetFileMethod(), getCallOptions(), request);
}
}
/**
*/
public static final class FileServiceFutureStub extends io.grpc.stub.AbstractFutureStub {
private FileServiceFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected FileServiceFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new FileServiceFutureStub(channel, callOptions);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture getFile(
com.redick.example.protocol.User request) {
return futureUnaryCall(
getChannel().newCall(getGetFileMethod(), getCallOptions()), request);
}
}
private static final int METHODID_GET_FILE = 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 FileServiceImplBase serviceImpl;
private final int methodId;
MethodHandlers(FileServiceImplBase 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_GET_FILE:
serviceImpl.getFile((com.redick.example.protocol.User) 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 FileServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
FileServiceBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.redick.example.protocol.Message.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("FileService");
}
}
private static final class FileServiceFileDescriptorSupplier
extends FileServiceBaseDescriptorSupplier {
FileServiceFileDescriptorSupplier() {}
}
private static final class FileServiceMethodDescriptorSupplier
extends FileServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
FileServiceMethodDescriptorSupplier(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 (FileServiceGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new FileServiceFileDescriptorSupplier())
.addMethod(getGetFileMethod())
.build();
}
}
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy