Java Client for the LH Public API

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
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

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

Download lhapi-client

How to add to project

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

Dependencies

compile (12)

Group / Artifact Type Version
org.apache.commons : commons-lang3 jar 3.2.1
io.swagger : swagger-annotations jar 1.5.4
com.sun.jersey : jersey-client jar 1.18
com.sun.jersey.contribs : jersey-multipart jar 1.18
com.fasterxml.jackson.core : jackson-core jar 2.4.2
com.fasterxml.jackson.core : jackson-annotations jar 2.4.2
com.fasterxml.jackson.jaxrs : jackson-jaxrs-json-provider jar 2.4.2
com.fasterxml.jackson.core : jackson-databind jar 2.4.2
com.fasterxml.jackson.datatype : jackson-datatype-jsr310 jar 2.4.2
com.fasterxml.jackson.datatype : jackson-datatype-joda jar 2.4.2
com.brsanthu : migbase64 jar 2.2
joda-time : joda-time jar 2.3

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

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