}
if err = c.db.Set(strconv.FormatUint(uint64(subId), 10), jsonData); err != nil {
+ c.UpdateCounter(cSDLWriteFailure)
return fmt.Errorf("SDL: WriteSubscriptionToSdl(): %s", err.Error())
} else {
xapp.Logger.Debug("SDL: Subscription written in db. subId = %v", subId)
key := strconv.FormatUint(uint64(subId), 10)
retMap, err := c.db.Get([]string{key})
if err != nil {
+ c.UpdateCounter(cSDLReadFailure)
return nil, fmt.Errorf("SDL: ReadSubscriptionFromSdl(): %s", err.Error())
} else {
xapp.Logger.Debug("SDL: Subscription read from db. subId = %v", subId)
// Get all keys
keys, err := c.db.GetAll()
if err != nil {
+ c.UpdateCounter(cSDLReadFailure)
return nil, nil, fmt.Errorf("SDL: ReadAllSubscriptionsFromSdl(), GetAll(). Error while reading keys from DBAAS %s\n", err.Error())
}
// Get all subscriptionInfos
iSubscriptionMap, err := c.db.Get(keys)
if err != nil {
+ c.UpdateCounter(cSDLReadFailure)
return nil, nil, fmt.Errorf("SDL: ReadAllSubscriptionsFromSdl(), Get(): Error while reading subscriptions from DBAAS %s\n", err.Error())
}
func (c *Control) RemoveAllSubscriptionsFromSdl() error {
if err := c.db.RemoveAll(); err != nil {
+ c.UpdateCounter(cSDLRemoveFailure)
return fmt.Errorf("SDL: RemoveAllSubscriptionsFromSdl(): %s\n", err.Error())
} else {
xapp.Logger.Debug("SDL: All subscriptions removed from db")