Ejemplo n.º 1
0
  @Override
  public League findLeagueById(Integer leagueId) {

    logger.debug("In findLeagueById");

    return leagueDao.findLeagueById(leagueId);
  }
Ejemplo n.º 2
0
  @Override
  public Collection<League> retrieveLeaguesInheritingFromLeague(Integer leagueId) {

    logger.debug("In retrieveLeaguesInheritingFromLeague");

    return leagueDao.retrieveLeaguesInheritingFromLeague(leagueId);
  }
Ejemplo n.º 3
0
  @Override
  public Collection<League> retrievePublicLeagues() {

    logger.debug("In retrievePublicLeagues");

    Collection<League> publicLeagues = leagueDao.retrievePublicLeagues();

    return publicLeagues;
  }
Ejemplo n.º 4
0
  @Override
  public Collection<League> retrievePublicLeaguesAvailableForUser(Integer userId) {

    logger.debug("In retrievePublicLeaguesAvailableForUser");

    Collection<League> result = new HashSet<>();

    Collection<League> publicLeagues = leagueDao.retrievePublicLeagues();

    User user = this.userService.findUserById(userId);

    for (League publicLeague : publicLeagues) {

      if (!user.isInvolvedInLeague(publicLeague.getId())) {

        result.add(publicLeague);
      }
    }

    return result;
  }