Skip to content

Commit

Permalink
Change spelling from 'Light' to 'Lite'
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Dec 4, 2024
1 parent 6703d62 commit 86a447f
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_AZURE_ET_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_AZURE_SX_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_ET_GOOGLE_PUBSUB_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_ET_LIGHT;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_ET_LITE;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_ET_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_SX_LITE;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.SIRI_SX_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.STOP_TIME_UPDATER;
import static org.opentripplanner.standalone.config.routerconfig.UpdatersConfig.Type.VEHICLE_PARKING;
Expand All @@ -31,9 +32,9 @@
import org.opentripplanner.standalone.config.routerconfig.updaters.MqttGtfsRealtimeUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.PollingTripUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriETGooglePubsubUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriETLightUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriETLiteUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriETUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriSXLightUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriSXLiteUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.SiriSXUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.VehicleParkingUpdaterConfig;
import org.opentripplanner.standalone.config.routerconfig.updaters.VehiclePositionsUpdaterConfig;
Expand All @@ -47,8 +48,8 @@
import org.opentripplanner.updater.siri.updater.SiriETUpdaterParameters;
import org.opentripplanner.updater.siri.updater.SiriSXUpdaterParameters;
import org.opentripplanner.updater.siri.updater.google.SiriETGooglePubsubUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriETLightUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriSXLightUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriETLiteUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriSXLiteUpdaterParameters;
import org.opentripplanner.updater.trip.MqttGtfsRealtimeUpdaterParameters;
import org.opentripplanner.updater.trip.PollingTripUpdaterParameters;
import org.opentripplanner.updater.vehicle_parking.VehicleParkingUpdaterParameters;
Expand Down Expand Up @@ -188,13 +189,13 @@ public List<SiriSXUpdaterParameters> getSiriSXUpdaterParameters() {
}

