User guide
For more information
For more information about how to use temporary security credentials to access AWS resources, visit
the following sections in the AWS Security Token Service User Guide:
• Creating Temporary Security Credentials
• Controlling Permissions for Temporary Security Credentials
• Requesting AWS Resources Using Temporary Security Credentials
• Activating AWS STS in a New Region
Programming Amazon SWF with the AWS SDK
for Java
This section provides information specific to programming Amazon SWF with the SDK for Java.
Topics
• Registering an Amazon SWF Domain Using the AWS SDK for Java (p. 64)
• Listing Amazon SWF Domains Using the AWS SDK for Java (p. 65)
Registering an Amazon SWF Domain Using the
AWS SDK for Java
Every workflow and activity in Amazon SWF needs a domain to run in.
To register an Amazon SWF domain
1. Create a new RegisterDomainRequest object, providing it with at least the domain name and workflow
execution retention period (these parameters are both required).
2. Call the AmazonSimpleWorkflowClient.registerDomain method with the RegisterDomainRequest
object.
3. 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!");
Version v1.0.0
64
AWS SDK for Java Developer Guide
For more information