2 |
|
|
3 |
|
|
4 |
import java.net.URL; |
import java.net.URL; |
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
5 |
import java.util.Map; |
import java.util.Map; |
6 |
import java.util.logging.Logger; |
import java.util.logging.Logger; |
7 |
|
|
8 |
import org.jsoup.nodes.Document; |
import org.jsoup.nodes.Document; |
9 |
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
10 |
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
|
import org.simpleframework.xml.ElementList; |
|
|
import org.simpleframework.xml.Root; |
|
11 |
|
|
12 |
|
import dk.thoerup.android.traininfo.common.MetroBean; |
13 |
|
import dk.thoerup.android.traininfo.common.MetroBean.MetroEntry; |
14 |
|
import dk.thoerup.android.traininfo.common.StationBean.StationEntry; |
15 |
import dk.thoerup.circuitbreaker.CircuitBreaker; |
import dk.thoerup.circuitbreaker.CircuitBreaker; |
16 |
import dk.thoerup.circuitbreaker.CircuitBreakerManager; |
import dk.thoerup.circuitbreaker.CircuitBreakerManager; |
17 |
import dk.thoerup.traininfoservice.StationDAO; |
import dk.thoerup.traininfoservice.StationDAO; |
18 |
import dk.thoerup.traininfoservice.Statistics; |
import dk.thoerup.traininfoservice.Statistics; |
|
import dk.thoerup.traininfoservice.StationBean.StationEntry; |
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
public class MetroFetcher { |
public class MetroFetcher { |
|
@Root(name="entry") |
|
|
public static class MetroEntry { |
|
|
|
|
|
@org.simpleframework.xml.Element |
|
|
String metro; |
|
|
|
|
|
@org.simpleframework.xml.Element |
|
|
String destination; |
|
|
|
|
|
@org.simpleframework.xml.Element |
|
|
String minutes; |
|
|
} |
|
|
|
|
|
@Root(name="metrodepatures") |
|
|
public static class MetroBean { |
|
|
|
|
|
@org.simpleframework.xml.Element |
|
|
String head; |
|
|
|
|
|
|
|
|
@org.simpleframework.xml.Element(name="operations") |
|
|
String operationInfo; //driftsinfo |
|
|
|
|
|
@ElementList |
|
|
List<MetroEntry> entries = new ArrayList<MetroEntry>(); |
|
|
|
|
|
@org.simpleframework.xml.Element |
|
|
String plan; // koereplan |
|
|
} |
|
23 |
|
|
24 |
Logger logger = Logger.getLogger(MetroFetcher.class.getName()); |
Logger logger = Logger.getLogger(MetroFetcher.class.getName()); |
25 |
StationDAO stationDAO = new StationDAO(); |
StationDAO stationDAO = new StationDAO(); |