package Ġpro . bi lo us . dif hub . load Ċ Ċ import Ġpro . bi lo us . dif hub . config . Config Ċ import Ġpro . bi lo us . dif hub . model . Model Ċ Ċ class ĠApplications Loader ( val Ġmodel Loader : ĠI Model Loader , Ġval Ġconfig : ĠConfig ) Ġ{ ĊĊ ĉ private Ġval Ġdif hub Ġ= Ġconfig . dif hub Ċ ĉ private Ġval Ġsystem Ġ= Ġconfig . system Ċ ĉ private Ġval Ġdataset Status Ġ= Ġconfig . dataset Status ĊĊ ĉ fun Ġload App By System ( system To Load : ĠString ): ĠList < String > Ġ{ Ċĉ ĉ val Ġmodels Ġ= Ġmodel Loader . load Models ( dif hub . get Applications Url ( system To Load )) ĊĊĉ ĉ val Ġapps Ġ= Ġmutable ListOf < String >() Ċĉ ĉ models ?. filter Ġ{ Ċĉĉ ĉ it .` object ` !!. usage Ġ== Ġ" Service " Ċĉ ĉ } ?. forEach Ġ{ Ċĉĉ ĉ val Ġname Ġ= Ġit . identity . name Ċĉĉ ĉ if Ġ( name . isNotEmpty ()) Ġ{ Ċĉĉĉ ĉ apps . add ( name ) Ċĉĉ ĉ } Ċĉ ĉ } Ċĉ ĉ return Ġapps Ċ ĉ } ĊĊ ĉ fun Ġload All (): ĠList < Model >? Ġ{ Ċĉ ĉ return Ġmodel Loader . load Models ( dif hub . get Applications Url ( system )) Ċ ĉ } ĊĊ ĉ fun Ġload One ( app : ĠString ): ĠModel ? Ġ{ Ċĉ ĉ return Ġmodel Loader . load Model ( dif hub . getApplication Url ( system , Ġapp ), Ġdataset Status ) Ċ ĉ } ĊĊ ĉ fun Ġload AppSettings ( app : ĠString ): ĠModel ? Ġ{ Ċĉ ĉ return Ġmodel Loader . load Model ( dif hub . getApplication Settings Url ( system , Ġapp ), Ġdataset Status ) Ċ ĉ } Ċ Ċ } Ċ