Remove accessId from AbstractHafasProvider constructor

This commit is contained in:
Andreas Schildbach 2013-11-08 16:09:45 +01:00
parent 4f45b6356a
commit 29dc8482f6
24 changed files with 34 additions and 29 deletions

View file

@ -84,7 +84,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
protected final String getStopEndpoint;
protected final String queryEndpoint;
private final int numProductBits;
private final String accessId;
private String accessId;
private String clientType;
private Charset jsonGetStopsEncoding;
private Charset jsonNearbyStationsEncoding;
@ -143,20 +143,18 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
}
}
public AbstractHafasProvider(final String stationBoardEndpoint, final String getStopEndpoint, final String queryEndpoint,
final int numProductBits, final String accessId)
public AbstractHafasProvider(final String stationBoardEndpoint, final String getStopEndpoint, final String queryEndpoint, final int numProductBits)
{
this(stationBoardEndpoint, getStopEndpoint, queryEndpoint, numProductBits, accessId, ISO_8859_1, ISO_8859_1);
this(stationBoardEndpoint, getStopEndpoint, queryEndpoint, numProductBits, ISO_8859_1, ISO_8859_1);
}
public AbstractHafasProvider(final String stationBoardEndpoint, final String getStopEndpoint, final String queryEndpoint,
final int numProductBits, final String accessId, final Charset jsonEncoding, final Charset xmlMlcResEncoding)
final int numProductBits, final Charset jsonEncoding, final Charset xmlMlcResEncoding)
{
this.stationBoardEndpoint = stationBoardEndpoint;
this.getStopEndpoint = getStopEndpoint;
this.queryEndpoint = queryEndpoint;
this.numProductBits = numProductBits;
this.accessId = accessId;
this.jsonGetStopsEncoding = jsonEncoding;
this.jsonNearbyStationsEncoding = jsonEncoding;
this.xmlMlcResEncoding = xmlMlcResEncoding;
@ -167,6 +165,11 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
this.clientType = clientType;
}
protected void setAccessId(final String accessId)
{
this.accessId = accessId;
}
protected void setDominantPlanStopTime(final boolean dominantPlanStopTime)
{
this.dominantPlanStopTime = dominantPlanStopTime;

View file

@ -43,7 +43,7 @@ public final class BahnProvider extends AbstractHafasProvider
public BahnProvider()
{
super(API_BASE + "bhftafel.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 14, null);
super(API_BASE + "bhftafel.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 14);
}
public NetworkId id()

View file

@ -65,7 +65,7 @@ public final class BvgProvider extends AbstractHafasProvider
public BvgProvider(final String additionalQueryParameter)
{
super(API_BASE + "stboard.bin/dn", API_BASE + "ajax-getstop.bin/dny", API_BASE + "query.bin/dn", 8, null);
super(API_BASE + "stboard.bin/dn", API_BASE + "ajax-getstop.bin/dny", API_BASE + "query.bin/dn", 8);
setStyles(STYLES);

View file

@ -42,7 +42,7 @@ public class DsbProvider extends AbstractHafasProvider
public DsbProvider()
{
super(API_BASE + "stboard.exe/mn", null, API_BASE + "query.exe/dn", 11, null);
super(API_BASE + "stboard.exe/mn", null, API_BASE + "query.exe/dn", 11);
}
public NetworkId id()

View file

@ -41,7 +41,7 @@ public class EireannProvider extends AbstractHafasProvider
public EireannProvider()
{
super(API_BASE + "stboard.bin/en", API_BASE + "ajax-getstop.bin/en", API_BASE + "query.bin/en", 4, null);
super(API_BASE + "stboard.bin/en", API_BASE + "ajax-getstop.bin/en", API_BASE + "query.bin/en", 4);
}
public NetworkId id()

View file

@ -54,7 +54,7 @@ public class InvgProvider extends AbstractHafasProvider
public InvgProvider()
{
super(API_BASE + "stboard.exe/dn", null, API_BASE + "extxml.exe", 10, null);
super(API_BASE + "stboard.exe/dn", null, API_BASE + "extxml.exe", 10);
setStyles(STYLES);
}

View file

@ -36,7 +36,7 @@ public class LuProvider extends AbstractHafasProvider
public LuProvider()
{
super(API_BASE + "stboard.exe/fn", null, API_BASE + "query.exe/fn", 10, null, UTF_8, UTF_8);
super(API_BASE + "stboard.exe/fn", null, API_BASE + "query.exe/fn", 10, UTF_8, UTF_8);
}
public NetworkId id()

View file

@ -41,7 +41,7 @@ public class NasaProvider extends AbstractHafasProvider
public NasaProvider()
{
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 8, null);
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 8);
setJsonNearbyStationsEncoding(UTF_8);
}

View file

@ -37,7 +37,7 @@ public class NriProvider extends AbstractHafasProvider
public NriProvider()
{
super(API_BASE + "stboard.exe/on", API_BASE + "ajax-getstop.exe/ony", API_BASE + "query.exe/on", 8, null);
super(API_BASE + "stboard.exe/on", API_BASE + "ajax-getstop.exe/ony", API_BASE + "query.exe/on", 8);
setJsonGetStopsEncoding(UTF_8);
}

View file

@ -41,7 +41,7 @@ public class NsProvider extends AbstractHafasProvider
public NsProvider()
{
super(API_BASE + "stboard.exe/nn", API_BASE + "ajax-getstop.exe/nny", API_BASE + "query.exe/nn", 10, null);
super(API_BASE + "stboard.exe/nn", API_BASE + "ajax-getstop.exe/nny", API_BASE + "query.exe/nn", 10);
setJsonGetStopsEncoding(UTF_8);
}

View file

@ -42,7 +42,7 @@ public class NvvProvider extends AbstractHafasProvider
public NvvProvider()
{
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 12, null, UTF_8, null);
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 12, UTF_8, null);
}
public NetworkId id()

