remove additionalQueryParameter from constructor of AbstractEfaProvider

This commit is contained in:
Andreas Schildbach 2013-03-10 23:19:07 +01:00
parent 40d3d67da5
commit f993ad28f1
42 changed files with 55 additions and 51 deletions

View file

@ -88,7 +88,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
private final String stopFinderEndpoint; private final String stopFinderEndpoint;
private final String coordEndpoint; private final String coordEndpoint;
private final String additionalQueryParameter; private String additionalQueryParameter = null;
private boolean canAcceptPoiId = false; private boolean canAcceptPoiId = false;
private boolean needsSpEncId = false; private boolean needsSpEncId = false;
private boolean includeRegionId = true; private boolean includeRegionId = true;
@ -128,26 +128,25 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
public AbstractEfaProvider() public AbstractEfaProvider()
{ {
this(null, null); this(null);
} }
public AbstractEfaProvider(final String apiBase, final String additionalQueryParameter) public AbstractEfaProvider(final String apiBase)
{ {
this(apiBase, null, null, null, null, additionalQueryParameter); this(apiBase, null, null, null, null);
} }
public AbstractEfaProvider(final String apiBase, final String departureMonitorEndpoint, final String tripEndpoint, public AbstractEfaProvider(final String apiBase, final String departureMonitorEndpoint, final String tripEndpoint,
final String stopFinderEndpoint, final String coordEndpoint, final String additionalQueryParameter) final String stopFinderEndpoint, final String coordEndpoint)
{ {
this(apiBase + (departureMonitorEndpoint != null ? departureMonitorEndpoint : DEFAULT_DEPARTURE_MONITOR_ENDPOINT), // this(apiBase + (departureMonitorEndpoint != null ? departureMonitorEndpoint : DEFAULT_DEPARTURE_MONITOR_ENDPOINT), //
apiBase + (tripEndpoint != null ? tripEndpoint : DEFAULT_TRIP_ENDPOINT), // apiBase + (tripEndpoint != null ? tripEndpoint : DEFAULT_TRIP_ENDPOINT), //
apiBase + (stopFinderEndpoint != null ? stopFinderEndpoint : DEFAULT_STOPFINDER_ENDPOINT), // apiBase + (stopFinderEndpoint != null ? stopFinderEndpoint : DEFAULT_STOPFINDER_ENDPOINT), //
apiBase + (coordEndpoint != null ? coordEndpoint : DEFAULT_COORD_ENDPOINT), // apiBase + (coordEndpoint != null ? coordEndpoint : DEFAULT_COORD_ENDPOINT));
additionalQueryParameter);
} }
public AbstractEfaProvider(final String departureMonitorEndpoint, final String tripEndpoint, final String stopFinderEndpoint, public AbstractEfaProvider(final String departureMonitorEndpoint, final String tripEndpoint, final String stopFinderEndpoint,
final String coordEndpoint, final String additionalQueryParameter) final String coordEndpoint)
{ {
try try
{ {
@ -162,8 +161,6 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
this.tripEndpoint = tripEndpoint; this.tripEndpoint = tripEndpoint;
this.stopFinderEndpoint = stopFinderEndpoint; this.stopFinderEndpoint = stopFinderEndpoint;
this.coordEndpoint = coordEndpoint; this.coordEndpoint = coordEndpoint;
this.additionalQueryParameter = additionalQueryParameter;
} }
protected void setRequestUrlEncoding(final Charset requestUrlEncoding) protected void setRequestUrlEncoding(final Charset requestUrlEncoding)
@ -206,6 +203,11 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
this.needsSpEncId = needsSpEncId; this.needsSpEncId = needsSpEncId;
} }
protected void setAdditionalQueryParameter(final String additionalQueryParameter)
{
this.additionalQueryParameter = additionalQueryParameter;
}
protected TimeZone timeZone() protected TimeZone timeZone()
{ {
return TimeZone.getTimeZone("Europe/Berlin"); return TimeZone.getTimeZone("Europe/Berlin");

View file

@ -33,7 +33,7 @@ public class AtcProvider extends AbstractEfaProvider
public AtcProvider() public AtcProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -32,7 +32,7 @@ public class AvvProvider extends AbstractEfaProvider
public AvvProvider() public AvvProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -27,7 +27,7 @@ public class BayernProvider extends AbstractEfaProvider
public BayernProvider() public BayernProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -33,7 +33,7 @@ public class BsagProvider extends AbstractEfaProvider
public BsagProvider() public BsagProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -36,7 +36,7 @@ public class BsvagProvider extends AbstractEfaProvider
public BsvagProvider() public BsvagProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -33,7 +33,7 @@ public class BvbProvider extends AbstractEfaProvider
public BvbProvider() public BvbProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -27,7 +27,7 @@ public class DingProvider extends AbstractEfaProvider
public DingProvider() public DingProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -34,7 +34,7 @@ public class DubProvider extends AbstractEfaProvider
public DubProvider() public DubProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -32,7 +32,9 @@ public class GvhProvider extends AbstractEfaProvider
public GvhProvider(final String additionalQueryParameter) public GvhProvider(final String additionalQueryParameter)
{ {
super(API_BASE, additionalQueryParameter); super(API_BASE);
setAdditionalQueryParameter(additionalQueryParameter);
} }
public NetworkId id() public NetworkId id()

View file

@ -27,7 +27,7 @@ public class IvbProvider extends AbstractEfaProvider
public IvbProvider() public IvbProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -40,7 +40,7 @@ public class KvvProvider extends AbstractEfaProvider
public KvvProvider(final String apiBase) public KvvProvider(final String apiBase)
{ {
super(apiBase, null); super(apiBase);
setSuppressPositions(true); setSuppressPositions(true);
} }

View file

@ -32,7 +32,7 @@ public class LinzProvider extends AbstractEfaProvider
public LinzProvider() public LinzProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -33,7 +33,7 @@ public class MariborProvider extends AbstractEfaProvider
public MariborProvider() public MariborProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -35,7 +35,7 @@ public class MetProvider extends AbstractEfaProvider
public MetProvider() public MetProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -33,7 +33,7 @@ public class MvgProvider extends AbstractEfaProvider
public MvgProvider() public MvgProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -38,7 +38,7 @@ public class MvvProvider extends AbstractEfaProvider
public MvvProvider(final String apiBase) public MvvProvider(final String apiBase)
{ {
super(apiBase, null); super(apiBase);
} }
public NetworkId id() public NetworkId id()

View file

@ -33,7 +33,7 @@ public class NaldoProvider extends AbstractEfaProvider
public NaldoProvider() public NaldoProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -33,7 +33,7 @@ public class NvbwProvider extends AbstractEfaProvider
public NvbwProvider() public NvbwProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -33,7 +33,7 @@ public class SfProvider extends AbstractEfaProvider
public SfProvider() public SfProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -33,7 +33,7 @@ public class StvProvider extends AbstractEfaProvider
public StvProvider() public StvProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -33,7 +33,7 @@ public class SvvProvider extends AbstractEfaProvider
public SvvProvider() public SvvProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -29,7 +29,7 @@ public class SydneyProvider extends AbstractEfaProvider
public SydneyProvider() public SydneyProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -33,7 +33,7 @@ public class TflProvider extends AbstractEfaProvider
public TflProvider() public TflProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -36,7 +36,7 @@ public class TlemProvider extends AbstractEfaProvider
public TlemProvider() public TlemProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -34,7 +34,7 @@ public class TlswProvider extends AbstractEfaProvider
public TlswProvider() public TlswProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -30,7 +30,7 @@ public class TlwmProvider extends AbstractEfaProvider
public TlwmProvider() public TlwmProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -37,7 +37,7 @@ public class VagfrProvider extends AbstractEfaProvider
public VagfrProvider() public VagfrProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -27,7 +27,7 @@ public class VblProvider extends AbstractEfaProvider
public VblProvider() public VblProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -33,7 +33,7 @@ public class VgnProvider extends AbstractEfaProvider
public VgnProvider(final String apiBase) public VgnProvider(final String apiBase)
{ {
super(apiBase, DEPARTURE_MONITOR_ENDPOINT, TRIP_ENDPOINT, null, null, null); super(apiBase, DEPARTURE_MONITOR_ENDPOINT, TRIP_ENDPOINT, null, null);
} }
public NetworkId id() public NetworkId id()

View file

@ -29,7 +29,7 @@ public class VmobilProvider extends AbstractEfaProvider
public VmobilProvider() public VmobilProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -33,7 +33,7 @@ public class VmsProvider extends AbstractEfaProvider
public VmsProvider() public VmsProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -33,7 +33,7 @@ public class VmvProvider extends AbstractEfaProvider
public VmvProvider() public VmvProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -32,7 +32,7 @@ public class VorProvider extends AbstractEfaProvider
public VorProvider() public VorProvider()
{ {
super(API_BASE, null); super(API_BASE);
setHttpReferer(API_BASE + DEFAULT_DEPARTURE_MONITOR_ENDPOINT); setHttpReferer(API_BASE + DEFAULT_DEPARTURE_MONITOR_ENDPOINT);
setHttpPost(true); setHttpPost(true);

View file

@ -27,7 +27,7 @@ public class VrnProvider extends AbstractEfaProvider
public VrnProvider() public VrnProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -36,7 +36,7 @@ public class VrrProvider extends AbstractEfaProvider
public VrrProvider() public VrrProvider()
{ {
super(API_BASE, null); super(API_BASE);
setNeedsSpEncId(true); setNeedsSpEncId(true);
} }

View file

@ -33,7 +33,7 @@ public class VrtProvider extends AbstractEfaProvider
public VrtProvider() public VrtProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()

View file

@ -33,7 +33,7 @@ public class VvmProvider extends AbstractEfaProvider
public VvmProvider() public VvmProvider()
{ {
super(API_BASE, null); super(API_BASE);
setNeedsSpEncId(true); setNeedsSpEncId(true);
} }

View file

@ -38,7 +38,7 @@ public class VvoProvider extends AbstractEfaProvider
public VvoProvider(final String apiBase) public VvoProvider(final String apiBase)
{ {
super(apiBase, null); super(apiBase);
setRequestUrlEncoding(UTF_8); setRequestUrlEncoding(UTF_8);
} }

View file

@ -34,7 +34,7 @@ public class VvsProvider extends AbstractEfaProvider
public VvsProvider(final String apiBase) public VvsProvider(final String apiBase)
{ {
super(apiBase, null); super(apiBase);
setCanAcceptPoiId(true); setCanAcceptPoiId(true);
} }

View file

@ -27,7 +27,7 @@ public class VvtProvider extends AbstractEfaProvider
public VvtProvider() public VvtProvider()
{ {
super(API_BASE, null); super(API_BASE);
setUseRouteIndexAsConnectionId(false); setUseRouteIndexAsConnectionId(false);
} }

View file

@ -29,7 +29,7 @@ public class VvvProvider extends AbstractEfaProvider
public VvvProvider() public VvvProvider()
{ {
super(API_BASE, null); super(API_BASE);
} }
public NetworkId id() public NetworkId id()