Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

de.stklcode.pubtrans:juraclient

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

de.stklcode.pubtrans:juraclient

Java client for URA based public transport API

  • 2.0.8
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

jURAclient

CI Quality Gate Status Javadocs Maven Central Version License

Java client for URA based public transport APIs.

This client allows to simply connect any Java application to the public transport API to implement a monitor for the local bus station or any other custom queries. API versions 1.x and 2.x are supported.

Supported versions

Version 2.x requires Java 11 or later. It also contains some new features and allows configuration using a dedicated configuration object.

Version 1.x requires Java 8 or later. This version is no longer supported and will not receive any future updates.

Usage Examples

Initialization

// Instantiate the client.
UraClient ura = new UraClient("https://ura.example.com");

// Initialize the API with non-standard endpoints.
UraClient ura = new UraClient("https://ura.example.com", 
                              "interfaces/ura/instant_V2", 
                              "interfaces/ura/stream_V2");

// Initialization with configuration builder (Client v2.x)
UraClient ura = new UraClient(
    UraClientConfiguration.forBaseURL("https://ura.example.com")
                          .withInstantPath("interfaces/ura/instant_V2")
                          .withStreamPath("interfaces/ura/stream_V2")
                          .withConnectTimeout(Duration.ofSeconds(2))
                          .withTimeout(Duration.ofSeconds(10))
                          .build()
);

List Stops

// List ALL available stops
List<Stop> stops = ura.getStops();

// List available stops in a 200m radius around given coordinates
List<Stop> stops = ura.forPosition(51.51009, -0.1345734, 200)
                      .getStops();

Get Trips

// Get next 10 trips for given stops and lines in a single direction (all filters optional)
List<Trip> trips = ura.forStops("100000")
                      .forLines("25", "35")
                      .forDirection(1)
                      .getTrips(10);

// Get trips from given stop towards your destination
List<Trip> trips = ura.forStopsByName("Piccadilly Circus")
                      .towards("Marble Arch")
                      .getTrips();

Get Messages

// Get next 10 trips for given stops and lines in a single direction (all filters optional)
List<Message> msgs = ura.forStops("100000")
                        .getMessages();

Maven Artifact

<dependency>
    <groupId>de.stklcode.pubtrans</groupId>
    <artifactId>juraclient</artifactId>
    <version>2.0.8</version>
</dependency>

License

The project is licensed under Apache License 2.0.

FAQs

Package last updated on 03 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc