} catch (org.wso2.carbon.user.api.UserStoreException e) {
throw new RestAPIException( e);
}
StratosAdminResponse stratosAdminResponse = new StratosAdminResponse();
try {
TenantMgtUtil.deactivateTenant(tenantDomain, tenantManager, tenantId);
} catch (Exception e) {
throw new RestAPIException( e);
}
//Notify tenant deactivation all listeners
try {
TenantMgtUtil.triggerTenantDeactivation(tenantId);
} catch (StratosException e) {
String msg = "Error in notifying tenant deactivate.";
log.error(msg, e);
throw new RestAPIException(msg, e);
}
stratosAdminResponse.setMessage("Successfully deactivated tenant " + tenantDomain);
return stratosAdminResponse;
}