/uf-ddiclient

Primary LanguageKotlinEclipse Public License 1.0EPL-1.0

UF ddi client

Build Status Test coverage License

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

Authors

See also the list of contributors who participated in this project.

License

Copyright © 2017-2018, Kynetics LLC. Released under the EPLv1 License.