use of org.jivesoftware.openfire.entity.UserProperty in project Openfire by igniterealtime.
the class UserUtils method convertUserToUserEntity.
/**
* Convert user to user entity.
*
* @param user
* the user
* @return the user entity
*/
public static UserEntity convertUserToUserEntity(User user) {
UserEntity userEntity = new UserEntity(user.getUsername(), user.getName(), user.getEmail());
List<UserProperty> userProperties = new ArrayList<UserProperty>();
for (Entry<String, String> property : user.getProperties().entrySet()) {
userProperties.add(new UserProperty(property.getKey(), property.getValue()));
}
userEntity.setProperties(userProperties);
return userEntity;
}
use of org.jivesoftware.openfire.entity.UserProperty in project Openfire by igniterealtime.
the class UserServicePluginNG method addProperties.
/**
* Adds the properties.
*
* @param userEntity
* the user entity
* @throws ServiceException
* the service exception
*/
private void addProperties(UserEntity userEntity) throws ServiceException {
User user = getAndCheckUser(userEntity.getUsername());
user.getProperties().clear();
if (userEntity.getProperties() != null) {
for (UserProperty property : userEntity.getProperties()) {
user.getProperties().put(property.getKey(), property.getValue());
}
}
}
Aggregations