Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 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 java.net.*;
  import java.util.*;
  
  
  import com.amazonaws.*;
  
Client for accessing AWSDirectoryService. 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.

  
  public class AWSDirectoryServiceClient extends AmazonWebServiceClient implements AWSDirectoryService {

    
Provider for AWS credentials.
  
  
      private static final Log log = LogFactory.getLog(AWSDirectoryService.class);

    
List of exception unmarshallers for all AWSDirectoryService exceptions.
  
      protected List<JsonErrorUnmarshallerjsonErrorUnmarshallers;

    
Constructs a new client to invoke service methods on AWSDirectoryService. 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.

  
      public AWSDirectoryServiceClient() {
          this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration());
      }

    
Constructs a new client to invoke service methods on AWSDirectoryService. 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.

Parameters:
clientConfiguration The client configuration options controlling how this client connects to AWSDirectoryService (ex: proxy settings, retry counts, etc.).
See also:
com.amazonaws.auth.DefaultAWSCredentialsProviderChain
 
     public AWSDirectoryServiceClient(ClientConfiguration clientConfiguration) {
         this(new DefaultAWSCredentialsProviderChain(), clientConfiguration);
     }

    
Constructs a new client to invoke service methods on AWSDirectoryService 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.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
 
     public AWSDirectoryServiceClient(AWSCredentials awsCredentials) {
         this(awsCredentialsnew ClientConfiguration());
     }

    
Constructs a new client to invoke service methods on AWSDirectoryService 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.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AWSDirectoryService (ex: proxy settings, retry counts, etc.).
 
     public AWSDirectoryServiceClient(AWSCredentials awsCredentialsClientConfiguration clientConfiguration) {
         super(adjustClientConfiguration(clientConfiguration));
         
         this. = new StaticCredentialsProvider(awsCredentials);
         
         init();
     }

    
Constructs a new client to invoke service methods on AWSDirectoryService 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.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
 
     public AWSDirectoryServiceClient(AWSCredentialsProvider awsCredentialsProvider) {
         this(awsCredentialsProvidernew ClientConfiguration());
     }

    
Constructs a new client to invoke service methods on AWSDirectoryService 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.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AWSDirectoryService (ex: proxy settings, retry counts, etc.).
 
     public AWSDirectoryServiceClient(AWSCredentialsProvider awsCredentialsProviderClientConfiguration clientConfiguration) {
         this(awsCredentialsProviderclientConfigurationnull);
     }

    
Constructs a new client to invoke service methods on AWSDirectoryService 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.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AWSDirectoryService (ex: proxy settings, retry counts, etc.).
requestMetricCollector optional request metric collector
 
     public AWSDirectoryServiceClient(AWSCredentialsProvider awsCredentialsProvider,
             ClientConfiguration clientConfiguration,
             RequestMetricCollector requestMetricCollector) {
         super(adjustClientConfiguration(clientConfiguration), requestMetricCollector);
         
         this. = awsCredentialsProvider;
         
         init();
     }
 
     private void init() {
         
         
         // calling this.setEndPoint(...) will also modify the signer accordingly
         this.setEndpoint("ds.us-east-1.amazonaws.com");
         
         HandlerChainFactory chainFactory = new HandlerChainFactory();
         .addAll(chainFactory.newRequestHandlerChain(
                 "/com/amazonaws/services/directory/request.handlers"));
         .addAll(chainFactory.newRequestHandler2Chain(
                 "/com/amazonaws/services/directory/request.handler2s"));
     }
 
         ClientConfiguration config = orig;
         
         return config;
     }

    

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.

