public void setProperty(User user, String name, Object propertyValue) throws IdentityException, IllegalArgumentException
{
if (log.isDebugEnabled()) log.debug("setProperty: " + name + "/" + propertyValue);
try
{
PropertyInfo property = getProfileInfo().getPropertyInfo(name);
if (property == null)
{
throw new IdentityException("Such property name is not supported: " + name);
}
if (user instanceof CachedUserImpl)
{
user = obtainUser(user);
}
if (property.isMappedLDAP() && isLDAPSupported() && user instanceof LDAPUserImpl)
{
log.debug("Delegating to LDAP module");
getLDAPModule().setProperty(user, name, propertyValue);
return;
}
else if (property.isMappedDB())
{
log.debug("Delegating to DB module");
getDBModule().setProperty(user, name, propertyValue);
fireUserProfileChangedEvent(user.getId(), user.getUserName(), name, propertyValue);