Example #1
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#getAllAttributes(java
   * .lang.String)
   */
  @Transactional(readOnly = true)
  public Map<String, UserAttribute> getAllAttributes(String userId) {
    Map<String, UserAttribute> attrMap = new HashMap<String, UserAttribute>();

    if (userId == null) {
      throw new NullPointerException("userId is null");
    }

    UserEntity usrEntity = userDao.findById(userId);

    if (usrEntity == null) return null;

    List<UserAttributeEntity> attrList = userAttributeDao.findUserAttributes(userId);

    if (attrList == null || attrList.size() == 0) return null;

    // migrate to a Map for the User object
    if (attrList != null && !attrList.isEmpty()) {
      int size = attrList.size();
      for (int i = 0; i < size; i++) {
        UserAttributeEntity attr = attrList.get(i);
        attrMap.put(attr.getName(), new UserAttribute(attr));
      }
    }

    return attrMap;
  }
Example #2
0
 @Override
 public List<User> getAllUsers() {
   List<ReconcileUserEntity> uL = userDao.findAllUsers();
   if (uL == null) return null;
   List<User> result = new ArrayList<User>();
   for (ReconcileUserEntity uWE : uL) {
     result.add(new User(uWE));
   }
   return result;
 }
Example #3
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#getAllNotes(java.lang
   * .String)
   */
  @Transactional(readOnly = true)
  public List<UserNote> getAllNotes(String userId) {

    if (userId == null) {
      throw new NullPointerException("userId is null");
    }
    List<UserNoteEntity> noteEntityList = userNoteDao.findUserNotes(userId);
    if (noteEntityList == null || noteEntityList.isEmpty()) {
      return null;
    }

    return userNoteDozerConverter.convertToDTOList(noteEntityList, false);
  }
Example #4
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.openiam.idm.srvc.user.service.UserDataService#getSupervisors(java
  * .lang.String)
  */
 @Transactional(readOnly = true)
 public List<Supervisor> getSupervisors(String employeeId) {
   if (employeeId == null) throw new NullPointerException("employeeId is null");
   List<SupervisorEntity> superVisList = supervisorDao.findSupervisors(employeeId);
   List<Supervisor> supervisorList = new LinkedList<Supervisor>();
   for (SupervisorEntity sup : superVisList) {
     org.hibernate.Hibernate.initialize(sup.getSupervisor().getPhones());
     org.hibernate.Hibernate.initialize(sup.getSupervisor().getEmailAddresses());
     org.hibernate.Hibernate.initialize(sup.getSupervisor().getAddresses());
     org.hibernate.Hibernate.initialize(sup.getSupervisor().getUserAttributes());
     supervisorList.add(supervisorDozerConverter.convertToDTO(sup, true));
   }
   return supervisorList;
 }
Example #5
0
  @Transactional(readOnly = true)
  public List<UserAttribute> getUserAsAttributeList(
      String principalName, List<String> attributeList) {

    List<UserAttribute> attrList = new ArrayList<UserAttribute>();

    User u =
        getUserByPrincipal(
            sysConfiguration.getDefaultSecurityDomain(),
            principalName,
            sysConfiguration.getDefaultManagedSysId(),
            false);
    if (u == null) {
      return null;
    }
    UserAttribute atr = new UserAttribute("EMAIL", u.getEmail());
    attrList.add(atr);

    return attrList;
  }