Is there a way to check if a domain name exists in SWF, instead of iterating the entire domain list?
Asked
Active
Viewed 591 times
1 Answers
3
If you are about to register that domain anyway in case, you could simply try to call registerDomain() and catch the DomainAlreadyExistsException:
Returned if the specified domain already exists. You will get this fault even if the existing domain is in deprecated status.
Obviously this has the side effect of actually registering the domain, if it doesn't exist yet ;)
Otherwise describeDomain() should allow a similar approach, insofar it will throw an UnknownResourceException in case of a non existing domain:
Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation. [emphasis mine]

Steffen Opel
- 63,899
- 11
- 192
- 211