/* * (non-Javadoc) * * @see * org.openiam.idm.srvc.user.service.UserDataService#updateAttribute(org * .openiam.idm.srvc.user.dto.UserAttribute) */ @Transactional public void updateAttribute(UserAttribute attribute) { if (attribute == null) throw new NullPointerException("Attribute can not be null"); if (StringUtils.isEmpty(attribute.getUserId())) { throw new NullPointerException("User has not been associated with this attribute."); } UserEntity userEntity = userDao.findById(attribute.getUserId()); userAttributeDao.update(userAttributeDozerConverter.convertToEntity(attribute, true)); // this.userMsgProducer.sendMessage(attribute.getUserId(),"UPDATE"); }
/* * (non-Javadoc) * * @see * org.openiam.idm.srvc.user.service.UserDataService#removeAttribute(org * .openiam.idm.srvc.user.dto.UserAttribute) */ @Transactional public void removeAttribute(UserAttribute attr) { if (attr == null) { throw new NullPointerException("attr is null"); } if (StringUtils.isEmpty(attr.getId())) { throw new NullPointerException("attrId is null"); } UserEntity userEntity = userDao.findById(attr.getUserId()); userAttributeDao.remove(userAttributeDozerConverter.convertToEntity(attr, true)); // this.userMsgProducer.sendMessage(attr.getUserId(),"DELETE"); }
/* * (non-Javadoc) * * @see * org.openiam.idm.srvc.user.service.UserDataService#addAttribute(org.openiam * .idm.srvc.user.dto.UserAttribute) */ @Transactional public UserAttribute addAttribute(UserAttribute attribute) { if (attribute == null) throw new NullPointerException("Attribute can not be null"); if (StringUtils.isEmpty(attribute.getUserId())) { throw new NullPointerException("User has not been associated with this attribute."); } UserAttributeEntity attributeEntity = userAttributeDozerConverter.convertToEntity(attribute, true); userAttributeDao.add(attributeEntity); // this.userMsgProducer.sendMessage(attribute.getUserId(),"ADD"); return userAttributeDozerConverter.convertToDTO(attributeEntity, true); }