+ ".";
log.error(msg, e);
throw new Exception(msg, e);
}
Tenant tenant;
try {
tenant = (Tenant) tenantManager.getTenant(tenantId);
} catch (UserStoreException e) {
String msg = "Error in retrieving the tenant id for the tenant domain: " +
tenantDomain + ".";
log.error(msg, e);
throw new Exception(msg, e);
}
// filling the first and last name values
if (tenantInfoBean.getFirstname() != null &&
!tenantInfoBean.getFirstname().trim().equals("")) {
try {
CommonUtil.validateName(tenantInfoBean.getFirstname(), "First Name");
} catch (Exception e) {
String msg = "Invalid first name is provided.";
log.error(msg, e);
throw new Exception(msg, e);
}
}
if (tenantInfoBean.getLastname() != null &&
!tenantInfoBean.getLastname().trim().equals("")) {
try {
CommonUtil.validateName(tenantInfoBean.getLastname(), "Last Name");
} catch (Exception e) {
String msg = "Invalid last name is provided.";
log.error(msg, e);
throw new Exception(msg, e);
}
}
tenant.setAdminFirstName(tenantInfoBean.getFirstname());
tenant.setAdminLastName(tenantInfoBean.getLastname());
TenantMgtUtil.addClaimsToUserStoreManager(tenant);
// filling the email value
if (tenantInfoBean.getEmail() != null && !tenantInfoBean.getEmail().equals("")) {
// validate the email
try {
CommonUtil.validateEmail(tenantInfoBean.getEmail());
} catch (Exception e) {
String msg = "Invalid email is provided.";
log.error(msg, e);
throw new Exception(msg, e);
}
tenant.setEmail(tenantInfoBean.getEmail());
}
UserRealm userRealm = configSystemRegistry.getUserRealm();
try {
userStoreManager = userRealm.getUserStoreManager();