Skip to content

sergeysedoy97/uf-ddiclient

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

214 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 98.6%
  • Shell 1.3%
  • Dockerfile 0.1%