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

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

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

revision 1059 by torben, Tue Sep 14 17:01:24 2010 UTC revision 1060 by torben, Thu Sep 16 13:32:10 2010 UTC
# Line 2  package dk.thoerup.traininfoservice.bane Line 2  package dk.thoerup.traininfoservice.bane
2    
3    
4  import java.net.URL;  import java.net.URL;
   
5  import java.util.ArrayList;  import java.util.ArrayList;
6  import java.util.List;  import java.util.List;
7  import java.util.Map;  import java.util.Map;
8  import java.util.logging.Logger;  import java.util.logging.Logger;
9    
   
10  import org.jsoup.nodes.Document;  import org.jsoup.nodes.Document;
11  import org.jsoup.nodes.Element;  import org.jsoup.nodes.Element;
12  import org.jsoup.select.Elements;  import org.jsoup.select.Elements;
13    import org.simpleframework.xml.ElementList;
14    import org.simpleframework.xml.Root;
15    
16  import dk.thoerup.circuitbreaker.CircuitBreaker;  import dk.thoerup.circuitbreaker.CircuitBreaker;
17  import dk.thoerup.circuitbreaker.CircuitBreakerManager;  import dk.thoerup.circuitbreaker.CircuitBreakerManager;
 import dk.thoerup.traininfoservice.StationBean;  
18  import dk.thoerup.traininfoservice.StationDAO;  import dk.thoerup.traininfoservice.StationDAO;
19  import dk.thoerup.traininfoservice.Statistics;  import dk.thoerup.traininfoservice.Statistics;
20    import dk.thoerup.traininfoservice.StationBean.StationEntry;
21    
22    
23    
24  public class MetroFetcher {  public class MetroFetcher {
25            @Root(name="entry")
26          public static class MetroEntry {          public static class MetroEntry {
27                    
28                    @org.simpleframework.xml.Element
29                  String metro;                  String metro;
30                    
31                    @org.simpleframework.xml.Element
32                  String destination;                  String destination;
33                    
34                    @org.simpleframework.xml.Element
35                  String minutes;                          String minutes;        
36          }          }
37                    
38            @Root(name="metrodepatures")
39          public static class MetroBean {          public static class MetroBean {
40                    
41                    @org.simpleframework.xml.Element
42                  String head;                  String head;
                 String operationInfo; //driftsinfo  
                 String plan; // koereplan  
43                                    
44                    
45                    @org.simpleframework.xml.Element(name="operations")
46                    String operationInfo; //driftsinfo      
47                    
48                    @ElementList
49                  List<MetroEntry> entries = new ArrayList<MetroEntry>();                  List<MetroEntry> entries = new ArrayList<MetroEntry>();
50                    
51                    @org.simpleframework.xml.Element
52                    String plan; // koereplan
53          }          }
54                    
55          Logger logger = Logger.getLogger(MetroFetcher.class.getName());          Logger logger = Logger.getLogger(MetroFetcher.class.getName());
# Line 58  public class MetroFetcher { Line 74  public class MetroFetcher {
74    
75          public MetroBean lookupMetroDepartures(int stationID) throws Exception {          public MetroBean lookupMetroDepartures(int stationID) throws Exception {
76                                    
77                  StationBean station = stationDAO.getById(stationID) ;                  StationEntry station = stationDAO.getById(stationID) ;
78                                                    
79                                    
80                  URL url = new URL("http://www.m.dk/layouts/Metro/Widgets/MetroWidget.ashx?StationId=" + station.getMetro() + "&Congestion=true&Application=MyMetro&Expiration=true");                  URL url = new URL("http://www.m.dk/layouts/Metro/Widgets/MetroWidget.ashx?StationId=" + station.getMetro() + "&Congestion=true&Application=MyMetro&Expiration=true");

Legend:
Removed from v.1059  
changed lines
  Added in v.1060

  ViewVC Help
Powered by ViewVC 1.1.20