X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fcontrol.go;h=3c7552339cde0da5892d094cbb00024f5c4d4730;hb=refs%2Fchanges%2F06%2F2306%2F1;hp=a2c8b0d5d84acb812c6154ae237d2848a7ca0392;hpb=422d018f94aedd9f4c001176b5ff06c786de28eb;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/control.go b/pkg/control/control.go index a2c8b0d..3c75523 100755 --- a/pkg/control/control.go +++ b/pkg/control/control.go @@ -23,7 +23,6 @@ import ( "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" @@ -60,7 +59,7 @@ type RMRMeid struct { const ( CREATE Action = 0 - MERGE Action = 1 + UPDATE Action = 1 NONE Action = 2 DELETE Action = 3 ) @@ -75,10 +74,7 @@ func init() { 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() @@ -335,7 +331,7 @@ func (c *Control) handleSubscriptionCreate(subs *Subscription, parentTrans *Tran parentTrans.SendEvent(nil, 0) } - subs.DelEndpoint(parentTrans.GetEndpoint()) + go c.registry.RemoveFromSubscription(subs, parentTrans, 5*time.Second) } //------------------------------------------------------------------- @@ -353,7 +349,7 @@ func (c *Control) handleSubscriptionDelete(subs *Subscription, parentTrans *Tran event := c.sendE2TSubscriptionDeleteRequest(subs, trans, parentTrans) parentTrans.SendEvent(event, 0) - subs.DelEndpoint(parentTrans.GetEndpoint()) + go c.registry.RemoveFromSubscription(subs, parentTrans, 5*time.Second) } //-------------------------------------------------------------------