26 |
import dk.thoerup.circuitbreaker.CircuitBreakerException; |
import dk.thoerup.circuitbreaker.CircuitBreakerException; |
27 |
import dk.thoerup.traininfoservice.StationDAO; |
import dk.thoerup.traininfoservice.StationDAO; |
28 |
import dk.thoerup.traininfoservice.Statistics; |
import dk.thoerup.traininfoservice.Statistics; |
29 |
|
import dk.thoerup.traininfoservice.banedk.DepartureFetcher.FetchTrainType; |
30 |
|
|
31 |
/** |
/** |
32 |
* Servlet implementation class DepartureServlet |
* Servlet implementation class DepartureServlet |
88 |
int station = Integer.parseInt( req.getParameter("station") ); |
int station = Integer.parseInt( req.getParameter("station") ); |
89 |
String format = req.getParameter("format"); |
String format = req.getParameter("format"); |
90 |
|
|
91 |
DepartureBean beans; |
DepartureBean beans; |
92 |
|
|
93 |
|
DepartureFetcher.FetchTrainType type = FetchTrainType.BOTH; |
94 |
|
if ( req.getParameter("type") != null) { |
95 |
|
type = FetchTrainType.valueOf( req.getParameter("type") ); |
96 |
|
} |
97 |
|
|
98 |
try { |
try { |
99 |
beans = fetcher.cachedLookupDepartures(station, arrival); |
beans = fetcher.cachedLookupDepartures(station, arrival, type); |
100 |
beans.arrival = arrival; |
beans.arrival = arrival; |
101 |
} catch (java.io.IOException ioe) { |
} catch (java.io.IOException ioe) { |
102 |
logger.warning("Read failed, station="+station + ". " + ioe.getMessage() ); |
logger.warning("Read failed, station="+station + ". " + ioe.getMessage() ); |