use of lora.ns.actility.rest.ActilityAdminService in project cumulocity-lora by SoftwareAG.
the class ActilityConnector method init.
@Override
protected void init() {
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient dxClient = new OkHttpClient.Builder().addInterceptor(new DXAdminJWTInterceptor(properties.getProperty("username"), properties.getProperty("password"))).addInterceptor(interceptor).build();
String url = properties.getProperty("url");
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
Retrofit core = new Retrofit.Builder().client(dxClient).baseUrl(url + "/thingpark/dx/core/latest/api/").addConverterFactory(JacksonConverterFactory.create()).build();
Retrofit admin = new Retrofit.Builder().baseUrl(url + "/iot-flow/v1/").client(client).addConverterFactory(JacksonConverterFactory.create()).build();
actilityCoreService = core.create(ActilityCoreService.class);
actilityAdminService = admin.create(ActilityAdminService.class);
}
Aggregations