* @return true, if the domain is available to register
* @throws Exception, if checking the existence of the tenant is failed.
*/
public static boolean isDomainNameAvailable(String tenantDomain) throws Exception {
TenantManager tenantManager = CloudCommonServiceComponent.getTenantManager();
// The registry reserved words are checked first.
if (tenantDomain.equals("atom") || tenantDomain.equals("registry")
|| tenantDomain.equals("resource")) {
String msg = "You can not use a registry reserved word:" + tenantDomain +
":as a tenant domain. Please choose a different one.";
log.error(msg);
throw new Exception(msg);
}
int tenantId;
try {
tenantId = tenantManager.getTenantId(tenantDomain);
} catch (UserStoreException e) {
String msg = "Error in getting the tenant id for the given domain " +
tenantDomain + ".";
log.error(msg);
throw new Exception(msg, e);