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

com.google.cloud.pubsub.v1.stub.GrpcSubscriberStub Maven / Gradle / Ivy

There is a newer version: 1.138.0
Show newest version
/*
 * Copyright 2018 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.cloud.pubsub.v1.stub;

import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSnapshotsPagedResponse;
import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse;

import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcCallableFactory;
import com.google.api.gax.rpc.BidiStreamingCallable;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.protobuf.Empty;
import com.google.pubsub.v1.AcknowledgeRequest;
import com.google.pubsub.v1.CreateSnapshotRequest;
import com.google.pubsub.v1.DeleteSnapshotRequest;
import com.google.pubsub.v1.DeleteSubscriptionRequest;
import com.google.pubsub.v1.GetSubscriptionRequest;
import com.google.pubsub.v1.ListSnapshotsRequest;
import com.google.pubsub.v1.ListSnapshotsResponse;
import com.google.pubsub.v1.ListSubscriptionsRequest;
import com.google.pubsub.v1.ListSubscriptionsResponse;
import com.google.pubsub.v1.ModifyAckDeadlineRequest;
import com.google.pubsub.v1.ModifyPushConfigRequest;
import com.google.pubsub.v1.PullRequest;
import com.google.pubsub.v1.PullResponse;
import com.google.pubsub.v1.SeekRequest;
import com.google.pubsub.v1.SeekResponse;
import com.google.pubsub.v1.Snapshot;
import com.google.pubsub.v1.StreamingPullRequest;
import com.google.pubsub.v1.StreamingPullResponse;
import com.google.pubsub.v1.Subscription;
import com.google.pubsub.v1.UpdateSnapshotRequest;
import com.google.pubsub.v1.UpdateSubscriptionRequest;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
 * gRPC stub implementation for Google Cloud Pub/Sub API.
 *
 * 

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by GAPIC v0.0.5") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcSubscriberStub extends SubscriberStub { private static final MethodDescriptor createSubscriptionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/CreateSubscription") .setRequestMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) .build(); private static final MethodDescriptor getSubscriptionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/GetSubscription") .setRequestMarshaller( ProtoUtils.marshaller(GetSubscriptionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) .build(); private static final MethodDescriptor updateSubscriptionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/UpdateSubscription") .setRequestMarshaller( ProtoUtils.marshaller(UpdateSubscriptionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) .build(); private static final MethodDescriptor listSubscriptionsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/ListSubscriptions") .setRequestMarshaller( ProtoUtils.marshaller(ListSubscriptionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListSubscriptionsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor deleteSubscriptionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/DeleteSubscription") .setRequestMarshaller( ProtoUtils.marshaller(DeleteSubscriptionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); private static final MethodDescriptor modifyAckDeadlineMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/ModifyAckDeadline") .setRequestMarshaller( ProtoUtils.marshaller(ModifyAckDeadlineRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); private static final MethodDescriptor acknowledgeMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/Acknowledge") .setRequestMarshaller(ProtoUtils.marshaller(AcknowledgeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); private static final MethodDescriptor pullMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/Pull") .setRequestMarshaller(ProtoUtils.marshaller(PullRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(PullResponse.getDefaultInstance())) .build(); private static final MethodDescriptor streamingPullMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.BIDI_STREAMING) .setFullMethodName("google.pubsub.v1.Subscriber/StreamingPull") .setRequestMarshaller( ProtoUtils.marshaller(StreamingPullRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(StreamingPullResponse.getDefaultInstance())) .build(); private static final MethodDescriptor modifyPushConfigMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/ModifyPushConfig") .setRequestMarshaller( ProtoUtils.marshaller(ModifyPushConfigRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); private static final MethodDescriptor listSnapshotsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/ListSnapshots") .setRequestMarshaller( ProtoUtils.marshaller(ListSnapshotsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListSnapshotsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor createSnapshotMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/CreateSnapshot") .setRequestMarshaller( ProtoUtils.marshaller(CreateSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) .build(); private static final MethodDescriptor updateSnapshotMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/UpdateSnapshot") .setRequestMarshaller( ProtoUtils.marshaller(UpdateSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) .build(); private static final MethodDescriptor deleteSnapshotMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/DeleteSnapshot") .setRequestMarshaller( ProtoUtils.marshaller(DeleteSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); private static final MethodDescriptor seekMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.pubsub.v1.Subscriber/Seek") .setRequestMarshaller(ProtoUtils.marshaller(SeekRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SeekResponse.getDefaultInstance())) .build(); private static final MethodDescriptor setIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) .build(); private static final MethodDescriptor testIamPermissionsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") .setRequestMarshaller( ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) .build(); private final BackgroundResource backgroundResources; private final UnaryCallable createSubscriptionCallable; private final UnaryCallable getSubscriptionCallable; private final UnaryCallable updateSubscriptionCallable; private final UnaryCallable listSubscriptionsCallable; private final UnaryCallable listSubscriptionsPagedCallable; private final UnaryCallable deleteSubscriptionCallable; private final UnaryCallable modifyAckDeadlineCallable; private final UnaryCallable acknowledgeCallable; private final UnaryCallable pullCallable; private final BidiStreamingCallable streamingPullCallable; private final UnaryCallable modifyPushConfigCallable; private final UnaryCallable listSnapshotsCallable; private final UnaryCallable listSnapshotsPagedCallable; private final UnaryCallable createSnapshotCallable; private final UnaryCallable updateSnapshotCallable; private final UnaryCallable deleteSnapshotCallable; private final UnaryCallable seekCallable; private final UnaryCallable setIamPolicyCallable; private final UnaryCallable getIamPolicyCallable; private final UnaryCallable testIamPermissionsCallable; public static final GrpcSubscriberStub create(SubscriberStubSettings settings) throws IOException { return new GrpcSubscriberStub(settings, ClientContext.create(settings)); } public static final GrpcSubscriberStub create(ClientContext clientContext) throws IOException { return new GrpcSubscriberStub(SubscriberStubSettings.newBuilder().build(), clientContext); } /** * Constructs an instance of GrpcSubscriberStub, using the given settings. This is protected so * that it is easy to make a subclass, but otherwise, the static factory methods should be * preferred. */ protected GrpcSubscriberStub(SubscriberStubSettings settings, ClientContext clientContext) throws IOException { GrpcCallSettings createSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createSubscriptionMethodDescriptor) .build(); GrpcCallSettings getSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getSubscriptionMethodDescriptor) .build(); GrpcCallSettings updateSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateSubscriptionMethodDescriptor) .build(); GrpcCallSettings listSubscriptionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSubscriptionsMethodDescriptor) .build(); GrpcCallSettings deleteSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSubscriptionMethodDescriptor) .build(); GrpcCallSettings modifyAckDeadlineTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(modifyAckDeadlineMethodDescriptor) .build(); GrpcCallSettings acknowledgeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(acknowledgeMethodDescriptor) .build(); GrpcCallSettings pullTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(pullMethodDescriptor) .build(); GrpcCallSettings streamingPullTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(streamingPullMethodDescriptor) .build(); GrpcCallSettings modifyPushConfigTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(modifyPushConfigMethodDescriptor) .build(); GrpcCallSettings listSnapshotsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSnapshotsMethodDescriptor) .build(); GrpcCallSettings createSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createSnapshotMethodDescriptor) .build(); GrpcCallSettings updateSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateSnapshotMethodDescriptor) .build(); GrpcCallSettings deleteSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSnapshotMethodDescriptor) .build(); GrpcCallSettings seekTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(seekMethodDescriptor) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .build(); GrpcCallSettings testIamPermissionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) .build(); this.createSubscriptionCallable = GrpcCallableFactory.createUnaryCallable( createSubscriptionTransportSettings, settings.createSubscriptionSettings(), clientContext); this.getSubscriptionCallable = GrpcCallableFactory.createUnaryCallable( getSubscriptionTransportSettings, settings.getSubscriptionSettings(), clientContext); this.updateSubscriptionCallable = GrpcCallableFactory.createUnaryCallable( updateSubscriptionTransportSettings, settings.updateSubscriptionSettings(), clientContext); this.listSubscriptionsCallable = GrpcCallableFactory.createUnaryCallable( listSubscriptionsTransportSettings, settings.listSubscriptionsSettings(), clientContext); this.listSubscriptionsPagedCallable = GrpcCallableFactory.createPagedCallable( listSubscriptionsTransportSettings, settings.listSubscriptionsSettings(), clientContext); this.deleteSubscriptionCallable = GrpcCallableFactory.createUnaryCallable( deleteSubscriptionTransportSettings, settings.deleteSubscriptionSettings(), clientContext); this.modifyAckDeadlineCallable = GrpcCallableFactory.createUnaryCallable( modifyAckDeadlineTransportSettings, settings.modifyAckDeadlineSettings(), clientContext); this.acknowledgeCallable = GrpcCallableFactory.createUnaryCallable( acknowledgeTransportSettings, settings.acknowledgeSettings(), clientContext); this.pullCallable = GrpcCallableFactory.createUnaryCallable( pullTransportSettings, settings.pullSettings(), clientContext); this.streamingPullCallable = GrpcCallableFactory.createBidiStreamingCallable( streamingPullTransportSettings, settings.streamingPullSettings(), clientContext); this.modifyPushConfigCallable = GrpcCallableFactory.createUnaryCallable( modifyPushConfigTransportSettings, settings.modifyPushConfigSettings(), clientContext); this.listSnapshotsCallable = GrpcCallableFactory.createUnaryCallable( listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); this.listSnapshotsPagedCallable = GrpcCallableFactory.createPagedCallable( listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); this.createSnapshotCallable = GrpcCallableFactory.createUnaryCallable( createSnapshotTransportSettings, settings.createSnapshotSettings(), clientContext); this.updateSnapshotCallable = GrpcCallableFactory.createUnaryCallable( updateSnapshotTransportSettings, settings.updateSnapshotSettings(), clientContext); this.deleteSnapshotCallable = GrpcCallableFactory.createUnaryCallable( deleteSnapshotTransportSettings, settings.deleteSnapshotSettings(), clientContext); this.seekCallable = GrpcCallableFactory.createUnaryCallable( seekTransportSettings, settings.seekSettings(), clientContext); this.setIamPolicyCallable = GrpcCallableFactory.createUnaryCallable( setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); this.getIamPolicyCallable = GrpcCallableFactory.createUnaryCallable( getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); this.testIamPermissionsCallable = GrpcCallableFactory.createUnaryCallable( testIamPermissionsTransportSettings, settings.testIamPermissionsSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } public UnaryCallable createSubscriptionCallable() { return createSubscriptionCallable; } public UnaryCallable getSubscriptionCallable() { return getSubscriptionCallable; } public UnaryCallable updateSubscriptionCallable() { return updateSubscriptionCallable; } public UnaryCallable listSubscriptionsPagedCallable() { return listSubscriptionsPagedCallable; } public UnaryCallable listSubscriptionsCallable() { return listSubscriptionsCallable; } public UnaryCallable deleteSubscriptionCallable() { return deleteSubscriptionCallable; } public UnaryCallable modifyAckDeadlineCallable() { return modifyAckDeadlineCallable; } public UnaryCallable acknowledgeCallable() { return acknowledgeCallable; } public UnaryCallable pullCallable() { return pullCallable; } public BidiStreamingCallable streamingPullCallable() { return streamingPullCallable; } public UnaryCallable modifyPushConfigCallable() { return modifyPushConfigCallable; } public UnaryCallable listSnapshotsPagedCallable() { return listSnapshotsPagedCallable; } public UnaryCallable listSnapshotsCallable() { return listSnapshotsCallable; } public UnaryCallable createSnapshotCallable() { return createSnapshotCallable; } public UnaryCallable updateSnapshotCallable() { return updateSnapshotCallable; } public UnaryCallable deleteSnapshotCallable() { return deleteSnapshotCallable; } public UnaryCallable seekCallable() { return seekCallable; } public UnaryCallable setIamPolicyCallable() { return setIamPolicyCallable; } public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; } public UnaryCallable testIamPermissionsCallable() { return testIamPermissionsCallable; } @Override public final void close() throws Exception { shutdown(); } @Override public void shutdown() { backgroundResources.shutdown(); } @Override public boolean isShutdown() { return backgroundResources.isShutdown(); } @Override public boolean isTerminated() { return backgroundResources.isTerminated(); } @Override public void shutdownNow() { backgroundResources.shutdownNow(); } @Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy