public Collection<UserAuthenticationEntity> getUserAuthenticationEntities(String username, UserAuthenticationType authenticationType) {
    UserEntity userEntity;

    if (!StringUtils.isEmpty(username)) {
      userEntity = userDAO.findUserByName(username);

      if (userEntity == null) {
        // The requested user was not found, return null
        return null;
      }
    } else {
      // The request is for all users
      userEntity = null;
    }

    return getUserAuthenticationEntities(userEntity, authenticationType);
  }
Gets the collection of {@link UserAuthenticationEntity}s for a given user.

@param username           the username of a user; if null assumes all users
@param authenticationType the authentication type, if null assumes all
@return a collection of the requested {@link UserAuthenticationEntity}s
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java