"fmt"
"gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
rtmgrclient "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client"
- rtmgrhandle "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client/handle"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
const (
CREATE Action = 0
- MERGE Action = 1
+ UPDATE Action = 1
NONE Action = 2
DELETE Action = 3
)
func NewControl() *Control {
transport := httptransport.New(viper.GetString("rtmgr.HostAddr")+":"+viper.GetString("rtmgr.port"), viper.GetString("rtmgr.baseUrl"), []string{"http"})
- client := rtmgrclient.New(transport, strfmt.Default)
- handle := rtmgrhandle.NewProvideXappSubscriptionHandleParamsWithTimeout(10 * time.Second)
- deleteHandle := rtmgrhandle.NewDeleteXappSubscriptionHandleParamsWithTimeout(10 * time.Second)
- rtmgrClient := RtmgrClient{client, handle, deleteHandle}
+ rtmgrClient := RtmgrClient{rtClient: rtmgrclient.New(transport, strfmt.Default)}
registry := new(Registry)
registry.Initialize()
parentTrans.SendEvent(nil, 0)
}
- subs.DelEndpoint(parentTrans.GetEndpoint())
+ go c.registry.RemoveFromSubscription(subs, parentTrans, 5*time.Second)
}
//-------------------------------------------------------------------
event := c.sendE2TSubscriptionDeleteRequest(subs, trans, parentTrans)
parentTrans.SendEvent(event, 0)
- subs.DelEndpoint(parentTrans.GetEndpoint())
+ go c.registry.RemoveFromSubscription(subs, parentTrans, 5*time.Second)
}
//-------------------------------------------------------------------
subDelReqMsg := &e2ap.E2APSubscriptionDeleteRequest{}
subDelReqMsg.RequestId.Id = 123
subDelReqMsg.RequestId.Seq = uint32(subs.GetSubId())
- subDelReqMsg.FunctionId = 0
+ subDelReqMsg.FunctionId = subs.SubReqMsg.FunctionId
trans.Mtype, trans.Payload, err = c.e2ap.PackSubscriptionDeleteRequest(subDelReqMsg)
if err != nil {
xapp.Logger.Error("SUBS-SubDelReq: %s parent %s", idstring(trans, subs, err), parentTrans.String())