The Amazon SDK for Java 1.x has entered maintenance mode as of July 31, 2024,
and will reach end-of-support
Registering Domains
Every workflow and activity in Amazon SWF
-
Create a new RegisterDomainRequest object, providing it with at least the domain name and workflow execution retention period (these parameters are both required).
-
Call the AmazonSimpleWorkflowClient.registerDomain
method with the RegisterDomainRequest object. -
Catch the DomainAlreadyExistsException if the domain you’re requesting already exists (in which case, no action is usually required).
The following code demonstrates this procedure:
public void register_swf_domain(AmazonSimpleWorkflowClient swf, String name) { RegisterDomainRequest request = new RegisterDomainRequest().withName(name); request.setWorkflowExecutionRetentionPeriodInDays("10"); try { swf.registerDomain(request); } catch (DomainAlreadyExistsException e) { System.out.println("Domain already exists!"); } }