
com.google.pubsub.v1.SubscriberGrpc Maven / Gradle / Ivy
Go to download
High performance Cloud Pub/Sub client library.
(NOTE) This release includes only data plane operations, publishing and
pulling messages, and it is based on our gRPC beta release.
(ALPHA) This library uses features that are part of an invitation-only
release of the underlying Cloud Pub/Sub API. The library will generate
errors unless you have access to this API. This restriction should be
relaxed in the near future. Please contact [email protected] with any
questions in the meantime.
package com.google.pubsub.v1;
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;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.0.1)",
comments = "Source: google/pubsub/pubsub.proto")
public class SubscriberGrpc {
private SubscriberGrpc() {}
public static final String SERVICE_NAME = "google.pubsub.v1.Subscriber";
// 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_STREAMING_PULL =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
generateFullMethodName(
"google.pubsub.v1.Subscriber", "StreamingPull"),
io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.StreamingPullRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.StreamingPullResponse.getDefaultInstance()));
/**
* Creates a new async stub that supports all call types for the service
*/
public static SubscriberStub newStub(io.grpc.Channel channel) {
return new SubscriberStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static SubscriberBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new SubscriberBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
*/
public static SubscriberFutureStub newFutureStub(
io.grpc.Channel channel) {
return new SubscriberFutureStub(channel);
}
/**
*/
public static abstract class SubscriberImplBase implements io.grpc.BindableService {
/**
*
* Establishes a stream with the server, which sends messages down to the
* client. The client streams acknowledgements and ack deadline modifications
* back to the server. The server will close the stream and return the status
* on any error. The server may close the stream with status `OK` to reassign
* server-side resources, in which case, the client should re-establish the
* stream. `UNAVAILABLE` may also be returned in the case of a transient error
* (e.g., a server restart). These should also be retried by the client. Flow
* control can be achieved by configuring the underlying RPC channel.
*
*/
public io.grpc.stub.StreamObserver streamingPull(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_STREAMING_PULL, responseObserver);
}
@java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
METHOD_STREAMING_PULL,
asyncBidiStreamingCall(
new MethodHandlers<
com.google.pubsub.v1.StreamingPullRequest,
com.google.pubsub.v1.StreamingPullResponse>(
this, METHODID_STREAMING_PULL)))
.build();
}
}
/**
*/
public static final class SubscriberStub extends io.grpc.stub.AbstractStub {
private SubscriberStub(io.grpc.Channel channel) {
super(channel);
}
private SubscriberStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected SubscriberStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new SubscriberStub(channel, callOptions);
}
/**
*
* Establishes a stream with the server, which sends messages down to the
* client. The client streams acknowledgements and ack deadline modifications
* back to the server. The server will close the stream and return the status
* on any error. The server may close the stream with status `OK` to reassign
* server-side resources, in which case, the client should re-establish the
* stream. `UNAVAILABLE` may also be returned in the case of a transient error
* (e.g., a server restart). These should also be retried by the client. Flow
* control can be achieved by configuring the underlying RPC channel.
*
*/
public io.grpc.stub.StreamObserver streamingPull(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
getChannel().newCall(METHOD_STREAMING_PULL, getCallOptions()), responseObserver);
}
}
/**
*/
public static final class SubscriberBlockingStub extends io.grpc.stub.AbstractStub {
private SubscriberBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private SubscriberBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected SubscriberBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new SubscriberBlockingStub(channel, callOptions);
}
}
/**
*/
public static final class SubscriberFutureStub extends io.grpc.stub.AbstractStub {
private SubscriberFutureStub(io.grpc.Channel channel) {
super(channel);
}
private SubscriberFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected SubscriberFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new SubscriberFutureStub(channel, callOptions);
}
}
private static final int METHODID_STREAMING_PULL = 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 SubscriberImplBase serviceImpl;
private final int methodId;
public MethodHandlers(SubscriberImplBase 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) {
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
case METHODID_STREAMING_PULL:
return (io.grpc.stub.StreamObserver) serviceImpl.streamingPull(
(io.grpc.stub.StreamObserver) responseObserver);
default:
throw new AssertionError();
}
}
}
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
return new io.grpc.ServiceDescriptor(SERVICE_NAME,
METHOD_STREAMING_PULL);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy