Listing Domains - Amazon SDK for Java 1.x
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

The Amazon SDK for Java 1.x has entered maintenance mode as of July 31, 2024, and will reach end-of-support on December 31, 2025. We recommend that you migrate to the Amazon SDK for Java 2.x to continue receiving new features, availability improvements, and security updates.

Listing Domains

You can list the Amazon SWF domains associated with your account and Amazon region by registration type.

  1. Create a ListDomainsRequest object, and specify the registration status of the domains that you’re interested in—​this is required.

  2. Call AmazonSimpleWorkflowClient.listDomains with the ListDomainRequest object. Results are provided in a DomainInfos object.

  3. Call getDomainInfos on the returned object to get a list of DomainInfo objects.

  4. Call getName on each DomainInfo object to get its name.

The following code demonstrates this procedure:

public void list_swf_domains(AmazonSimpleWorkflowClient swf) { ListDomainsRequest request = new ListDomainsRequest(); request.setRegistrationStatus("REGISTERED"); DomainInfos domains = swf.listDomains(request); System.out.println("Current Domains:"); for (DomainInfo di : domains.getDomainInfos()) { System.out.println(" * " + di.getName()); } }