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

com.google.pubsub.v1.PublisherGrpc Maven / Gradle / Ivy

There is a newer version: 1.114.2
Show newest version
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;

/**
 * 
 * The service that an application uses to manipulate topics, and to send
 * messages to a topic.
 * 
*/ @javax.annotation.Generated( value = "by gRPC proto compiler (version 1.0.1)", comments = "Source: google/pubsub/v1/pubsub.proto") public class PublisherGrpc { private PublisherGrpc() {} public static final String SERVICE_NAME = "google.pubsub.v1.Publisher"; // 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_CREATE_TOPIC = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.pubsub.v1.Publisher", "CreateTopic"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.Topic.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.Topic.getDefaultInstance())); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_PUBLISH = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.pubsub.v1.Publisher", "Publish"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.PublishRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.PublishResponse.getDefaultInstance())); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_GET_TOPIC = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.pubsub.v1.Publisher", "GetTopic"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.GetTopicRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.Topic.getDefaultInstance())); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_LIST_TOPICS = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.pubsub.v1.Publisher", "ListTopics"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListTopicsResponse.getDefaultInstance())); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_LIST_TOPIC_SUBSCRIPTIONS = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.pubsub.v1.Publisher", "ListTopicSubscriptions"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListTopicSubscriptionsRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListTopicSubscriptionsResponse.getDefaultInstance())); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_DELETE_TOPIC = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.pubsub.v1.Publisher", "DeleteTopic"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.DeleteTopicRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance())); /** * Creates a new async stub that supports all call types for the service */ public static PublisherStub newStub(io.grpc.Channel channel) { return new PublisherStub(channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static PublisherBlockingStub newBlockingStub( io.grpc.Channel channel) { return new PublisherBlockingStub(channel); } /** * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service */ public static PublisherFutureStub newFutureStub( io.grpc.Channel channel) { return new PublisherFutureStub(channel); } /** *
   * The service that an application uses to manipulate topics, and to send
   * messages to a topic.
   * 
*/ public static abstract class PublisherImplBase implements io.grpc.BindableService { /** *
     * Creates the given topic with the given name.
     * 
*/ public void createTopic(com.google.pubsub.v1.Topic request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_CREATE_TOPIC, responseObserver); } /** *
     * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
     * does not exist. The message payload must not be empty; it must contain
     *  either a non-empty data field, or at least one attribute.
     * 
*/ public void publish(com.google.pubsub.v1.PublishRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_PUBLISH, responseObserver); } /** *
     * Gets the configuration of a topic.
     * 
*/ public void getTopic(com.google.pubsub.v1.GetTopicRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_GET_TOPIC, responseObserver); } /** *
     * Lists matching topics.
     * 
*/ public void listTopics(com.google.pubsub.v1.ListTopicsRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_LIST_TOPICS, responseObserver); } /** *
     * Lists the name of the subscriptions for this topic.
     * 
*/ public void listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_LIST_TOPIC_SUBSCRIPTIONS, responseObserver); } /** *
     * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
     * does not exist. After a topic is deleted, a new topic may be created with
     * the same name; this is an entirely new topic with none of the old
     * configuration or subscriptions. Existing subscriptions to this topic are
     * not deleted, but their `topic` field is set to `_deleted-topic_`.
     * 
*/ public void deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_DELETE_TOPIC, responseObserver); } @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( METHOD_CREATE_TOPIC, asyncUnaryCall( new MethodHandlers< com.google.pubsub.v1.Topic, com.google.pubsub.v1.Topic>( this, METHODID_CREATE_TOPIC))) .addMethod( METHOD_PUBLISH, asyncUnaryCall( new MethodHandlers< com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse>( this, METHODID_PUBLISH))) .addMethod( METHOD_GET_TOPIC, asyncUnaryCall( new MethodHandlers< com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic>( this, METHODID_GET_TOPIC))) .addMethod( METHOD_LIST_TOPICS, asyncUnaryCall( new MethodHandlers< com.google.pubsub.v1.ListTopicsRequest, com.google.pubsub.v1.ListTopicsResponse>( this, METHODID_LIST_TOPICS))) .addMethod( METHOD_LIST_TOPIC_SUBSCRIPTIONS, asyncUnaryCall( new MethodHandlers< com.google.pubsub.v1.ListTopicSubscriptionsRequest, com.google.pubsub.v1.ListTopicSubscriptionsResponse>( this, METHODID_LIST_TOPIC_SUBSCRIPTIONS))) .addMethod( METHOD_DELETE_TOPIC, asyncUnaryCall( new MethodHandlers< com.google.pubsub.v1.DeleteTopicRequest, com.google.protobuf.Empty>( this, METHODID_DELETE_TOPIC))) .build(); } } /** *
   * The service that an application uses to manipulate topics, and to send
   * messages to a topic.
   * 
*/ public static final class PublisherStub extends io.grpc.stub.AbstractStub { private PublisherStub(io.grpc.Channel channel) { super(channel); } private PublisherStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected PublisherStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new PublisherStub(channel, callOptions); } /** *
     * Creates the given topic with the given name.
     * 
*/ public void createTopic(com.google.pubsub.v1.Topic request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_CREATE_TOPIC, getCallOptions()), request, responseObserver); } /** *
     * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
     * does not exist. The message payload must not be empty; it must contain
     *  either a non-empty data field, or at least one attribute.
     * 
*/ public void publish(com.google.pubsub.v1.PublishRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_PUBLISH, getCallOptions()), request, responseObserver); } /** *
     * Gets the configuration of a topic.
     * 
*/ public void getTopic(com.google.pubsub.v1.GetTopicRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_GET_TOPIC, getCallOptions()), request, responseObserver); } /** *
     * Lists matching topics.
     * 
*/ public void listTopics(com.google.pubsub.v1.ListTopicsRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_LIST_TOPICS, getCallOptions()), request, responseObserver); } /** *
     * Lists the name of the subscriptions for this topic.
     * 
*/ public void listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_LIST_TOPIC_SUBSCRIPTIONS, getCallOptions()), request, responseObserver); } /** *
     * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
     * does not exist. After a topic is deleted, a new topic may be created with
     * the same name; this is an entirely new topic with none of the old
     * configuration or subscriptions. Existing subscriptions to this topic are
     * not deleted, but their `topic` field is set to `_deleted-topic_`.
     * 
*/ public void deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_DELETE_TOPIC, getCallOptions()), request, responseObserver); } } /** *
   * The service that an application uses to manipulate topics, and to send
   * messages to a topic.
   * 
*/ public static final class PublisherBlockingStub extends io.grpc.stub.AbstractStub { private PublisherBlockingStub(io.grpc.Channel channel) { super(channel); } private PublisherBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected PublisherBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new PublisherBlockingStub(channel, callOptions); } /** *
     * Creates the given topic with the given name.
     * 
*/ public com.google.pubsub.v1.Topic createTopic(com.google.pubsub.v1.Topic request) { return blockingUnaryCall( getChannel(), METHOD_CREATE_TOPIC, getCallOptions(), request); } /** *
     * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
     * does not exist. The message payload must not be empty; it must contain
     *  either a non-empty data field, or at least one attribute.
     * 
*/ public com.google.pubsub.v1.PublishResponse publish(com.google.pubsub.v1.PublishRequest request) { return blockingUnaryCall( getChannel(), METHOD_PUBLISH, getCallOptions(), request); } /** *
     * Gets the configuration of a topic.
     * 
*/ public com.google.pubsub.v1.Topic getTopic(com.google.pubsub.v1.GetTopicRequest request) { return blockingUnaryCall( getChannel(), METHOD_GET_TOPIC, getCallOptions(), request); } /** *
     * Lists matching topics.
     * 
*/ public com.google.pubsub.v1.ListTopicsResponse listTopics(com.google.pubsub.v1.ListTopicsRequest request) { return blockingUnaryCall( getChannel(), METHOD_LIST_TOPICS, getCallOptions(), request); } /** *
     * Lists the name of the subscriptions for this topic.
     * 
*/ public com.google.pubsub.v1.ListTopicSubscriptionsResponse listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { return blockingUnaryCall( getChannel(), METHOD_LIST_TOPIC_SUBSCRIPTIONS, getCallOptions(), request); } /** *
     * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
     * does not exist. After a topic is deleted, a new topic may be created with
     * the same name; this is an entirely new topic with none of the old
     * configuration or subscriptions. Existing subscriptions to this topic are
     * not deleted, but their `topic` field is set to `_deleted-topic_`.
     * 
*/ public com.google.protobuf.Empty deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request) { return blockingUnaryCall( getChannel(), METHOD_DELETE_TOPIC, getCallOptions(), request); } } /** *
   * The service that an application uses to manipulate topics, and to send
   * messages to a topic.
   * 
*/ public static final class PublisherFutureStub extends io.grpc.stub.AbstractStub { private PublisherFutureStub(io.grpc.Channel channel) { super(channel); } private PublisherFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected PublisherFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new PublisherFutureStub(channel, callOptions); } /** *
     * Creates the given topic with the given name.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture createTopic( com.google.pubsub.v1.Topic request) { return futureUnaryCall( getChannel().newCall(METHOD_CREATE_TOPIC, getCallOptions()), request); } /** *
     * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
     * does not exist. The message payload must not be empty; it must contain
     *  either a non-empty data field, or at least one attribute.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture publish( com.google.pubsub.v1.PublishRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_PUBLISH, getCallOptions()), request); } /** *
     * Gets the configuration of a topic.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture getTopic( com.google.pubsub.v1.GetTopicRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_GET_TOPIC, getCallOptions()), request); } /** *
     * Lists matching topics.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture listTopics( com.google.pubsub.v1.ListTopicsRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_LIST_TOPICS, getCallOptions()), request); } /** *
     * Lists the name of the subscriptions for this topic.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture listTopicSubscriptions( com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_LIST_TOPIC_SUBSCRIPTIONS, getCallOptions()), request); } /** *
     * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
     * does not exist. After a topic is deleted, a new topic may be created with
     * the same name; this is an entirely new topic with none of the old
     * configuration or subscriptions. Existing subscriptions to this topic are
     * not deleted, but their `topic` field is set to `_deleted-topic_`.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture deleteTopic( com.google.pubsub.v1.DeleteTopicRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_DELETE_TOPIC, getCallOptions()), request); } } private static final int METHODID_CREATE_TOPIC = 0; private static final int METHODID_PUBLISH = 1; private static final int METHODID_GET_TOPIC = 2; private static final int METHODID_LIST_TOPICS = 3; private static final int METHODID_LIST_TOPIC_SUBSCRIPTIONS = 4; private static final int METHODID_DELETE_TOPIC = 5; 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 PublisherImplBase serviceImpl; private final int methodId; public MethodHandlers(PublisherImplBase 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_CREATE_TOPIC: serviceImpl.createTopic((com.google.pubsub.v1.Topic) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_PUBLISH: serviceImpl.publish((com.google.pubsub.v1.PublishRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_GET_TOPIC: serviceImpl.getTopic((com.google.pubsub.v1.GetTopicRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_LIST_TOPICS: serviceImpl.listTopics((com.google.pubsub.v1.ListTopicsRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_LIST_TOPIC_SUBSCRIPTIONS: serviceImpl.listTopicSubscriptions((com.google.pubsub.v1.ListTopicSubscriptionsRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_DELETE_TOPIC: serviceImpl.deleteTopic((com.google.pubsub.v1.DeleteTopicRequest) 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_CREATE_TOPIC, METHOD_PUBLISH, METHOD_GET_TOPIC, METHOD_LIST_TOPICS, METHOD_LIST_TOPIC_SUBSCRIPTIONS, METHOD_DELETE_TOPIC); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy