Add new interfaces
[ric-plt/xapp-frame.git] / pkg / xapp / xapp.go
index d796afe..1fd7ad6 100755 (executable)
@@ -25,28 +25,36 @@ import (
        "net/http"
 )
 
+type ReadyCB func(interface{})
+
 var (
        // XApp is an application instance
        Rmr      *RMRClient
        Sdl      *SDLClient
-       UeNib    *UENIBClient
        Rnib     *RNIBClient
        Resource *Router
        Metric   *Metrics
-       Logger   Log
+       Logger   *Log
        Config   Configurator
 )
 
+func IsReady() bool {
+       return Rmr.IsReady() && Sdl.IsReady()
+}
+
+func SetReadyCB(cb ReadyCB, params interface{}) {
+       Rmr.SetReadyCB(cb, params)
+}
+
 func init() {
        // Load xapp configuration
        Logger = LoadConfig()
 
        Logger.SetLevel(viper.GetInt("logger.level"))
-       Rmr = NewRMRClient()
        Resource = NewRouter()
        Config = Configurator{}
-       UeNib = NewUENIBClient()
        Metric = NewMetrics(viper.GetString("metrics.url"), viper.GetString("metrics.namespace"), Resource.router)
+       Rmr = NewRMRClient()
 
        if viper.IsSet("db.namespaces") {
                namespaces := viper.GetStringSlice("db.namespaces")