}
resource.setProperty(email, "true");
// now we will really update the tenant email
Tenant tenant;
try {
tenant = tenantManager.getTenant(tenantId);
} catch (UserStoreException e) {
String msg =
"Error in retrieving the tenant information for the tenant id: " + tenantId +
".";
log.error(msg, e);
throw new RegistryException(msg, e);
}
tenant.setEmail(email);
try {
tenantManager.updateTenant(tenant);
} catch (UserStoreException e) {
String msg =
"Error in updating the tenant information for the tenant id: " + tenantId + ".";
log.error(msg, e);
throw new RegistryException(msg, e);
}
// activate the tenant on successful validation of the email, if it is not already activated.
if ("false".equals(resource.getProperty(StratosConstants.IS_EMAIL_VALIDATED))) {
tenantManager.activateTenant(tenantId);
// set the registry flag
resource.editPropertyValue(StratosConstants.IS_EMAIL_VALIDATED, "false", "true");
if (log.isDebugEnabled()) {
log.debug("Tenant : " + tenantId + " is activated after validating the " +
"email of the tenant admin.");
}
// send the notification message to the tenant admin
TenantMgtUtil.notifyTenantCreation(tenant.getDomain(),
resource.getProperty(StratosConstants.TENANT_ADMIN),
tenant.getEmail());
// send the notification message to the super tenant
TenantMgtUtil.notifyTenantActivationToSuperAdmin(tenant.getDomain(),
resource.getProperty(StratosConstants.TENANT_ADMIN),
tenant.getEmail());
}
// update the registry
superTenantSystemRegistry.put(emailVerificationPath, resource);