View file

@ -41,7 +41,7 @@ public class OebbProvider extends AbstractHafasProvider
public OebbProvider()
{
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dny", API_BASE + "query.exe/dn", 13, null);
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dny", API_BASE + "query.exe/dn", 13);
setDominantPlanStopTime(true);
setJsonGetStopsEncoding(UTF_8);

View file

@ -41,7 +41,7 @@ public class PlProvider extends AbstractHafasProvider
public PlProvider()
{
super(API_BASE + "stboard.exe/pn", null, API_BASE + "query.exe/pn", 7, null, UTF_8, UTF_8);
super(API_BASE + "stboard.exe/pn", null, API_BASE + "query.exe/pn", 7, UTF_8, UTF_8);
}
public NetworkId id()

View file

@ -37,7 +37,7 @@ public class RtProvider extends AbstractHafasProvider
public RtProvider()
{
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 10, null, UTF_8, null);
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 10, UTF_8, null);
}
public NetworkId id()

View file

@ -37,7 +37,9 @@ public class SbbProvider extends AbstractHafasProvider
public SbbProvider(final String accessId)
{
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "extxml.exe", 10, accessId);
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "extxml.exe", 10);
setAccessId(accessId);
}
public NetworkId id()

View file

@ -47,7 +47,7 @@ public class SeProvider extends AbstractHafasProvider
public SeProvider()
{
super(API_BASE + "stboard.exe/sn", API_BASE + "ajax-getstop.exe/sny", API_BASE + "query.exe/sn", 14, null, UTF_8, null);
super(API_BASE + "stboard.exe/sn", API_BASE + "ajax-getstop.exe/sny", API_BASE + "query.exe/sn", 14, UTF_8, null);
setClientType("ANDROID");
setCanDoEquivs(false);

View file

@ -53,7 +53,7 @@ public class SeptaProvider extends AbstractHafasProvider
public SeptaProvider()
{
super(API_BASE + "stboard.exe/en", API_BASE + "ajax-getstop.exe/dny", API_BASE + "query.exe/en", 4, null);
super(API_BASE + "stboard.exe/en", API_BASE + "ajax-getstop.exe/dny", API_BASE + "query.exe/en", 4);
}
public NetworkId id()

View file

@ -51,7 +51,7 @@ public class ShProvider extends AbstractHafasProvider
public ShProvider()
{
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 10, null, null, UTF_8);
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 10, null, UTF_8);
}
public NetworkId id()

View file

@ -37,7 +37,7 @@ public class SncbProvider extends AbstractHafasProvider
public SncbProvider()
{
super(API_BASE + "stboard.exe/nn", API_BASE + "ajax-getstop.exe/nny", API_BASE + "query.exe/nn", 16, null);
super(API_BASE + "stboard.exe/nn", API_BASE + "ajax-getstop.exe/nny", API_BASE + "query.exe/nn", 16);
setJsonGetStopsEncoding(UTF_8);
setJsonNearbyStationsEncoding(UTF_8);

View file

@ -48,7 +48,7 @@ public class StockholmProvider extends AbstractHafasProvider
public StockholmProvider()
{
super(API_BASE + "stboard.exe/sn", API_BASE + "ajax-getstop.exe/sny", API_BASE + "query.exe/sn", 7, null);
super(API_BASE + "stboard.exe/sn", API_BASE + "ajax-getstop.exe/sny", API_BASE + "query.exe/sn", 7);
setStyles(STYLES);
}

View file

@ -43,7 +43,7 @@ public class VbbProvider extends AbstractHafasProvider
public VbbProvider()
{
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 7, null, UTF_8, UTF_8);
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 7, UTF_8, UTF_8);
}
public NetworkId id()

View file

@ -41,7 +41,7 @@ public class VbnProvider extends AbstractHafasProvider
public VbnProvider()
{
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dny", API_BASE + "query.exe/dn", 10, null);
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dny", API_BASE + "query.exe/dn", 10);
}
public NetworkId id()

View file

@ -40,7 +40,7 @@ public class VgsProvider extends AbstractHafasProvider
public VgsProvider()
{
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 11, null);
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 11);
}
public NetworkId id()

View file

@ -42,7 +42,7 @@ public class ZvvProvider extends AbstractHafasProvider
public ZvvProvider()
{
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 10, null, UTF_8, UTF_8);
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 10, UTF_8, UTF_8);
setStyles(STYLES);
}