public class AmazonTranslateAsyncClient extends AmazonTranslateClient implements AmazonTranslateAsync
Provides translation between one source language and another of the same set of languages.
LOGGING_AWS_REQUEST_METRIC
Constructor and Description |
---|
AmazonTranslateAsyncClient()
Deprecated.
|
AmazonTranslateAsyncClient(AWSCredentials awsCredentials)
Constructs a new asynchronous client to invoke service methods on Amazon
Translate using the specified AWS account credentials.
|
AmazonTranslateAsyncClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration,
java.util.concurrent.ExecutorService executorService)
Constructs a new asynchronous client to invoke service methods on Amazon
Translate using the specified AWS account credentials, executor service,
and client configuration options.
|
AmazonTranslateAsyncClient(AWSCredentials awsCredentials,
java.util.concurrent.ExecutorService executorService)
Constructs a new asynchronous client to invoke service methods on Amazon
Translate using the specified AWS account credentials and executor
service.
|
AmazonTranslateAsyncClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new asynchronous client to invoke service methods on Amazon
Translate using the specified AWS account credentials provider.
|
AmazonTranslateAsyncClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
Constructs a new asynchronous client to invoke service methods on Amazon
Translate using the specified AWS account credentials provider and client
configuration options.
|
AmazonTranslateAsyncClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
java.util.concurrent.ExecutorService executorService)
Constructs a new asynchronous client to invoke service methods on Amazon
Translate using the specified AWS account credentials provider, executor
service, and client configuration options.
|
AmazonTranslateAsyncClient(AWSCredentialsProvider awsCredentialsProvider,
java.util.concurrent.ExecutorService executorService)
Constructs a new asynchronous client to invoke service methods on Amazon
Translate using the specified AWS account credentials provider and
executor service.
|
AmazonTranslateAsyncClient(ClientConfiguration clientConfiguration)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.Future<java.lang.Void> |
deleteTerminologyAsync(DeleteTerminologyRequest deleteTerminologyRequest)
A synchronous action that deletes a custom terminology.
|
java.util.concurrent.Future<java.lang.Void> |
deleteTerminologyAsync(DeleteTerminologyRequest deleteTerminologyRequest,
AsyncHandler<DeleteTerminologyRequest,java.lang.Void> asyncHandler)
A synchronous action that deletes a custom terminology.
|
java.util.concurrent.ExecutorService |
getExecutorService()
Returns the executor service used by this async client to execute
requests.
|
java.util.concurrent.Future<GetTerminologyResult> |
getTerminologyAsync(GetTerminologyRequest getTerminologyRequest)
Retrieves a custom terminology.
|
java.util.concurrent.Future<GetTerminologyResult> |
getTerminologyAsync(GetTerminologyRequest getTerminologyRequest,
AsyncHandler<GetTerminologyRequest,GetTerminologyResult> asyncHandler)
Retrieves a custom terminology.
|
java.util.concurrent.Future<ImportTerminologyResult> |
importTerminologyAsync(ImportTerminologyRequest importTerminologyRequest)
Creates or updates a custom terminology, depending on whether or not one
already exists for the given terminology name.
|
java.util.concurrent.Future<ImportTerminologyResult> |
importTerminologyAsync(ImportTerminologyRequest importTerminologyRequest,
AsyncHandler<ImportTerminologyRequest,ImportTerminologyResult> asyncHandler)
Creates or updates a custom terminology, depending on whether or not one
already exists for the given terminology name.
|
java.util.concurrent.Future<ListTerminologiesResult> |
listTerminologiesAsync(ListTerminologiesRequest listTerminologiesRequest)
Provides a list of custom terminologies associated with your account.
|
java.util.concurrent.Future<ListTerminologiesResult> |
listTerminologiesAsync(ListTerminologiesRequest listTerminologiesRequest,
AsyncHandler<ListTerminologiesRequest,ListTerminologiesResult> asyncHandler)
Provides a list of custom terminologies associated with your account.
|
void |
shutdown()
Shuts down the client, releasing all managed resources.
|
java.util.concurrent.Future<TranslateTextResult> |
translateTextAsync(TranslateTextRequest translateTextRequest)
Translates input text from the source language to the target language.
|
java.util.concurrent.Future<TranslateTextResult> |
translateTextAsync(TranslateTextRequest translateTextRequest,
AsyncHandler<TranslateTextRequest,TranslateTextResult> asyncHandler)
Translates input text from the source language to the target language.
|
deleteTerminology, getCachedResponseMetadata, getTerminology, importTerminology, listTerminologies, translateText
addRequestHandler, addRequestHandler, getEndpoint, getEndpointPrefix, getRegions, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerRegionOverride, getTimeOffset, removeRequestHandler, removeRequestHandler, setConfiguration, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deleteTerminology, getCachedResponseMetadata, getTerminology, importTerminology, listTerminologies, setEndpoint, setRegion, translateText
@Deprecated public AmazonTranslateAsyncClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
@Deprecated public AmazonTranslateAsyncClient(ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling
how this client connects to Amazon Translate (ex: proxy
settings, retry counts, etc.).DefaultAWSCredentialsProviderChain
public AmazonTranslateAsyncClient(AWSCredentials awsCredentials)
All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.
awsCredentials
- The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.public AmazonTranslateAsyncClient(AWSCredentials awsCredentials, java.util.concurrent.ExecutorService executorService)
All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.
awsCredentials
- The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.executorService
- The executor service by which all asynchronous
requests will be executed.public AmazonTranslateAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, java.util.concurrent.ExecutorService executorService)
All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.
awsCredentials
- The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.clientConfiguration
- Client configuration options (ex: max retry
limit, proxy settings, etc).executorService
- The executor service by which all asynchronous
requests will be executed.public AmazonTranslateAsyncClient(AWSCredentialsProvider awsCredentialsProvider)
All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.public AmazonTranslateAsyncClient(AWSCredentialsProvider awsCredentialsProvider, java.util.concurrent.ExecutorService executorService)
All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.executorService
- The executor service by which all asynchronous
requests will be executed.public AmazonTranslateAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- Client configuration options (ex: max retry
limit, proxy settings, etc).public AmazonTranslateAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, java.util.concurrent.ExecutorService executorService)
All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- Client configuration options (ex: max retry
limit, proxy settings, etc).executorService
- The executor service by which all asynchronous
requests will be executed.public java.util.concurrent.ExecutorService getExecutorService()
public void shutdown()
shutdown
in interface AmazonTranslate
shutdown
in class AmazonWebServiceClient
public java.util.concurrent.Future<java.lang.Void> deleteTerminologyAsync(DeleteTerminologyRequest deleteTerminologyRequest) throws AmazonServiceException, AmazonClientException
A synchronous action that deletes a custom terminology.
deleteTerminologyAsync
in interface AmazonTranslateAsync
deleteTerminologyRequest
- ResourceNotFoundException
TooManyRequestsException
InternalServerException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public java.util.concurrent.Future<java.lang.Void> deleteTerminologyAsync(DeleteTerminologyRequest deleteTerminologyRequest, AsyncHandler<DeleteTerminologyRequest,java.lang.Void> asyncHandler) throws AmazonServiceException, AmazonClientException
A synchronous action that deletes a custom terminology.
deleteTerminologyAsync
in interface AmazonTranslateAsync
deleteTerminologyRequest
- asyncHandler
- Asynchronous callback handler for events in the
life-cycle of the request. Users could provide the
implementation of the four callback methods in this interface
to process the operation result or handle the exception.ResourceNotFoundException
TooManyRequestsException
InternalServerException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public java.util.concurrent.Future<GetTerminologyResult> getTerminologyAsync(GetTerminologyRequest getTerminologyRequest) throws AmazonServiceException, AmazonClientException
Retrieves a custom terminology.
getTerminologyAsync
in interface AmazonTranslateAsync
getTerminologyRequest
- ResourceNotFoundException
InvalidParameterValueException
TooManyRequestsException
InternalServerException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public java.util.concurrent.Future<GetTerminologyResult> getTerminologyAsync(GetTerminologyRequest getTerminologyRequest, AsyncHandler<GetTerminologyRequest,GetTerminologyResult> asyncHandler) throws AmazonServiceException, AmazonClientException
Retrieves a custom terminology.
getTerminologyAsync
in interface AmazonTranslateAsync
getTerminologyRequest
- asyncHandler
- Asynchronous callback handler for events in the
life-cycle of the request. Users could provide the
implementation of the four callback methods in this interface
to process the operation result or handle the exception.ResourceNotFoundException
InvalidParameterValueException
TooManyRequestsException
InternalServerException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public java.util.concurrent.Future<ImportTerminologyResult> importTerminologyAsync(ImportTerminologyRequest importTerminologyRequest) throws AmazonServiceException, AmazonClientException
Creates or updates a custom terminology, depending on whether or not one already exists for the given terminology name. Importing a terminology with the same name as an existing one will merge the terminologies based on the chosen merge strategy. Currently, the only supported merge strategy is OVERWRITE, and so the imported terminology will overwrite an existing terminology of the same name.
If you import a terminology that overwrites an existing one, the new terminology take up to 10 minutes to fully propagate and be available for use in a translation due to cache policies with the DataPlane service that performs the translations.
importTerminologyAsync
in interface AmazonTranslateAsync
importTerminologyRequest
- InvalidParameterValueException
LimitExceededException
TooManyRequestsException
InternalServerException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public java.util.concurrent.Future<ImportTerminologyResult> importTerminologyAsync(ImportTerminologyRequest importTerminologyRequest, AsyncHandler<ImportTerminologyRequest,ImportTerminologyResult> asyncHandler) throws AmazonServiceException, AmazonClientException
Creates or updates a custom terminology, depending on whether or not one already exists for the given terminology name. Importing a terminology with the same name as an existing one will merge the terminologies based on the chosen merge strategy. Currently, the only supported merge strategy is OVERWRITE, and so the imported terminology will overwrite an existing terminology of the same name.
If you import a terminology that overwrites an existing one, the new terminology take up to 10 minutes to fully propagate and be available for use in a translation due to cache policies with the DataPlane service that performs the translations.
importTerminologyAsync
in interface AmazonTranslateAsync
importTerminologyRequest
- asyncHandler
- Asynchronous callback handler for events in the
life-cycle of the request. Users could provide the
implementation of the four callback methods in this interface
to process the operation result or handle the exception.InvalidParameterValueException
LimitExceededException
TooManyRequestsException
InternalServerException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public java.util.concurrent.Future<ListTerminologiesResult> listTerminologiesAsync(ListTerminologiesRequest listTerminologiesRequest) throws AmazonServiceException, AmazonClientException
Provides a list of custom terminologies associated with your account.
listTerminologiesAsync
in interface AmazonTranslateAsync
listTerminologiesRequest
- InvalidParameterValueException
TooManyRequestsException
InternalServerException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public java.util.concurrent.Future<ListTerminologiesResult> listTerminologiesAsync(ListTerminologiesRequest listTerminologiesRequest, AsyncHandler<ListTerminologiesRequest,ListTerminologiesResult> asyncHandler) throws AmazonServiceException, AmazonClientException
Provides a list of custom terminologies associated with your account.
listTerminologiesAsync
in interface AmazonTranslateAsync
listTerminologiesRequest
- asyncHandler
- Asynchronous callback handler for events in the
life-cycle of the request. Users could provide the
implementation of the four callback methods in this interface
to process the operation result or handle the exception.InvalidParameterValueException
TooManyRequestsException
InternalServerException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public java.util.concurrent.Future<TranslateTextResult> translateTextAsync(TranslateTextRequest translateTextRequest) throws AmazonServiceException, AmazonClientException
Translates input text from the source language to the target language. It is not necessary to use English (en) as either the source or the target language but not all language combinations are supported by Amazon Translate. For more information, see Supported Language Pairs.
Arabic (ar)
Chinese (Simplified) (zh)
Chinese (Traditional) (zh-TW)
Czech (cs)
Danish (da)
Dutch (nl)
English (en)
Finnish (fi)
French (fr)
German (de)
Hebrew (he)
Indonesian (id)
Italian (it)
Japanese (ja)
Korean (ko)
Polish (pl)
Portuguese (pt)
Russian (ru)
Spanish (es)
Swedish (sv)
Turkish (tr)
To have Amazon Translate determine the source language of your text, you
can specify auto
in the SourceLanguageCode
field. If you specify auto
, Amazon Translate will call
Amazon Comprehend to determine the source language.
translateTextAsync
in interface AmazonTranslateAsync
translateTextRequest
- InvalidRequestException
TextSizeLimitExceededException
TooManyRequestsException
UnsupportedLanguagePairException
DetectedLanguageLowConfidenceException
ResourceNotFoundException
InternalServerException
ServiceUnavailableException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public java.util.concurrent.Future<TranslateTextResult> translateTextAsync(TranslateTextRequest translateTextRequest, AsyncHandler<TranslateTextRequest,TranslateTextResult> asyncHandler) throws AmazonServiceException, AmazonClientException
Translates input text from the source language to the target language. It is not necessary to use English (en) as either the source or the target language but not all language combinations are supported by Amazon Translate. For more information, see Supported Language Pairs.
Arabic (ar)
Chinese (Simplified) (zh)
Chinese (Traditional) (zh-TW)
Czech (cs)
Danish (da)
Dutch (nl)
English (en)
Finnish (fi)
French (fr)
German (de)
Hebrew (he)
Indonesian (id)
Italian (it)
Japanese (ja)
Korean (ko)
Polish (pl)
Portuguese (pt)
Russian (ru)
Spanish (es)
Swedish (sv)
Turkish (tr)
To have Amazon Translate determine the source language of your text, you
can specify auto
in the SourceLanguageCode
field. If you specify auto
, Amazon Translate will call
Amazon Comprehend to determine the source language.
translateTextAsync
in interface AmazonTranslateAsync
translateTextRequest
- asyncHandler
- Asynchronous callback handler for events in the
life-cycle of the request. Users could provide the
implementation of the four callback methods in this interface
to process the operation result or handle the exception.InvalidRequestException
TextSizeLimitExceededException
TooManyRequestsException
UnsupportedLanguagePairException
DetectedLanguageLowConfidenceException
ResourceNotFoundException
InternalServerException
ServiceUnavailableException
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.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.