/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 837 by torben, Fri Jun 11 17:16:06 2010 UTC revision 970 by torben, Fri Jul 9 21:23:48 2010 UTC
# Line 76  public class TimetableFetcher { Line 76  public class TimetableFetcher {
76                                    
77                  if (id == null) {                  if (id == null) {
78                          try {                          try {
79                                  id = stationDao.getBySpecificName(name);                                  id = stationDao.getIdByName(name);
80                                  stationCache.put(name, id);                                  stationCache.put(name, id);
81                          } catch (SQLException e) {                          } catch (SQLException e) {
82                                  logger.log(Level.SEVERE, "getStationId failed", e);                                  logger.log(Level.SEVERE, "getStationId failed", e);
# Line 90  public class TimetableFetcher { Line 90  public class TimetableFetcher {
90          List<TimetableBean> lookupTimetableRealSite(String trainID, String type) throws Exception {                      List<TimetableBean> lookupTimetableRealSite(String trainID, String type) throws Exception {            
91                  List<TimetableBean> timetableList = new ArrayList<TimetableBean>();                  List<TimetableBean> timetableList = new ArrayList<TimetableBean>();
92                                    
93                  String url = "http://www.bane.dk/visRute.asp?W=" + type + "&TogNr=" + trainID + "&artikelId=4276";                  //String url = "http://www.bane.dk/visRute.asp?W=" + type + "&TogNr=" + trainID + "&artikelId=4276";
94                                                    String url = "http://trafikinfo.bane.dk/TrafikInformation/Ruteplan/" + trainID;                
95    
96              final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3);              final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3);
97              webClient.setTimeout(2500);              webClient.setTimeout(2500);
# Line 100  public class TimetableFetcher { Line 100  public class TimetableFetcher {
100              webClient.setCssEnabled(false);              webClient.setCssEnabled(false);
101                            
102                            
103              BanedkInvocation wrapper = new BanedkInvocation(webClient, url);              HtmlunitInvocation wrapper = new HtmlunitInvocation(webClient, url);
104              CircuitBreaker breaker = CircuitBreakerManager.getManager().getCircuitBreaker("banedk");              CircuitBreaker breaker = CircuitBreakerManager.getManager().getCircuitBreaker("banedk");
105                            
106              HtmlPage page = (HtmlPage) breaker.invoke(wrapper);              HtmlPage page = (HtmlPage) breaker.invoke(wrapper);

Legend:
Removed from v.837  
changed lines
  Added in v.970

  ViewVC Help
Powered by ViewVC 1.1.20