mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
NVBW: Update API base.
This commit is contained in:
parent
56311f52db
commit
14d11b1a4d
1 changed files with 3 additions and 30 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010-2015 the original author or authors.
|
* Copyright the original author or authors.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,19 +17,13 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Line;
|
import de.schildbach.pte.dto.Line;
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.Product;
|
import de.schildbach.pte.dto.Product;
|
||||||
import de.schildbach.pte.dto.QueryTripsContext;
|
|
||||||
import de.schildbach.pte.dto.QueryTripsResult;
|
|
||||||
|
|
||||||
import okhttp3.HttpUrl;
|
import okhttp3.HttpUrl;
|
||||||
|
|
||||||
|
@ -38,20 +32,12 @@ import okhttp3.HttpUrl;
|
||||||
*/
|
*/
|
||||||
public class NvbwProvider extends AbstractEfaProvider {
|
public class NvbwProvider extends AbstractEfaProvider {
|
||||||
// no intermeditate stops
|
// no intermeditate stops
|
||||||
private final static HttpUrl API_BASE = HttpUrl.parse("https://www.efa-bw.de/nvbw/");
|
private final static HttpUrl API_BASE = HttpUrl.parse("https://www.efa-bw.de/nvbw3L/");
|
||||||
private final static HttpUrl API_BASE_MOBILE = HttpUrl.parse("https://www.efa-bw.de/android/");
|
|
||||||
// http://efa2.naldo.de/naldo/
|
// http://efa2.naldo.de/naldo/
|
||||||
|
|
||||||
public NvbwProvider() {
|
public NvbwProvider() {
|
||||||
super(NetworkId.NVBW, API_BASE.newBuilder().addPathSegment(DEFAULT_DEPARTURE_MONITOR_ENDPOINT).build(),
|
super(NetworkId.NVBW, API_BASE);
|
||||||
API_BASE_MOBILE.newBuilder().addPathSegment(DEFAULT_TRIP_ENDPOINT).build(),
|
|
||||||
API_BASE.newBuilder().addPathSegment(DEFAULT_STOPFINDER_ENDPOINT).build(),
|
|
||||||
API_BASE.newBuilder().addPathSegment(DEFAULT_COORD_ENDPOINT).build());
|
|
||||||
|
|
||||||
setIncludeRegionId(false);
|
setIncludeRegionId(false);
|
||||||
setUseRouteIndexAsTripId(false);
|
|
||||||
setNumTripsRequested(12);
|
|
||||||
setSessionCookieName("EFABWLB");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Pattern P_LINE_S_AVG_VBK = Pattern.compile("(S\\d+) \\((?:AVG|VBK)\\)");
|
private static final Pattern P_LINE_S_AVG_VBK = Pattern.compile("(S\\d+) \\((?:AVG|VBK)\\)");
|
||||||
|
@ -95,17 +81,4 @@ public class NvbwProvider extends AbstractEfaProvider {
|
||||||
|
|
||||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public QueryTripsResult queryTrips(final Location from, final @Nullable Location via, final Location to,
|
|
||||||
final Date date, final boolean dep, final @Nullable Set<Product> products,
|
|
||||||
final @Nullable Optimize optimize, final @Nullable WalkSpeed walkSpeed,
|
|
||||||
final @Nullable Accessibility accessibility, final @Nullable Set<Option> options) throws IOException {
|
|
||||||
return queryTripsMobile(from, via, to, date, dep, products, optimize, walkSpeed, accessibility, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException {
|
|
||||||
return queryMoreTripsMobile(contextObj, later);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue