Fix for DB read after VM restart and REST subscription query aded
Change-Id: I975ba41ceafee16470fdfacc7c823815dfc6ad49
Signed-off-by: Anssi Mannila <anssi.mannila@nokia.com>
diff --git a/pkg/control/registry.go b/pkg/control/registry.go
index 2495d3b..72a2100 100644
--- a/pkg/control/registry.go
+++ b/pkg/control/registry.go
@@ -20,6 +20,7 @@
package control
import (
+ "encoding/json"
"fmt"
"sync"
"time"
@@ -104,6 +105,16 @@
}
}
+func (r *Registry) GetAllRestSubscriptions() []byte {
+ r.mutex.Lock()
+ defer r.mutex.Unlock()
+ restSubscriptionsJson, err := json.Marshal(r.restSubscriptions)
+ if err != nil {
+ xapp.Logger.Error("GetAllRestSubscriptions(): %v", err)
+ }
+ return restSubscriptionsJson
+}
+
func (r *Registry) CreateRESTSubscription(restSubId *string, xAppRmrEndPoint *string, maid *string) (*RESTSubscription, error) {
r.mutex.Lock()
defer r.mutex.Unlock()