Java Client for the LH Public API - Project

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

Categories

Categories

CLI User Interface
GroupId

GroupId

org.hisrc.lhapi
ArtifactId

ArtifactId

lhapi-client-project
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

pom
Description

Description

Java Client for the LH Public API - Project
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Source Code Management

Source Code Management

https://github.com/highsource/lhapi-client

Download lhapi-client-project

How to add to project

<!-- https://jarcasting.com/artifacts/org.hisrc.lhapi/lhapi-client-project/ -->
<dependency>
    <groupId>org.hisrc.lhapi</groupId>
    <artifactId>lhapi-client-project</artifactId>
    <version>1.0.1</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/org.hisrc.lhapi/lhapi-client-project/
implementation 'org.hisrc.lhapi:lhapi-client-project:1.0.1'
// https://jarcasting.com/artifacts/org.hisrc.lhapi/lhapi-client-project/
implementation ("org.hisrc.lhapi:lhapi-client-project:1.0.1")
'org.hisrc.lhapi:lhapi-client-project:pom:1.0.1'
<dependency org="org.hisrc.lhapi" name="lhapi-client-project" rev="1.0.1">
  <artifact name="lhapi-client-project" type="pom" />
</dependency>
@Grapes(
@Grab(group='org.hisrc.lhapi', module='lhapi-client-project', version='1.0.1')
)
libraryDependencies += "org.hisrc.lhapi" % "lhapi-client-project" % "1.0.1"
[org.hisrc.lhapi/lhapi-client-project "1.0.1"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

  • client

LH Public API Java Client

This projects provides a Java Client for LH Public API.

This client is based of the Swagger/OpenAPI specifications for the LH Public API from the lhapi-specification project.

Usage

Adding the client to your project

Maven

Add the following dependency to your project:

<dependency>
	<groupId>org.hisrc.lhapi</groupId>
	<artifactId>lhapi-client</artifactId>
	<version>...</version>
</dependency>

Using the client in your Java code

Creating the client

LhApiClient client = new AuthenticatingLhApiClient(clientId, clientSecret);

Getting the flight status

Flight status of LO379 (today):

FlightStatusResponse departuresStatus = client.flightStatus("LO379", LocalDate.now());

Getting departures

Departures from DME +/- one hour from now:

FlightsStatusResponse departuresStatus = client.departuresStatus(
	"DME",
	LocalDateTime.now().minusHours(1),
	LocalDateTime.now().plusHours(1));

Getting arrivals

Arrivals to FRA +/- one hour from now:

FlightsStatusResponse arrivalsStatus = client.arrivalsStatus(
	"FRA",
	LocalDateTime.now().minusHours(1),
	LocalDateTime.now().plusHours(1));

License

Please note that this code is currently under the GPL-3.0 license. We plan to switch to MIT or BSD or dual licensing in the future.

Versions

Version
1.0.1