Menu
AWS SDK for Java
Developer Guide

Listing Domains

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

To list Amazon SWF domains

  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:

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