mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 02:59:52 +00:00
Raise default number of requested trips to 6
This commit is contained in:
parent
115ef114bd
commit
8f201d4b1f
21 changed files with 107 additions and 109 deletions
|
@ -2021,8 +2021,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String xsltTripRequestParameters(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
protected String xsltTripRequestParameters(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options)
|
|
||||||
{
|
{
|
||||||
final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMdd", Locale.US);
|
final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMdd", Locale.US);
|
||||||
final DateFormat TIME_FORMAT = new SimpleDateFormat("HHmm", Locale.US);
|
final DateFormat TIME_FORMAT = new SimpleDateFormat("HHmm", Locale.US);
|
||||||
|
@ -2045,7 +2044,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
uri.append("&itdTime=").append(ParserUtils.urlEncode(TIME_FORMAT.format(date)));
|
uri.append("&itdTime=").append(ParserUtils.urlEncode(TIME_FORMAT.format(date)));
|
||||||
uri.append("&itdTripDateTimeDepArr=").append(dep ? "dep" : "arr");
|
uri.append("&itdTripDateTimeDepArr=").append(dep ? "dep" : "arr");
|
||||||
|
|
||||||
uri.append("&calcNumberOfTrips=").append(numTrips);
|
uri.append("&calcNumberOfTrips=").append(numTripsRequested);
|
||||||
|
|
||||||
uri.append("&ptOptionsActive=1"); // enable public transport options
|
uri.append("&ptOptionsActive=1"); // enable public transport options
|
||||||
uri.append("&itOptionsActive=1"); // enable individual transport options
|
uri.append("&itOptionsActive=1"); // enable individual transport options
|
||||||
|
@ -2117,6 +2116,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
|
|
||||||
uri.append("?sessionID=").append(sessionId);
|
uri.append("?sessionID=").append(sessionId);
|
||||||
uri.append("&requestID=").append(requestId);
|
uri.append("&requestID=").append(requestId);
|
||||||
|
uri.append("&calcNumberOfTrips=").append(numTripsRequested);
|
||||||
appendCommonXsltTripRequest2Params(uri);
|
appendCommonXsltTripRequest2Params(uri);
|
||||||
|
|
||||||
return uri.toString();
|
return uri.toString();
|
||||||
|
@ -2126,15 +2126,14 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
{
|
{
|
||||||
if (useStringCoordListOutputFormat)
|
if (useStringCoordListOutputFormat)
|
||||||
uri.append("&coordListOutputFormat=STRING");
|
uri.append("&coordListOutputFormat=STRING");
|
||||||
uri.append("&calcNumberOfTrips=4");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
|
|
||||||
final String parameters = xsltTripRequestParameters(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
final String parameters = xsltTripRequestParameters(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
|
|
||||||
final StringBuilder uri = new StringBuilder(tripEndpoint);
|
final StringBuilder uri = new StringBuilder(tripEndpoint);
|
||||||
if (!httpPost)
|
if (!httpPost)
|
||||||
|
@ -2165,11 +2164,11 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
protected QueryTripsResult queryTripsMobile(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
protected QueryTripsResult queryTripsMobile(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
|
|
||||||
final String parameters = xsltTripRequestParameters(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
final String parameters = xsltTripRequestParameters(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
|
|
||||||
final StringBuilder uri = new StringBuilder(tripEndpoint);
|
final StringBuilder uri = new StringBuilder(tripEndpoint);
|
||||||
if (!httpPost)
|
if (!httpPost)
|
||||||
|
@ -2201,7 +2200,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
|
|
||||||
private static final Pattern P_SESSION_EXPIRED = Pattern.compile("Your session has expired");
|
private static final Pattern P_SESSION_EXPIRED = Pattern.compile("Your session has expired");
|
||||||
|
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
final Context context = (Context) contextObj;
|
final Context context = (Context) contextObj;
|
||||||
final String commandUri = context.context;
|
final String commandUri = context.context;
|
||||||
|
@ -2247,8 +2246,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected QueryTripsResult queryMoreTripsMobile(final QueryTripsContext contextObj, final boolean later, final int numConnections)
|
protected QueryTripsResult queryMoreTripsMobile(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
throws IOException
|
|
||||||
{
|
{
|
||||||
final Context context = (Context) contextObj;
|
final Context context = (Context) contextObj;
|
||||||
final String commandUri = context.context;
|
final String commandUri = context.context;
|
||||||
|
|
|
@ -807,15 +807,15 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsXml(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsXml(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext context, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext context, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsXml(context, later, numTrips);
|
return queryMoreTripsXml(context, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void appendTripsQueryUri(final StringBuilder uri, final Location from, final Location via, final Location to, final Date date,
|
protected final void appendTripsQueryUri(final StringBuilder uri, final Location from, final Location via, final Location to, final Date date,
|
||||||
|
@ -889,7 +889,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
uri.append("&REQ0JourneyProduct_opt3=1");
|
uri.append("&REQ0JourneyProduct_opt3=1");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final QueryTripsResult queryTripsXml(Location from, Location via, Location to, final Date date, final boolean dep, final int numTrips,
|
protected final QueryTripsResult queryTripsXml(Location from, Location via, Location to, final Date date, final boolean dep,
|
||||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
|
@ -967,7 +967,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
// number of trips backwards
|
// number of trips backwards
|
||||||
conReq.append(" b=\"").append(0).append("\"");
|
conReq.append(" b=\"").append(0).append("\"");
|
||||||
// number of trips forwards
|
// number of trips forwards
|
||||||
conReq.append(" f=\"").append(numTrips).append("\"");
|
conReq.append(" f=\"").append(numTripsRequested).append("\"");
|
||||||
// percentual extension of change time
|
// percentual extension of change time
|
||||||
conReq.append(" chExtension=\"").append(walkSpeed == WalkSpeed.SLOW ? 50 : 0).append("\"");
|
conReq.append(" chExtension=\"").append(walkSpeed == WalkSpeed.SLOW ? 50 : 0).append("\"");
|
||||||
// TODO nrChanges: max number of changes
|
// TODO nrChanges: max number of changes
|
||||||
|
@ -977,13 +977,12 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
return queryTripsXml(null, true, conReq, from, via, to);
|
return queryTripsXml(null, true, conReq, from, via, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final QueryTripsResult queryMoreTripsXml(final QueryTripsContext contextObj, final boolean later, final int numTrips)
|
protected final QueryTripsResult queryMoreTripsXml(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
throws IOException
|
|
||||||
{
|
{
|
||||||
final Context context = (Context) contextObj;
|
final Context context = (Context) contextObj;
|
||||||
|
|
||||||
final StringBuilder conScrReq = new StringBuilder("<ConScrReq scrDir=\"").append(later ? 'F' : 'B').append("\" nrCons=\"").append(numTrips)
|
final StringBuilder conScrReq = new StringBuilder("<ConScrReq scrDir=\"").append(later ? 'F' : 'B').append("\" nrCons=\"")
|
||||||
.append("\">");
|
.append(numTripsRequested).append("\">");
|
||||||
conScrReq.append("<ConResCtxt>").append(later ? context.laterContext : context.earlierContext).append("</ConResCtxt>");
|
conScrReq.append("<ConResCtxt>").append(later ? context.laterContext : context.earlierContext).append("</ConResCtxt>");
|
||||||
conScrReq.append("</ConScrReq>");
|
conScrReq.append("</ConScrReq>");
|
||||||
|
|
||||||
|
@ -1516,8 +1515,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
private final static int QUERY_TRIPS_BINARY_BUFFER_SIZE = 384 * 1024;
|
private final static int QUERY_TRIPS_BINARY_BUFFER_SIZE = 384 * 1024;
|
||||||
|
|
||||||
protected final QueryTripsResult queryTripsBinary(Location from, Location via, Location to, final Date date, final boolean dep,
|
protected final QueryTripsResult queryTripsBinary(Location from, Location via, Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
final ResultHeader header = new ResultHeader(SERVER_PRODUCT);
|
final ResultHeader header = new ResultHeader(SERVER_PRODUCT);
|
||||||
|
|
||||||
|
@ -1558,7 +1557,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
return queryTripsBinary(uri.toString(), from, via, to, QUERY_TRIPS_BINARY_BUFFER_SIZE);
|
return queryTripsBinary(uri.toString(), from, via, to, QUERY_TRIPS_BINARY_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected QueryTripsResult queryMoreTripsBinary(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
protected QueryTripsResult queryMoreTripsBinary(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
final QueryTripsBinaryContext context = (QueryTripsBinaryContext) contextObj;
|
final QueryTripsBinaryContext context = (QueryTripsBinaryContext) contextObj;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@ public abstract class AbstractNetworkProvider implements NetworkProvider
|
||||||
protected static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
|
protected static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
|
||||||
protected static final Set<Product> ALL_EXCEPT_HIGHSPEED;
|
protected static final Set<Product> ALL_EXCEPT_HIGHSPEED;
|
||||||
|
|
||||||
|
protected int numTripsRequested = 6;
|
||||||
|
|
||||||
private Map<String, Style> styles = null;
|
private Map<String, Style> styles = null;
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -49,6 +51,11 @@ public abstract class AbstractNetworkProvider implements NetworkProvider
|
||||||
return ALL_EXCEPT_HIGHSPEED;
|
return ALL_EXCEPT_HIGHSPEED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setNumTripsRequested(final int numTripsRequested)
|
||||||
|
{
|
||||||
|
this.numTripsRequested = numTripsRequested;
|
||||||
|
}
|
||||||
|
|
||||||
protected void setStyles(final Map<String, Style> styles)
|
protected void setStyles(final Map<String, Style> styles)
|
||||||
{
|
{
|
||||||
this.styles = styles;
|
this.styles = styles;
|
||||||
|
|
|
@ -186,16 +186,16 @@ public final class BahnProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Pattern P_NORMALIZE_LINE_NAME_TRAM = Pattern.compile("str\\s+(.*)", Pattern.CASE_INSENSITIVE);
|
private static final Pattern P_NORMALIZE_LINE_NAME_TRAM = Pattern.compile("str\\s+(.*)", Pattern.CASE_INSENSITIVE);
|
||||||
|
|
|
@ -124,15 +124,15 @@ public class BayernProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsMobile(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsMobile(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsMobile(contextObj, later, numTrips);
|
return queryMoreTripsMobile(contextObj, later);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -536,16 +536,16 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Pattern P_NORMALIZE_LINE_NAME_TRAM = Pattern.compile("(?:tra|tram)\\s+(.*)", Pattern.CASE_INSENSITIVE);
|
private static final Pattern P_NORMALIZE_LINE_NAME_TRAM = Pattern.compile("(?:tra|tram)\\s+(.*)", Pattern.CASE_INSENSITIVE);
|
||||||
|
|
|
@ -160,16 +160,16 @@ public class JetProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Pattern P_NORMALIZE_BUS = Pattern.compile("([א]?\\d{1,3})#");
|
private static final Pattern P_NORMALIZE_BUS = Pattern.compile("([א]?\\d{1,3})#");
|
||||||
|
|
|
@ -179,16 +179,16 @@ public class NasaProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -128,8 +128,6 @@ public interface NetworkProvider
|
||||||
* desired date for departing, mandatory
|
* desired date for departing, mandatory
|
||||||
* @param dep
|
* @param dep
|
||||||
* date is departure date? {@code true} for departure, {@code false} for arrival
|
* date is departure date? {@code true} for departure, {@code false} for arrival
|
||||||
* @param numTrips
|
|
||||||
* number of trips to query
|
|
||||||
* @param products
|
* @param products
|
||||||
* products to take into account
|
* products to take into account
|
||||||
* @param walkSpeed
|
* @param walkSpeed
|
||||||
|
@ -141,8 +139,8 @@ public interface NetworkProvider
|
||||||
* @return result object that can contain alternatives to clear up ambiguousnesses, or contains possible trips
|
* @return result object that can contain alternatives to clear up ambiguousnesses, or contains possible trips
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
QueryTripsResult queryTrips(Location from, Location via, Location to, Date date, boolean dep, int numTrips, Collection<Product> products,
|
QueryTripsResult queryTrips(Location from, Location via, Location to, Date date, boolean dep, Collection<Product> products, WalkSpeed walkSpeed,
|
||||||
WalkSpeed walkSpeed, Accessibility accessibility, Set<Option> options) throws IOException;
|
Accessibility accessibility, Set<Option> options) throws IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query more trips (e.g. earlier or later)
|
* Query more trips (e.g. earlier or later)
|
||||||
|
@ -151,12 +149,10 @@ public interface NetworkProvider
|
||||||
* context to query more trips from
|
* context to query more trips from
|
||||||
* @param next
|
* @param next
|
||||||
* {@code true} for get next trips, {@code false} for get previous trips
|
* {@code true} for get next trips, {@code false} for get previous trips
|
||||||
* @param numTrips
|
|
||||||
* number of trips to query
|
|
||||||
* @return result object that contains possible trips
|
* @return result object that contains possible trips
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
QueryTripsResult queryMoreTrips(QueryTripsContext context, boolean later, int numTrips) throws IOException;
|
QueryTripsResult queryMoreTrips(QueryTripsContext context, boolean later) throws IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get style of line
|
* Get style of line
|
||||||
|
|
|
@ -155,16 +155,16 @@ public class NsProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -213,16 +213,16 @@ public class NvvProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -198,16 +198,16 @@ public class OebbProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class SadProvider extends AbstractNetworkProvider {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryTripsResult queryTrips(Location from, Location via, Location to, Date date, boolean dep, final int numTrips,
|
public QueryTripsResult queryTrips(Location from, Location via, Location to, Date date, boolean dep,
|
||||||
Collection<Product> products, WalkSpeed walkSpeed, Accessibility accessibility, Set<Option> options) throws IOException {
|
Collection<Product> products, WalkSpeed walkSpeed, Accessibility accessibility, Set<Option> options) throws IOException {
|
||||||
|
|
||||||
// Select correct SOAP method depending on the dep flag
|
// Select correct SOAP method depending on the dep flag
|
||||||
|
@ -193,7 +193,7 @@ public class SadProvider extends AbstractNetworkProvider {
|
||||||
return calculateResponse(from, to, response, dep, date);
|
return calculateResponse(from, to, response, dep, date);
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
// Split and parse context
|
// Split and parse context
|
||||||
final Context context = (Context) contextObj;
|
final Context context = (Context) contextObj;
|
||||||
|
@ -221,7 +221,7 @@ public class SadProvider extends AbstractNetworkProvider {
|
||||||
// Query for trips with new date/time value
|
// Query for trips with new date/time value
|
||||||
// NOTE: via, products, walkSpeed, accessibility are set to null
|
// NOTE: via, products, walkSpeed, accessibility are set to null
|
||||||
return queryTrips(new Location(LocationType.STATION, fromId), null, new Location(LocationType.STATION, toId), date, dep,
|
return queryTrips(new Location(LocationType.STATION, fromId), null, new Location(LocationType.STATION, toId), date, dep,
|
||||||
0, null, null, null, null);
|
null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TimeZone timeZone() {
|
protected TimeZone timeZone() {
|
||||||
|
|
|
@ -200,16 +200,16 @@ public class SeProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -190,16 +190,16 @@ public class StockholmProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -188,16 +188,16 @@ public class VbbProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -165,16 +165,16 @@ public class VbnProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -71,10 +71,8 @@ public class VgnProvider extends AbstractEfaProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String xsltTripRequestParameters(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
protected String xsltTripRequestParameters(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options)
|
|
||||||
{
|
{
|
||||||
return super.xsltTripRequestParameters(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options)
|
return super.xsltTripRequestParameters(from, via, to, date, dep, products, walkSpeed, accessibility, options) + "&itdLPxx_showTariffLevel=1";
|
||||||
+ "&itdLPxx_showTariffLevel=1";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,15 +168,15 @@ public class VgsProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final int numTrips, final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility,
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||||
final Set<Option> options) throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return queryTripsBinary(from, via, to, date, dep, numTrips, products, walkSpeed, accessibility, options);
|
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later, final int numTrips) throws IOException
|
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return queryMoreTripsBinary(contextObj, later, numTrips);
|
return queryMoreTripsBinary(contextObj, later);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,11 +70,11 @@ public abstract class AbstractProviderLiveTest
|
||||||
protected final QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
protected final QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility) throws IOException
|
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility) throws IOException
|
||||||
{
|
{
|
||||||
return provider.queryTrips(from, via, to, date, dep, 4, products, walkSpeed, accessibility, null);
|
return provider.queryTrips(from, via, to, date, dep, products, walkSpeed, accessibility, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final QueryTripsResult queryMoreTrips(final QueryTripsContext context, final boolean later) throws IOException
|
protected final QueryTripsResult queryMoreTrips(final QueryTripsContext context, final boolean later) throws IOException
|
||||||
{
|
{
|
||||||
return provider.queryMoreTrips(context, later, 4);
|
return provider.queryMoreTrips(context, later);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,6 @@ public class TripController
|
||||||
{
|
{
|
||||||
final Location fromLocation = new Location(fromType, fromId, null, from);
|
final Location fromLocation = new Location(fromType, fromId, null, from);
|
||||||
final Location toLocation = new Location(toType, toId, null, to);
|
final Location toLocation = new Location(toType, toId, null, to);
|
||||||
return provider.queryTrips(fromLocation, null, toLocation, new Date(), true, 4, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL, null);
|
return provider.queryTrips(fromLocation, null, toLocation, new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue