com.amazonaws.services.managedgrafana.AmazonManagedGrafanaAsyncClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-managedgrafana Show documentation
Show all versions of aws-java-sdk-managedgrafana Show documentation
The AWS Java SDK for Amazon Managed Grafana module holds the client classes that are used for communicating with Amazon Managed Grafana Service
/*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.managedgrafana;
import javax.annotation.Generated;
import com.amazonaws.services.managedgrafana.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing Amazon Managed Grafana asynchronously. Each asynchronous method will return a Java Future object
* representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
* notification when an asynchronous operation completes.
*
*
* Amazon Managed Grafana is a fully managed and secure data visualization service that you can use to instantly query,
* correlate, and visualize operational metrics, logs, and traces from multiple sources. Amazon Managed Grafana makes it
* easy to deploy, operate, and scale Grafana, a widely deployed data visualization tool that is popular for its
* extensible data support.
*
*
* With Amazon Managed Grafana, you create logically isolated Grafana servers called workspaces. In a workspace,
* you can create Grafana dashboards and visualizations to analyze your metrics, logs, and traces without having to
* build, package, or deploy any hardware to run Grafana servers.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonManagedGrafanaAsyncClient extends AmazonManagedGrafanaClient implements AmazonManagedGrafanaAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AmazonManagedGrafanaAsyncClientBuilder asyncBuilder() {
return AmazonManagedGrafanaAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon Managed Grafana using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AmazonManagedGrafanaAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon Managed Grafana using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AmazonManagedGrafanaAsyncClient(AwsAsyncClientParams asyncClientParams, boolean endpointDiscoveryEnabled) {
super(asyncClientParams, endpointDiscoveryEnabled);
this.executorService = asyncClientParams.getExecutor();
}
/**
* Returns the executor service used by this client to execute async requests.
*
* @return The executor service used by this client to execute async requests.
*/
public ExecutorService getExecutorService() {
return executorService;
}
@Override
public java.util.concurrent.Future associateLicenseAsync(AssociateLicenseRequest request) {
return associateLicenseAsync(request, null);
}
@Override
public java.util.concurrent.Future associateLicenseAsync(final AssociateLicenseRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateLicenseRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateLicenseResult call() throws Exception {
AssociateLicenseResult result = null;
try {
result = executeAssociateLicense(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future createWorkspaceAsync(CreateWorkspaceRequest request) {
return createWorkspaceAsync(request, null);
}
@Override
public java.util.concurrent.Future createWorkspaceAsync(final CreateWorkspaceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateWorkspaceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateWorkspaceResult call() throws Exception {
CreateWorkspaceResult result = null;
try {
result = executeCreateWorkspace(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future createWorkspaceApiKeyAsync(CreateWorkspaceApiKeyRequest request) {
return createWorkspaceApiKeyAsync(request, null);
}
@Override
public java.util.concurrent.Future createWorkspaceApiKeyAsync(final CreateWorkspaceApiKeyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateWorkspaceApiKeyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateWorkspaceApiKeyResult call() throws Exception {
CreateWorkspaceApiKeyResult result = null;
try {
result = executeCreateWorkspaceApiKey(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteWorkspaceAsync(DeleteWorkspaceRequest request) {
return deleteWorkspaceAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteWorkspaceAsync(final DeleteWorkspaceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteWorkspaceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteWorkspaceResult call() throws Exception {
DeleteWorkspaceResult result = null;
try {
result = executeDeleteWorkspace(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteWorkspaceApiKeyAsync(DeleteWorkspaceApiKeyRequest request) {
return deleteWorkspaceApiKeyAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteWorkspaceApiKeyAsync(final DeleteWorkspaceApiKeyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteWorkspaceApiKeyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteWorkspaceApiKeyResult call() throws Exception {
DeleteWorkspaceApiKeyResult result = null;
try {
result = executeDeleteWorkspaceApiKey(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeWorkspaceAsync(DescribeWorkspaceRequest request) {
return describeWorkspaceAsync(request, null);
}
@Override
public java.util.concurrent.Future describeWorkspaceAsync(final DescribeWorkspaceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeWorkspaceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeWorkspaceResult call() throws Exception {
DescribeWorkspaceResult result = null;
try {
result = executeDescribeWorkspace(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeWorkspaceAuthenticationAsync(
DescribeWorkspaceAuthenticationRequest request) {
return describeWorkspaceAuthenticationAsync(request, null);
}
@Override
public java.util.concurrent.Future describeWorkspaceAuthenticationAsync(
final DescribeWorkspaceAuthenticationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeWorkspaceAuthenticationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeWorkspaceAuthenticationResult call() throws Exception {
DescribeWorkspaceAuthenticationResult result = null;
try {
result = executeDescribeWorkspaceAuthentication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeWorkspaceConfigurationAsync(DescribeWorkspaceConfigurationRequest request) {
return describeWorkspaceConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future describeWorkspaceConfigurationAsync(
final DescribeWorkspaceConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeWorkspaceConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeWorkspaceConfigurationResult call() throws Exception {
DescribeWorkspaceConfigurationResult result = null;
try {
result = executeDescribeWorkspaceConfiguration(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future disassociateLicenseAsync(DisassociateLicenseRequest request) {
return disassociateLicenseAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociateLicenseAsync(final DisassociateLicenseRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociateLicenseRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociateLicenseResult call() throws Exception {
DisassociateLicenseResult result = null;
try {
result = executeDisassociateLicense(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listPermissionsAsync(ListPermissionsRequest request) {
return listPermissionsAsync(request, null);
}
@Override
public java.util.concurrent.Future listPermissionsAsync(final ListPermissionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListPermissionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListPermissionsResult call() throws Exception {
ListPermissionsResult result = null;
try {
result = executeListPermissions(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listTagsForResourceAsync(ListTagsForResourceRequest request) {
return listTagsForResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future listTagsForResourceAsync(final ListTagsForResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListTagsForResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListTagsForResourceResult call() throws Exception {
ListTagsForResourceResult result = null;
try {
result = executeListTagsForResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listVersionsAsync(ListVersionsRequest request) {
return listVersionsAsync(request, null);
}
@Override
public java.util.concurrent.Future listVersionsAsync(final ListVersionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListVersionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListVersionsResult call() throws Exception {
ListVersionsResult result = null;
try {
result = executeListVersions(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listWorkspacesAsync(ListWorkspacesRequest request) {
return listWorkspacesAsync(request, null);
}
@Override
public java.util.concurrent.Future listWorkspacesAsync(final ListWorkspacesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListWorkspacesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListWorkspacesResult call() throws Exception {
ListWorkspacesResult result = null;
try {
result = executeListWorkspaces(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future tagResourceAsync(TagResourceRequest request) {
return tagResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future tagResourceAsync(final TagResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final TagResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public TagResourceResult call() throws Exception {
TagResourceResult result = null;
try {
result = executeTagResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future untagResourceAsync(UntagResourceRequest request) {
return untagResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future untagResourceAsync(final UntagResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UntagResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UntagResourceResult call() throws Exception {
UntagResourceResult result = null;
try {
result = executeUntagResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future updatePermissionsAsync(UpdatePermissionsRequest request) {
return updatePermissionsAsync(request, null);
}
@Override
public java.util.concurrent.Future updatePermissionsAsync(final UpdatePermissionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdatePermissionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdatePermissionsResult call() throws Exception {
UpdatePermissionsResult result = null;
try {
result = executeUpdatePermissions(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future updateWorkspaceAsync(UpdateWorkspaceRequest request) {
return updateWorkspaceAsync(request, null);
}
@Override
public java.util.concurrent.Future updateWorkspaceAsync(final UpdateWorkspaceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateWorkspaceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateWorkspaceResult call() throws Exception {
UpdateWorkspaceResult result = null;
try {
result = executeUpdateWorkspace(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future updateWorkspaceAuthenticationAsync(UpdateWorkspaceAuthenticationRequest request) {
return updateWorkspaceAuthenticationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateWorkspaceAuthenticationAsync(
final UpdateWorkspaceAuthenticationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateWorkspaceAuthenticationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateWorkspaceAuthenticationResult call() throws Exception {
UpdateWorkspaceAuthenticationResult result = null;
try {
result = executeUpdateWorkspaceAuthentication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future updateWorkspaceConfigurationAsync(UpdateWorkspaceConfigurationRequest request) {
return updateWorkspaceConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateWorkspaceConfigurationAsync(final UpdateWorkspaceConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateWorkspaceConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateWorkspaceConfigurationResult call() throws Exception {
UpdateWorkspaceConfigurationResult result = null;
try {
result = executeUpdateWorkspaceConfiguration(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending
* asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should
* call {@code getExecutorService().shutdown()} followed by {@code getExecutorService().awaitTermination()} prior to
* calling this method.
*/
@Override
public void shutdown() {
super.shutdown();
executorService.shutdownNow();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy