/** Ċ Ġ* ĠCopyright Ġ( c ) Ġ 2 0 2 0 - 2 0 2 1 , ĠKon ink lij ke ĠPhil ips ĠN . V ., Ġhttps :// www . phil ips . com Ċ Ġ* ĠSPDX - License - Identifier : ĠMIT Ċ Ġ*/ Ċ @ file : Suppress (" unused ") Ċ Ċ package Ġcom . phil ips . h sdp . apis . provisioning Ċ Ċ import Ġcom . phil ips . h sdp . apis . provisioning . domain . sdk . Device Identity Ċ import Ġcom . phil ips . h sdp . apis . provisioning . domain . sdk . New Device Identity Ċ import Ġcom . phil ips . h sdp . apis . provisioning . domain . sdk . Provisioning Response Ċ import Ġcom . phil ips . h sdp . apis . support . HttpClient Ċ import Ġkotlinx . coroutines . Coroutine Scope Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . Supervisor Job Ċ import Ġkotlinx . coroutines . cancel Ċ import Ġkotlinx . coroutines . future . future Ċ import Ġjava . util . concurrent . Comp letableFuture Ċ Ċ class ĠProvisioning Service Java Proxy ( provisioning Url : ĠString , ĠhttpClient : ĠHttpClient ) Ġ: ĠAuto Closeable Ġ{ ĊĠĠĠ Ġprivate Ġval Ġprovisioning Service Ġ= ĠProvisioning Service ( provisioning Url , ĠhttpClient ) ĊĠĠĠ Ġprivate Ġval Ġscope Ġ= ĠCor outine Scope ( Dispatch ers . IO Ġ+ ĠSuper visor Job ()) ĊĊĠĠĠ Ġfun Ġcreate Identity ( new Device Identity : ĠNew Device Identity ): ĠCompletableFuture < Provisioning Response < Device Identity >> Ġ= ĊĠĠĠĠĠĠĠ Ġscope . future Ġ{ Ġprovisioning Service . create Identity ( new Device Identity ) Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġclose () Ġ{ ĊĠĠĠĠĠĠĠ Ġscope . cancel () ĊĠĠĠ Ġ} Ċ } Ċ