41 |
protected List<StationBean> getStations(HttpServletRequest req) throws SQLException { |
protected List<StationBean> getStations(HttpServletRequest req) throws SQLException { |
42 |
List<StationBean> stations = null; |
List<StationBean> stations = null; |
43 |
if (req.getParameter("latitude") != null && req.getParameter("latitude") != null) { |
if (req.getParameter("latitude") != null && req.getParameter("latitude") != null) { |
44 |
|
|
45 |
|
Statistics.getInstance().incrementStationLookupsLocation(); |
46 |
|
|
47 |
double latitude = Double.parseDouble( req.getParameter("latitude") ); |
double latitude = Double.parseDouble( req.getParameter("latitude") ); |
48 |
double longitude = Double.parseDouble( req.getParameter("longitude") ); |
double longitude = Double.parseDouble( req.getParameter("longitude") ); |
49 |
stations = stationDao.getByLocation(latitude, longitude); |
stations = stationDao.getByLocation(latitude, longitude); |
50 |
|
|
51 |
} else if (req.getParameter("name") != null) { |
} else if (req.getParameter("name") != null) { |
52 |
|
Statistics.getInstance().incrementStationLookupsName(); |
53 |
String name = req.getParameter("name").trim(); |
String name = req.getParameter("name").trim(); |
54 |
stations = stationDao.getByName(name); |
stations = stationDao.getByName(name); |
55 |
|
|
56 |
} else if (req.getParameter("list") != null) { |
} else if (req.getParameter("list") != null) { |
57 |
|
Statistics.getInstance().incrementStationLookupsFavorites(); |
58 |
String list = transformToIntList( req.getParameter("list")); |
String list = transformToIntList( req.getParameter("list")); |
59 |
stations = stationDao.getByList(list); |
stations = stationDao.getByList(list); |
60 |
} |
} |