/db-elevator-api-client

Java Client for DB S&S Elevators and Escalators API

Primary LanguageBatchfileBSD 2-Clause "Simplified" LicenseBSD-2-Clause

Dbeac - Java Client for the Elevators and Escalators API

This projects provides a Java Client for the Escalators and Elevators API of the DB Station&Service AG, codenamed Dbeac.

The API is published in the frame of Aufzugs-API Contest.

The original API definition file can be found here:

SSTBT_REST-API_ADAM_1_contest_alpha.yaml

Usage

Adding the client to your project

Maven

Add the following dependency to your project:

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

Provided operations

List all facilities

API invocation:

https://adam.noncd.db.de/api/v1.0/facilities

Java code:

List<Facility> allFacilities = api.findFacilities(null, null);

List active elevators

API invocation:

https://adam.noncd.db.de/api/v1.0/facilities?type=ELEVATOR&state=ACTIVE

Java code:

List<Facility> findFacilities = api.findFacilities(
	Arrays.asList(Facility.TypeEnum.ELEVATOR.toString()),
	Arrays.asList(Facility.StateEnum.ACTIVE.toString()));

Get facility by the equipment number

API invocation:

https://adam.noncd.db.de/api/v1.0/facilities/10110110

Java code:

Facility facility = api.getFacilityByEquipmentNumber(10110110L);

Find station by the station number

API invocation:

https://adam.noncd.db.de/api/v1.0/stations/3925

Java code:

Station station = api.findStationByStationNumber(3925L);