@Override
public List<SiriETLightUpdaterParameters> getSiriETLightUpdaterParameters() {
return getParameters(SIRI_ET_LIGHT);
public List<SiriETLiteUpdaterParameters> getSiriETLightUpdaterParameters() {
return getParameters(SIRI_ET_LITE);
}

@Override
public List<SiriSXLightUpdaterParameters> getSiriSXLightUpdaterParameters() {
return getParameters(Type.SIRI_SX_LIGHT);
public List<SiriSXLiteUpdaterParameters> getSiriSXLightUpdaterParameters() {
return getParameters(SIRI_SX_LITE);
}

@Override
Expand Down Expand Up @@ -233,10 +234,10 @@ public enum Type {
REAL_TIME_ALERTS(GtfsRealtimeAlertsUpdaterConfig::create),
VEHICLE_POSITIONS(VehiclePositionsUpdaterConfig::create),
SIRI_ET_UPDATER(SiriETUpdaterConfig::create),
SIRI_ET_LIGHT(SiriETLightUpdaterConfig::create),
SIRI_SX_LIGHT(SiriSXLightUpdaterConfig::create),
SIRI_ET_LITE(SiriETLiteUpdaterConfig::create),
SIRI_ET_GOOGLE_PUBSUB_UPDATER(SiriETGooglePubsubUpdaterConfig::create),
SIRI_SX_UPDATER(SiriSXUpdaterConfig::create),
SIRI_SX_LITE(SiriSXLiteUpdaterConfig::create),
SIRI_AZURE_ET_UPDATER(SiriAzureETUpdaterConfig::create),
SIRI_AZURE_SX_UPDATER(SiriAzureSXUpdaterConfig::create);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import java.time.Duration;
import org.opentripplanner.standalone.config.framework.json.NodeAdapter;
import org.opentripplanner.updater.siri.updater.light.SiriETLightUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriETLiteUpdaterParameters;

public class SiriETLightUpdaterConfig {
public class SiriETLiteUpdaterConfig {

public static SiriETLightUpdaterParameters create(String configRef, NodeAdapter c) {
return new SiriETLightUpdaterParameters(
public static SiriETLiteUpdaterParameters create(String configRef, NodeAdapter c) {
return new SiriETLiteUpdaterParameters(
configRef,
c.of("feedId").since(V2_7).summary("The ID of the feed to apply the updates to.").asString(),
c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

import java.time.Duration;
import org.opentripplanner.standalone.config.framework.json.NodeAdapter;
import org.opentripplanner.updater.siri.updater.light.SiriSXLightUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriSXLiteUpdaterParameters;

public class SiriSXLightUpdaterConfig {
public class SiriSXLiteUpdaterConfig {

public static SiriSXLightUpdaterParameters create(String configRef, NodeAdapter c) {
return new SiriSXLightUpdaterParameters(
public static SiriSXLiteUpdaterParameters create(String configRef, NodeAdapter c) {
return new SiriSXLiteUpdaterParameters(
configRef,
c.of("feedId").since(V2_7).summary("The ID of the feed to apply the updates to.").asString(),
c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import org.opentripplanner.updater.siri.updater.SiriETUpdaterParameters;
import org.opentripplanner.updater.siri.updater.SiriSXUpdaterParameters;
import org.opentripplanner.updater.siri.updater.google.SiriETGooglePubsubUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriETLightUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriSXLightUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriETLiteUpdaterParameters;
import org.opentripplanner.updater.siri.updater.light.SiriSXLiteUpdaterParameters;
import org.opentripplanner.updater.trip.MqttGtfsRealtimeUpdaterParameters;
import org.opentripplanner.updater.trip.PollingTripUpdaterParameters;
import org.opentripplanner.updater.vehicle_parking.VehicleParkingUpdaterParameters;
Expand All @@ -35,9 +35,9 @@ public interface UpdatersParameters {

List<SiriSXUpdaterParameters> getSiriSXUpdaterParameters();

List<SiriETLightUpdaterParameters> getSiriETLightUpdaterParameters();
List<SiriETLiteUpdaterParameters> getSiriETLightUpdaterParameters();

List<SiriSXLightUpdaterParameters> getSiriSXLightUpdaterParameters();
List<SiriSXLiteUpdaterParameters> getSiriSXLightUpdaterParameters();

List<MqttGtfsRealtimeUpdaterParameters> getMqttGtfsRealtimeUpdaterParameters();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import org.opentripplanner.updater.siri.updater.SiriHttpLoader;
import org.opentripplanner.updater.siri.updater.SiriSXUpdater;
import org.opentripplanner.updater.siri.updater.google.SiriETGooglePubsubUpdater;
import org.opentripplanner.updater.siri.updater.light.SiriETLightHttpTripUpdateSource;
import org.opentripplanner.updater.siri.updater.light.SiriLightHttpLoader;
import org.opentripplanner.updater.siri.updater.light.SiriETLiteHttpTripUpdateSource;
import org.opentripplanner.updater.siri.updater.light.SiriLiteHttpLoader;
import org.opentripplanner.updater.spi.GraphUpdater;
import org.opentripplanner.updater.spi.TimetableSnapshotFlush;
import org.opentripplanner.updater.trip.MqttGtfsRealtimeUpdater;
Expand Down Expand Up @@ -201,7 +201,7 @@ private List<GraphUpdater> createUpdatersFromConfig() {
new SiriETUpdater(
configItem,
provideSiriTimetableSnapshot(),
new SiriETLightHttpTripUpdateSource(configItem.sourceParameters()),
new SiriETLiteHttpTripUpdateSource(configItem.sourceParameters()),
TripUpdateMetrics.batch(configItem)
)
);
Expand All @@ -223,7 +223,7 @@ private List<GraphUpdater> createUpdatersFromConfig() {
new SiriSXUpdater(
configItem,
timetableRepository,
new SiriLightHttpLoader(
new SiriLiteHttpLoader(
configItem.uri(),
configItem.timeout(),
configItem.requestHeaders()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
/**
* SIRI Light downloads periodically all messages as a single GET request.
*/
public class SiriETLightHttpTripUpdateSource implements EstimatedTimetableSource {
public class SiriETLiteHttpTripUpdateSource implements EstimatedTimetableSource {

private static final Logger LOG = LoggerFactory.getLogger(SiriETLightHttpTripUpdateSource.class);
private static final Logger LOG = LoggerFactory.getLogger(SiriETLiteHttpTripUpdateSource.class);
/**
* The framework code requires a requestor ref but in SIRI Light this is not used.
*/
Expand All @@ -31,7 +31,7 @@ public class SiriETLightHttpTripUpdateSource implements EstimatedTimetableSource

private final SiriLoader siriLoader;

public SiriETLightHttpTripUpdateSource(Parameters parameters) {
public SiriETLiteHttpTripUpdateSource(Parameters parameters) {
this.parameters = parameters;

this.siriLoader = createLoader(parameters);
Expand Down Expand Up @@ -73,7 +73,7 @@ private static SiriLoader createLoader(Parameters parameters) {
}
// Fallback to default loader
else {
return new SiriLightHttpLoader(
return new SiriLiteHttpLoader(
parameters.uri(),
parameters.timeout(),
parameters.httpRequestHeaders()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.opentripplanner.updater.siri.updater.SiriETUpdater;
import org.opentripplanner.updater.spi.HttpHeaders;

public record SiriETLightUpdaterParameters(
public record SiriETLiteUpdaterParameters(
String configRef,
String feedId,
URI uri,
Expand All @@ -14,8 +14,8 @@ public record SiriETLightUpdaterParameters(
boolean fuzzyTripMatching,
HttpHeaders httpRequestHeaders
)
implements SiriETUpdater.SiriETUpdaterParameters, SiriETLightHttpTripUpdateSource.Parameters {
public SiriETLightHttpTripUpdateSource.Parameters sourceParameters() {
implements SiriETUpdater.SiriETUpdaterParameters, SiriETLiteHttpTripUpdateSource.Parameters {
public SiriETLiteHttpTripUpdateSource.Parameters sourceParameters() {
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
* Load real-time updates from SIRI-SX and SIRI-ET feeds over HTTP via a single request
* that contains all updates.
*/
public class SiriLightHttpLoader implements SiriLoader {
public class SiriLiteHttpLoader implements SiriLoader {

private static final Logger LOG = LoggerFactory.getLogger(SiriLightHttpLoader.class);
private static final Logger LOG = LoggerFactory.getLogger(SiriLiteHttpLoader.class);
private final HttpHeaders headers;
private final URI uri;
private final Duration timeout;
private final OtpHttpClient otpHttpClient;

public SiriLightHttpLoader(URI uri, Duration timeout, HttpHeaders headers) {
public SiriLiteHttpLoader(URI uri, Duration timeout, HttpHeaders headers) {
this.uri = uri;
this.timeout = timeout;
this.headers = HttpHeaders.of().acceptApplicationXML().add(headers).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.opentripplanner.updater.siri.updater.SiriSXUpdater;
import org.opentripplanner.updater.spi.HttpHeaders;

public record SiriSXLightUpdaterParameters(
public record SiriSXLiteUpdaterParameters(
String configRef,
String feedId,
URI uri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class SiriConfigDocTest {
private static final Set<String> INCLUDE_UPDATERS = Set.of(
"siri-et-updater",
"siri-sx-updater",
"siri-et-light",
"siri-sx-light"
"siri-et-lite",
"siri-sx-lite"
);
private static final SkipNodes SKIP_NODES = SkipNodes.of().build();
public static final ObjectMapper mapper = new ObjectMapper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public class UpdaterConfigDocTest {
"siri-et-updater",
"siri-et-google-pubsub-updater",
"siri-sx-updater",
"siri-et-light",
"siri-sx-light"
"siri-et-lite",
"siri-sx-lite"
);
private static final SkipNodes SKIP_NODES = SkipNodes.of().build();
public static final ObjectMapper mapper = new ObjectMapper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import org.opentripplanner.updater.spi.HttpHeaders;
import uk.org.siri.siri20.NaturalLanguageStringStructure;

class SiriLightHttpLoaderTest {
class SiriLiteHttpLoaderTest {

private static final Duration ONE_MIN = Duration.ofMinutes(1);

@Test
void test() {
var uri = ResourceLoader.of(this).uri("siri-sx.xml");
var loader = new SiriLightHttpLoader(uri, ONE_MIN, HttpHeaders.empty());
var loader = new SiriLiteHttpLoader(uri, ONE_MIN, HttpHeaders.empty());
var siri = loader.fetchETFeed("OTP");
var delivery = siri.get().getServiceDelivery().getSituationExchangeDeliveries().getFirst();
var element = delivery.getSituations().getPtSituationElements().getFirst();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,13 @@
"url": "https://transmodel.api.opendatahub.com/siri-lite/fm/parking"
},
{
"type": "siri-et-light",
"type": "siri-et-lite",
"feedId": "sta",
"url": "https://example.com/siri-lite/estimated-timetable/xml",
"fuzzyTripMatching": true
},
{
"type": "siri-sx-light",
"type": "siri-sx-lite",
"feedId": "sta",
"url": "https://example.com/siri-lite/situation-exchange/xml"
}
Expand Down
12 changes: 6 additions & 6 deletions doc/templates/sandbox/siri/SiriUpdater.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ To enable the SIRI updater you need to add it to the `updaters` section of the `

<!-- INSERT: siri-sx-updater -->

### SIRI-ET Light
### SIRI-ET Lite

SIRI Light is [not very well](https://nextcloud.leonard.io/s/2tdYdmYBGtLQMfi/download?path=&files=Proposition-Profil-SIRI-Lite-initial-v1-3%20en.pdf)
SIRI Lite is [not very well](https://nextcloud.leonard.io/s/2tdYdmYBGtLQMfi/download?path=&files=Proposition-Profil-SIRI-Lite-initial-v1-3%20en.pdf)
[specified](https://normes.transport.data.gouv.fr/normes/siri/profil-france/#protocoles-d%C3%A9change-des-donn%C3%A9es-siri),
but this updater supports the following definition:

Fetching XML-formatted SIRI messages as single GET request rather than the more common request/response
flow. This means that the XML feed must contain all updates for all trips, just like it is the case
for GTFS-RT TripUpdates.

<!-- INSERT: siri-et-light -->
<!-- INSERT: siri-et-lite -->

### SIRI-SX Light
### SIRI-SX Lite

This updater follows the same definition of SIRI Light as the SIRI-ET one: it downloads the entire
This updater follows the same definition of SIRI Lite as the SIRI-ET one: it downloads the entire
feed in a single HTTP GET request.

<!-- INSERT: siri-sx-light -->
<!-- INSERT: siri-sx-lite -->


## Changelog
Expand Down
4 changes: 2 additions & 2 deletions doc/user/RouterConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -877,13 +877,13 @@ Used to group requests when monitoring OTP.
"url" : "https://transmodel.api.opendatahub.com/siri-lite/fm/parking"
},
{
"type" : "siri-et-light",
"type" : "siri-et-lite",
"feedId" : "sta",
"url" : "https://example.com/siri-lite/estimated-timetable/xml",
"fuzzyTripMatching" : true
},
{
"type" : "siri-sx-light",
"type" : "siri-sx-lite",
"feedId" : "sta",
"url" : "https://example.com/siri-lite/situation-exchange/xml"
}
Expand Down
Loading

0 comments on commit 86a447f

Please sign in to comment.