main.grpc.com.streamlayer.social.TwitterGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sl-protofiles Show documentation
Show all versions of sl-protofiles Show documentation
StreamLayer Java Protofiles
package com.streamlayer.social;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.65.1)",
comments = "Source: streamlayer/social/twitter.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class TwitterGrpc {
private TwitterGrpc() {}
public static final java.lang.String SERVICE_NAME = "streamlayer.social.Twitter";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getSubscriptionMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Subscription",
requestType = com.streamlayer.social.SubscriptionRequest.class,
responseType = com.streamlayer.social.SubscriptionResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
public static io.grpc.MethodDescriptor getSubscriptionMethod() {
io.grpc.MethodDescriptor getSubscriptionMethod;
if ((getSubscriptionMethod = TwitterGrpc.getSubscriptionMethod) == null) {
synchronized (TwitterGrpc.class) {
if ((getSubscriptionMethod = TwitterGrpc.getSubscriptionMethod) == null) {
TwitterGrpc.getSubscriptionMethod = getSubscriptionMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Subscription"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
com.streamlayer.social.SubscriptionRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
com.streamlayer.social.SubscriptionResponse.getDefaultInstance()))
.build();
}
}
}
return getSubscriptionMethod;
}
private static volatile io.grpc.MethodDescriptor getSyncMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Sync",
requestType = com.streamlayer.social.SyncRequest.class,
responseType = com.streamlayer.social.SyncResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getSyncMethod() {
io.grpc.MethodDescriptor getSyncMethod;
if ((getSyncMethod = TwitterGrpc.getSyncMethod) == null) {
synchronized (TwitterGrpc.class) {
if ((getSyncMethod = TwitterGrpc.getSyncMethod) == null) {
TwitterGrpc.getSyncMethod = getSyncMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Sync"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
com.streamlayer.social.SyncRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
com.streamlayer.social.SyncResponse.getDefaultInstance()))
.build();
}
}
}
return getSyncMethod;
}
private static volatile io.grpc.MethodDescriptor getGetTweetMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetTweet",
requestType = com.streamlayer.social.GetTweetRequest.class,
responseType = com.streamlayer.social.GetTweetResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getGetTweetMethod() {
io.grpc.MethodDescriptor getGetTweetMethod;
if ((getGetTweetMethod = TwitterGrpc.getGetTweetMethod) == null) {
synchronized (TwitterGrpc.class) {
if ((getGetTweetMethod = TwitterGrpc.getGetTweetMethod) == null) {
TwitterGrpc.getGetTweetMethod = getGetTweetMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTweet"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
com.streamlayer.social.GetTweetRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
com.streamlayer.social.GetTweetResponse.getDefaultInstance()))
.build();
}
}
}
return getGetTweetMethod;
}
private static volatile io.grpc.MethodDescriptor getSyncTweetMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "SyncTweet",
requestType = com.streamlayer.social.SyncTweetRequest.class,
responseType = com.streamlayer.social.SyncTweetResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getSyncTweetMethod() {
io.grpc.MethodDescriptor getSyncTweetMethod;
if ((getSyncTweetMethod = TwitterGrpc.getSyncTweetMethod) == null) {
synchronized (TwitterGrpc.class) {
if ((getSyncTweetMethod = TwitterGrpc.getSyncTweetMethod) == null) {
TwitterGrpc.getSyncTweetMethod = getSyncTweetMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SyncTweet"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
com.streamlayer.social.SyncTweetRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
com.streamlayer.social.SyncTweetResponse.getDefaultInstance()))
.build();
}
}
}
return getSyncTweetMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static TwitterStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public TwitterStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TwitterStub(channel, callOptions);
}
};
return TwitterStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static TwitterBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public TwitterBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TwitterBlockingStub(channel, callOptions);
}
};
return TwitterBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static TwitterFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public TwitterFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TwitterFutureStub(channel, callOptions);
}
};
return TwitterFutureStub.newStub(factory, channel);
}
/**
*/
public interface AsyncService {
/**
*/
default void subscription(com.streamlayer.social.SubscriptionRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSubscriptionMethod(), responseObserver);
}
/**
*/
default void sync(com.streamlayer.social.SyncRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSyncMethod(), responseObserver);
}
/**
*/
default void getTweet(com.streamlayer.social.GetTweetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTweetMethod(), responseObserver);
}
/**
*/
default void syncTweet(com.streamlayer.social.SyncTweetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSyncTweetMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service Twitter.
*/
public static abstract class TwitterImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return TwitterGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service Twitter.
*/
public static final class TwitterStub
extends io.grpc.stub.AbstractAsyncStub {
private TwitterStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected TwitterStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TwitterStub(channel, callOptions);
}
/**
*/
public void subscription(com.streamlayer.social.SubscriptionRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncServerStreamingCall(
getChannel().newCall(getSubscriptionMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void sync(com.streamlayer.social.SyncRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getSyncMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void getTweet(com.streamlayer.social.GetTweetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetTweetMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void syncTweet(com.streamlayer.social.SyncTweetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getSyncTweetMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service Twitter.
*/
public static final class TwitterBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private TwitterBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected TwitterBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TwitterBlockingStub(channel, callOptions);
}
/**
*/
public java.util.Iterator subscription(
com.streamlayer.social.SubscriptionRequest request) {
return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
getChannel(), getSubscriptionMethod(), getCallOptions(), request);
}
/**
*/
public com.streamlayer.social.SyncResponse sync(com.streamlayer.social.SyncRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getSyncMethod(), getCallOptions(), request);
}
/**
*/
public com.streamlayer.social.GetTweetResponse getTweet(com.streamlayer.social.GetTweetRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetTweetMethod(), getCallOptions(), request);
}
/**
*/
public com.streamlayer.social.SyncTweetResponse syncTweet(com.streamlayer.social.SyncTweetRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getSyncTweetMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service Twitter.
*/
public static final class TwitterFutureStub
extends io.grpc.stub.AbstractFutureStub {
private TwitterFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected TwitterFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new TwitterFutureStub(channel, callOptions);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture sync(
com.streamlayer.social.SyncRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getSyncMethod(), getCallOptions()), request);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture getTweet(
com.streamlayer.social.GetTweetRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetTweetMethod(), getCallOptions()), request);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture syncTweet(
com.streamlayer.social.SyncTweetRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getSyncTweetMethod(), getCallOptions()), request);
}
}
private static final int METHODID_SUBSCRIPTION = 0;
private static final int METHODID_SYNC = 1;
private static final int METHODID_GET_TWEET = 2;
private static final int METHODID_SYNC_TWEET = 3;
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 AsyncService serviceImpl;
private final int methodId;
MethodHandlers(AsyncService 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_SUBSCRIPTION:
serviceImpl.subscription((com.streamlayer.social.SubscriptionRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_SYNC:
serviceImpl.sync((com.streamlayer.social.SyncRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_GET_TWEET:
serviceImpl.getTweet((com.streamlayer.social.GetTweetRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_SYNC_TWEET:
serviceImpl.syncTweet((com.streamlayer.social.SyncTweetRequest) 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 final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getSubscriptionMethod(),
io.grpc.stub.ServerCalls.asyncServerStreamingCall(
new MethodHandlers<
com.streamlayer.social.SubscriptionRequest,
com.streamlayer.social.SubscriptionResponse>(
service, METHODID_SUBSCRIPTION)))
.addMethod(
getSyncMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.streamlayer.social.SyncRequest,
com.streamlayer.social.SyncResponse>(
service, METHODID_SYNC)))
.addMethod(
getGetTweetMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.streamlayer.social.GetTweetRequest,
com.streamlayer.social.GetTweetResponse>(
service, METHODID_GET_TWEET)))
.addMethod(
getSyncTweetMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.streamlayer.social.SyncTweetRequest,
com.streamlayer.social.SyncTweetResponse>(
service, METHODID_SYNC_TWEET)))
.build();
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (TwitterGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.addMethod(getSubscriptionMethod())
.addMethod(getSyncMethod())
.addMethod(getGetTweetMethod())
.addMethod(getSyncTweetMethod())
.build();
}
}
}
return result;
}
}