com.google.cloud.pubsub.v1.stub.GrpcSubscriberStub Maven / Gradle / Ivy
Show all versions of google-cloud-pubsub Show documentation
/*
* 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.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.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.BidiStreamingCallable;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsBuilder;
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.longrunning.stub.GrpcOperationsStub;
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.GetSnapshotRequest;
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 the Subscriber service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
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 getSnapshotMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.pubsub.v1.Subscriber/GetSnapshot")
.setRequestMarshaller(ProtoUtils.marshaller(GetSnapshotRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Snapshot.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 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 getSnapshotCallable;
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;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
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);
}
public static final GrpcSubscriberStub create(
ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
return new GrpcSubscriberStub(
SubscriberStubSettings.newBuilder().build(), clientContext, callableFactory);
}
/**
* 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 {
this(settings, clientContext, new GrpcSubscriberCallableFactory());
}
/**
* 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,
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
GrpcCallSettings createSubscriptionTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createSubscriptionMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings getSubscriptionTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getSubscriptionMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("subscription", String.valueOf(request.getSubscription()));
return builder.build();
})
.build();
GrpcCallSettings updateSubscriptionTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateSubscriptionMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
"subscription.name", String.valueOf(request.getSubscription().getName()));
return builder.build();
})
.build();
GrpcCallSettings
listSubscriptionsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listSubscriptionsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("project", String.valueOf(request.getProject()));
return builder.build();
})
.build();
GrpcCallSettings deleteSubscriptionTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteSubscriptionMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("subscription", String.valueOf(request.getSubscription()));
return builder.build();
})
.build();
GrpcCallSettings modifyAckDeadlineTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(modifyAckDeadlineMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("subscription", String.valueOf(request.getSubscription()));
return builder.build();
})
.build();
GrpcCallSettings acknowledgeTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(acknowledgeMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("subscription", String.valueOf(request.getSubscription()));
return builder.build();
})
.build();
GrpcCallSettings pullTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(pullMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("subscription", String.valueOf(request.getSubscription()));
return builder.build();
})
.build();
GrpcCallSettings streamingPullTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(streamingPullMethodDescriptor)
.build();
GrpcCallSettings modifyPushConfigTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(modifyPushConfigMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("subscription", String.valueOf(request.getSubscription()));
return builder.build();
})
.build();
GrpcCallSettings getSnapshotTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getSnapshotMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("snapshot", String.valueOf(request.getSnapshot()));
return builder.build();
})
.build();
GrpcCallSettings listSnapshotsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listSnapshotsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("project", String.valueOf(request.getProject()));
return builder.build();
})
.build();
GrpcCallSettings createSnapshotTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createSnapshotMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings updateSnapshotTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateSnapshotMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("snapshot.name", String.valueOf(request.getSnapshot().getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteSnapshotTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteSnapshotMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("snapshot", String.valueOf(request.getSnapshot()));
return builder.build();
})
.build();
GrpcCallSettings seekTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(seekMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("subscription", String.valueOf(request.getSubscription()));
return builder.build();
})
.build();
GrpcCallSettings setIamPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(setIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings getIamPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings
testIamPermissionsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(testIamPermissionsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
this.createSubscriptionCallable =
callableFactory.createUnaryCallable(
createSubscriptionTransportSettings,
settings.createSubscriptionSettings(),
clientContext);
this.getSubscriptionCallable =
callableFactory.createUnaryCallable(
getSubscriptionTransportSettings, settings.getSubscriptionSettings(), clientContext);
this.updateSubscriptionCallable =
callableFactory.createUnaryCallable(
updateSubscriptionTransportSettings,
settings.updateSubscriptionSettings(),
clientContext);
this.listSubscriptionsCallable =
callableFactory.createUnaryCallable(
listSubscriptionsTransportSettings,
settings.listSubscriptionsSettings(),
clientContext);
this.listSubscriptionsPagedCallable =
callableFactory.createPagedCallable(
listSubscriptionsTransportSettings,
settings.listSubscriptionsSettings(),
clientContext);
this.deleteSubscriptionCallable =
callableFactory.createUnaryCallable(
deleteSubscriptionTransportSettings,
settings.deleteSubscriptionSettings(),
clientContext);
this.modifyAckDeadlineCallable =
callableFactory.createUnaryCallable(
modifyAckDeadlineTransportSettings,
settings.modifyAckDeadlineSettings(),
clientContext);
this.acknowledgeCallable =
callableFactory.createUnaryCallable(
acknowledgeTransportSettings, settings.acknowledgeSettings(), clientContext);
this.pullCallable =
callableFactory.createUnaryCallable(
pullTransportSettings, settings.pullSettings(), clientContext);
this.streamingPullCallable =
callableFactory.createBidiStreamingCallable(
streamingPullTransportSettings, settings.streamingPullSettings(), clientContext);
this.modifyPushConfigCallable =
callableFactory.createUnaryCallable(
modifyPushConfigTransportSettings, settings.modifyPushConfigSettings(), clientContext);
this.getSnapshotCallable =
callableFactory.createUnaryCallable(
getSnapshotTransportSettings, settings.getSnapshotSettings(), clientContext);
this.listSnapshotsCallable =
callableFactory.createUnaryCallable(
listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext);
this.listSnapshotsPagedCallable =
callableFactory.createPagedCallable(
listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext);
this.createSnapshotCallable =
callableFactory.createUnaryCallable(
createSnapshotTransportSettings, settings.createSnapshotSettings(), clientContext);
this.updateSnapshotCallable =
callableFactory.createUnaryCallable(
updateSnapshotTransportSettings, settings.updateSnapshotSettings(), clientContext);
this.deleteSnapshotCallable =
callableFactory.createUnaryCallable(
deleteSnapshotTransportSettings, settings.deleteSnapshotSettings(), clientContext);
this.seekCallable =
callableFactory.createUnaryCallable(
seekTransportSettings, settings.seekSettings(), clientContext);
this.setIamPolicyCallable =
callableFactory.createUnaryCallable(
setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext);
this.getIamPolicyCallable =
callableFactory.createUnaryCallable(
getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext);
this.testIamPermissionsCallable =
callableFactory.createUnaryCallable(
testIamPermissionsTransportSettings,
settings.testIamPermissionsSettings(),
clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
@Override
public UnaryCallable createSubscriptionCallable() {
return createSubscriptionCallable;
}
@Override
public UnaryCallable getSubscriptionCallable() {
return getSubscriptionCallable;
}
@Override
public UnaryCallable updateSubscriptionCallable() {
return updateSubscriptionCallable;
}
@Override
public UnaryCallable
listSubscriptionsCallable() {
return listSubscriptionsCallable;
}
@Override
public UnaryCallable
listSubscriptionsPagedCallable() {
return listSubscriptionsPagedCallable;
}
@Override
public UnaryCallable deleteSubscriptionCallable() {
return deleteSubscriptionCallable;
}
@Override
public UnaryCallable modifyAckDeadlineCallable() {
return modifyAckDeadlineCallable;
}
@Override
public UnaryCallable acknowledgeCallable() {
return acknowledgeCallable;
}
@Override
public UnaryCallable pullCallable() {
return pullCallable;
}
@Override
public BidiStreamingCallable
streamingPullCallable() {
return streamingPullCallable;
}
@Override
public UnaryCallable modifyPushConfigCallable() {
return modifyPushConfigCallable;
}
@Override
public UnaryCallable getSnapshotCallable() {
return getSnapshotCallable;
}
@Override
public UnaryCallable listSnapshotsCallable() {
return listSnapshotsCallable;
}
@Override
public UnaryCallable
listSnapshotsPagedCallable() {
return listSnapshotsPagedCallable;
}
@Override
public UnaryCallable createSnapshotCallable() {
return createSnapshotCallable;
}
@Override
public UnaryCallable updateSnapshotCallable() {
return updateSnapshotCallable;
}
@Override
public UnaryCallable deleteSnapshotCallable() {
return deleteSnapshotCallable;
}
@Override
public UnaryCallable seekCallable() {
return seekCallable;
}
@Override
public UnaryCallable setIamPolicyCallable() {
return setIamPolicyCallable;
}
@Override
public UnaryCallable getIamPolicyCallable() {
return getIamPolicyCallable;
}
@Override
public UnaryCallable
testIamPermissionsCallable() {
return testIamPermissionsCallable;
}
@Override
public final void close() {
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}
@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);
}
}