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

com.amazonaws.services.directory.AWSDirectoryServiceClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Directory Service module holds the client classes that is used for communicating with AWS Directory Service

There is a newer version: 1.11.486
Show newest version
/*
 * Copyright 2010-2016 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.directory;

import org.w3c.dom.*;

import java.net.*;
import java.util.*;
import java.util.Map.Entry;

import org.apache.commons.logging.*;

import com.amazonaws.*;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;

import com.amazonaws.services.directory.model.*;
import com.amazonaws.services.directory.model.transform.*;

/**
 * Client for accessing Directory Service. All service calls made using this
 * client are blocking, and will not return until the service call completes.
 * 

* AWS Directory Service *

* This is the AWS Directory Service API Reference. This guide provides * detailed information about AWS Directory Service operations, data types, * parameters, and errors. *

*/ @ThreadSafe public class AWSDirectoryServiceClient extends AmazonWebServiceClient implements AWSDirectoryService { /** Provider for AWS credentials. */ private AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AWSDirectoryService.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "ds"; /** * Client configuration factory providing ClientConfigurations tailored to * this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final SdkJsonProtocolFactory protocolFactory = new SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode( "EntityAlreadyExistsException") .withModeledClass( com.amazonaws.services.directory.model.EntityAlreadyExistsException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode( "DirectoryUnavailableException") .withModeledClass( com.amazonaws.services.directory.model.DirectoryUnavailableException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode("InvalidNextTokenException") .withModeledClass( com.amazonaws.services.directory.model.InvalidNextTokenException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode("TagLimitExceededException") .withModeledClass( com.amazonaws.services.directory.model.TagLimitExceededException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode("ServiceException") .withModeledClass( com.amazonaws.services.directory.model.ServiceException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode("InvalidParameterException") .withModeledClass( com.amazonaws.services.directory.model.InvalidParameterException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode( "SnapshotLimitExceededException") .withModeledClass( com.amazonaws.services.directory.model.SnapshotLimitExceededException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode( "UnsupportedOperationException") .withModeledClass( com.amazonaws.services.directory.model.UnsupportedOperationException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode( "EntityDoesNotExistException") .withModeledClass( com.amazonaws.services.directory.model.EntityDoesNotExistException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode( "InsufficientPermissionsException") .withModeledClass( com.amazonaws.services.directory.model.InsufficientPermissionsException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode("ClientException") .withModeledClass( com.amazonaws.services.directory.model.ClientException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode( "DirectoryLimitExceededException") .withModeledClass( com.amazonaws.services.directory.model.DirectoryLimitExceededException.class)) .addErrorMetadata( new JsonErrorShapeMetadata() .withErrorCode( "AuthenticationFailedException") .withModeledClass( com.amazonaws.services.directory.model.AuthenticationFailedException.class))); /** * Constructs a new client to invoke service methods on Directory Service. A * credentials provider chain will be used that searches for credentials in * this order: *
    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Instance profile credentials delivered through the Amazon EC2 * metadata service
  • *
* *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @see DefaultAWSCredentialsProviderChain */ public AWSDirectoryServiceClient() { this(new DefaultAWSCredentialsProviderChain(), configFactory .getConfig()); } /** * Constructs a new client to invoke service methods on Directory Service. A * credentials provider chain will be used that searches for credentials in * this order: *

    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Instance profile credentials delivered through the Amazon EC2 * metadata service
  • *
* *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param clientConfiguration * The client configuration options controlling how this client * connects to Directory Service (ex: proxy settings, retry counts, * etc.). * * @see DefaultAWSCredentialsProviderChain */ public AWSDirectoryServiceClient(ClientConfiguration clientConfiguration) { this(new DefaultAWSCredentialsProviderChain(), clientConfiguration); } /** * Constructs a new client to invoke service methods on Directory Service * using the specified AWS account credentials. * *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when * authenticating with AWS services. */ public AWSDirectoryServiceClient(AWSCredentials awsCredentials) { this(awsCredentials, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on Directory Service * using the specified AWS account credentials and client configuration * options. * *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when * authenticating with AWS services. * @param clientConfiguration * The client configuration options controlling how this client * connects to Directory Service (ex: proxy settings, retry counts, * etc.). */ public AWSDirectoryServiceClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) { super(clientConfiguration); this.awsCredentialsProvider = new StaticCredentialsProvider( awsCredentials); init(); } /** * Constructs a new client to invoke service methods on Directory Service * using the specified AWS account credentials provider. * *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to * authenticate requests with AWS services. */ public AWSDirectoryServiceClient( AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on Directory Service * using the specified AWS account credentials provider and client * configuration options. * *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to * authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client * connects to Directory Service (ex: proxy settings, retry counts, * etc.). */ public AWSDirectoryServiceClient( AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, null); } /** * Constructs a new client to invoke service methods on Directory Service * using the specified AWS account credentials provider, client * configuration options, and request metric collector. * *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to * authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client * connects to Directory Service (ex: proxy settings, retry counts, * etc.). * @param requestMetricCollector * optional request metric collector */ public AWSDirectoryServiceClient( AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector) { super(clientConfiguration, requestMetricCollector); this.awsCredentialsProvider = awsCredentialsProvider; init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("https://ds.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s .addAll(chainFactory .newRequestHandlerChain("/com/amazonaws/services/directory/request.handlers")); requestHandler2s .addAll(chainFactory .newRequestHandler2Chain("/com/amazonaws/services/directory/request.handler2s")); } /** *

* Adds or overwrites one or more tags for the specified Amazon Directory * Services directory. Each directory can have a maximum of 10 tags. Each * tag consists of a key and optional value. Tag keys must be unique per * resource. *

* * @param addTagsToResourceRequest * @return Result of the AddTagsToResource operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws TagLimitExceededException * The maximum allowed number of tags was exceeded. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.AddTagsToResource */ @Override public AddTagsToResourceResult addTagsToResource( AddTagsToResourceRequest addTagsToResourceRequest) { ExecutionContext executionContext = createExecutionContext(addTagsToResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AddTagsToResourceRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(addTagsToResourceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new AddTagsToResourceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates an AD Connector to connect to an on-premises directory. *

* * @param connectDirectoryRequest * Contains the inputs for the ConnectDirectory operation. * @return Result of the ConnectDirectory operation returned by the service. * @throws DirectoryLimitExceededException * The maximum number of directories in the region has been reached. * You can use the GetDirectoryLimits operation to determine * your directory limits in the region. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.ConnectDirectory */ @Override public ConnectDirectoryResult connectDirectory( ConnectDirectoryRequest connectDirectoryRequest) { ExecutionContext executionContext = createExecutionContext(connectDirectoryRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ConnectDirectoryRequestMarshaller(protocolFactory) .marshall(super .beforeMarshalling(connectDirectoryRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new ConnectDirectoryResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates an alias for a directory and assigns the alias to the directory. * The alias is used to construct the access URL for the directory, such as * http://<alias>.awsapps.com. *

* *

* After an alias has been created, it cannot be deleted or reused, so this * operation should only be used when absolutely necessary. *

*
* * @param createAliasRequest * Contains the inputs for the CreateAlias operation. * @return Result of the CreateAlias operation returned by the service. * @throws EntityAlreadyExistsException * The specified entity already exists. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.CreateAlias */ @Override public CreateAliasResult createAlias(CreateAliasRequest createAliasRequest) { ExecutionContext executionContext = createExecutionContext(createAliasRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateAliasRequestMarshaller(protocolFactory) .marshall(super.beforeMarshalling(createAliasRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new CreateAliasResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates a computer account in the specified directory, and joins the * computer to the directory. *

* * @param createComputerRequest * Contains the inputs for the CreateComputer operation. * @return Result of the CreateComputer operation returned by the service. * @throws AuthenticationFailedException * An authentication error occurred. * @throws DirectoryUnavailableException * The specified directory is unavailable or could not be found. * @throws EntityAlreadyExistsException * The specified entity already exists. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws UnsupportedOperationException * The operation is not supported. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.CreateComputer */ @Override public CreateComputerResult createComputer( CreateComputerRequest createComputerRequest) { ExecutionContext executionContext = createExecutionContext(createComputerRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateComputerRequestMarshaller(protocolFactory) .marshall(super .beforeMarshalling(createComputerRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new CreateComputerResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates a conditional forwarder associated with your AWS directory. * Conditional forwarders are required in order to set up a trust * relationship with another domain. The conditional forwarder points to the * trusted domain. *

* * @param createConditionalForwarderRequest * Initiates the creation of a conditional forwarder for your AWS * Directory Service for Microsoft Active Directory. Conditional * forwarders are required in order to set up a trust relationship * with another domain. * @return Result of the CreateConditionalForwarder operation returned by * the service. * @throws EntityAlreadyExistsException * The specified entity already exists. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws DirectoryUnavailableException * The specified directory is unavailable or could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws UnsupportedOperationException * The operation is not supported. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.CreateConditionalForwarder */ @Override public CreateConditionalForwarderResult createConditionalForwarder( CreateConditionalForwarderRequest createConditionalForwarderRequest) { ExecutionContext executionContext = createExecutionContext(createConditionalForwarderRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateConditionalForwarderRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(createConditionalForwarderRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler( new JsonOperationMetadata().withPayloadJson(true) .withHasStreamingSuccessResponse(false), new CreateConditionalForwarderResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates a Simple AD directory. *

* * @param createDirectoryRequest * Contains the inputs for the CreateDirectory operation. * @return Result of the CreateDirectory operation returned by the service. * @throws DirectoryLimitExceededException * The maximum number of directories in the region has been reached. * You can use the GetDirectoryLimits operation to determine * your directory limits in the region. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.CreateDirectory */ @Override public CreateDirectoryResult createDirectory( CreateDirectoryRequest createDirectoryRequest) { ExecutionContext executionContext = createExecutionContext(createDirectoryRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateDirectoryRequestMarshaller(protocolFactory) .marshall(super .beforeMarshalling(createDirectoryRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new CreateDirectoryResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates a Microsoft AD in the AWS cloud. *

* * @param createMicrosoftADRequest * Creates a Microsoft AD in the AWS cloud. * @return Result of the CreateMicrosoftAD operation returned by the * service. * @throws DirectoryLimitExceededException * The maximum number of directories in the region has been reached. * You can use the GetDirectoryLimits operation to determine * your directory limits in the region. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @throws UnsupportedOperationException * The operation is not supported. * @sample AWSDirectoryService.CreateMicrosoftAD */ @Override public CreateMicrosoftADResult createMicrosoftAD( CreateMicrosoftADRequest createMicrosoftADRequest) { ExecutionContext executionContext = createExecutionContext(createMicrosoftADRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateMicrosoftADRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(createMicrosoftADRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new CreateMicrosoftADResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates a snapshot of a Simple AD or Microsoft AD directory in the AWS * cloud. *

* *

* You cannot take snapshots of AD Connector directories. *

*
* * @param createSnapshotRequest * Contains the inputs for the CreateSnapshot operation. * @return Result of the CreateSnapshot operation returned by the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws SnapshotLimitExceededException * The maximum number of manual snapshots for the directory has been * reached. You can use the GetSnapshotLimits operation to * determine the snapshot limits for a directory. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.CreateSnapshot */ @Override public CreateSnapshotResult createSnapshot( CreateSnapshotRequest createSnapshotRequest) { ExecutionContext executionContext = createExecutionContext(createSnapshotRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateSnapshotRequestMarshaller(protocolFactory) .marshall(super .beforeMarshalling(createSnapshotRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new CreateSnapshotResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* AWS Directory Service for Microsoft Active Directory allows you to * configure trust relationships. For example, you can establish a trust * between your Microsoft AD in the AWS cloud, and your existing on-premises * Microsoft Active Directory. This would allow you to provide users and * groups access to resources in either domain, with a single set of * credentials. *

*

* This action initiates the creation of the AWS side of a trust * relationship between a Microsoft AD in the AWS cloud and an external * domain. *

* * @param createTrustRequest * AWS Directory Service for Microsoft Active Directory allows you to * configure trust relationships. For example, you can establish a * trust between your Microsoft AD in the AWS cloud, and your * existing on-premises Microsoft Active Directory. This would allow * you to provide users and groups access to resources in either * domain, with a single set of credentials.

*

* This action initiates the creation of the AWS side of a trust * relationship between a Microsoft AD in the AWS cloud and an * external domain. * @return Result of the CreateTrust operation returned by the service. * @throws EntityAlreadyExistsException * The specified entity already exists. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @throws UnsupportedOperationException * The operation is not supported. * @sample AWSDirectoryService.CreateTrust */ @Override public CreateTrustResult createTrust(CreateTrustRequest createTrustRequest) { ExecutionContext executionContext = createExecutionContext(createTrustRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateTrustRequestMarshaller(protocolFactory) .marshall(super.beforeMarshalling(createTrustRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new CreateTrustResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes a conditional forwarder that has been set up for your AWS * directory. *

* * @param deleteConditionalForwarderRequest * Deletes a conditional forwarder. * @return Result of the DeleteConditionalForwarder operation returned by * the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws DirectoryUnavailableException * The specified directory is unavailable or could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws UnsupportedOperationException * The operation is not supported. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DeleteConditionalForwarder */ @Override public DeleteConditionalForwarderResult deleteConditionalForwarder( DeleteConditionalForwarderRequest deleteConditionalForwarderRequest) { ExecutionContext executionContext = createExecutionContext(deleteConditionalForwarderRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteConditionalForwarderRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(deleteConditionalForwarderRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler( new JsonOperationMetadata().withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DeleteConditionalForwarderResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes an AWS Directory Service directory. *

* * @param deleteDirectoryRequest * Contains the inputs for the DeleteDirectory operation. * @return Result of the DeleteDirectory operation returned by the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DeleteDirectory */ @Override public DeleteDirectoryResult deleteDirectory( DeleteDirectoryRequest deleteDirectoryRequest) { ExecutionContext executionContext = createExecutionContext(deleteDirectoryRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteDirectoryRequestMarshaller(protocolFactory) .marshall(super .beforeMarshalling(deleteDirectoryRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DeleteDirectoryResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes a directory snapshot. *

* * @param deleteSnapshotRequest * Contains the inputs for the DeleteSnapshot operation. * @return Result of the DeleteSnapshot operation returned by the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DeleteSnapshot */ @Override public DeleteSnapshotResult deleteSnapshot( DeleteSnapshotRequest deleteSnapshotRequest) { ExecutionContext executionContext = createExecutionContext(deleteSnapshotRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteSnapshotRequestMarshaller(protocolFactory) .marshall(super .beforeMarshalling(deleteSnapshotRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DeleteSnapshotResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes an existing trust relationship between your Microsoft AD in the * AWS cloud and an external domain. *

* * @param deleteTrustRequest * Deletes the local side of an existing trust relationship between * the Microsoft AD in the AWS cloud and the external domain. * @return Result of the DeleteTrust operation returned by the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @throws UnsupportedOperationException * The operation is not supported. * @sample AWSDirectoryService.DeleteTrust */ @Override public DeleteTrustResult deleteTrust(DeleteTrustRequest deleteTrustRequest) { ExecutionContext executionContext = createExecutionContext(deleteTrustRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteTrustRequestMarshaller(protocolFactory) .marshall(super.beforeMarshalling(deleteTrustRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DeleteTrustResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Removes the specified directory as a publisher to the specified SNS * topic. *

* * @param deregisterEventTopicRequest * Removes the specified directory as a publisher to the specified * SNS topic. * @return Result of the DeregisterEventTopic operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DeregisterEventTopic */ @Override public DeregisterEventTopicResult deregisterEventTopic( DeregisterEventTopicRequest deregisterEventTopicRequest) { ExecutionContext executionContext = createExecutionContext(deregisterEventTopicRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeregisterEventTopicRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(deregisterEventTopicRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DeregisterEventTopicResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Obtains information about the conditional forwarders for this account. *

*

* If no input parameters are provided for RemoteDomainNames, this request * describes all conditional forwarders for the specified directory ID. *

* * @param describeConditionalForwardersRequest * Describes a conditional forwarder. * @return Result of the DescribeConditionalForwarders operation returned by * the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws DirectoryUnavailableException * The specified directory is unavailable or could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws UnsupportedOperationException * The operation is not supported. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DescribeConditionalForwarders */ @Override public DescribeConditionalForwardersResult describeConditionalForwarders( DescribeConditionalForwardersRequest describeConditionalForwardersRequest) { ExecutionContext executionContext = createExecutionContext(describeConditionalForwardersRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeConditionalForwardersRequestMarshaller( protocolFactory) .marshall(super .beforeMarshalling(describeConditionalForwardersRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler( new JsonOperationMetadata().withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DescribeConditionalForwardersResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Obtains information about the directories that belong to this account. *

*

* You can retrieve information about specific directories by passing the * directory identifiers in the DirectoryIds parameter. Otherwise, * all directories that belong to the current account are returned. *

*

* This operation supports pagination with the use of the NextToken * request and response parameters. If more results are available, the * DescribeDirectoriesResult.NextToken member contains a token that * you pass in the next call to DescribeDirectories to retrieve the * next set of items. *

*

* You can also specify a maximum number of return results with the * Limit parameter. *

* * @param describeDirectoriesRequest * Contains the inputs for the DescribeDirectories operation. * @return Result of the DescribeDirectories operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws InvalidNextTokenException * The NextToken value is not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DescribeDirectories */ @Override public DescribeDirectoriesResult describeDirectories( DescribeDirectoriesRequest describeDirectoriesRequest) { ExecutionContext executionContext = createExecutionContext(describeDirectoriesRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeDirectoriesRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(describeDirectoriesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DescribeDirectoriesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } @Override public DescribeDirectoriesResult describeDirectories() { return describeDirectories(new DescribeDirectoriesRequest()); } /** *

* Obtains information about which SNS topics receive status messages from * the specified directory. *

*

* If no input parameters are provided, such as DirectoryId or TopicName, * this request describes all of the associations in the account. *

* * @param describeEventTopicsRequest * Describes event topics. * @return Result of the DescribeEventTopics operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DescribeEventTopics */ @Override public DescribeEventTopicsResult describeEventTopics( DescribeEventTopicsRequest describeEventTopicsRequest) { ExecutionContext executionContext = createExecutionContext(describeEventTopicsRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeEventTopicsRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(describeEventTopicsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DescribeEventTopicsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Obtains information about the directory snapshots that belong to this * account. *

*

* This operation supports pagination with the use of the NextToken * request and response parameters. If more results are available, the * DescribeSnapshots.NextToken member contains a token that you pass * in the next call to DescribeSnapshots to retrieve the next set of * items. *

*

* You can also specify a maximum number of return results with the * Limit parameter. *

* * @param describeSnapshotsRequest * Contains the inputs for the DescribeSnapshots operation. * @return Result of the DescribeSnapshots operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws InvalidNextTokenException * The NextToken value is not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DescribeSnapshots */ @Override public DescribeSnapshotsResult describeSnapshots( DescribeSnapshotsRequest describeSnapshotsRequest) { ExecutionContext executionContext = createExecutionContext(describeSnapshotsRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeSnapshotsRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(describeSnapshotsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DescribeSnapshotsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } @Override public DescribeSnapshotsResult describeSnapshots() { return describeSnapshots(new DescribeSnapshotsRequest()); } /** *

* Obtains information about the trust relationships for this account. *

*

* If no input parameters are provided, such as DirectoryId or TrustIds, * this request describes all the trust relationships belonging to the * account. *

* * @param describeTrustsRequest * Describes the trust relationships for a particular Microsoft AD in * the AWS cloud. If no input parameters are are provided, such as * directory ID or trust ID, this request describes all the trust * relationships. * @return Result of the DescribeTrusts operation returned by the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidNextTokenException * The NextToken value is not valid. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @throws UnsupportedOperationException * The operation is not supported. * @sample AWSDirectoryService.DescribeTrusts */ @Override public DescribeTrustsResult describeTrusts( DescribeTrustsRequest describeTrustsRequest) { ExecutionContext executionContext = createExecutionContext(describeTrustsRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeTrustsRequestMarshaller(protocolFactory) .marshall(super .beforeMarshalling(describeTrustsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DescribeTrustsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Disables multi-factor authentication (MFA) with the Remote Authentication * Dial In User Service (RADIUS) server for an AD Connector directory. *

* * @param disableRadiusRequest * Contains the inputs for the DisableRadius operation. * @return Result of the DisableRadius operation returned by the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DisableRadius */ @Override public DisableRadiusResult disableRadius( DisableRadiusRequest disableRadiusRequest) { ExecutionContext executionContext = createExecutionContext(disableRadiusRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DisableRadiusRequestMarshaller(protocolFactory) .marshall(super.beforeMarshalling(disableRadiusRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DisableRadiusResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Disables single-sign on for a directory. *

* * @param disableSsoRequest * Contains the inputs for the DisableSso operation. * @return Result of the DisableSso operation returned by the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InsufficientPermissionsException * The account does not have sufficient permission to perform the * operation. * @throws AuthenticationFailedException * An authentication error occurred. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.DisableSso */ @Override public DisableSsoResult disableSso(DisableSsoRequest disableSsoRequest) { ExecutionContext executionContext = createExecutionContext(disableSsoRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DisableSsoRequestMarshaller(protocolFactory) .marshall(super.beforeMarshalling(disableSsoRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new DisableSsoResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Enables multi-factor authentication (MFA) with the Remote Authentication * Dial In User Service (RADIUS) server for an AD Connector directory. *

* * @param enableRadiusRequest * Contains the inputs for the EnableRadius operation. * @return Result of the EnableRadius operation returned by the service. * @throws InvalidParameterException * One or more parameters are not valid. * @throws EntityAlreadyExistsException * The specified entity already exists. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.EnableRadius */ @Override public EnableRadiusResult enableRadius( EnableRadiusRequest enableRadiusRequest) { ExecutionContext executionContext = createExecutionContext(enableRadiusRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new EnableRadiusRequestMarshaller(protocolFactory) .marshall(super.beforeMarshalling(enableRadiusRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new EnableRadiusResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Enables single-sign on for a directory. *

* * @param enableSsoRequest * Contains the inputs for the EnableSso operation. * @return Result of the EnableSso operation returned by the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InsufficientPermissionsException * The account does not have sufficient permission to perform the * operation. * @throws AuthenticationFailedException * An authentication error occurred. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.EnableSso */ @Override public EnableSsoResult enableSso(EnableSsoRequest enableSsoRequest) { ExecutionContext executionContext = createExecutionContext(enableSsoRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new EnableSsoRequestMarshaller(protocolFactory) .marshall(super.beforeMarshalling(enableSsoRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new EnableSsoResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Obtains directory limit information for the current region. *

* * @param getDirectoryLimitsRequest * Contains the inputs for the GetDirectoryLimits operation. * @return Result of the GetDirectoryLimits operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.GetDirectoryLimits */ @Override public GetDirectoryLimitsResult getDirectoryLimits( GetDirectoryLimitsRequest getDirectoryLimitsRequest) { ExecutionContext executionContext = createExecutionContext(getDirectoryLimitsRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetDirectoryLimitsRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(getDirectoryLimitsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new GetDirectoryLimitsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } @Override public GetDirectoryLimitsResult getDirectoryLimits() { return getDirectoryLimits(new GetDirectoryLimitsRequest()); } /** *

* Obtains the manual snapshot limits for a directory. *

* * @param getSnapshotLimitsRequest * Contains the inputs for the GetSnapshotLimits operation. * @return Result of the GetSnapshotLimits operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.GetSnapshotLimits */ @Override public GetSnapshotLimitsResult getSnapshotLimits( GetSnapshotLimitsRequest getSnapshotLimitsRequest) { ExecutionContext executionContext = createExecutionContext(getSnapshotLimitsRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetSnapshotLimitsRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(getSnapshotLimitsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new GetSnapshotLimitsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Lists all tags on an Amazon Directory Services directory. *

* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidNextTokenException * The NextToken value is not valid. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.ListTagsForResource */ @Override public ListTagsForResourceResult listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) { ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListTagsForResourceRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(listTagsForResourceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Associates a directory with an SNS topic. This establishes the directory * as a publisher to the specified SNS topic. You can then receive email or * text (SMS) messages when the status of your directory changes. You get * notified if your directory goes from an Active status to an Impaired or * Inoperable status. You also receive a notification when the directory * returns to an Active status. *

* * @param registerEventTopicRequest * Registers a new event topic. * @return Result of the RegisterEventTopic operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.RegisterEventTopic */ @Override public RegisterEventTopicResult registerEventTopic( RegisterEventTopicRequest registerEventTopicRequest) { ExecutionContext executionContext = createExecutionContext(registerEventTopicRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RegisterEventTopicRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(registerEventTopicRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new RegisterEventTopicResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Removes tags from an Amazon Directory Services directory. *

* * @param removeTagsFromResourceRequest * @return Result of the RemoveTagsFromResource operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.RemoveTagsFromResource */ @Override public RemoveTagsFromResourceResult removeTagsFromResource( RemoveTagsFromResourceRequest removeTagsFromResourceRequest) { ExecutionContext executionContext = createExecutionContext(removeTagsFromResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RemoveTagsFromResourceRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(removeTagsFromResourceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new RemoveTagsFromResourceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Restores a directory using an existing directory snapshot. *

*

* When you restore a directory from a snapshot, any changes made to the * directory after the snapshot date are overwritten. *

*

* This action returns as soon as the restore operation is initiated. You * can monitor the progress of the restore operation by calling the * DescribeDirectories operation with the directory identifier. When * the DirectoryDescription.Stage value changes to * Active, the restore operation is complete. *

* * @param restoreFromSnapshotRequest * An object representing the inputs for the * RestoreFromSnapshot operation. * @return Result of the RestoreFromSnapshot operation returned by the * service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.RestoreFromSnapshot */ @Override public RestoreFromSnapshotResult restoreFromSnapshot( RestoreFromSnapshotRequest restoreFromSnapshotRequest) { ExecutionContext executionContext = createExecutionContext(restoreFromSnapshotRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RestoreFromSnapshotRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(restoreFromSnapshotRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new RestoreFromSnapshotResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Updates a conditional forwarder that has been set up for your AWS * directory. *

* * @param updateConditionalForwarderRequest * Updates a conditional forwarder. * @return Result of the UpdateConditionalForwarder operation returned by * the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws DirectoryUnavailableException * The specified directory is unavailable or could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws UnsupportedOperationException * The operation is not supported. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.UpdateConditionalForwarder */ @Override public UpdateConditionalForwarderResult updateConditionalForwarder( UpdateConditionalForwarderRequest updateConditionalForwarderRequest) { ExecutionContext executionContext = createExecutionContext(updateConditionalForwarderRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateConditionalForwarderRequestMarshaller( protocolFactory).marshall(super .beforeMarshalling(updateConditionalForwarderRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler( new JsonOperationMetadata().withPayloadJson(true) .withHasStreamingSuccessResponse(false), new UpdateConditionalForwarderResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Updates the Remote Authentication Dial In User Service (RADIUS) server * information for an AD Connector directory. *

* * @param updateRadiusRequest * Contains the inputs for the UpdateRadius operation. * @return Result of the UpdateRadius operation returned by the service. * @throws InvalidParameterException * One or more parameters are not valid. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @sample AWSDirectoryService.UpdateRadius */ @Override public UpdateRadiusResult updateRadius( UpdateRadiusRequest updateRadiusRequest) { ExecutionContext executionContext = createExecutionContext(updateRadiusRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateRadiusRequestMarshaller(protocolFactory) .marshall(super.beforeMarshalling(updateRadiusRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new UpdateRadiusResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* AWS Directory Service for Microsoft Active Directory allows you to * configure and verify trust relationships. *

*

* This action verifies a trust relationship between your Microsoft AD in * the AWS cloud and an external domain. *

* * @param verifyTrustRequest * Initiates the verification of an existing trust relationship * between a Microsoft AD in the AWS cloud and an external domain. * @return Result of the VerifyTrust operation returned by the service. * @throws EntityDoesNotExistException * The specified entity could not be found. * @throws InvalidParameterException * One or more parameters are not valid. * @throws ClientException * A client exception has occurred. * @throws ServiceException * An exception has occurred in AWS Directory Service. * @throws UnsupportedOperationException * The operation is not supported. * @sample AWSDirectoryService.VerifyTrust */ @Override public VerifyTrustResult verifyTrust(VerifyTrustRequest verifyTrustRequest) { ExecutionContext executionContext = createExecutionContext(verifyTrustRequest); AWSRequestMetrics awsRequestMetrics = executionContext .getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new VerifyTrustRequestMarshaller(protocolFactory) .marshall(super.beforeMarshalling(verifyTrustRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true) .withHasStreamingSuccessResponse(false), new VerifyTrustResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * Returns additional metadata for a previously executed successful, * request, typically used for debugging issues where a service isn't acting * as expected. This data isn't considered part of the result data returned * by an operation, so it's available through this separate, diagnostic * interface. *

* Response metadata is only cached for a limited period of time, so if you * need to access this extra diagnostic information for an executed request, * you should use this method to retrieve it as soon as possible after * executing the request. * * @param request * The originally executed request * * @return The response metadata for the specified request, or null if none * is available. */ public ResponseMetadata getCachedResponseMetadata( AmazonWebServiceRequest request) { return client.getResponseMetadataForRequest(request); } /** * Normal invoke with authentication. Credentials are required and may be * overriden at the request level. **/ private Response invoke( Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { executionContext.setCredentialsProvider(CredentialUtils .getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider)); return doInvoke(request, responseHandler, executionContext); } /** * Invoke with no authentication. Credentials are not required and any * credentials set on the client or request will be ignored for this * operation. **/ private Response anonymousInvoke( Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { return doInvoke(request, responseHandler, executionContext); } /** * Invoke the request using the http client. Assumes credentials (or lack * thereof) have been configured in the ExecutionContext beforehand. **/ private Response doInvoke( Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { request.setEndpoint(endpoint); request.setTimeOffset(timeOffset); HttpResponseHandler errorResponseHandler = protocolFactory .createErrorResponseHandler(new JsonErrorResponseMetadata()); return client.execute(request, responseHandler, errorResponseHandler, executionContext); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy