This is the unofficial Java SDK to consume the CLCERT Beacon service.
Step 1: Add the JitPack repository to your build file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Step 2: Add the dependency
<dependency>
<groupId>com.github.elbraulio</groupId>
<artifactId>clcert-beacon-observer</artifactId>
<version>0.2.0</version>
</dependency>
Pretty simple to use:
// get an observer.
BeaconObserver beaconObserver = BeaconFactory.observer();
// ask for randomness.
PulseContainer pulseContainer = beaconObserver.lastPulse();
You can ask for specific times as well. Always remember to use UTC.
Instant instant = Instant
.now()
.atOffset(ZoneOffset.UTC)
.toInstant()
.truncatedTo(ChronoUnit.MINUTES);
PulseContainer pulseContainer = beaconObserver.pulseBefore(instant);
See the response structure in:
See the supported calls in BeaconObserver here .