throw new Exception("Invalid data."); // obscure error message.
}
Tenant tenant = TenantMgtUtil.initializeTenant(tenantInfoBean);
TenantPersistor persistor = TenantMgtServiceComponent.getTenantPersistor();
// not validating the domain ownership, since created by super tenant
persistor.persistTenant(tenant, false, tenantInfoBean.getSuccessKey(),
tenantInfoBean.getOriginatedService());
TenantMgtUtil.addClaimsToUserStoreManager(tenant);
// For the registration validation - mail for the tenant email address
TenantMgtUtil.sendEmail(tenant, tenantInfoBean.getOriginatedService());