--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java 2009/10/22 06:04:45 468 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java 2010/02/05 13:57:39 584 @@ -26,11 +26,19 @@ } - Map> cache = new TimeoutMap>(120 * 1000); + Map> cache; Logger logger = Logger.getLogger(TimetableFetcher.class.getName()); + private boolean useTempSite; + + public TimetableFetcher(boolean tmpSite, int cacheTimeout) { + useTempSite = tmpSite; + + cache = new TimeoutMap>(cacheTimeout); + } + List cachedLookupTimetable(String trainID, String type) throws Exception { String key = trainID+type; @@ -44,8 +52,16 @@ } return list; } + + List lookupTimetable(String trainID, String type) throws Exception { + if (useTempSite == false ){ + return lookupTimetableRealSite(trainID, type); + } else { + return new ArrayList(); // no timetable data on temp site + } + } - List lookupTimetable(String trainID, String type) throws Exception { + List lookupTimetableRealSite(String trainID, String type) throws Exception { List timetableList = new ArrayList(); String url = "http://www.bane.dk/visRute.asp?W=" + type + "&TogNr=" + trainID + "&artikelId=4276";