text:
package com.amazonaws.services.iot;

import com.amazonaws.services.iot.model.*;
import com.amazonaws.annotation.ThreadSafe;

/**
 * Interface for accessing AWS IoT asynchronously. Each asynchronous method will
 * return a Java Future object representing the asynchronous operation;
 * overloads which accept an {@code AsyncHandler} can be used to receive
 * notification when an asynchronous operation completes.
 *

 * <fullname>AWS IoT</fullname>
 *

 * AWS IoT provides secure, bi-directional communication between
 * Internet-connected things (such as sensors, actuators, embedded devices, or
 * smart appliances) and the AWS cloud. You can discover your custom IoT-Data
 * endpoint to communicate with, configure rules for data processing and
 * integration with other services, organize resources associated with each
 * thing (Thing Registry), configure logging, and create and manage policies and
 * credentials to authenticate things.
 *

 *

 * For more information about how AWS IoT works, see the Developer Guide.
 *

 */
@ThreadSafe
public class AWSIotAsyncClient extends AWSIotClient implements AWSIotAsync {

    private static final int DEFAULT_THREAD_POOL_SIZE = 50;

    private final java.util.concurrent.ExecutorService executorService;

    /**
     * Constructs a new asynchronous client to invoke service methods on AWS
     * IoT. 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

     *
Credential profiles file at the default location (~/.aws/credentials)
     * shared by all AWS SDKs and the AWS CLI

     *
Instance profile credentials delivered through the Amazon EC2
     * metadata service

     *

     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * 50 threads (to match the default maximum number of concurrent connections
     * to the service).
     *
     * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AWSIotAsyncClient() {
        this(new com.amazonaws.auth.DefaultAWSCredentialsProviderChain());
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on AWS
     * IoT. 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

     *
Credential profiles file at the default location (~/.aws/credentials)
     * shared by all AWS SDKs and the AWS CLI

     *
Instance profile credentials delivered through the Amazon EC2
     * metadata service

     *

     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * a number of threads equal to the maximum number of concurrent connections
     * configured via {@code ClientConfiguration.getMaxConnections()}.
     *
     * @param clientConfiguration
     *        The client configuration options controlling how this client
     *        connects to AWS IoT (ex: proxy settings, retry counts, etc).
     *
     * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AWSIotAsyncClient(
            com.amazonaws.ClientConfiguration clientConfiguration) {
        this(new com.amazonaws.auth.DefaultAWSCredentialsProviderChain(),
                clientConfiguration, java.util.concurrent.Executors
                        .newFixedThreadPool(clientConfiguration
                                .getMaxConnections()));
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on AWS IoT
     * using the specified AWS account credentials.
     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * 50 threads (to match the default maximum number of concurrent connections
     * to the service).
     *
     * @param awsCredentials
     *        The AWS credentials (access key ID and secret key) to use when
     *        authenticating with AWS services.
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AWSIotAsyncClient(com.amazonaws.auth.AWSCredentials awsCredentials) {
        this(awsCredentials, java.util.concurrent.Executors
                .newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on AWS IoT
     * using the specified AWS account credentials and executor service. Default
     * client settings will be used.
     *
     * @param awsCredentials
     *        The AWS credentials (access key ID and secret key) to use when
     *        authenticating with AWS services.
     * @param executorService
     *        The executor service by which all asynchronous requests will be
     *        executed.
     */
    public AWSIotAsyncClient(com.amazonaws.auth.AWSCredentials awsCredentials,
            java.util.concurrent.ExecutorService executorService) {

        this(awsCredentials, configFactory.getConfig(), executorService);
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on AWS IoT
     * using the specified AWS account credentials, executor service, and client
     * configuration options.
     *
     * @param awsCredentials
     *        The AWS credentials (access key ID and secret key) to use when
     *        authenticating with AWS services.
     * @param clientConfiguration
     *        Client configuration options (ex: max retry limit, proxy settings,
     *        etc).
     * @param executorService
     *        The executor service by which all asynchronous requests will be
     *        executed.
     */
    public AWSIotAsyncClient(com.amazonaws.auth.AWSCredentials awsCredentials,
            com.amazonaws.ClientConfiguration clientConfiguration,
            java.util.concurrent.ExecutorService executorService) {

        super(awsCredentials, clientConfiguration);
        this.executorService = executorService;
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on AWS IoT
     * using the specified AWS account credentials provider. Default client
     * settings will be used.
     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * 50 threads (to match the default maximum number of concurrent connections
     * to the service).
     *
     * @param awsCredentialsProvider
     *        The AWS credentials provider which will provide credentials to
     *        authenticate requests with AWS services.
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AWSIotAsyncClient(
            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider) {
        this(awsCredentialsProvider, java.util.concurrent.Executors
                .newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on AWS IoT
     * using the provided AWS account credentials provider and client
     * configuration options.
     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * a number of threads equal to the maximum number of concurrent connections
     * configured via {@code ClientConfiguration.getMaxConnections()}.
     *
     * @param awsCredentialsProvider
     *        The AWS credentials provider which will provide credentials to
     *        authenticate requests with AWS services.
     * @param clientConfiguration
     *        Client configuration options (ex: max retry limit, proxy settings,
     *        etc).
     *
     * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AWSIotAsyncClient(
            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
            com.amazonaws.ClientConfiguration clientConfiguration) {

        this(awsCredentialsProvider, clientConfiguration,
                java.util.concurrent.Executors
                        .newFixedThreadPool(clientConfiguration
                                .getMaxConnections()));
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on AWS IoT
     * using the specified AWS account credentials provider and executor
     * service. Default client settings will be used.
     *
     * @param awsCredentialsProvider
     *        The AWS credentials provider which will provide credentials to
     *        authenticate requests with AWS services.
     * @param executorService
     *        The executor service by which all asynchronous requests will be
     *        executed.
     */
    public AWSIotAsyncClient(
            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
            java.util.concurrent.ExecutorService executorService) {

        this(awsCredentialsProvider, configFactory.getConfig(), executorService);
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on AWS IoT
     * using the specified AWS account credentials provider, executor service,
     * and client configuration options.
     *
     * @param awsCredentialsProvider
     *        The AWS credentials provider which will provide credentials to
     *        authenticate requests with AWS services.
     * @param clientConfiguration
     *        Client configuration options (ex: max retry limit, proxy settings,
     *        etc).
     * @param executorService
     *        The executor service by which all asynchronous requests will be
     *        executed.
     */
    public AWSIotAsyncClient(
            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
            com.amazonaws.ClientConfiguration clientConfiguration,
            java.util.concurrent.ExecutorService executorService) {

        super(awsCredentialsProvider, clientConfiguration);
        this.executorService = executorService;
    }

    /**
     * Returns the executor service used by this client to execute async
     * requests.
     *
     * @return The executor service used by this client to execute async
     *         requests.
     */
    public java.util.concurrent.ExecutorService getExecutorService() {
        return executorService;
    }

    @Override
    public java.util.concurrent.Future<Void> acceptCertificateTransferAsync(
            AcceptCertificateTransferRequest request) {

        return acceptCertificateTransferAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> acceptCertificateTransferAsync(
            final AcceptCertificateTransferRequest request,
            final com.amazonaws.handlers.AsyncHandler<AcceptCertificateTransferRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            acceptCertificateTransfer(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> attachPrincipalPolicyAsync(
            AttachPrincipalPolicyRequest request) {

        return attachPrincipalPolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> attachPrincipalPolicyAsync(
            final AttachPrincipalPolicyRequest request,
            final com.amazonaws.handlers.AsyncHandler<AttachPrincipalPolicyRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            attachPrincipalPolicy(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<AttachThingPrincipalResult> attachThingPrincipalAsync(
            AttachThingPrincipalRequest request) {

        return attachThingPrincipalAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<AttachThingPrincipalResult> attachThingPrincipalAsync(
            final AttachThingPrincipalRequest request,
            final com.amazonaws.handlers.AsyncHandler<AttachThingPrincipalRequest, AttachThingPrincipalResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<AttachThingPrincipalResult>() {
                    @Override
                    public AttachThingPrincipalResult call() throws Exception {
                        AttachThingPrincipalResult result;

                        try {
                            result = attachThingPrincipal(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> cancelCertificateTransferAsync(
            CancelCertificateTransferRequest request) {

        return cancelCertificateTransferAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> cancelCertificateTransferAsync(
            final CancelCertificateTransferRequest request,
            final com.amazonaws.handlers.AsyncHandler<CancelCertificateTransferRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            cancelCertificateTransfer(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<CreateCertificateFromCsrResult> createCertificateFromCsrAsync(
            CreateCertificateFromCsrRequest request) {

        return createCertificateFromCsrAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<CreateCertificateFromCsrResult> createCertificateFromCsrAsync(
            final CreateCertificateFromCsrRequest request,
            final com.amazonaws.handlers.AsyncHandler<CreateCertificateFromCsrRequest, CreateCertificateFromCsrResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<CreateCertificateFromCsrResult>() {
                    @Override
                    public CreateCertificateFromCsrResult call()
                            throws Exception {
                        CreateCertificateFromCsrResult result;

                        try {
                            result = createCertificateFromCsr(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<CreateKeysAndCertificateResult> createKeysAndCertificateAsync(
            CreateKeysAndCertificateRequest request) {

        return createKeysAndCertificateAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<CreateKeysAndCertificateResult> createKeysAndCertificateAsync(
            final CreateKeysAndCertificateRequest request,
            final com.amazonaws.handlers.AsyncHandler<CreateKeysAndCertificateRequest, CreateKeysAndCertificateResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<CreateKeysAndCertificateResult>() {
                    @Override
                    public CreateKeysAndCertificateResult call()
                            throws Exception {
                        CreateKeysAndCertificateResult result;

                        try {
                            result = createKeysAndCertificate(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<CreatePolicyResult> createPolicyAsync(
            CreatePolicyRequest request) {

        return createPolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<CreatePolicyResult> createPolicyAsync(
            final CreatePolicyRequest request,
            final com.amazonaws.handlers.AsyncHandler<CreatePolicyRequest, CreatePolicyResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<CreatePolicyResult>() {
                    @Override
                    public CreatePolicyResult call() throws Exception {
                        CreatePolicyResult result;

                        try {
                            result = createPolicy(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<CreatePolicyVersionResult> createPolicyVersionAsync(
            CreatePolicyVersionRequest request) {

        return createPolicyVersionAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<CreatePolicyVersionResult> createPolicyVersionAsync(
            final CreatePolicyVersionRequest request,
            final com.amazonaws.handlers.AsyncHandler<CreatePolicyVersionRequest, CreatePolicyVersionResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<CreatePolicyVersionResult>() {
                    @Override
                    public CreatePolicyVersionResult call() throws Exception {
                        CreatePolicyVersionResult result;

                        try {
                            result = createPolicyVersion(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<CreateThingResult> createThingAsync(
            CreateThingRequest request) {

        return createThingAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<CreateThingResult> createThingAsync(
            final CreateThingRequest request,
            final com.amazonaws.handlers.AsyncHandler<CreateThingRequest, CreateThingResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<CreateThingResult>() {
                    @Override
                    public CreateThingResult call() throws Exception {
                        CreateThingResult result;

                        try {
                            result = createThing(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> createTopicRuleAsync(
            CreateTopicRuleRequest request) {

        return createTopicRuleAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> createTopicRuleAsync(
            final CreateTopicRuleRequest request,
            final com.amazonaws.handlers.AsyncHandler<CreateTopicRuleRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            createTopicRule(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> deleteCertificateAsync(
            DeleteCertificateRequest request) {

        return deleteCertificateAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> deleteCertificateAsync(
            final DeleteCertificateRequest request,
            final com.amazonaws.handlers.AsyncHandler<DeleteCertificateRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            deleteCertificate(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> deletePolicyAsync(
            DeletePolicyRequest request) {

        return deletePolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> deletePolicyAsync(
            final DeletePolicyRequest request,
            final com.amazonaws.handlers.AsyncHandler<DeletePolicyRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            deletePolicy(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> deletePolicyVersionAsync(
            DeletePolicyVersionRequest request) {

        return deletePolicyVersionAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> deletePolicyVersionAsync(
            final DeletePolicyVersionRequest request,
            final com.amazonaws.handlers.AsyncHandler<DeletePolicyVersionRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            deletePolicyVersion(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<DeleteThingResult> deleteThingAsync(
            DeleteThingRequest request) {

        return deleteThingAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DeleteThingResult> deleteThingAsync(
            final DeleteThingRequest request,
            final com.amazonaws.handlers.AsyncHandler<DeleteThingRequest, DeleteThingResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DeleteThingResult>() {
                    @Override
                    public DeleteThingResult call() throws Exception {
                        DeleteThingResult result;

                        try {
                            result = deleteThing(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> deleteTopicRuleAsync(
            DeleteTopicRuleRequest request) {

        return deleteTopicRuleAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> deleteTopicRuleAsync(
            final DeleteTopicRuleRequest request,
            final com.amazonaws.handlers.AsyncHandler<DeleteTopicRuleRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            deleteTopicRule(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<DescribeCertificateResult> describeCertificateAsync(
            DescribeCertificateRequest request) {

        return describeCertificateAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeCertificateResult> describeCertificateAsync(
            final DescribeCertificateRequest request,
            final com.amazonaws.handlers.AsyncHandler<DescribeCertificateRequest, DescribeCertificateResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DescribeCertificateResult>() {
                    @Override
                    public DescribeCertificateResult call() throws Exception {
                        DescribeCertificateResult result;

                        try {
                            result = describeCertificate(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<DescribeEndpointResult> describeEndpointAsync(
            DescribeEndpointRequest request) {

        return describeEndpointAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeEndpointResult> describeEndpointAsync(
            final DescribeEndpointRequest request,
            final com.amazonaws.handlers.AsyncHandler<DescribeEndpointRequest, DescribeEndpointResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DescribeEndpointResult>() {
                    @Override
                    public DescribeEndpointResult call() throws Exception {
                        DescribeEndpointResult result;

                        try {
                            result = describeEndpoint(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<DescribeThingResult> describeThingAsync(
            DescribeThingRequest request) {

        return describeThingAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeThingResult> describeThingAsync(
            final DescribeThingRequest request,
            final com.amazonaws.handlers.AsyncHandler<DescribeThingRequest, DescribeThingResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DescribeThingResult>() {
                    @Override
                    public DescribeThingResult call() throws Exception {
                        DescribeThingResult result;

                        try {
                            result = describeThing(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> detachPrincipalPolicyAsync(
            DetachPrincipalPolicyRequest request) {

        return detachPrincipalPolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> detachPrincipalPolicyAsync(
            final DetachPrincipalPolicyRequest request,
            final com.amazonaws.handlers.AsyncHandler<DetachPrincipalPolicyRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            detachPrincipalPolicy(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<DetachThingPrincipalResult> detachThingPrincipalAsync(
            DetachThingPrincipalRequest request) {

        return detachThingPrincipalAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DetachThingPrincipalResult> detachThingPrincipalAsync(
            final DetachThingPrincipalRequest request,
            final com.amazonaws.handlers.AsyncHandler<DetachThingPrincipalRequest, DetachThingPrincipalResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DetachThingPrincipalResult>() {
                    @Override
                    public DetachThingPrincipalResult call() throws Exception {
                        DetachThingPrincipalResult result;

                        try {
                            result = detachThingPrincipal(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> disableTopicRuleAsync(
            DisableTopicRuleRequest request) {

        return disableTopicRuleAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> disableTopicRuleAsync(
            final DisableTopicRuleRequest request,
            final com.amazonaws.handlers.AsyncHandler<DisableTopicRuleRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            disableTopicRule(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> enableTopicRuleAsync(
            EnableTopicRuleRequest request) {

        return enableTopicRuleAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> enableTopicRuleAsync(
            final EnableTopicRuleRequest request,
            final com.amazonaws.handlers.AsyncHandler<EnableTopicRuleRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            enableTopicRule(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<GetLoggingOptionsResult> getLoggingOptionsAsync(
            GetLoggingOptionsRequest request) {

        return getLoggingOptionsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<GetLoggingOptionsResult> getLoggingOptionsAsync(
            final GetLoggingOptionsRequest request,
            final com.amazonaws.handlers.AsyncHandler<GetLoggingOptionsRequest, GetLoggingOptionsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<GetLoggingOptionsResult>() {
                    @Override
                    public GetLoggingOptionsResult call() throws Exception {
                        GetLoggingOptionsResult result;

                        try {
                            result = getLoggingOptions(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<GetPolicyResult> getPolicyAsync(
            GetPolicyRequest request) {

        return getPolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<GetPolicyResult> getPolicyAsync(
            final GetPolicyRequest request,
            final com.amazonaws.handlers.AsyncHandler<GetPolicyRequest, GetPolicyResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<GetPolicyResult>() {
                    @Override
                    public GetPolicyResult call() throws Exception {
                        GetPolicyResult result;

                        try {
                            result = getPolicy(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<GetPolicyVersionResult> getPolicyVersionAsync(
            GetPolicyVersionRequest request) {

        return getPolicyVersionAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<GetPolicyVersionResult> getPolicyVersionAsync(
            final GetPolicyVersionRequest request,
            final com.amazonaws.handlers.AsyncHandler<GetPolicyVersionRequest, GetPolicyVersionResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<GetPolicyVersionResult>() {
                    @Override
                    public GetPolicyVersionResult call() throws Exception {
                        GetPolicyVersionResult result;

                        try {
                            result = getPolicyVersion(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<GetTopicRuleResult> getTopicRuleAsync(
            GetTopicRuleRequest request) {

        return getTopicRuleAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<GetTopicRuleResult> getTopicRuleAsync(
            final GetTopicRuleRequest request,
            final com.amazonaws.handlers.AsyncHandler<GetTopicRuleRequest, GetTopicRuleResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<GetTopicRuleResult>() {
                    @Override
                    public GetTopicRuleResult call() throws Exception {
                        GetTopicRuleResult result;

                        try {
                            result = getTopicRule(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<ListCertificatesResult> listCertificatesAsync(
            ListCertificatesRequest request) {

        return listCertificatesAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListCertificatesResult> listCertificatesAsync(
            final ListCertificatesRequest request,
            final com.amazonaws.handlers.AsyncHandler<ListCertificatesRequest, ListCertificatesResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<ListCertificatesResult>() {
                    @Override
                    public ListCertificatesResult call() throws Exception {
                        ListCertificatesResult result;

                        try {
                            result = listCertificates(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<ListPoliciesResult> listPoliciesAsync(
            ListPoliciesRequest request) {

        return listPoliciesAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListPoliciesResult> listPoliciesAsync(
            final ListPoliciesRequest request,
            final com.amazonaws.handlers.AsyncHandler<ListPoliciesRequest, ListPoliciesResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<ListPoliciesResult>() {
                    @Override
                    public ListPoliciesResult call() throws Exception {
                        ListPoliciesResult result;

                        try {
                            result = listPolicies(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<ListPolicyVersionsResult> listPolicyVersionsAsync(
            ListPolicyVersionsRequest request) {

        return listPolicyVersionsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListPolicyVersionsResult> listPolicyVersionsAsync(
            final ListPolicyVersionsRequest request,
            final com.amazonaws.handlers.AsyncHandler<ListPolicyVersionsRequest, ListPolicyVersionsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<ListPolicyVersionsResult>() {
                    @Override
                    public ListPolicyVersionsResult call() throws Exception {
                        ListPolicyVersionsResult result;

                        try {
                            result = listPolicyVersions(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<ListPrincipalPoliciesResult> listPrincipalPoliciesAsync(
            ListPrincipalPoliciesRequest request) {

        return listPrincipalPoliciesAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListPrincipalPoliciesResult> listPrincipalPoliciesAsync(
            final ListPrincipalPoliciesRequest request,
            final com.amazonaws.handlers.AsyncHandler<ListPrincipalPoliciesRequest, ListPrincipalPoliciesResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<ListPrincipalPoliciesResult>() {
                    @Override
                    public ListPrincipalPoliciesResult call() throws Exception {
                        ListPrincipalPoliciesResult result;

                        try {
                            result = listPrincipalPolicies(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<ListPrincipalThingsResult> listPrincipalThingsAsync(
            ListPrincipalThingsRequest request) {

        return listPrincipalThingsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListPrincipalThingsResult> listPrincipalThingsAsync(
            final ListPrincipalThingsRequest request,
            final com.amazonaws.handlers.AsyncHandler<ListPrincipalThingsRequest, ListPrincipalThingsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<ListPrincipalThingsResult>() {
                    @Override
                    public ListPrincipalThingsResult call() throws Exception {
                        ListPrincipalThingsResult result;

                        try {
                            result = listPrincipalThings(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<ListThingPrincipalsResult> listThingPrincipalsAsync(
            ListThingPrincipalsRequest request) {

        return listThingPrincipalsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListThingPrincipalsResult> listThingPrincipalsAsync(
            final ListThingPrincipalsRequest request,
            final com.amazonaws.handlers.AsyncHandler<ListThingPrincipalsRequest, ListThingPrincipalsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<ListThingPrincipalsResult>() {
                    @Override
                    public ListThingPrincipalsResult call() throws Exception {
                        ListThingPrincipalsResult result;

                        try {
                            result = listThingPrincipals(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<ListThingsResult> listThingsAsync(
            ListThingsRequest request) {

        return listThingsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListThingsResult> listThingsAsync(
            final ListThingsRequest request,
            final com.amazonaws.handlers.AsyncHandler<ListThingsRequest, ListThingsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<ListThingsResult>() {
                    @Override
                    public ListThingsResult call() throws Exception {
                        ListThingsResult result;

                        try {
                            result = listThings(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<ListTopicRulesResult> listTopicRulesAsync(
            ListTopicRulesRequest request) {

        return listTopicRulesAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListTopicRulesResult> listTopicRulesAsync(
            final ListTopicRulesRequest request,
            final com.amazonaws.handlers.AsyncHandler<ListTopicRulesRequest, ListTopicRulesResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<ListTopicRulesResult>() {
                    @Override
                    public ListTopicRulesResult call() throws Exception {
                        ListTopicRulesResult result;

                        try {
                            result = listTopicRules(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> rejectCertificateTransferAsync(
            RejectCertificateTransferRequest request) {

        return rejectCertificateTransferAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> rejectCertificateTransferAsync(
            final RejectCertificateTransferRequest request,
            final com.amazonaws.handlers.AsyncHandler<RejectCertificateTransferRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            rejectCertificateTransfer(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> replaceTopicRuleAsync(
            ReplaceTopicRuleRequest request) {

        return replaceTopicRuleAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> replaceTopicRuleAsync(
            final ReplaceTopicRuleRequest request,
            final com.amazonaws.handlers.AsyncHandler<ReplaceTopicRuleRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            replaceTopicRule(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> setDefaultPolicyVersionAsync(
            SetDefaultPolicyVersionRequest request) {

        return setDefaultPolicyVersionAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> setDefaultPolicyVersionAsync(
            final SetDefaultPolicyVersionRequest request,
            final com.amazonaws.handlers.AsyncHandler<SetDefaultPolicyVersionRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            setDefaultPolicyVersion(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> setLoggingOptionsAsync(
            SetLoggingOptionsRequest request) {

        return setLoggingOptionsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> setLoggingOptionsAsync(
            final SetLoggingOptionsRequest request,
            final com.amazonaws.handlers.AsyncHandler<SetLoggingOptionsRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            setLoggingOptions(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<TransferCertificateResult> transferCertificateAsync(
            TransferCertificateRequest request) {

        return transferCertificateAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<TransferCertificateResult> transferCertificateAsync(
            final TransferCertificateRequest request,
            final com.amazonaws.handlers.AsyncHandler<TransferCertificateRequest, TransferCertificateResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<TransferCertificateResult>() {
                    @Override
                    public TransferCertificateResult call() throws Exception {
                        TransferCertificateResult result;

                        try {
                            result = transferCertificate(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<Void> updateCertificateAsync(
            UpdateCertificateRequest request) {

        return updateCertificateAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<Void> updateCertificateAsync(
            final UpdateCertificateRequest request,
            final com.amazonaws.handlers.AsyncHandler<UpdateCertificateRequest, Void> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        Void result;

                        try {
                            updateCertificate(request);
                            result = null;
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<UpdateThingResult> updateThingAsync(
            UpdateThingRequest request) {

        return updateThingAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<UpdateThingResult> updateThingAsync(
            final UpdateThingRequest request,
            final com.amazonaws.handlers.AsyncHandler<UpdateThingRequest, UpdateThingResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<UpdateThingResult>() {
                    @Override
                    public UpdateThingResult call() throws Exception {
                        UpdateThingResult result;

                        try {
                            result = updateThing(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    /**
     * Shuts down the client, releasing all managed resources. This includes
     * forcibly terminating all pending asynchronous service calls. Clients who
     * wish to give pending asynchronous service calls time to complete should
     * call {@code getExecutorService().shutdown()} followed by
     * {@code getExecutorService().awaitTermination()} prior to calling this
     * method.
     */
    @Override
    public void shutdown() {
        super.shutdown();
        executorService.shutdownNow();
    }
}


text:
layout: feature
title: 'Clitic'
shortdef: 'clitic'
udver: '2'
---

Boolean feature to say if a word is clitic or not.

### `Yes`: it is clitic

Used with clitic agreement markers that come before a non-verbal predicate.

#### Examples

* [quc] _At k'o pa siwan!_ "Estás en el barranco!"
* [quc] _In in k'o pa tijob'al._ "Yo estoy en la clase."

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

        <meta charset="UTF-8" />
        <meta name="robots" content="index, follow, all" />
        <title>Thelia\Form\TaxModificationForm | </title>
                    <link rel="stylesheet" type="text/css" href="../../stylesheet.css">

Classes

Namespaces

Interfaces

Traits

Index

Class

Thelia\Form\TaxModificationForm

    class
    TaxModificationForm        extends TaxCreationForm

Class TaxModificationForm

Methods

                    __construct(Request $request, $type = 'form', $data = array(), $options = array(), TaxEngine $taxEngine = null)

                from TaxCreationForm

                    string

                    getName()

                    verifyTaxId($value, ExecutionContextInterface $context)

Details

in TaxCreationForm at line 34

                    public
    __construct(Request $request, $type = 'form', $data = array(), $options = array(), TaxEngine $taxEngine = null)

Parameters

                Request
                $request

                $type

                $data

                $options

                TaxEngine
                $taxEngine

at line 47

                    public            string
    getName()

Return Value

            string
            the name of you form. This name must be unique

at line 52

                    public
    verifyTaxId($value, ExecutionContextInterface $context)

Parameters

                $value

                ExecutionContextInterface
                $context

        Generated by Sami, the API Documentation Generator.


text:
/*
 *  This file is part of the Heritrix web crawler (crawler.archive.org).
 *
 *  Licensed to the Internet Archive (IA) by one or more individual
 *  contributors.
 *
 *  The IA licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License 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 org.archive.crawler.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import org.archive.util.FileUtils;

/**
 * Utilities useful checkpointing.
 * @author stack
 * @version $Date$ $Revision$
 */
public class CheckpointUtils {
    public static final String SERIALIZED_CLASS_SUFFIX = ".serialized";

    public static File getBdbSubDirectory(File checkpointDir) {
        return new File(checkpointDir, "bdbje-logs");
    }

    public static File getClassCheckpointFile(File checkpointDir,
            final String suffix, Class<?> c) {
        return new File(checkpointDir, getClassCheckpointFilename(c, suffix));
    }

    public static File getClassCheckpointFile(File checkpointDir, Class<?> c) {
        return new File(checkpointDir, getClassCheckpointFilename(c, null));
    }

    public static String getClassCheckpointFilename(final Class<?> c) {
        return getClassCheckpointFilename(c, null);
    }

    public static String getClassCheckpointFilename(final Class<?> c,
            final String suffix) {
        return c.getName() + ((suffix == null)? "": "." + suffix) +
            SERIALIZED_CLASS_SUFFIX;
    }

    /**
     * Utility function to serialize an object to a file in current checkpoint
     * dir. Facilities
     * to store related files alongside the serialized object in a directory
     * named with a <code>.auxillary</code> suffix.
     *
     * @param o Object to serialize.
     * @param dir Directory to serialize into.
     * @throws IOException
     */
    public static void writeObjectToFile(final Object o, final File dir)
    throws IOException {
        writeObjectToFile(o, null, dir);
    }

    public static void writeObjectToFile(final Object o, final String suffix,
            final File dir)
    throws IOException {
        FileUtils.ensureWriteableDirectory(dir);
        ObjectOutputStream out = new ObjectOutputStream(
            new FileOutputStream(getClassCheckpointFile(dir, suffix,
                o.getClass())));
        try {
            out.writeObject(o);
        } finally {
            out.close();
        }
    }

    public static <T> T readObjectFromFile(final Class<T> c, final File dir)
    throws FileNotFoundException, IOException, ClassNotFoundException {
        return readObjectFromFile(c, null, dir);
    }

    public static <T> T readObjectFromFile(final Class<T> c, final String suffix,
            final File dir)
    throws FileNotFoundException, IOException, ClassNotFoundException {
        ObjectInputStream in = new ObjectInputStream(
            new FileInputStream(getClassCheckpointFile(dir, suffix, c)));
        T o = null;
        try {
            o = c.cast(in.readObject());
        } finally {
            in.close();
        }
        return o;
    }

    /**
     * @return Instance of filename filter that will let through files ending
     * in '.jdb' (i.e. bdb je log files).
     */
    public static FilenameFilter getJeLogsFilter() {
        return new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name != null && name.toLowerCase().endsWith(".jdb");
            }
        };
    }
}


text:
from swift.common.utils import public

from swift.common.middleware.s3api.controllers.base import Controller, \
    bucket_operation
from swift.common.middleware.s3api.etree import Element, tostring
from swift.common.middleware.s3api.s3response import HTTPOk, S3NotImplemented, \
    NoLoggingStatusForKey

class LoggingStatusController(Controller):
    """
    Handles the following APIs:

    * GET Bucket logging
    * PUT Bucket logging

    Those APIs are logged as LOGGING_STATUS operations in the S3 server log.
    """
    @public
    @bucket_operation(err_resp=NoLoggingStatusForKey)
    def GET(self, req):
        """
        Handles GET Bucket logging.
        """
        req.get_response(self.app, method='HEAD')

        # logging disabled
        elem = Element('BucketLoggingStatus')
        body = tostring(elem)

        return HTTPOk(body=body, content_type='application/xml')

    @public
    @bucket_operation(err_resp=NoLoggingStatusForKey)
    def PUT(self, req):
        """
        Handles PUT Bucket logging.
        """
        raise S3NotImplemented()


text:
describe('OAuth2 / OpenID Connect Dynamic Client Registration', function () {
  it('should return same client_secret given in request for newly created clients with client_secret specified', function () {
    cy.request({
      method: 'POST',
      url: Cypress.env('public_url') + '/oauth2/register',
      body: {
        client_name: 'clientName',
        scope: 'foo openid offline_access',
        grant_types: ['client_credentials']
      }
    }).then((response) => {
      expect(response.body.registration_access_token).to.not.be.empty
    })
  })

  it('should get client when having a valid client_secret in body', function () {
    cy.request({
      method: 'POST',
      url: Cypress.env('public_url') + '/oauth2/register',
      body: {
        client_name: 'clientName',
        grant_types: ['client_credentials']
      }
    }).then((response) => {
      cy.request({
        method: 'GET',
        url:
          Cypress.env('public_url') +
          '/oauth2/register/' +
          response.body.client_id,
        headers: {
          Authorization: 'Bearer ' + response.body.registration_access_token
        }
      }).then((response) => {
        expect(response.body.client_name).to.equal('clientName')
      })
    })
  })

  it('should fail for get client when Authorization header is not presented', function () {
    cy.request({
      method: 'POST',
      url: Cypress.env('public_url') + '/oauth2/register',
      body: {
        grant_types: ['client_credentials']
      }
    }).then((response) => {
      cy.request({
        method: 'GET',
        failOnStatusCode: false,
        url:
          Cypress.env('public_url') +
          '/oauth2/register/' +
          response.body.client_id
      }).then((response) => {
        expect(response.status).to.eq(401)
      })
    })
  })

  it('should update client name', function () {
    cy.request({
      method: 'POST',
      url: Cypress.env('public_url') + '/oauth2/register',
      body: {
        grant_types: ['client_credentials']
      }
    }).then((response) => {
      cy.request({
        method: 'PUT',
        failOnStatusCode: false,
        url:
          Cypress.env('public_url') +
          '/oauth2/register/' +
          response.body.client_id,
        headers: {
          Authorization: 'Bearer ' + response.body.registration_access_token
        },
        body: {
          client_id: 'clientid',
          client_name: 'clientName2',
          scope: 'foo openid offline_access',
          grant_types: ['client_credentials']
        }
      }).then((response) => {
        expect(response.body.client_name).to.equal('clientName2')
        expect(response.body.client_id).to.not.equal('clientid')
      })
    })
  })
  it('should not be able to choose the secret', function () {
    cy.request({
      method: 'POST',
      url: Cypress.env('public_url') + '/oauth2/register',
      body: {
        grant_types: ['client_credentials']
      }
    }).then((response) => {
      cy.request({
        method: 'PUT',
        failOnStatusCode: false,
        url:
          Cypress.env('public_url') +
          '/oauth2/register/' +
          response.body.client_id,
        headers: {
          Authorization: 'Bearer ' + response.body.registration_access_token
        },
        body: {
          client_id: 'clientid',
          client_name: 'clientName2',
          client_secret: 'secret',
          scope: 'foo openid offline_access',
          grant_types: ['client_credentials']
        }
      }).then((response) => {
        expect(response.status).to.eq(403)
      })
    })
  })

  it('should fail to update client name when Authorization header is not presented', function () {
    cy.request({
      method: 'POST',
      url: Cypress.env('public_url') + '/oauth2/register',
      body: {
        client_name: 'clientName',
        grant_types: ['client_credentials']
      }
    }).then((response) => {
      cy.request({
        method: 'PUT',
        failOnStatusCode: false,
        url:
          Cypress.env('public_url') +
          '/oauth2/register/' +
          response.body.client_id
      }).then((response) => {
        expect(response.status).to.eq(401)
      })
    })
  })

  it('should fail to delete client when Authorization header is not presented', function () {
    cy.request({
      method: 'POST',
      url: Cypress.env('public_url') + '/oauth2/register',
      body: {
        client_name: 'clientName',
        grant_types: ['client_credentials']
      }
    }).then((response) => {
      cy.request({
        method: 'DELETE',
        failOnStatusCode: false,
        url:
          Cypress.env('public_url') +
          '/oauth2/register/' +
          response.body.client_id
      }).then((response) => {
        expect(response.status).to.eq(401)
      })
    })
  })

  it('should delete client when having an valid Authorization header', function () {
    cy.request({
      method: 'POST',
      url: Cypress.env('public_url') + '/oauth2/register',
      body: {
        client_name: 'clientName',
        grant_types: ['client_credentials']
      }
    }).then((response) => {
      cy.request({
        method: 'DELETE',
        failOnStatusCode: false,
        url:
          Cypress.env('public_url') +
          '/oauth2/register/' +
          response.body.client_id,
        headers: {
          Authorization: 'Bearer ' + response.body.registration_access_token
        }
      }).then((response) => {
        expect(response.status).to.eq(204)
      })
    })
  })
})


text:
/*
 * DisplayPanel.java
 *
 * Created on October 28, 2003, 10:12 PM
 */

package com.seekerr.simulator.robot.graphics.wallCollision;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JPanel;
/**
 *
 * @author  Wesley Kerr
 */
public class ActualPanel extends JPanel {

    /** Creates a new instance of DisplayPanel */
    public ActualPanel() {
        super(true);
        init();
    }

    public void init() {
        setBackground(Color.white);
        setForeground(Color.white);
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D f = (Graphics2D) g;
        f.setColor(Color.white);
        f.fillRect(0, 0, getWidth(), getHeight());

        Observer o = Observer.inst();
        int scaleX = getWidth() / o.width;
        int scaleY = getHeight() / o.height;

        int scale = Math.min(scaleX, scaleY);

        //paintGrid(f, scale);
        paintRobots(f, scale, o.getCalculator());
    }

    public void paintGrid(Graphics2D g, int size) {
        g.setColor(Color.black);
        for (int i = 0; i <= Observer.inst().width; ++i) {
            g.drawLine(i*size, 0, i*size, Observer.inst().height*size);
        }

        for (int i = 0; i <= Observer.inst().height; ++i) {
            g.drawLine(0, i*size, Observer.inst().width*size, i*size);
        }
    }

    public void paintRobots(Graphics2D g, int size, Calculator c) {

        if (c == null) {
            System.out.println("Calculator is null");
            return;
        }

        int centerx = Observer.inst().width / 2;
        int centery = Observer.inst().height / 2;

        g.setColor(Color.blue);
        g.drawLine(centerx*size, centery*size, (int) ((centerx+c.globalVx)*size), centery*size);
        g.drawLine(centerx*size, centery*size, centerx*size, (int) ((centery+c.globalVy)*size));

        g.setColor(Color.red);
        g.drawLine(centerx*size, centery*size, (int) ((centerx+c.globalVx)*size), (int) ((centery+c.globalVy)*size));
    }
}


text:
import React, { Component } from 'react'

class SignUpForm extends Component {
  constructor(props) {
    super(props)

    this.state = {
      name: '',
      address: ''
    }
  }

  onInputChange(event) {
    this.setState({ name: event.target.value })
  }

  handleSubmit(event) {
    event.preventDefault()

    if (this.state.name.length < 2)
    {
      return alert('Please fill in your name.')
    }

    this.props.onSignUpFormSubmit(this.state.name)
  }

  render() {
    return(
      <form className="pure-form pure-form-stacked" onSubmit={this.handleSubmit.bind(this)}>
        <fieldset>
          Name
          <input id="name" type="text" value={this.state.name} onChange={this.onInputChange.bind(this)} placeholder="Name" />
          This is a required field.

          <button type="submit" className="pure-button pure-button-primary">Sign Up</button>
        </fieldset>
      </form>
    )
  }
}

export default SignUpForm


text:
namespace security_interstitials {

// Provides utilities for security interstitials on //content-based platforms.

#if !defined(OS_CHROMEOS) && !defined(OS_FUCHSIA)
// Launches date and time settings as appropriate based on the platform (not
// supported on ChromeOS, where taking this action requires embedder-level
// machinery, or Fuchsia, which simply doesn't require this functionality).
void LaunchDateAndTimeSettings();
#endif

}  // namespace security_interstitials

#endif  // COMPONENTS_SECURITY_INTERSTITIALS_CONTENT_UTILS_H_


text:
from astropy.io import fits
import numpy as np
import matplotlib.pyplot as plt
import os

def loadSpc(fileName):

    hdu = fits.open(fileName)
    header=hdu[0].header
    if False:
#        print(f"header= {header}")
        for k in header:
            print(f"{k} = {header[k]} \t\t\t '{header.comments[k]}''")

    flux=hdu[0].data
    waveLenght = np.linspace(start=header['CRVAL1'],num=header['NAXIS1'],stop=header['CRVAL1']+(header['NAXIS1']-1)*header['CDELT1'])

    hdu.close()

    return flux,waveLenght,header

def saveSpc(fileName,newsHeader,flux):
    hdu = fits.PrimaryHDU(flux)
    hdu.header=newsHeader
#    hdu[0].data=flux
    hdu.writeto(fileName)

def plot(path,filename,save=True):

    flux,waveLenght,header = loadSpc(path+'/'+fileName)

    (fig1,axes) = plt.subplots(2,1)

    fig1.set_size_inches(16, 10)
    fig1.suptitle(f"{header['OBJNAME']}, {header['EXPTIME2']}, dateObs(UTC)={header['DATE-OBS']},\n\n {fileName}")

    axes[0].set_title('global data')
    axes[0].plot(waveLenght,flux,'r-')
    axes[0].set_ylim(bottom=0)

    axes[1].set_title('zoom on Ha')
    axes[1].plot(waveLenght,flux,'r-')

    axes[1].set_ylim(bottom=0)
    axes[1].set_xlim(6540,6541)

    if save:
        plt.savefig('plot/plot'+header['DATE-OBS'].replace(':','-')+'.png')
    else:
        plt.show()

    plt.close()

def testDeriv():
    y = [1, 2, 3, 4, 4, 5, 6]
    print(f"y={y}")
    dy = np.diff(y)
    print(f"dy={dy}")
    d2y = np.diff(dy)
    print(f"d2y={d2y}")

def simplePlot(waveLenght,flux,plotTitle):
    fig, ax = plt.subplots()
    ax.plot(waveLenght,flux)

    ax.set(xlabel='time (s)', ylabel='flux',   title=plotTitle)
    ax.grid()

    plt.show()

def deriv(path,filename,dstPath):

    flux,waveLenght,header = loadSpc(path+'/'+fileName)

    cntEch = np.arange(1, len(waveLenght)+1, 1)

    difFlux = np.diff(flux)
    dif2Flux = abs(np.diff(difFlux))

    waveLenghtDif2 = waveLenght[1:-1]   # derivate twice, we lost 1 elements and last element

    #simplePlot(waveLenght[:-1],difFlux,"1st diff")
    #simplePlot(waveLenghtDif2,absD2Flux,"2nd diff")
    # find zeros seg:

    lastF=flux[1]
    lastY=dif2Flux[0]
    lastX=waveLenghtDif2[0]
    slope="increase"

    pixelWave=[]
    pixelFlux=[]

    log = False
    for x,y,f in zip(waveLenghtDif2[1:] , dif2Flux[1:] , flux[2:]):
        if log:
            print(f"dif2({x})={y}")

        if slope == "increase" and lastY > y :
            if log:
                print("start to decrease")
            pixelWave.append(lastX)
            pixelFlux.append(lastF)
            slope = "decrease"
        elif slope == "decrease" and lastY < y:
            if log:
                print("start to increade")
            slope = "increase"

        lastF=f
        lastX=x
        lastY=y

    print(f"Nb pixels found = {len(pixelFlux)}")

    # we add the last point of interpolled data
    pixelWave.append(waveLenght[-1])
    pixelFlux.append(flux[-1])

    #convert wavelenght in pixel number.  Int are more easy to debug..
    pixelWaveInt=[ round((waveLenght - header['CRVAL1']) / header['CDELT1']) for waveLenght in pixelWave]

    #convert point in escalier
    barWaveInt=[]
    lastBarWaveInt=0

    barFlux=[]
    lastBarWaveInt=0

    for posSrc in range(len(pixelWaveInt)):

        if posSrc != len(pixelWaveInt)-1:
            endPixelPosInt=(pixelWaveInt[posSrc]+pixelWaveInt[posSrc+1])  # double of average
        else:
            endPixelPosInt=len(waveLenght)*2   # last pos

        sizePixel=endPixelPosInt-lastBarWaveInt

        if log:
            print(f"endPixelPosInt={endPixelPosInt}")
            #print(f"sizePixel={sizePixel}")
            print(f"lastBarWaveInt={lastBarWaveInt}")
        barWaveInt.extend(list(range(int(lastBarWaveInt),int(endPixelPosInt))))
        barFlux.extend([pixelFlux[posSrc]] * int(sizePixel))

        if log:
            print(f"barWaveInt={barWaveInt}")
            print(f"barFlux={barFlux}")

#        input("Press a key")

        lastBarWaveInt=lastBarWaveInt + sizePixel

    barWave=[header['CRVAL1'] +  header['CDELT1']*0.25 + i * header['CDELT1'] / 2 for i in barWaveInt]

    if log:
        print(f"original  data len = {len(flux)}")
        print(f"pixelized data len = {len(barFlux)}")

    #save data
    # modify header for wavelenght
    header['NAXIS1'] = header['NAXIS1'] * 2
    header['CRVAL1'] = header['CRVAL1'] + header['CDELT1'] * 0.25
    header['CDELT1'] = header['CDELT1'] / 2

    saveSpc(dstPath + '/' + fileName,header,barFlux)

    # plot..
    minWavelenght,maxWavelenght= 6540 , 6542
    minWavelenght,maxWavelenght= 6500 , 6720
    fig, ax = plt.subplots(1,1)

    ax.step(waveLenght,flux,'b')
    ax.plot(pixelWave,pixelFlux,'*r')
    ax.step(barWave,barFlux,'g')
    ax.set_xlim(minWavelenght,maxWavelenght)

    plt.grid()
    plt.show()

def enquete(fileBilin,fileSpline,fileRepixel):
    fluxBilin,waveLenghtBilin,headerBilin = loadSpc(fileBilin)
    fluxSpline,waveLenghtSpline,headerSpline = loadSpc(fileSpline)
    fluxRepixel,waveLengthRepixel,headerRepixel = loadSpc(fileRepixel)
    fig, ax = plt.subplots(1,1)

    ax.step(waveLenghtBilin,fluxBilin)
    ax.step(waveLenghtSpline,fluxSpline)
    ax.step(waveLengthRepixel,fluxRepixel)
    fig.suptitle("Compare plot\n"+fileBilin+" ->>> Blue\n vs "+fileSpline+" ->>> Orange\n and Repixel Version ->>> Green")
    plt.grid()
    plt.show()

"""
********************
*   main code here *
********************
"""

enquete("./_RRLyr_20200726_976_600_TLE_34_bilin.fits","./_RRLyr_20200726_976_600_TLE_34_spline.fits","./_RRLyr_20200726_976_600_TLE_34_bilin_repixel.fits")
exit()

srcPath="./data"
dstPath="./dataPixel"
filesName=os.listdir(srcPath)
i=1
for fileName in filesName:
    print(f"{i}/{len(filesName)} file:{fileName}  ")
    #plot(srcPath,fileName,save=False)
    deriv(srcPath,fileName,dstPath)
    i=i+1


text:
import _ = require("lodash");

export interface IDisposable {
    dispose(): void;
}

export class CompositeDisposable implements IDisposable {

    private _disposables: IDisposable[] = [];

    add(disposable: IDisposable) {
        this._disposables.push(disposable);
        return this;
    }

    dispose(): void {
        _(this._disposables).reverse().forEach(d => d.dispose());
    }
}

export class Disposable implements IDisposable {

    private _disposed = false;

    constructor(private _dispose: () => void) {
    }

    dispose(): void {
        if (this._disposed)
            return;
        this._disposed = true;
        this._dispose();
    }
}

export class SerialDisposable implements IDisposable {

    private _disposable: IDisposable;
    private _disposed = false;

    setDisposable(disposable: IDisposable) {
        if (this._disposed) {
            disposable.dispose();
        } else {
            if (this._disposable)
                this._disposable.dispose();

            this._disposable = disposable;
        }
    }

    dispose(): void {
        this._disposed = true;
        if (this._disposable) {
            this._disposable.dispose();
            this._disposable = null;
        }
    }
}


text:
{% if messages %}

    {% if messages %}

    {% for message in messages %}

{{ message }}

    {% endfor %}
      {% endif %}

{% endif %}


text:
package com.github.mrvilkaman.presentationlayer.resolution.toolbar;

import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public interface ToolbarResolver extends IToolbar {

	void setUseCustomTitle();

	interface ToolbarResolverCallback{
		void onClickHome();
		void updateIcon();
	}

	void init(View view, AppCompatActivity activity);

	void setCallback(ToolbarResolverCallback callback);

	void onPrepareOptionsMenu(Menu menu);

	void onOptionsItemSelected(MenuItem item);

	void updateIcon();

	void clear();

	void showHomeIcon();

	void showBackIcon();
}