- 2.54.0 (latest)
- 2.53.0
- 2.52.0
- 2.50.0
- 2.49.0
- 2.48.0
- 2.47.0
- 2.46.0
- 2.45.0
- 2.44.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.40.0
- 2.38.0
- 2.37.0
- 2.36.0
- 2.35.0
- 2.34.0
- 2.33.0
- 2.32.0
- 2.31.0
- 2.30.0
- 2.29.0
- 2.28.0
- 2.25.0
- 2.24.0
- 2.23.0
- 2.22.0
- 2.21.0
- 2.20.0
- 2.19.0
- 2.18.0
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.0
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.6
- 2.2.9
public class ApplicationServiceClient implements BackgroundResource
Service Description: A service that handles application management, including CRUD and enumeration.
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:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]");
Application application = Application.newBuilder().build();
Application response = applicationServiceClient.createApplication(parent, application);
}
Note: close() needs to be called on the ApplicationServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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 ApplicationServiceSettings to create(). For example:
To customize credentials:
ApplicationServiceSettings applicationServiceSettings =
ApplicationServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ApplicationServiceClient applicationServiceClient =
ApplicationServiceClient.create(applicationServiceSettings);
To customize the endpoint:
ApplicationServiceSettings applicationServiceSettings =
ApplicationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
ApplicationServiceClient applicationServiceClient =
ApplicationServiceClient.create(applicationServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final ApplicationServiceClient create()
Constructs an instance of ApplicationServiceClient with default settings.
Type | Description |
ApplicationServiceClient |
Type | Description |
IOException |
create(ApplicationServiceSettings settings)
public static final ApplicationServiceClient create(ApplicationServiceSettings settings)
Constructs an instance of ApplicationServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | ApplicationServiceSettings |
Type | Description |
ApplicationServiceClient |
Type | Description |
IOException |
create(ApplicationServiceStub stub)
public static final ApplicationServiceClient create(ApplicationServiceStub stub)
Constructs an instance of ApplicationServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(ApplicationServiceSettings).
Name | Description |
stub | ApplicationServiceStub |
Type | Description |
ApplicationServiceClient |
Constructors
ApplicationServiceClient(ApplicationServiceSettings settings)
protected ApplicationServiceClient(ApplicationServiceSettings settings)
Constructs an instance of ApplicationServiceClient, 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.
Name | Description |
settings | ApplicationServiceSettings |
ApplicationServiceClient(ApplicationServiceStub stub)
protected ApplicationServiceClient(ApplicationServiceStub stub)
Name | Description |
stub | ApplicationServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
createApplication(CreateApplicationRequest request)
public final Application createApplication(CreateApplicationRequest request)
Creates a new application entity.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
CreateApplicationRequest request =
CreateApplicationRequest.newBuilder()
.setParent(ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]").toString())
.setApplication(Application.newBuilder().build())
.build();
Application response = applicationServiceClient.createApplication(request);
}
Name | Description |
request | CreateApplicationRequest The request object containing all of the parameters for the API call. |
Type | Description |
Application |
createApplication(ProfileName parent, Application application)
public final Application createApplication(ProfileName parent, Application application)
Creates a new application entity.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]");
Application application = Application.newBuilder().build();
Application response = applicationServiceClient.createApplication(parent, application);
}
Name | Description |
parent | ProfileName Required. Resource name of the profile under which the application is created. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For example, "projects/foo/tenants/bar/profiles/baz". |
application | Application Required. The application to be created. |
Type | Description |
Application |
createApplication(String parent, Application application)
public final Application createApplication(String parent, Application application)
Creates a new application entity.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
String parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]").toString();
Application application = Application.newBuilder().build();
Application response = applicationServiceClient.createApplication(parent, application);
}
Name | Description |
parent | String Required. Resource name of the profile under which the application is created. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For example, "projects/foo/tenants/bar/profiles/baz". |
application | Application Required. The application to be created. |
Type | Description |
Application |
createApplicationCallable()
public final UnaryCallable<CreateApplicationRequest,Application> createApplicationCallable()
Creates a new application entity.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
CreateApplicationRequest request =
CreateApplicationRequest.newBuilder()
.setParent(ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]").toString())
.setApplication(Application.newBuilder().build())
.build();
ApiFuture<Application> future =
applicationServiceClient.createApplicationCallable().futureCall(request);
// Do something.
Application response = future.get();
}
Type | Description |
UnaryCallable<CreateApplicationRequest,Application> |
deleteApplication(ApplicationName name)
public final void deleteApplication(ApplicationName name)
Deletes specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ApplicationName name =
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
applicationServiceClient.deleteApplication(name);
}
Name | Description |
name | ApplicationName Required. The resource name of the application to be deleted. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}". For example, "projects/foo/tenants/bar/profiles/baz/applications/qux". |
deleteApplication(DeleteApplicationRequest request)
public final void deleteApplication(DeleteApplicationRequest request)
Deletes specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
DeleteApplicationRequest request =
DeleteApplicationRequest.newBuilder()
.setName(
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]")
.toString())
.build();
applicationServiceClient.deleteApplication(request);
}
Name | Description |
request | DeleteApplicationRequest The request object containing all of the parameters for the API call. |
deleteApplication(String name)
public final void deleteApplication(String name)
Deletes specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
String name =
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]").toString();
applicationServiceClient.deleteApplication(name);
}
Name | Description |
name | String Required. The resource name of the application to be deleted. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}". For example, "projects/foo/tenants/bar/profiles/baz/applications/qux". |
deleteApplicationCallable()
public final UnaryCallable<DeleteApplicationRequest,Empty> deleteApplicationCallable()
Deletes specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
DeleteApplicationRequest request =
DeleteApplicationRequest.newBuilder()
.setName(
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]")
.toString())
.build();
ApiFuture<Empty> future =
applicationServiceClient.deleteApplicationCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteApplicationRequest,Empty> |
getApplication(ApplicationName name)
public final Application getApplication(ApplicationName name)
Retrieves specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ApplicationName name =
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
Application response = applicationServiceClient.getApplication(name);
}
Name | Description |
name | ApplicationName Required. The resource name of the application to be retrieved. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}". For example, "projects/foo/tenants/bar/profiles/baz/applications/qux". |
Type | Description |
Application |
getApplication(GetApplicationRequest request)
public final Application getApplication(GetApplicationRequest request)
Retrieves specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
GetApplicationRequest request =
GetApplicationRequest.newBuilder()
.setName(
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]")
.toString())
.build();
Application response = applicationServiceClient.getApplication(request);
}
Name | Description |
request | GetApplicationRequest The request object containing all of the parameters for the API call. |
Type | Description |
Application |
getApplication(String name)
public final Application getApplication(String name)
Retrieves specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
String name =
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]").toString();
Application response = applicationServiceClient.getApplication(name);
}
Name | Description |
name | String Required. The resource name of the application to be retrieved. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}". For example, "projects/foo/tenants/bar/profiles/baz/applications/qux". |
Type | Description |
Application |
getApplicationCallable()
public final UnaryCallable<GetApplicationRequest,Application> getApplicationCallable()
Retrieves specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
GetApplicationRequest request =
GetApplicationRequest.newBuilder()
.setName(
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]")
.toString())
.build();
ApiFuture<Application> future =
applicationServiceClient.getApplicationCallable().futureCall(request);
// Do something.
Application response = future.get();
}
Type | Description |
UnaryCallable<GetApplicationRequest,Application> |
getSettings()
public final ApplicationServiceSettings getSettings()
Type | Description |
ApplicationServiceSettings |
getStub()
public ApplicationServiceStub getStub()
Type | Description |
ApplicationServiceStub |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listApplications(ListApplicationsRequest request)
public final ApplicationServiceClient.ListApplicationsPagedResponse listApplications(ListApplicationsRequest request)
Lists all applications associated with the profile.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ListApplicationsRequest request =
ListApplicationsRequest.newBuilder()
.setParent(ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (Application element : applicationServiceClient.listApplications(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListApplicationsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ApplicationServiceClient.ListApplicationsPagedResponse |
listApplications(ProfileName parent)
public final ApplicationServiceClient.ListApplicationsPagedResponse listApplications(ProfileName parent)
Lists all applications associated with the profile.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]");
for (Application element : applicationServiceClient.listApplications(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | ProfileName Required. Resource name of the profile under which the application is created. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", for example, "projects/foo/tenants/bar/profiles/baz". |
Type | Description |
ApplicationServiceClient.ListApplicationsPagedResponse |
listApplications(String parent)
public final ApplicationServiceClient.ListApplicationsPagedResponse listApplications(String parent)
Lists all applications associated with the profile.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
String parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]").toString();
for (Application element : applicationServiceClient.listApplications(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. Resource name of the profile under which the application is created. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", for example, "projects/foo/tenants/bar/profiles/baz". |
Type | Description |
ApplicationServiceClient.ListApplicationsPagedResponse |
listApplicationsCallable()
public final UnaryCallable<ListApplicationsRequest,ListApplicationsResponse> listApplicationsCallable()
Lists all applications associated with the profile.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ListApplicationsRequest request =
ListApplicationsRequest.newBuilder()
.setParent(ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListApplicationsResponse response =
applicationServiceClient.listApplicationsCallable().call(request);
for (Application element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListApplicationsRequest,ListApplicationsResponse> |
listApplicationsPagedCallable()
public final UnaryCallable<ListApplicationsRequest,ApplicationServiceClient.ListApplicationsPagedResponse> listApplicationsPagedCallable()
Lists all applications associated with the profile.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ListApplicationsRequest request =
ListApplicationsRequest.newBuilder()
.setParent(ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<Application> future =
applicationServiceClient.listApplicationsPagedCallable().futureCall(request);
// Do something.
for (Application element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListApplicationsRequest,ListApplicationsPagedResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateApplication(Application application)
public final Application updateApplication(Application application)
Updates specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
Application application = Application.newBuilder().build();
Application response = applicationServiceClient.updateApplication(application);
}
Name | Description |
application | Application Required. The application resource to replace the current resource in the system. |
Type | Description |
Application |
updateApplication(UpdateApplicationRequest request)
public final Application updateApplication(UpdateApplicationRequest request)
Updates specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
UpdateApplicationRequest request =
UpdateApplicationRequest.newBuilder()
.setApplication(Application.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Application response = applicationServiceClient.updateApplication(request);
}
Name | Description |
request | UpdateApplicationRequest The request object containing all of the parameters for the API call. |
Type | Description |
Application |
updateApplicationCallable()
public final UnaryCallable<UpdateApplicationRequest,Application> updateApplicationCallable()
Updates specified application.
Sample code:
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
UpdateApplicationRequest request =
UpdateApplicationRequest.newBuilder()
.setApplication(Application.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Application> future =
applicationServiceClient.updateApplicationCallable().futureCall(request);
// Do something.
Application response = future.get();
}
Type | Description |
UnaryCallable<UpdateApplicationRequest,Application> |