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

com.google.cloud.datastream.v1alpha1.stub.GrpcDatastreamStub Maven / Gradle / Ivy

Go to download

Datastream is a serverless and easy-to-use change data capture (CDC) and replication service. It allows you to synchronize data across heterogeneous databases and applications reliably, and with minimal latency and downtime.

There is a newer version: 1.53.0
Show newest version
/*
 * 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.datastream.v1alpha1.stub;

import static com.google.cloud.datastream.v1alpha1.DatastreamClient.FetchStaticIpsPagedResponse;
import static com.google.cloud.datastream.v1alpha1.DatastreamClient.ListConnectionProfilesPagedResponse;
import static com.google.cloud.datastream.v1alpha1.DatastreamClient.ListPrivateConnectionsPagedResponse;
import static com.google.cloud.datastream.v1alpha1.DatastreamClient.ListRoutesPagedResponse;
import static com.google.cloud.datastream.v1alpha1.DatastreamClient.ListStreamsPagedResponse;

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.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.datastream.v1alpha1.ConnectionProfile;
import com.google.cloud.datastream.v1alpha1.CreateConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.CreatePrivateConnectionRequest;
import com.google.cloud.datastream.v1alpha1.CreateRouteRequest;
import com.google.cloud.datastream.v1alpha1.CreateStreamRequest;
import com.google.cloud.datastream.v1alpha1.DeleteConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.DeletePrivateConnectionRequest;
import com.google.cloud.datastream.v1alpha1.DeleteRouteRequest;
import com.google.cloud.datastream.v1alpha1.DeleteStreamRequest;
import com.google.cloud.datastream.v1alpha1.DiscoverConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.DiscoverConnectionProfileResponse;
import com.google.cloud.datastream.v1alpha1.FetchErrorsRequest;
import com.google.cloud.datastream.v1alpha1.FetchErrorsResponse;
import com.google.cloud.datastream.v1alpha1.FetchStaticIpsRequest;
import com.google.cloud.datastream.v1alpha1.FetchStaticIpsResponse;
import com.google.cloud.datastream.v1alpha1.GetConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.GetPrivateConnectionRequest;
import com.google.cloud.datastream.v1alpha1.GetRouteRequest;
import com.google.cloud.datastream.v1alpha1.GetStreamRequest;
import com.google.cloud.datastream.v1alpha1.ListConnectionProfilesRequest;
import com.google.cloud.datastream.v1alpha1.ListConnectionProfilesResponse;
import com.google.cloud.datastream.v1alpha1.ListPrivateConnectionsRequest;
import com.google.cloud.datastream.v1alpha1.ListPrivateConnectionsResponse;
import com.google.cloud.datastream.v1alpha1.ListRoutesRequest;
import com.google.cloud.datastream.v1alpha1.ListRoutesResponse;
import com.google.cloud.datastream.v1alpha1.ListStreamsRequest;
import com.google.cloud.datastream.v1alpha1.ListStreamsResponse;
import com.google.cloud.datastream.v1alpha1.OperationMetadata;
import com.google.cloud.datastream.v1alpha1.PrivateConnection;
import com.google.cloud.datastream.v1alpha1.Route;
import com.google.cloud.datastream.v1alpha1.Stream;
import com.google.cloud.datastream.v1alpha1.UpdateConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.UpdateStreamRequest;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
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 Datastream service API.
 *
 * 

This class is for advanced usage and reflects the underlying API directly. */ @BetaApi @Generated("by gapic-generator-java") public class GrpcDatastreamStub extends DatastreamStub { private static final MethodDescriptor< ListConnectionProfilesRequest, ListConnectionProfilesResponse> listConnectionProfilesMethodDescriptor = MethodDescriptor .newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName( "google.cloud.datastream.v1alpha1.Datastream/ListConnectionProfiles") .setRequestMarshaller( ProtoUtils.marshaller(ListConnectionProfilesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListConnectionProfilesResponse.getDefaultInstance())) .build(); private static final MethodDescriptor getConnectionProfileMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/GetConnectionProfile") .setRequestMarshaller( ProtoUtils.marshaller(GetConnectionProfileRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ConnectionProfile.getDefaultInstance())) .build(); private static final MethodDescriptor createConnectionProfileMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName( "google.cloud.datastream.v1alpha1.Datastream/CreateConnectionProfile") .setRequestMarshaller( ProtoUtils.marshaller(CreateConnectionProfileRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor updateConnectionProfileMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName( "google.cloud.datastream.v1alpha1.Datastream/UpdateConnectionProfile") .setRequestMarshaller( ProtoUtils.marshaller(UpdateConnectionProfileRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor deleteConnectionProfileMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName( "google.cloud.datastream.v1alpha1.Datastream/DeleteConnectionProfile") .setRequestMarshaller( ProtoUtils.marshaller(DeleteConnectionProfileRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor< DiscoverConnectionProfileRequest, DiscoverConnectionProfileResponse> discoverConnectionProfileMethodDescriptor = MethodDescriptor .newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName( "google.cloud.datastream.v1alpha1.Datastream/DiscoverConnectionProfile") .setRequestMarshaller( ProtoUtils.marshaller(DiscoverConnectionProfileRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(DiscoverConnectionProfileResponse.getDefaultInstance())) .build(); private static final MethodDescriptor listStreamsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/ListStreams") .setRequestMarshaller(ProtoUtils.marshaller(ListStreamsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListStreamsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor getStreamMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/GetStream") .setRequestMarshaller(ProtoUtils.marshaller(GetStreamRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Stream.getDefaultInstance())) .build(); private static final MethodDescriptor createStreamMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/CreateStream") .setRequestMarshaller(ProtoUtils.marshaller(CreateStreamRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor updateStreamMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/UpdateStream") .setRequestMarshaller(ProtoUtils.marshaller(UpdateStreamRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor deleteStreamMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/DeleteStream") .setRequestMarshaller(ProtoUtils.marshaller(DeleteStreamRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor fetchErrorsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/FetchErrors") .setRequestMarshaller(ProtoUtils.marshaller(FetchErrorsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor fetchStaticIpsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/FetchStaticIps") .setRequestMarshaller( ProtoUtils.marshaller(FetchStaticIpsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(FetchStaticIpsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor createPrivateConnectionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName( "google.cloud.datastream.v1alpha1.Datastream/CreatePrivateConnection") .setRequestMarshaller( ProtoUtils.marshaller(CreatePrivateConnectionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor getPrivateConnectionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/GetPrivateConnection") .setRequestMarshaller( ProtoUtils.marshaller(GetPrivateConnectionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(PrivateConnection.getDefaultInstance())) .build(); private static final MethodDescriptor< ListPrivateConnectionsRequest, ListPrivateConnectionsResponse> listPrivateConnectionsMethodDescriptor = MethodDescriptor .newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName( "google.cloud.datastream.v1alpha1.Datastream/ListPrivateConnections") .setRequestMarshaller( ProtoUtils.marshaller(ListPrivateConnectionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListPrivateConnectionsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor deletePrivateConnectionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName( "google.cloud.datastream.v1alpha1.Datastream/DeletePrivateConnection") .setRequestMarshaller( ProtoUtils.marshaller(DeletePrivateConnectionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor createRouteMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/CreateRoute") .setRequestMarshaller(ProtoUtils.marshaller(CreateRouteRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor getRouteMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/GetRoute") .setRequestMarshaller(ProtoUtils.marshaller(GetRouteRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Route.getDefaultInstance())) .build(); private static final MethodDescriptor listRoutesMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/ListRoutes") .setRequestMarshaller(ProtoUtils.marshaller(ListRoutesRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListRoutesResponse.getDefaultInstance())) .build(); private static final MethodDescriptor deleteRouteMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/DeleteRoute") .setRequestMarshaller(ProtoUtils.marshaller(DeleteRouteRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private final UnaryCallable listConnectionProfilesCallable; private final UnaryCallable listConnectionProfilesPagedCallable; private final UnaryCallable getConnectionProfileCallable; private final UnaryCallable createConnectionProfileCallable; private final OperationCallable< CreateConnectionProfileRequest, ConnectionProfile, OperationMetadata> createConnectionProfileOperationCallable; private final UnaryCallable updateConnectionProfileCallable; private final OperationCallable< UpdateConnectionProfileRequest, ConnectionProfile, OperationMetadata> updateConnectionProfileOperationCallable; private final UnaryCallable deleteConnectionProfileCallable; private final OperationCallable deleteConnectionProfileOperationCallable; private final UnaryCallable discoverConnectionProfileCallable; private final UnaryCallable listStreamsCallable; private final UnaryCallable listStreamsPagedCallable; private final UnaryCallable getStreamCallable; private final UnaryCallable createStreamCallable; private final OperationCallable createStreamOperationCallable; private final UnaryCallable updateStreamCallable; private final OperationCallable updateStreamOperationCallable; private final UnaryCallable deleteStreamCallable; private final OperationCallable deleteStreamOperationCallable; private final UnaryCallable fetchErrorsCallable; private final OperationCallable fetchErrorsOperationCallable; private final UnaryCallable fetchStaticIpsCallable; private final UnaryCallable fetchStaticIpsPagedCallable; private final UnaryCallable createPrivateConnectionCallable; private final OperationCallable< CreatePrivateConnectionRequest, PrivateConnection, OperationMetadata> createPrivateConnectionOperationCallable; private final UnaryCallable getPrivateConnectionCallable; private final UnaryCallable listPrivateConnectionsCallable; private final UnaryCallable listPrivateConnectionsPagedCallable; private final UnaryCallable deletePrivateConnectionCallable; private final OperationCallable deletePrivateConnectionOperationCallable; private final UnaryCallable createRouteCallable; private final OperationCallable createRouteOperationCallable; private final UnaryCallable getRouteCallable; private final UnaryCallable listRoutesCallable; private final UnaryCallable listRoutesPagedCallable; private final UnaryCallable deleteRouteCallable; private final OperationCallable deleteRouteOperationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcDatastreamStub create(DatastreamStubSettings settings) throws IOException { return new GrpcDatastreamStub(settings, ClientContext.create(settings)); } public static final GrpcDatastreamStub create(ClientContext clientContext) throws IOException { return new GrpcDatastreamStub(DatastreamStubSettings.newBuilder().build(), clientContext); } public static final GrpcDatastreamStub create( ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { return new GrpcDatastreamStub( DatastreamStubSettings.newBuilder().build(), clientContext, callableFactory); } /** * Constructs an instance of GrpcDatastreamStub, 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 GrpcDatastreamStub(DatastreamStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcDatastreamCallableFactory()); } /** * Constructs an instance of GrpcDatastreamStub, 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 GrpcDatastreamStub( DatastreamStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listConnectionProfilesTransportSettings = GrpcCallSettings .newBuilder() .setMethodDescriptor(listConnectionProfilesMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings getConnectionProfileTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getConnectionProfileMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings createConnectionProfileTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createConnectionProfileMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings updateConnectionProfileTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateConnectionProfileMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add( "connection_profile.name", String.valueOf(request.getConnectionProfile().getName())); return builder.build(); }) .build(); GrpcCallSettings deleteConnectionProfileTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteConnectionProfileMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings discoverConnectionProfileTransportSettings = GrpcCallSettings .newBuilder() .setMethodDescriptor(discoverConnectionProfileMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings listStreamsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listStreamsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings getStreamTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getStreamMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings createStreamTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createStreamMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings updateStreamTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateStreamMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("stream.name", String.valueOf(request.getStream().getName())); return builder.build(); }) .build(); GrpcCallSettings deleteStreamTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteStreamMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings fetchErrorsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(fetchErrorsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("stream", String.valueOf(request.getStream())); return builder.build(); }) .build(); GrpcCallSettings fetchStaticIpsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(fetchStaticIpsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings createPrivateConnectionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createPrivateConnectionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings getPrivateConnectionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getPrivateConnectionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings listPrivateConnectionsTransportSettings = GrpcCallSettings .newBuilder() .setMethodDescriptor(listPrivateConnectionsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings deletePrivateConnectionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deletePrivateConnectionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings createRouteTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createRouteMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings getRouteTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getRouteMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings listRoutesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listRoutesMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings deleteRouteTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteRouteMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); this.listConnectionProfilesCallable = callableFactory.createUnaryCallable( listConnectionProfilesTransportSettings, settings.listConnectionProfilesSettings(), clientContext); this.listConnectionProfilesPagedCallable = callableFactory.createPagedCallable( listConnectionProfilesTransportSettings, settings.listConnectionProfilesSettings(), clientContext); this.getConnectionProfileCallable = callableFactory.createUnaryCallable( getConnectionProfileTransportSettings, settings.getConnectionProfileSettings(), clientContext); this.createConnectionProfileCallable = callableFactory.createUnaryCallable( createConnectionProfileTransportSettings, settings.createConnectionProfileSettings(), clientContext); this.createConnectionProfileOperationCallable = callableFactory.createOperationCallable( createConnectionProfileTransportSettings, settings.createConnectionProfileOperationSettings(), clientContext, operationsStub); this.updateConnectionProfileCallable = callableFactory.createUnaryCallable( updateConnectionProfileTransportSettings, settings.updateConnectionProfileSettings(), clientContext); this.updateConnectionProfileOperationCallable = callableFactory.createOperationCallable( updateConnectionProfileTransportSettings, settings.updateConnectionProfileOperationSettings(), clientContext, operationsStub); this.deleteConnectionProfileCallable = callableFactory.createUnaryCallable( deleteConnectionProfileTransportSettings, settings.deleteConnectionProfileSettings(), clientContext); this.deleteConnectionProfileOperationCallable = callableFactory.createOperationCallable( deleteConnectionProfileTransportSettings, settings.deleteConnectionProfileOperationSettings(), clientContext, operationsStub); this.discoverConnectionProfileCallable = callableFactory.createUnaryCallable( discoverConnectionProfileTransportSettings, settings.discoverConnectionProfileSettings(), clientContext); this.listStreamsCallable = callableFactory.createUnaryCallable( listStreamsTransportSettings, settings.listStreamsSettings(), clientContext); this.listStreamsPagedCallable = callableFactory.createPagedCallable( listStreamsTransportSettings, settings.listStreamsSettings(), clientContext); this.getStreamCallable = callableFactory.createUnaryCallable( getStreamTransportSettings, settings.getStreamSettings(), clientContext); this.createStreamCallable = callableFactory.createUnaryCallable( createStreamTransportSettings, settings.createStreamSettings(), clientContext); this.createStreamOperationCallable = callableFactory.createOperationCallable( createStreamTransportSettings, settings.createStreamOperationSettings(), clientContext, operationsStub); this.updateStreamCallable = callableFactory.createUnaryCallable( updateStreamTransportSettings, settings.updateStreamSettings(), clientContext); this.updateStreamOperationCallable = callableFactory.createOperationCallable( updateStreamTransportSettings, settings.updateStreamOperationSettings(), clientContext, operationsStub); this.deleteStreamCallable = callableFactory.createUnaryCallable( deleteStreamTransportSettings, settings.deleteStreamSettings(), clientContext); this.deleteStreamOperationCallable = callableFactory.createOperationCallable( deleteStreamTransportSettings, settings.deleteStreamOperationSettings(), clientContext, operationsStub); this.fetchErrorsCallable = callableFactory.createUnaryCallable( fetchErrorsTransportSettings, settings.fetchErrorsSettings(), clientContext); this.fetchErrorsOperationCallable = callableFactory.createOperationCallable( fetchErrorsTransportSettings, settings.fetchErrorsOperationSettings(), clientContext, operationsStub); this.fetchStaticIpsCallable = callableFactory.createUnaryCallable( fetchStaticIpsTransportSettings, settings.fetchStaticIpsSettings(), clientContext); this.fetchStaticIpsPagedCallable = callableFactory.createPagedCallable( fetchStaticIpsTransportSettings, settings.fetchStaticIpsSettings(), clientContext); this.createPrivateConnectionCallable = callableFactory.createUnaryCallable( createPrivateConnectionTransportSettings, settings.createPrivateConnectionSettings(), clientContext); this.createPrivateConnectionOperationCallable = callableFactory.createOperationCallable( createPrivateConnectionTransportSettings, settings.createPrivateConnectionOperationSettings(), clientContext, operationsStub); this.getPrivateConnectionCallable = callableFactory.createUnaryCallable( getPrivateConnectionTransportSettings, settings.getPrivateConnectionSettings(), clientContext); this.listPrivateConnectionsCallable = callableFactory.createUnaryCallable( listPrivateConnectionsTransportSettings, settings.listPrivateConnectionsSettings(), clientContext); this.listPrivateConnectionsPagedCallable = callableFactory.createPagedCallable( listPrivateConnectionsTransportSettings, settings.listPrivateConnectionsSettings(), clientContext); this.deletePrivateConnectionCallable = callableFactory.createUnaryCallable( deletePrivateConnectionTransportSettings, settings.deletePrivateConnectionSettings(), clientContext); this.deletePrivateConnectionOperationCallable = callableFactory.createOperationCallable( deletePrivateConnectionTransportSettings, settings.deletePrivateConnectionOperationSettings(), clientContext, operationsStub); this.createRouteCallable = callableFactory.createUnaryCallable( createRouteTransportSettings, settings.createRouteSettings(), clientContext); this.createRouteOperationCallable = callableFactory.createOperationCallable( createRouteTransportSettings, settings.createRouteOperationSettings(), clientContext, operationsStub); this.getRouteCallable = callableFactory.createUnaryCallable( getRouteTransportSettings, settings.getRouteSettings(), clientContext); this.listRoutesCallable = callableFactory.createUnaryCallable( listRoutesTransportSettings, settings.listRoutesSettings(), clientContext); this.listRoutesPagedCallable = callableFactory.createPagedCallable( listRoutesTransportSettings, settings.listRoutesSettings(), clientContext); this.deleteRouteCallable = callableFactory.createUnaryCallable( deleteRouteTransportSettings, settings.deleteRouteSettings(), clientContext); this.deleteRouteOperationCallable = callableFactory.createOperationCallable( deleteRouteTransportSettings, settings.deleteRouteOperationSettings(), clientContext, operationsStub); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } public GrpcOperationsStub getOperationsStub() { return operationsStub; } @Override public UnaryCallable listConnectionProfilesCallable() { return listConnectionProfilesCallable; } @Override public UnaryCallable listConnectionProfilesPagedCallable() { return listConnectionProfilesPagedCallable; } @Override public UnaryCallable getConnectionProfileCallable() { return getConnectionProfileCallable; } @Override public UnaryCallable createConnectionProfileCallable() { return createConnectionProfileCallable; } @Override public OperationCallable createConnectionProfileOperationCallable() { return createConnectionProfileOperationCallable; } @Override public UnaryCallable updateConnectionProfileCallable() { return updateConnectionProfileCallable; } @Override public OperationCallable updateConnectionProfileOperationCallable() { return updateConnectionProfileOperationCallable; } @Override public UnaryCallable deleteConnectionProfileCallable() { return deleteConnectionProfileCallable; } @Override public OperationCallable deleteConnectionProfileOperationCallable() { return deleteConnectionProfileOperationCallable; } @Override public UnaryCallable discoverConnectionProfileCallable() { return discoverConnectionProfileCallable; } @Override public UnaryCallable listStreamsCallable() { return listStreamsCallable; } @Override public UnaryCallable listStreamsPagedCallable() { return listStreamsPagedCallable; } @Override public UnaryCallable getStreamCallable() { return getStreamCallable; } @Override public UnaryCallable createStreamCallable() { return createStreamCallable; } @Override public OperationCallable createStreamOperationCallable() { return createStreamOperationCallable; } @Override public UnaryCallable updateStreamCallable() { return updateStreamCallable; } @Override public OperationCallable updateStreamOperationCallable() { return updateStreamOperationCallable; } @Override public UnaryCallable deleteStreamCallable() { return deleteStreamCallable; } @Override public OperationCallable deleteStreamOperationCallable() { return deleteStreamOperationCallable; } @Override public UnaryCallable fetchErrorsCallable() { return fetchErrorsCallable; } @Override public OperationCallable fetchErrorsOperationCallable() { return fetchErrorsOperationCallable; } @Override public UnaryCallable fetchStaticIpsCallable() { return fetchStaticIpsCallable; } @Override public UnaryCallable fetchStaticIpsPagedCallable() { return fetchStaticIpsPagedCallable; } @Override public UnaryCallable createPrivateConnectionCallable() { return createPrivateConnectionCallable; } @Override public OperationCallable createPrivateConnectionOperationCallable() { return createPrivateConnectionOperationCallable; } @Override public UnaryCallable getPrivateConnectionCallable() { return getPrivateConnectionCallable; } @Override public UnaryCallable listPrivateConnectionsCallable() { return listPrivateConnectionsCallable; } @Override public UnaryCallable listPrivateConnectionsPagedCallable() { return listPrivateConnectionsPagedCallable; } @Override public UnaryCallable deletePrivateConnectionCallable() { return deletePrivateConnectionCallable; } @Override public OperationCallable deletePrivateConnectionOperationCallable() { return deletePrivateConnectionOperationCallable; } @Override public UnaryCallable createRouteCallable() { return createRouteCallable; } @Override public OperationCallable createRouteOperationCallable() { return createRouteOperationCallable; } @Override public UnaryCallable getRouteCallable() { return getRouteCallable; } @Override public UnaryCallable listRoutesCallable() { return listRoutesCallable; } @Override public UnaryCallable listRoutesPagedCallable() { return listRoutesPagedCallable; } @Override public UnaryCallable deleteRouteCallable() { return deleteRouteCallable; } @Override public OperationCallable deleteRouteOperationCallable() { return deleteRouteOperationCallable; } @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); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy