Listing Domains - AWS SDK for Java 1.x

The AWS 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 AWS 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 AWS 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()); } }