UF-DDICLIENT
UF-DDICLIENT is a java library that help the creation of a client to UpdateFactory or Hawkbit servers.
Install
To import this project use jitpack plugin.
Example
Create a class that implements the Observer interface:
private class ObserverState implements Observer {
@Override
public void update(Observable observable, Object o) {
if (o instanceof UFService.SharedEvent) {
...
}
}
}
Create the Service, add the observer and start the service:
DdiRestApi api = new ClientBuilder()
.withBaseUrl("https://personal.updatefactory.io")
.withGatewayToken("[gatewayToken]")
.withHttpBuilder(new OkHttpClient.Builder())
.withOnTargetTokenFound(System.out::println)
.withServerType(ServerType.UPDATE_FACTORY)
.build();
Map<String,String> map = new HashMap<>();
map.put("test","tes");
ufService = UFService.builder()
.withClient(api)
.withControllerId("controllerId")
.withTargetData(()->map)
.withTenant("test")
.build();
ufService.addObserver(new ObserverState());
ufService.start();
Third-Party Libraries
- Retrofit library
Authors
- Daniele Sergio - Initial work - danielesergio
See also the list of contributors who participated in this project.
License
Copyright © 2017-2018, Kynetics LLC. Released under the EPLv1 License.