Parameters:
describeSnapshotsRequest Container for the necessary parameters to execute the DescribeSnapshots service method on AWSDirectoryService.
Returns:
The response from the DescribeSnapshots service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.InvalidNextTokenException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public DescribeSnapshotsResult describeSnapshots(DescribeSnapshotsRequest describeSnapshotsRequest) {
         ExecutionContext executionContext = createExecutionContext(describeSnapshotsRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DescribeSnapshotsRequestrequest = null;
         Response<DescribeSnapshotsResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DescribeSnapshotsRequestMarshaller().marshall(super.beforeMarshalling(describeSnapshotsRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<DescribeSnapshotsResultJsonUnmarshallerContextunmarshaller =
                 new DescribeSnapshotsResultJsonUnmarshaller();
             JsonResponseHandler<DescribeSnapshotsResultresponseHandler =
                 new JsonResponseHandler<DescribeSnapshotsResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

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 .

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

Parameters:
createAliasRequest Container for the necessary parameters to execute the CreateAlias service method on AWSDirectoryService.
Returns:
The response from the CreateAlias service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.EntityAlreadyExistsException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public CreateAliasResult createAlias(CreateAliasRequest createAliasRequest) {
         ExecutionContext executionContext = createExecutionContext(createAliasRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<CreateAliasRequestrequest = null;
         Response<CreateAliasResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new CreateAliasRequestMarshaller().marshall(super.beforeMarshalling(createAliasRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<CreateAliasResultJsonUnmarshallerContextunmarshaller =
                 new CreateAliasResultJsonUnmarshaller();
             JsonResponseHandler<CreateAliasResultresponseHandler =
                 new JsonResponseHandler<CreateAliasResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Deletes a directory snapshot.

Parameters:
deleteSnapshotRequest Container for the necessary parameters to execute the DeleteSnapshot service method on AWSDirectoryService.
Returns:
The response from the DeleteSnapshot service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public DeleteSnapshotResult deleteSnapshot(DeleteSnapshotRequest deleteSnapshotRequest) {
         ExecutionContext executionContext = createExecutionContext(deleteSnapshotRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DeleteSnapshotRequestrequest = null;
         Response<DeleteSnapshotResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DeleteSnapshotRequestMarshaller().marshall(super.beforeMarshalling(deleteSnapshotRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<DeleteSnapshotResultJsonUnmarshallerContextunmarshaller =
                 new DeleteSnapshotResultJsonUnmarshaller();
             JsonResponseHandler<DeleteSnapshotResultresponseHandler =
                 new JsonResponseHandler<DeleteSnapshotResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

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

Parameters:
updateRadiusRequest Container for the necessary parameters to execute the UpdateRadius service method on AWSDirectoryService.
Returns:
The response from the UpdateRadius service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public UpdateRadiusResult updateRadius(UpdateRadiusRequest updateRadiusRequest) {
         ExecutionContext executionContext = createExecutionContext(updateRadiusRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<UpdateRadiusRequestrequest = null;
         Response<UpdateRadiusResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new UpdateRadiusRequestMarshaller().marshall(super.beforeMarshalling(updateRadiusRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<UpdateRadiusResultJsonUnmarshallerContextunmarshaller =
                 new UpdateRadiusResultJsonUnmarshaller();
             JsonResponseHandler<UpdateRadiusResultresponseHandler =
                 new JsonResponseHandler<UpdateRadiusResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

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.

Parameters:
describeDirectoriesRequest Container for the necessary parameters to execute the DescribeDirectories service method on AWSDirectoryService.
Returns:
The response from the DescribeDirectories service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.InvalidNextTokenException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public DescribeDirectoriesResult describeDirectories(DescribeDirectoriesRequest describeDirectoriesRequest) {
         ExecutionContext executionContext = createExecutionContext(describeDirectoriesRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DescribeDirectoriesRequestrequest = null;
         Response<DescribeDirectoriesResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DescribeDirectoriesRequestMarshaller().marshall(super.beforeMarshalling(describeDirectoriesRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<DescribeDirectoriesResultJsonUnmarshallerContextunmarshaller =
                 new DescribeDirectoriesResultJsonUnmarshaller();
             JsonResponseHandler<DescribeDirectoriesResultresponseHandler =
                 new JsonResponseHandler<DescribeDirectoriesResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

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

Parameters:
connectDirectoryRequest Container for the necessary parameters to execute the ConnectDirectory service method on AWSDirectoryService.
Returns:
The response from the ConnectDirectory service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.DirectoryLimitExceededException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public ConnectDirectoryResult connectDirectory(ConnectDirectoryRequest connectDirectoryRequest) {
         ExecutionContext executionContext = createExecutionContext(connectDirectoryRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<ConnectDirectoryRequestrequest = null;
         Response<ConnectDirectoryResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new ConnectDirectoryRequestMarshaller().marshall(super.beforeMarshalling(connectDirectoryRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<ConnectDirectoryResultJsonUnmarshallerContextunmarshaller =
                 new ConnectDirectoryResultJsonUnmarshaller();
             JsonResponseHandler<ConnectDirectoryResultresponseHandler =
                 new JsonResponseHandler<ConnectDirectoryResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Creates a snapshot of an existing directory.

You cannot take snapshots of extended or connected directories.

Parameters:
createSnapshotRequest Container for the necessary parameters to execute the CreateSnapshot service method on AWSDirectoryService.
Returns:
The response from the CreateSnapshot service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.SnapshotLimitExceededException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public CreateSnapshotResult createSnapshot(CreateSnapshotRequest createSnapshotRequest) {
         ExecutionContext executionContext = createExecutionContext(createSnapshotRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<CreateSnapshotRequestrequest = null;
         Response<CreateSnapshotResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new CreateSnapshotRequestMarshaller().marshall(super.beforeMarshalling(createSnapshotRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<CreateSnapshotResultJsonUnmarshallerContextunmarshaller =
                 new CreateSnapshotResultJsonUnmarshaller();
             JsonResponseHandler<CreateSnapshotResultresponseHandler =
                 new JsonResponseHandler<CreateSnapshotResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Deletes an AWS Directory Service directory.

Parameters:
deleteDirectoryRequest Container for the necessary parameters to execute the DeleteDirectory service method on AWSDirectoryService.
Returns:
The response from the DeleteDirectory service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public DeleteDirectoryResult deleteDirectory(DeleteDirectoryRequest deleteDirectoryRequest) {
         ExecutionContext executionContext = createExecutionContext(deleteDirectoryRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DeleteDirectoryRequestrequest = null;
         Response<DeleteDirectoryResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DeleteDirectoryRequestMarshaller().marshall(super.beforeMarshalling(deleteDirectoryRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<DeleteDirectoryResultJsonUnmarshallerContextunmarshaller =
                 new DeleteDirectoryResultJsonUnmarshaller();
             JsonResponseHandler<DeleteDirectoryResultresponseHandler =
                 new JsonResponseHandler<DeleteDirectoryResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Obtains directory limit information for the current region.

Parameters:
getDirectoryLimitsRequest Container for the necessary parameters to execute the GetDirectoryLimits service method on AWSDirectoryService.
Returns:
The response from the GetDirectoryLimits service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public GetDirectoryLimitsResult getDirectoryLimits(GetDirectoryLimitsRequest getDirectoryLimitsRequest) {
         ExecutionContext executionContext = createExecutionContext(getDirectoryLimitsRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<GetDirectoryLimitsRequestrequest = null;
         Response<GetDirectoryLimitsResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new GetDirectoryLimitsRequestMarshaller().marshall(super.beforeMarshalling(getDirectoryLimitsRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<GetDirectoryLimitsResultJsonUnmarshallerContextunmarshaller =
                 new GetDirectoryLimitsResultJsonUnmarshaller();
             JsonResponseHandler<GetDirectoryLimitsResultresponseHandler =
                 new JsonResponseHandler<GetDirectoryLimitsResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Disables single-sign on for a directory.

Parameters:
disableSsoRequest Container for the necessary parameters to execute the DisableSso service method on AWSDirectoryService.
Returns:
The response from the DisableSso service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InsufficientPermissionsException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.AuthenticationFailedException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public DisableSsoResult disableSso(DisableSsoRequest disableSsoRequest) {
         ExecutionContext executionContext = createExecutionContext(disableSsoRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DisableSsoRequestrequest = null;
         Response<DisableSsoResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DisableSsoRequestMarshaller().marshall(super.beforeMarshalling(disableSsoRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<DisableSsoResultJsonUnmarshallerContextunmarshaller =
                 new DisableSsoResultJsonUnmarshaller();
             JsonResponseHandler<DisableSsoResultresponseHandler =
                 new JsonResponseHandler<DisableSsoResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

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

Parameters:
enableRadiusRequest Container for the necessary parameters to execute the EnableRadius service method on AWSDirectoryService.
Returns:
The response from the EnableRadius service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.EntityAlreadyExistsException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public EnableRadiusResult enableRadius(EnableRadiusRequest enableRadiusRequest) {
         ExecutionContext executionContext = createExecutionContext(enableRadiusRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<EnableRadiusRequestrequest = null;
         Response<EnableRadiusResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new EnableRadiusRequestMarshaller().marshall(super.beforeMarshalling(enableRadiusRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<EnableRadiusResultJsonUnmarshallerContextunmarshaller =
                 new EnableRadiusResultJsonUnmarshaller();
             JsonResponseHandler<EnableRadiusResultresponseHandler =
                 new JsonResponseHandler<EnableRadiusResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

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

Parameters:
createComputerRequest Container for the necessary parameters to execute the CreateComputer service method on AWSDirectoryService.
Returns:
The response from the CreateComputer service method, as returned by AWSDirectoryService.
Throws:
UnsupportedOperationException
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.DirectoryUnavailableException
com.amazonaws.services.directory.model.AuthenticationFailedException
com.amazonaws.services.directory.model.EntityAlreadyExistsException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public CreateComputerResult createComputer(CreateComputerRequest createComputerRequest) {
         ExecutionContext executionContext = createExecutionContext(createComputerRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<CreateComputerRequestrequest = null;
         Response<CreateComputerResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new CreateComputerRequestMarshaller().marshall(super.beforeMarshalling(createComputerRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<CreateComputerResultJsonUnmarshallerContextunmarshaller =
                 new CreateComputerResultJsonUnmarshaller();
             JsonResponseHandler<CreateComputerResultresponseHandler =
                 new JsonResponseHandler<CreateComputerResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Enables single-sign on for a directory.

Parameters:
enableSsoRequest Container for the necessary parameters to execute the EnableSso service method on AWSDirectoryService.
Returns:
The response from the EnableSso service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InsufficientPermissionsException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.AuthenticationFailedException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
 
     public EnableSsoResult enableSso(EnableSsoRequest enableSsoRequest) {
         ExecutionContext executionContext = createExecutionContext(enableSsoRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<EnableSsoRequestrequest = null;
         Response<EnableSsoResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new EnableSsoRequestMarshaller().marshall(super.beforeMarshalling(enableSsoRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<EnableSsoResultJsonUnmarshallerContextunmarshaller =
                 new EnableSsoResultJsonUnmarshaller();
             JsonResponseHandler<EnableSsoResultresponseHandler =
                 new JsonResponseHandler<EnableSsoResult>(unmarshaller);
 
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

Creates a Simple AD directory.

Parameters:
createDirectoryRequest Container for the necessary parameters to execute the CreateDirectory service method on AWSDirectoryService.
Returns:
The response from the CreateDirectory service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.DirectoryLimitExceededException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
    public CreateDirectoryResult createDirectory(CreateDirectoryRequest createDirectoryRequest) {
        ExecutionContext executionContext = createExecutionContext(createDirectoryRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<CreateDirectoryRequestrequest = null;
        Response<CreateDirectoryResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new CreateDirectoryRequestMarshaller().marshall(super.beforeMarshalling(createDirectoryRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<CreateDirectoryResultJsonUnmarshallerContextunmarshaller =
                new CreateDirectoryResultJsonUnmarshaller();
            JsonResponseHandler<CreateDirectoryResultresponseHandler =
                new JsonResponseHandler<CreateDirectoryResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

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.

Parameters:
restoreFromSnapshotRequest Container for the necessary parameters to execute the RestoreFromSnapshot service method on AWSDirectoryService.
Returns:
The response from the RestoreFromSnapshot service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
    public RestoreFromSnapshotResult restoreFromSnapshot(RestoreFromSnapshotRequest restoreFromSnapshotRequest) {
        ExecutionContext executionContext = createExecutionContext(restoreFromSnapshotRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<RestoreFromSnapshotRequestrequest = null;
        Response<RestoreFromSnapshotResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new RestoreFromSnapshotRequestMarshaller().marshall(super.beforeMarshalling(restoreFromSnapshotRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<RestoreFromSnapshotResultJsonUnmarshallerContextunmarshaller =
                new RestoreFromSnapshotResultJsonUnmarshaller();
            JsonResponseHandler<RestoreFromSnapshotResultresponseHandler =
                new JsonResponseHandler<RestoreFromSnapshotResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

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

Parameters:
disableRadiusRequest Container for the necessary parameters to execute the DisableRadius service method on AWSDirectoryService.
Returns:
The response from the DisableRadius service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
    public DisableRadiusResult disableRadius(DisableRadiusRequest disableRadiusRequest) {
        ExecutionContext executionContext = createExecutionContext(disableRadiusRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<DisableRadiusRequestrequest = null;
        Response<DisableRadiusResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new DisableRadiusRequestMarshaller().marshall(super.beforeMarshalling(disableRadiusRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<DisableRadiusResultJsonUnmarshallerContextunmarshaller =
                new DisableRadiusResultJsonUnmarshaller();
            JsonResponseHandler<DisableRadiusResultresponseHandler =
                new JsonResponseHandler<DisableRadiusResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

Obtains the manual snapshot limits for a directory.

Parameters:
getSnapshotLimitsRequest Container for the necessary parameters to execute the GetSnapshotLimits service method on AWSDirectoryService.
Returns:
The response from the GetSnapshotLimits service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
    public GetSnapshotLimitsResult getSnapshotLimits(GetSnapshotLimitsRequest getSnapshotLimitsRequest) {
        ExecutionContext executionContext = createExecutionContext(getSnapshotLimitsRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(.);
        Request<GetSnapshotLimitsRequestrequest = null;
        Response<GetSnapshotLimitsResultresponse = null;
        
        try {
            awsRequestMetrics.startEvent(.);
            try {
                request = new GetSnapshotLimitsRequestMarshaller().marshall(super.beforeMarshalling(getSnapshotLimitsRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
            } finally {
                awsRequestMetrics.endEvent(.);
            }
            Unmarshaller<GetSnapshotLimitsResultJsonUnmarshallerContextunmarshaller =
                new GetSnapshotLimitsResultJsonUnmarshaller();
            JsonResponseHandler<GetSnapshotLimitsResultresponseHandler =
                new JsonResponseHandler<GetSnapshotLimitsResult>(unmarshaller);
            response = invoke(requestresponseHandlerexecutionContext);
            return response.getAwsResponse();
        } finally {
            
            endClientExecution(awsRequestMetricsrequestresponse);
        }
    }

    

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.

Returns:
The response from the DescribeSnapshots service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.InvalidNextTokenException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
        return describeSnapshots(new DescribeSnapshotsRequest());
    }
    
    

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.

Returns:
The response from the DescribeDirectories service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.InvalidParameterException
com.amazonaws.services.directory.model.InvalidNextTokenException
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
        return describeDirectories(new DescribeDirectoriesRequest());
    }
    
    

Obtains directory limit information for the current region.

Returns:
The response from the GetDirectoryLimits service method, as returned by AWSDirectoryService.
Throws:
com.amazonaws.services.directory.model.EntityDoesNotExistException
com.amazonaws.services.directory.model.ServiceException
com.amazonaws.services.directory.model.ClientException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSDirectoryService indicating either a problem with the data in the request, or a server side issue.
        return getDirectoryLimits(new GetDirectoryLimitsRequest());
    }
    @Override
    public void setEndpoint(String endpoint) {
        super.setEndpoint(endpoint);
    }
    @Override
    public void setEndpoint(String endpointString serviceNameString regionIdthrows IllegalArgumentException {
        super.setEndpoint(endpointserviceNameregionId);
    }

    
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.

Parameters:
request The originally executed request
Returns:
The response metadata for the specified request, or null if none is available.
        return .getResponseMetadataForRequest(request);
    }
    private <X, Y extends AmazonWebServiceRequestResponse<X> invoke(Request<Y> request,
            HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
            ExecutionContext executionContext) {
        request.setEndpoint();
        request.setTimeOffset();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        AWSCredentials credentials;
        awsRequestMetrics.startEvent(.);
        try {
            credentials = .getCredentials();
        } finally {
            awsRequestMetrics.endEvent(.);
        }
        AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
        if (originalRequest != null && originalRequest.getRequestCredentials() != null) {
            credentials = originalRequest.getRequestCredentials();
        }
        executionContext.setCredentials(credentials);
        JsonErrorResponseHandler errorResponseHandler = new JsonErrorResponseHandler();
        Response<X> result = .execute(requestresponseHandler,
                errorResponseHandlerexecutionContext);
        return result;
    }
}
        
New to GrepCode? Check out our FAQ X