{
SwapCNamesContext context = SwapCNamesContextBuilder.swapCNamesContext()//
.withSourceEnvironmentId(newEnvironmentId)//
.withDestinationEnvironmentId(curEnvironmentId)//
.build();
SwapCNamesCommand command = new SwapCNamesCommand(this);
command.execute(context);
}
{
WaitForEnvironmentContext context = new WaitForEnvironmentContextBuilder()
.withApplicationName(applicationName)//
.withStatusToWaitFor("Ready")//
.withEnvironmentId(newEnvironmentId)//
.withTimeoutMins(timeoutMins)//
.withDomainToWaitFor(cnamePrefix).build();
WaitForEnvironmentCommand command = new WaitForEnvironmentCommand(this);
command.execute(context);
}
}