Seleziona le tue preferenze relative ai cookie

Utilizziamo cookie essenziali e strumenti simili necessari per fornire il nostro sito e i nostri servizi. Utilizziamo i cookie prestazionali per raccogliere statistiche anonime in modo da poter capire come i clienti utilizzano il nostro sito e apportare miglioramenti. I cookie essenziali non possono essere disattivati, ma puoi fare clic su \"Personalizza\" o \"Rifiuta\" per rifiutare i cookie prestazionali.

Se sei d'accordo, AWS e le terze parti approvate utilizzeranno i cookie anche per fornire utili funzionalità del sito, ricordare le tue preferenze e visualizzare contenuti pertinenti, inclusa la pubblicità pertinente. Per continuare senza accettare questi cookie, fai clic su \"Continua\" o \"Rifiuta\". Per effettuare scelte più dettagliate o saperne di più, fai clic su \"Personalizza\".

Use GetMatchingJob with an AWS SDK - AWS SDK Code Examples
Questa pagina non è tradotta nella tua lingua. Richiedi traduzione

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use GetMatchingJob with an AWS SDK

The following code example shows how to use GetMatchingJob.

Java
SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/** * Asynchronously retrieves a matching job based on the provided job ID and workflow name. * * @param jobId the ID of the job to retrieve * @param workflowName the name of the workflow associated with the job * @return a {@link CompletableFuture} that completes when the job information is available or an exception occurs */ public CompletableFuture<GetMatchingJobResponse> getMatchingJobAsync(String jobId, String workflowName) { GetMatchingJobRequest request = GetMatchingJobRequest.builder() .jobId(jobId) .workflowName(workflowName) .build(); return getResolutionAsyncClient().getMatchingJob(request) .whenComplete((response, exception) -> { if (response != null) { // Successfully fetched the matching job details, log the job status. logger.info("Job status: " + response.status()); logger.info("Job details: " + response.toString()); } else { if (exception == null) { throw new CompletionException("An unknown error occurred while fetching the matching job.", null); } Throwable cause = exception.getCause(); if (cause instanceof ResourceNotFoundException) { throw new CompletionException("The requested job could not be found.", cause); } // Wrap other exceptions in a CompletionException with the message. throw new CompletionException("Error fetching matching job: " + exception.getMessage(), exception); } }); }
  • For API details, see GetMatchingJob in AWS SDK for Java 2.x API Reference.

SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/** * Asynchronously retrieves a matching job based on the provided job ID and workflow name. * * @param jobId the ID of the job to retrieve * @param workflowName the name of the workflow associated with the job * @return a {@link CompletableFuture} that completes when the job information is available or an exception occurs */ public CompletableFuture<GetMatchingJobResponse> getMatchingJobAsync(String jobId, String workflowName) { GetMatchingJobRequest request = GetMatchingJobRequest.builder() .jobId(jobId) .workflowName(workflowName) .build(); return getResolutionAsyncClient().getMatchingJob(request) .whenComplete((response, exception) -> { if (response != null) { // Successfully fetched the matching job details, log the job status. logger.info("Job status: " + response.status()); logger.info("Job details: " + response.toString()); } else { if (exception == null) { throw new CompletionException("An unknown error occurred while fetching the matching job.", null); } Throwable cause = exception.getCause(); if (cause instanceof ResourceNotFoundException) { throw new CompletionException("The requested job could not be found.", cause); } // Wrap other exceptions in a CompletionException with the message. throw new CompletionException("Error fetching matching job: " + exception.getMessage(), exception); } }); }
  • For API details, see GetMatchingJob in AWS SDK for Java 2.x API Reference.

PrivacyCondizioni del sitoPreferenze cookie
© 2025, Amazon Web Services, Inc. o società affiliate. Tutti i diritti riservati.