String tenantDomain = null;
try {
tenantDomain = resolveDomainName(request.getParameter("domain"));
TenantSelfRegistrationClient selfRegistrationClient =
new TenantSelfRegistrationClient(config, session);
return selfRegistrationClient.checkDomainAvailability(tenantDomain);
} catch (Exception e) {
String msg = "Failed to check the domain availability:" + tenantDomain + ".";
log.error(msg, e);
throw new UIException(msg, e);
}