Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.pubsub.v1;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*
*
*
* The service that an application uses to manipulate topics, and to send
* messages to a topic.
*
* Lists the names of the snapshots on this topic. Snapshots are used in
* [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
* which allow you to manage message acknowledgments in bulk. That is, you can
* set the acknowledgment state of messages in an existing subscription to the
* state captured by a snapshot.
*
* 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_`.
*
* Detaches a subscription from this topic. All messages retained in the
* subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
* will return FAILED_PRECONDITION. If the subscription is a push
* subscription, pushes to the endpoint will stop.
*
*/
default void detachSubscription(
com.google.pubsub.v1.DetachSubscriptionRequest request,
io.grpc.stub.StreamObserver
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getDetachSubscriptionMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service Publisher.
*
*
* The service that an application uses to manipulate topics, and to send
* messages to a topic.
*
*/
public abstract static class PublisherImplBase implements io.grpc.BindableService, AsyncService {
@java.lang.Override
public final io.grpc.ServerServiceDefinition bindService() {
return PublisherGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service Publisher.
*
*
* 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.AbstractAsyncStub {
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. See the [resource name rules]
* (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
*
* Lists the names of the snapshots on this topic. Snapshots are used in
* [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
* which allow you to manage message acknowledgments in bulk. That is, you can
* set the acknowledgment state of messages in an existing subscription to the
* state captured by a snapshot.
*
* 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_`.
*
* Detaches a subscription from this topic. All messages retained in the
* subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
* will return FAILED_PRECONDITION. If the subscription is a push
* subscription, pushes to the endpoint will stop.
*
*/
public void detachSubscription(
com.google.pubsub.v1.DetachSubscriptionRequest request,
io.grpc.stub.StreamObserver
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDetachSubscriptionMethod(), getCallOptions()),
request,
responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service Publisher.
*
*
* 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.AbstractBlockingStub {
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. See the [resource name rules]
* (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
*
* Lists the names of the snapshots on this topic. Snapshots are used in
* [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
* which allow you to manage message acknowledgments in bulk. That is, you can
* set the acknowledgment state of messages in an existing subscription to the
* state captured by a snapshot.
*
* 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_`.
*
* Detaches a subscription from this topic. All messages retained in the
* subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
* will return FAILED_PRECONDITION. If the subscription is a push
* subscription, pushes to the endpoint will stop.
*
*/
public com.google.pubsub.v1.DetachSubscriptionResponse detachSubscription(
com.google.pubsub.v1.DetachSubscriptionRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDetachSubscriptionMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service Publisher.
*
*
* 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.AbstractFutureStub {
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. See the [resource name rules]
* (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
*
* Lists the names of the snapshots on this topic. Snapshots are used in
* [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
* which allow you to manage message acknowledgments in bulk. That is, you can
* set the acknowledgment state of messages in an existing subscription to the
* state captured by a snapshot.
*
* 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_`.
*
* Detaches a subscription from this topic. All messages retained in the
* subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
* will return FAILED_PRECONDITION. If the subscription is a push
* subscription, pushes to the endpoint will stop.
*
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.pubsub.v1.DetachSubscriptionResponse>
detachSubscription(com.google.pubsub.v1.DetachSubscriptionRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDetachSubscriptionMethod(), getCallOptions()), request);
}
}
private static final int METHODID_CREATE_TOPIC = 0;
private static final int METHODID_UPDATE_TOPIC = 1;
private static final int METHODID_PUBLISH = 2;
private static final int METHODID_GET_TOPIC = 3;
private static final int METHODID_LIST_TOPICS = 4;
private static final int METHODID_LIST_TOPIC_SUBSCRIPTIONS = 5;
private static final int METHODID_LIST_TOPIC_SNAPSHOTS = 6;
private static final int METHODID_DELETE_TOPIC = 7;
private static final int METHODID_DETACH_SUBSCRIPTION = 8;
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_CREATE_TOPIC:
serviceImpl.createTopic(
(com.google.pubsub.v1.Topic) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_UPDATE_TOPIC:
serviceImpl.updateTopic(
(com.google.pubsub.v1.UpdateTopicRequest) 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_LIST_TOPIC_SNAPSHOTS:
serviceImpl.listTopicSnapshots(
(com.google.pubsub.v1.ListTopicSnapshotsRequest) 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;
case METHODID_DETACH_SUBSCRIPTION:
serviceImpl.detachSubscription(
(com.google.pubsub.v1.DetachSubscriptionRequest) 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(
getCreateTopicMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers(
service, METHODID_CREATE_TOPIC)))
.addMethod(
getUpdateTopicMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.pubsub.v1.UpdateTopicRequest, com.google.pubsub.v1.Topic>(
service, METHODID_UPDATE_TOPIC)))
.addMethod(
getPublishMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse>(
service, METHODID_PUBLISH)))
.addMethod(
getGetTopicMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic>(
service, METHODID_GET_TOPIC)))
.addMethod(
getListTopicsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.pubsub.v1.ListTopicsRequest,
com.google.pubsub.v1.ListTopicsResponse>(service, METHODID_LIST_TOPICS)))
.addMethod(
getListTopicSubscriptionsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.pubsub.v1.ListTopicSubscriptionsRequest,
com.google.pubsub.v1.ListTopicSubscriptionsResponse>(
service, METHODID_LIST_TOPIC_SUBSCRIPTIONS)))
.addMethod(
getListTopicSnapshotsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.pubsub.v1.ListTopicSnapshotsRequest,
com.google.pubsub.v1.ListTopicSnapshotsResponse>(
service, METHODID_LIST_TOPIC_SNAPSHOTS)))
.addMethod(
getDeleteTopicMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.pubsub.v1.DeleteTopicRequest, com.google.protobuf.Empty>(
service, METHODID_DELETE_TOPIC)))
.addMethod(
getDetachSubscriptionMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.pubsub.v1.DetachSubscriptionRequest,
com.google.pubsub.v1.DetachSubscriptionResponse>(
service, METHODID_DETACH_SUBSCRIPTION)))
.build();
}
private abstract static class PublisherBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
io.grpc.protobuf.ProtoServiceDescriptorSupplier {
PublisherBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.google.pubsub.v1.PubsubProto.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Publisher");
}
}
private static final class PublisherFileDescriptorSupplier
extends PublisherBaseDescriptorSupplier {
PublisherFileDescriptorSupplier() {}
}
private static final class PublisherMethodDescriptorSupplier
extends PublisherBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final java.lang.String methodName;
PublisherMethodDescriptorSupplier(java.lang.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 (PublisherGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor =
result =
io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new PublisherFileDescriptorSupplier())
.addMethod(getCreateTopicMethod())
.addMethod(getUpdateTopicMethod())
.addMethod(getPublishMethod())
.addMethod(getGetTopicMethod())
.addMethod(getListTopicsMethod())
.addMethod(getListTopicSubscriptionsMethod())
.addMethod(getListTopicSnapshotsMethod())
.addMethod(getDeleteTopicMethod())
.addMethod(getDetachSubscriptionMethod())
.build();
}
}
}
return result;
}
}