Skip to main content
This page covers what’s specific to the Java client. Authentication, regions, operations and error handling work the same way in both languages; for those, see the Core SDK page.

Requirements

JDK 11 or later.

Installation

The SDK is published to Maven Central under the com.gbg group.

Building from source

To build the artifact and install it into your local Maven repository:

Call shape

Every operation follows the same three-part pattern: select the resource, name the operation, then call it. The terminal .call() is what sends the request.
Between start() and call() you can attach a .request() body or an extra .header(). Operations that use their own credential, such as devices().connect(), also take a .security().

Reading responses

Response bodies come back wrapped in Optional. The accessor is named after the body type: for example, the response from journeys().start() exposes it as journeyStartResponse().
Each response also carries statusCode(), contentType(), and rawResponse() if you need to handle the HTTP response yourself.

Asynchronous calls

Call .toAsync() on a built client to get an async client. Standard operations then return a CompletableFuture<T> instead of blocking.
Note the different package: async response types live under com.gbg.gocore.models.operations.async.

Reactive libraries

Operations that involve multiple I/O interactions return a Reactive Streams Publisher<T> rather than a CompletableFuture<T>. Reactive Streams was chosen over the JDK Flow API because most reactive toolkits support it natively: If you need the JDK Flow API, adapt with FlowAdapters.toFlowPublisher(publisher).

Jackson configuration

The SDK ships a pre-configured Jackson ObjectMapper with the type modules, strict deserializers, and feature flags it needs, including ISO-8601 OffsetDateTime serialization.
If your application already has its own ObjectMapper, register the SDK’s module on it rather than replacing your mapper:

Logging

The SDK logs through SLF4J. Add an implementation to your project and configure the levels you want:
  • DEBUG: HTTP requests and responses, retry attempts, hook execution
  • TRACE: request and response bodies, backoff calculations
TRACE level logs full request and response bodies, which include access tokens and end-user personal data. Don’t enable it in production.

Further reading