Class ManagedKafkaConnectClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) {
ConnectClusterName name =
ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]");
ConnectCluster response = managedKafkaConnectClient.getConnectCluster(name);
}
Note: close() needs to be called on the ManagedKafkaConnectClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListConnectClusters |
Lists the Kafka Connect clusters in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetConnectCluster |
Returns the properties of a single Kafka Connect cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateConnectCluster |
Creates a new Kafka Connect cluster in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateConnectCluster |
Updates the properties of a single Kafka Connect cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteConnectCluster |
Deletes a single Connect cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListConnectors |
Lists the connectors in a given Connect cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetConnector |
Returns the properties of a single connector. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateConnector |
Creates a new connector in a given Connect cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateConnector |
Updates the properties of a connector. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteConnector |
Deletes a connector. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
PauseConnector |
Pauses the connector and its tasks. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ResumeConnector |
Resumes the connector and its tasks. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RestartConnector |
Restarts the connector. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StopConnector |
Stops the connector. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of ManagedKafkaConnectSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ManagedKafkaConnectSettings managedKafkaConnectSettings =
ManagedKafkaConnectSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ManagedKafkaConnectClient managedKafkaConnectClient =
ManagedKafkaConnectClient.create(managedKafkaConnectSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ManagedKafkaConnectSettings managedKafkaConnectSettings =
ManagedKafkaConnectSettings.newBuilder().setEndpoint(myEndpoint).build();
ManagedKafkaConnectClient managedKafkaConnectClient =
ManagedKafkaConnectClient.create(managedKafkaConnectSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ManagedKafkaConnectSettings managedKafkaConnectSettings =
ManagedKafkaConnectSettings.newHttpJsonBuilder().build();
ManagedKafkaConnectClient managedKafkaConnectClient =
ManagedKafkaConnectClient.create(managedKafkaConnectSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of ManagedKafkaConnectClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final ManagedKafkaConnectClientcreate()Constructs an instance of ManagedKafkaConnectClient with default settings.static final ManagedKafkaConnectClientcreate(ManagedKafkaConnectSettings settings) Constructs an instance of ManagedKafkaConnectClient, using the given settings.static final ManagedKafkaConnectClientConstructs an instance of ManagedKafkaConnectClient, using the given stub for making calls.Creates a new Kafka Connect cluster in a given project and location.createConnectClusterAsync(LocationName parent, ConnectCluster connectCluster, String connectClusterId) Creates a new Kafka Connect cluster in a given project and location.createConnectClusterAsync(String parent, ConnectCluster connectCluster, String connectClusterId) Creates a new Kafka Connect cluster in a given project and location.Creates a new Kafka Connect cluster in a given project and location.Creates a new Kafka Connect cluster in a given project and location.final ConnectorcreateConnector(ConnectClusterName parent, Connector connector, String connectorId) Creates a new connector in a given Connect cluster.final ConnectorcreateConnector(CreateConnectorRequest request) Creates a new connector in a given Connect cluster.final ConnectorcreateConnector(String parent, Connector connector, String connectorId) Creates a new connector in a given Connect cluster.Creates a new connector in a given Connect cluster.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Connect cluster.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Connect cluster.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Connect cluster.Deletes a single Connect cluster.final OperationCallable<DeleteConnectClusterRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Connect cluster.final voiddeleteConnector(ConnectorName name) Deletes a connector.final voiddeleteConnector(DeleteConnectorRequest request) Deletes a connector.final voiddeleteConnector(String name) Deletes a connector.final UnaryCallable<DeleteConnectorRequest,com.google.protobuf.Empty> Deletes a connector.final ConnectClusterReturns the properties of a single Kafka Connect cluster.final ConnectClusterReturns the properties of a single Kafka Connect cluster.final ConnectClustergetConnectCluster(String name) Returns the properties of a single Kafka Connect cluster.Returns the properties of a single Kafka Connect cluster.final ConnectorgetConnector(ConnectorName name) Returns the properties of a single connector.final ConnectorgetConnector(GetConnectorRequest request) Returns the properties of a single connector.final ConnectorgetConnector(String name) Returns the properties of a single connector.Returns the properties of a single connector.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.getStub()booleanbooleanLists the Kafka Connect clusters in a given project and location.listConnectClusters(LocationName parent) Lists the Kafka Connect clusters in a given project and location.listConnectClusters(String parent) Lists the Kafka Connect clusters in a given project and location.Lists the Kafka Connect clusters in a given project and location.final UnaryCallable<ListConnectClustersRequest,ManagedKafkaConnectClient.ListConnectClustersPagedResponse> Lists the Kafka Connect clusters in a given project and location.listConnectors(ConnectClusterName parent) Lists the connectors in a given Connect cluster.listConnectors(ListConnectorsRequest request) Lists the connectors in a given Connect cluster.listConnectors(String parent) Lists the connectors in a given Connect cluster.Lists the connectors in a given Connect cluster.Lists the connectors in a given Connect cluster.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.final PauseConnectorResponsepauseConnector(ConnectorName name) Pauses the connector and its tasks.final PauseConnectorResponsepauseConnector(PauseConnectorRequest request) Pauses the connector and its tasks.final PauseConnectorResponsepauseConnector(String name) Pauses the connector and its tasks.Pauses the connector and its tasks.final RestartConnectorResponseRestarts the connector.final RestartConnectorResponserestartConnector(RestartConnectorRequest request) Restarts the connector.final RestartConnectorResponserestartConnector(String name) Restarts the connector.Restarts the connector.final ResumeConnectorResponseresumeConnector(ConnectorName name) Resumes the connector and its tasks.final ResumeConnectorResponseresumeConnector(ResumeConnectorRequest request) Resumes the connector and its tasks.final ResumeConnectorResponseresumeConnector(String name) Resumes the connector and its tasks.Resumes the connector and its tasks.voidshutdown()voidfinal StopConnectorResponsestopConnector(ConnectorName name) Stops the connector.final StopConnectorResponsestopConnector(StopConnectorRequest request) Stops the connector.final StopConnectorResponsestopConnector(String name) Stops the connector.Stops the connector.updateConnectClusterAsync(ConnectCluster connectCluster, com.google.protobuf.FieldMask updateMask) Updates the properties of a single Kafka Connect cluster.Updates the properties of a single Kafka Connect cluster.Updates the properties of a single Kafka Connect cluster.Updates the properties of a single Kafka Connect cluster.final ConnectorupdateConnector(Connector connector, com.google.protobuf.FieldMask updateMask) Updates the properties of a connector.final ConnectorupdateConnector(UpdateConnectorRequest request) Updates the properties of a connector.Updates the properties of a connector.
-
Constructor Details
-
ManagedKafkaConnectClient
Constructs an instance of ManagedKafkaConnectClient, 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.- Throws:
IOException
-
ManagedKafkaConnectClient
-
-
Method Details
-
create
Constructs an instance of ManagedKafkaConnectClient with default settings.- Throws:
IOException
-
create
public static final ManagedKafkaConnectClient create(ManagedKafkaConnectSettings settings) throws IOException Constructs an instance of ManagedKafkaConnectClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of ManagedKafkaConnectClient, using the given stub for making calls. This is for advanced usage - prefer using create(ManagedKafkaConnectSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listConnectClusters
public final ManagedKafkaConnectClient.ListConnectClustersPagedResponse listConnectClusters(LocationName parent) Lists the Kafka Connect clusters in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (ConnectCluster element : managedKafkaConnectClient.listConnectClusters(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent project/location whose Connect clusters are to be listed. Structured like `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listConnectClusters
public final ManagedKafkaConnectClient.ListConnectClustersPagedResponse listConnectClusters(String parent) Lists the Kafka Connect clusters in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (ConnectCluster element : managedKafkaConnectClient.listConnectClusters(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent project/location whose Connect clusters are to be listed. Structured like `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listConnectClusters
public final ManagedKafkaConnectClient.ListConnectClustersPagedResponse listConnectClusters(ListConnectClustersRequest request) Lists the Kafka Connect clusters in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ListConnectClustersRequest request = ListConnectClustersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ConnectCluster element : managedKafkaConnectClient.listConnectClusters(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listConnectClustersPagedCallable
public final UnaryCallable<ListConnectClustersRequest,ManagedKafkaConnectClient.ListConnectClustersPagedResponse> listConnectClustersPagedCallable()Lists the Kafka Connect clusters in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ListConnectClustersRequest request = ListConnectClustersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ConnectCluster> future = managedKafkaConnectClient.listConnectClustersPagedCallable().futureCall(request); // Do something. for (ConnectCluster element : future.get().iterateAll()) { // doThingsWith(element); } } -
listConnectClustersCallable
public final UnaryCallable<ListConnectClustersRequest,ListConnectClustersResponse> listConnectClustersCallable()Lists the Kafka Connect clusters in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ListConnectClustersRequest request = ListConnectClustersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListConnectClustersResponse response = managedKafkaConnectClient.listConnectClustersCallable().call(request); for (ConnectCluster element : response.getConnectClustersList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getConnectCluster
Returns the properties of a single Kafka Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectClusterName name = ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]"); ConnectCluster response = managedKafkaConnectClient.getConnectCluster(name); }- Parameters:
name- Required. The name of the Kafka Connect cluster whose configuration to return. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.- Throws:
ApiException- if the remote call fails
-
getConnectCluster
Returns the properties of a single Kafka Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String name = ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString(); ConnectCluster response = managedKafkaConnectClient.getConnectCluster(name); }- Parameters:
name- Required. The name of the Kafka Connect cluster whose configuration to return. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.- Throws:
ApiException- if the remote call fails
-
getConnectCluster
Returns the properties of a single Kafka Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { GetConnectClusterRequest request = GetConnectClusterRequest.newBuilder() .setName( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .build(); ConnectCluster response = managedKafkaConnectClient.getConnectCluster(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getConnectClusterCallable
Returns the properties of a single Kafka Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { GetConnectClusterRequest request = GetConnectClusterRequest.newBuilder() .setName( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .build(); ApiFuture<ConnectCluster> future = managedKafkaConnectClient.getConnectClusterCallable().futureCall(request); // Do something. ConnectCluster response = future.get(); } -
createConnectClusterAsync
public final OperationFuture<ConnectCluster,OperationMetadata> createConnectClusterAsync(LocationName parent, ConnectCluster connectCluster, String connectClusterId) Creates a new Kafka Connect cluster in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ConnectCluster connectCluster = ConnectCluster.newBuilder().build(); String connectClusterId = "connectClusterId-1562078485"; ConnectCluster response = managedKafkaConnectClient .createConnectClusterAsync(parent, connectCluster, connectClusterId) .get(); }- Parameters:
parent- Required. The parent project/location in which to create the Kafka Connect cluster. Structured like `projects/{project}/locations/{location}/`.connectCluster- Required. Configuration of the Kafka Connect cluster to create. Its `name` field is ignored.connectClusterId- Required. The ID to use for the Connect cluster, which will become the final component of the cluster's name. The ID must be 1-63 characters long, and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with RFC 1035.This value is structured like: `my-cluster-id`.
- Throws:
ApiException- if the remote call fails
-
createConnectClusterAsync
public final OperationFuture<ConnectCluster,OperationMetadata> createConnectClusterAsync(String parent, ConnectCluster connectCluster, String connectClusterId) Creates a new Kafka Connect cluster in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ConnectCluster connectCluster = ConnectCluster.newBuilder().build(); String connectClusterId = "connectClusterId-1562078485"; ConnectCluster response = managedKafkaConnectClient .createConnectClusterAsync(parent, connectCluster, connectClusterId) .get(); }- Parameters:
parent- Required. The parent project/location in which to create the Kafka Connect cluster. Structured like `projects/{project}/locations/{location}/`.connectCluster- Required. Configuration of the Kafka Connect cluster to create. Its `name` field is ignored.connectClusterId- Required. The ID to use for the Connect cluster, which will become the final component of the cluster's name. The ID must be 1-63 characters long, and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with RFC 1035.This value is structured like: `my-cluster-id`.
- Throws:
ApiException- if the remote call fails
-
createConnectClusterAsync
public final OperationFuture<ConnectCluster,OperationMetadata> createConnectClusterAsync(CreateConnectClusterRequest request) Creates a new Kafka Connect cluster in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { CreateConnectClusterRequest request = CreateConnectClusterRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConnectClusterId("connectClusterId-1562078485") .setConnectCluster(ConnectCluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); ConnectCluster response = managedKafkaConnectClient.createConnectClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createConnectClusterOperationCallable
public final OperationCallable<CreateConnectClusterRequest,ConnectCluster, createConnectClusterOperationCallable()OperationMetadata> Creates a new Kafka Connect cluster in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { CreateConnectClusterRequest request = CreateConnectClusterRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConnectClusterId("connectClusterId-1562078485") .setConnectCluster(ConnectCluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<ConnectCluster, OperationMetadata> future = managedKafkaConnectClient.createConnectClusterOperationCallable().futureCall(request); // Do something. ConnectCluster response = future.get(); } -
createConnectClusterCallable
Creates a new Kafka Connect cluster in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { CreateConnectClusterRequest request = CreateConnectClusterRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConnectClusterId("connectClusterId-1562078485") .setConnectCluster(ConnectCluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = managedKafkaConnectClient.createConnectClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateConnectClusterAsync
public final OperationFuture<ConnectCluster,OperationMetadata> updateConnectClusterAsync(ConnectCluster connectCluster, com.google.protobuf.FieldMask updateMask) Updates the properties of a single Kafka Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectCluster connectCluster = ConnectCluster.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ConnectCluster response = managedKafkaConnectClient.updateConnectClusterAsync(connectCluster, updateMask).get(); }- Parameters:
connectCluster- Required. The Kafka Connect cluster to update. Its `name` field must be populated.updateMask- Required. Field mask is used to specify the fields to be overwritten in the cluster resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. The mask is required and a value of * will update all fields.- Throws:
ApiException- if the remote call fails
-
updateConnectClusterAsync
public final OperationFuture<ConnectCluster,OperationMetadata> updateConnectClusterAsync(UpdateConnectClusterRequest request) Updates the properties of a single Kafka Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { UpdateConnectClusterRequest request = UpdateConnectClusterRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConnectCluster(ConnectCluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); ConnectCluster response = managedKafkaConnectClient.updateConnectClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateConnectClusterOperationCallable
public final OperationCallable<UpdateConnectClusterRequest,ConnectCluster, updateConnectClusterOperationCallable()OperationMetadata> Updates the properties of a single Kafka Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { UpdateConnectClusterRequest request = UpdateConnectClusterRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConnectCluster(ConnectCluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<ConnectCluster, OperationMetadata> future = managedKafkaConnectClient.updateConnectClusterOperationCallable().futureCall(request); // Do something. ConnectCluster response = future.get(); } -
updateConnectClusterCallable
Updates the properties of a single Kafka Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { UpdateConnectClusterRequest request = UpdateConnectClusterRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConnectCluster(ConnectCluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = managedKafkaConnectClient.updateConnectClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteConnectClusterAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectClusterAsync(ConnectClusterName name) Deletes a single Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectClusterName name = ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]"); managedKafkaConnectClient.deleteConnectClusterAsync(name).get(); }- Parameters:
name- Required. The name of the Kafka Connect cluster to delete. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.- Throws:
ApiException- if the remote call fails
-
deleteConnectClusterAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectClusterAsync(String name) Deletes a single Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String name = ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString(); managedKafkaConnectClient.deleteConnectClusterAsync(name).get(); }- Parameters:
name- Required. The name of the Kafka Connect cluster to delete. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.- Throws:
ApiException- if the remote call fails
-
deleteConnectClusterAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectClusterAsync(DeleteConnectClusterRequest request) Deletes a single Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { DeleteConnectClusterRequest request = DeleteConnectClusterRequest.newBuilder() .setName( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .setRequestId("requestId693933066") .build(); managedKafkaConnectClient.deleteConnectClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteConnectClusterOperationCallable
public final OperationCallable<DeleteConnectClusterRequest,com.google.protobuf.Empty, deleteConnectClusterOperationCallable()OperationMetadata> Deletes a single Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { DeleteConnectClusterRequest request = DeleteConnectClusterRequest.newBuilder() .setName( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = managedKafkaConnectClient.deleteConnectClusterOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteConnectClusterCallable
Deletes a single Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { DeleteConnectClusterRequest request = DeleteConnectClusterRequest.newBuilder() .setName( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = managedKafkaConnectClient.deleteConnectClusterCallable().futureCall(request); // Do something. future.get(); } -
listConnectors
public final ManagedKafkaConnectClient.ListConnectorsPagedResponse listConnectors(ConnectClusterName parent) Lists the connectors in a given Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectClusterName parent = ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]"); for (Connector element : managedKafkaConnectClient.listConnectors(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent Connect cluster whose connectors are to be listed. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.- Throws:
ApiException- if the remote call fails
-
listConnectors
Lists the connectors in a given Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String parent = ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString(); for (Connector element : managedKafkaConnectClient.listConnectors(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent Connect cluster whose connectors are to be listed. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.- Throws:
ApiException- if the remote call fails
-
listConnectors
public final ManagedKafkaConnectClient.ListConnectorsPagedResponse listConnectors(ListConnectorsRequest request) Lists the connectors in a given Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ListConnectorsRequest request = ListConnectorsRequest.newBuilder() .setParent( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Connector element : managedKafkaConnectClient.listConnectors(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listConnectorsPagedCallable
public final UnaryCallable<ListConnectorsRequest,ManagedKafkaConnectClient.ListConnectorsPagedResponse> listConnectorsPagedCallable()Lists the connectors in a given Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ListConnectorsRequest request = ListConnectorsRequest.newBuilder() .setParent( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Connector> future = managedKafkaConnectClient.listConnectorsPagedCallable().futureCall(request); // Do something. for (Connector element : future.get().iterateAll()) { // doThingsWith(element); } } -
listConnectorsCallable
Lists the connectors in a given Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ListConnectorsRequest request = ListConnectorsRequest.newBuilder() .setParent( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListConnectorsResponse response = managedKafkaConnectClient.listConnectorsCallable().call(request); for (Connector element : response.getConnectorsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getConnector
Returns the properties of a single connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectorName name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]"); Connector response = managedKafkaConnectClient.getConnector(name); }- Parameters:
name- Required. The name of the connector whose configuration to return. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
getConnector
Returns the properties of a single connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString(); Connector response = managedKafkaConnectClient.getConnector(name); }- Parameters:
name- Required. The name of the connector whose configuration to return. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
getConnector
Returns the properties of a single connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { GetConnectorRequest request = GetConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); Connector response = managedKafkaConnectClient.getConnector(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getConnectorCallable
Returns the properties of a single connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { GetConnectorRequest request = GetConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); ApiFuture<Connector> future = managedKafkaConnectClient.getConnectorCallable().futureCall(request); // Do something. Connector response = future.get(); } -
createConnector
public final Connector createConnector(ConnectClusterName parent, Connector connector, String connectorId) Creates a new connector in a given Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectClusterName parent = ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]"); Connector connector = Connector.newBuilder().build(); String connectorId = "connectorId1724784200"; Connector response = managedKafkaConnectClient.createConnector(parent, connector, connectorId); }- Parameters:
parent- Required. The parent Connect cluster in which to create the connector. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.connector- Required. The connector to create.connectorId- Required. The ID to use for the connector, which will become the final component of the connector's name. The ID must be 1-63 characters long, and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with RFC 1035.This value is structured like: `my-connector-id`.
- Throws:
ApiException- if the remote call fails
-
createConnector
Creates a new connector in a given Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String parent = ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString(); Connector connector = Connector.newBuilder().build(); String connectorId = "connectorId1724784200"; Connector response = managedKafkaConnectClient.createConnector(parent, connector, connectorId); }- Parameters:
parent- Required. The parent Connect cluster in which to create the connector. Structured like `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.connector- Required. The connector to create.connectorId- Required. The ID to use for the connector, which will become the final component of the connector's name. The ID must be 1-63 characters long, and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with RFC 1035.This value is structured like: `my-connector-id`.
- Throws:
ApiException- if the remote call fails
-
createConnector
Creates a new connector in a given Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { CreateConnectorRequest request = CreateConnectorRequest.newBuilder() .setParent( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .setConnectorId("connectorId1724784200") .setConnector(Connector.newBuilder().build()) .build(); Connector response = managedKafkaConnectClient.createConnector(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createConnectorCallable
Creates a new connector in a given Connect cluster.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { CreateConnectorRequest request = CreateConnectorRequest.newBuilder() .setParent( ConnectClusterName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]").toString()) .setConnectorId("connectorId1724784200") .setConnector(Connector.newBuilder().build()) .build(); ApiFuture<Connector> future = managedKafkaConnectClient.createConnectorCallable().futureCall(request); // Do something. Connector response = future.get(); } -
updateConnector
public final Connector updateConnector(Connector connector, com.google.protobuf.FieldMask updateMask) Updates the properties of a connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { Connector connector = Connector.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Connector response = managedKafkaConnectClient.updateConnector(connector, updateMask); }- Parameters:
connector- Required. The connector to update. Its `name` field must be populated.updateMask- Required. Field mask is used to specify the fields to be overwritten in the cluster resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. The mask is required and a value of * will update all fields.- Throws:
ApiException- if the remote call fails
-
updateConnector
Updates the properties of a connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { UpdateConnectorRequest request = UpdateConnectorRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConnector(Connector.newBuilder().build()) .build(); Connector response = managedKafkaConnectClient.updateConnector(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateConnectorCallable
Updates the properties of a connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { UpdateConnectorRequest request = UpdateConnectorRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConnector(Connector.newBuilder().build()) .build(); ApiFuture<Connector> future = managedKafkaConnectClient.updateConnectorCallable().futureCall(request); // Do something. Connector response = future.get(); } -
deleteConnector
Deletes a connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectorName name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]"); managedKafkaConnectClient.deleteConnector(name); }- Parameters:
name- Required. The name of the connector to delete. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
deleteConnector
Deletes a connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString(); managedKafkaConnectClient.deleteConnector(name); }- Parameters:
name- Required. The name of the connector to delete. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
deleteConnector
Deletes a connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { DeleteConnectorRequest request = DeleteConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); managedKafkaConnectClient.deleteConnector(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteConnectorCallable
public final UnaryCallable<DeleteConnectorRequest,com.google.protobuf.Empty> deleteConnectorCallable()Deletes a connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { DeleteConnectorRequest request = DeleteConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); ApiFuture<Empty> future = managedKafkaConnectClient.deleteConnectorCallable().futureCall(request); // Do something. future.get(); } -
pauseConnector
Pauses the connector and its tasks.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectorName name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]"); PauseConnectorResponse response = managedKafkaConnectClient.pauseConnector(name); }- Parameters:
name- Required. The name of the connector to pause. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
pauseConnector
Pauses the connector and its tasks.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString(); PauseConnectorResponse response = managedKafkaConnectClient.pauseConnector(name); }- Parameters:
name- Required. The name of the connector to pause. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
pauseConnector
Pauses the connector and its tasks.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { PauseConnectorRequest request = PauseConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); PauseConnectorResponse response = managedKafkaConnectClient.pauseConnector(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
pauseConnectorCallable
Pauses the connector and its tasks.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { PauseConnectorRequest request = PauseConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); ApiFuture<PauseConnectorResponse> future = managedKafkaConnectClient.pauseConnectorCallable().futureCall(request); // Do something. PauseConnectorResponse response = future.get(); } -
resumeConnector
Resumes the connector and its tasks.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectorName name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]"); ResumeConnectorResponse response = managedKafkaConnectClient.resumeConnector(name); }- Parameters:
name- Required. The name of the connector to pause. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
resumeConnector
Resumes the connector and its tasks.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString(); ResumeConnectorResponse response = managedKafkaConnectClient.resumeConnector(name); }- Parameters:
name- Required. The name of the connector to pause. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
resumeConnector
Resumes the connector and its tasks.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ResumeConnectorRequest request = ResumeConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); ResumeConnectorResponse response = managedKafkaConnectClient.resumeConnector(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
resumeConnectorCallable
public final UnaryCallable<ResumeConnectorRequest,ResumeConnectorResponse> resumeConnectorCallable()Resumes the connector and its tasks.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ResumeConnectorRequest request = ResumeConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); ApiFuture<ResumeConnectorResponse> future = managedKafkaConnectClient.resumeConnectorCallable().futureCall(request); // Do something. ResumeConnectorResponse response = future.get(); } -
restartConnector
Restarts the connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectorName name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]"); RestartConnectorResponse response = managedKafkaConnectClient.restartConnector(name); }- Parameters:
name- Required. The name of the connector to restart. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
restartConnector
Restarts the connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString(); RestartConnectorResponse response = managedKafkaConnectClient.restartConnector(name); }- Parameters:
name- Required. The name of the connector to restart. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
restartConnector
Restarts the connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { RestartConnectorRequest request = RestartConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); RestartConnectorResponse response = managedKafkaConnectClient.restartConnector(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
restartConnectorCallable
public final UnaryCallable<RestartConnectorRequest,RestartConnectorResponse> restartConnectorCallable()Restarts the connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { RestartConnectorRequest request = RestartConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); ApiFuture<RestartConnectorResponse> future = managedKafkaConnectClient.restartConnectorCallable().futureCall(request); // Do something. RestartConnectorResponse response = future.get(); } -
stopConnector
Stops the connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ConnectorName name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]"); StopConnectorResponse response = managedKafkaConnectClient.stopConnector(name); }- Parameters:
name- Required. The name of the connector to stop. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
stopConnector
Stops the connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { String name = ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString(); StopConnectorResponse response = managedKafkaConnectClient.stopConnector(name); }- Parameters:
name- Required. The name of the connector to stop. Structured like: projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}- Throws:
ApiException- if the remote call fails
-
stopConnector
Stops the connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { StopConnectorRequest request = StopConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); StopConnectorResponse response = managedKafkaConnectClient.stopConnector(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
stopConnectorCallable
Stops the connector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { StopConnectorRequest request = StopConnectorRequest.newBuilder() .setName( ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECT_CLUSTER]", "[CONNECTOR]") .toString()) .build(); ApiFuture<StopConnectorResponse> future = managedKafkaConnectClient.stopConnectorCallable().futureCall(request); // Do something. StopConnectorResponse response = future.get(); } -
listLocations
public final ManagedKafkaConnectClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : managedKafkaConnectClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,ManagedKafkaConnectClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = managedKafkaConnectClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = managedKafkaConnectClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = managedKafkaConnectClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ManagedKafkaConnectClient managedKafkaConnectClient = ManagedKafkaConnectClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = managedKafkaConnectClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-