Example usage for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflowClient listDomains

List of usage examples for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflowClient listDomains

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflowClient listDomains.

Prototype

@Override
public DomainInfos listDomains(ListDomainsRequest request) 

Source Link

Document

Returns the list of domains registered in the account.

Usage

From source file:org.wildfly.camel.test.common.aws.SWFUtils.java

License:Apache License

public static void registerDomain(AmazonSimpleWorkflowClient swfClient) {
    boolean registerDomain = true;
    ListDomainsRequest listreq = new ListDomainsRequest().withRegistrationStatus("REGISTERED");
    for (DomainInfo domain : swfClient.listDomains(listreq).getDomainInfos()) {
        registerDomain &= !DOMAIN.equals(domain.getName());
    }/*from w w w. ja  v a  2  s.  c  o  m*/
    if (registerDomain) {
        RegisterDomainRequest domain = new RegisterDomainRequest()
                .withWorkflowExecutionRetentionPeriodInDays("NONE").withName(DOMAIN);
        swfClient.registerDomain(domain);
    }
}