-func (s *Sbi) updateEndpoints(rcs *rtmgr.RicComponents, sbii SbiEngine) {
- for _, xapp := range (*rcs).Xapps {
- for _, instance := range xapp.Instances {
- uuid := instance.Ip + ":" + strconv.Itoa(int(instance.Port))
- if _, ok := rtmgr.Eps[uuid]; ok {
- rtmgr.Eps[uuid].Keepalive = true
- } else {
- ep := &rtmgr.Endpoint{
- uuid,
- instance.Name,
- xapp.Name,
- instance.Ip,
- instance.Port,
- instance.TxMessages,
- instance.RxMessages,
- nil,
- false,
- true,
- }
- if err := sbii.AddEndpoint(ep); err != nil {
- rtmgr.Logger.Error("can't create socket for endpoint: " + ep.Name + " due to:" + err.Error())
- continue
- }
- rtmgr.Eps[uuid] = ep
- }
- }
- }
- s.updatePlatformEndpoints(&((*rcs).Pcs), sbii)
- s.pruneEndpointList(sbii)
+func (s *Sbi) updateEndpoints(rcs *rtmgr.RicComponents, sbi Engine) {
+ for _, xapps := range (*rcs).XApps {
+ for _, instance := range xapps.Instances {
+ uuid := instance.Ip + ":" + strconv.Itoa(int(instance.Port))
+ if _, ok := rtmgr.Eps[uuid]; ok {
+ rtmgr.Eps[uuid].Keepalive = true
+ } else {
+ ep := &rtmgr.Endpoint{
+ Uuid: uuid,
+ Name: instance.Name,
+ XAppType: xapps.Name,
+ Ip: instance.Ip,
+ Port: instance.Port,
+ TxMessages: instance.TxMessages,
+ RxMessages: instance.RxMessages,
+ Policies: instance.Policies,
+ Socket: nil,
+ IsReady: false,
+ Keepalive: true,
+ }
+ if err := sbi.AddEndpoint(ep); err != nil {
+ xapp.Logger.Error("can't create socket for endpoint: " + ep.Name + " due to:" + err.Error())
+ continue
+ }
+ rtmgr.Eps[uuid] = ep
+ }
+ }
+ }
+ s.updatePlatformEndpoints(&((*rcs).Pcs), sbi)
+ s.pruneEndpointList(sbi)