String msg = "Error in getting the tenant manager. " +
"The realm service is not available.";
log.error(msg);
return new ResponseTarget(context, new EmptyResponseContext(400, msg));
}
TenantManager tenantManager =
RegistryContext.getBaseInstance().getRealmService().
getTenantManager();
try {
calledTenantId = tenantManager.getTenantId(tenantDomain);
} catch (org.wso2.carbon.user.api.UserStoreException e) {
String msg =
"Error in converting tenant domain to the id for tenant domain: " +
tenantDomain + ".";
log.error(msg, e);
return new ResponseTarget(context, new EmptyResponseContext(400, msg));
}
try {
if (!tenantManager.isTenantActive(calledTenantId)) {
// the tenant is not active.
String msg =
"The tenant is not active. tenant domain: " + tenantDomain +
".";
log.error(msg);