mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
'previous connections' handling for hafas based providers
This commit is contained in:
parent
d0cf992647
commit
0eb1ac9da9
2 changed files with 6 additions and 4 deletions
|
@ -781,10 +781,10 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
|
|
||||||
public QueryConnectionsResult queryMoreConnections(final String context, final boolean next) throws IOException
|
public QueryConnectionsResult queryMoreConnections(final String context, final boolean next) throws IOException
|
||||||
{
|
{
|
||||||
final StringBuilder request = new StringBuilder("<ConScrReq scr=\"").append('F').append("\" nrCons=\"").append(NUM_CONNECTIONS).append("\">");
|
final StringBuilder request = new StringBuilder("<ConScrReq scrDir=\"").append(next ? 'F' : 'B').append("\" nrCons=\"")
|
||||||
|
.append(NUM_CONNECTIONS).append("\">");
|
||||||
request.append("<ConResCtxt>").append(context).append("</ConResCtxt>");
|
request.append("<ConResCtxt>").append(context).append("</ConResCtxt>");
|
||||||
request.append("</ConScrReq>");
|
request.append("</ConScrReq>");
|
||||||
// TODO handle next/prev
|
|
||||||
|
|
||||||
return queryConnections(request.toString(), null, null, null);
|
return queryConnections(request.toString(), null, null, null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,8 +77,10 @@ public class VbbProviderLiveTest extends AbstractProviderLiveTest
|
||||||
null, new Location(LocationType.STATION, 9013103, "Berlin", "Prinzenstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL,
|
null, new Location(LocationType.STATION, 9013103, "Berlin", "Prinzenstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL,
|
||||||
Accessibility.NEUTRAL);
|
Accessibility.NEUTRAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context, true);
|
final QueryConnectionsResult nextResult = provider.queryMoreConnections(result.context, true);
|
||||||
System.out.println(moreResult);
|
System.out.println(nextResult);
|
||||||
|
final QueryConnectionsResult previousResult = provider.queryMoreConnections(result.context, false);
|
||||||
|
System.out.println(previousResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue