X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fsubscription.go;h=58f0adf545703644eaa18263e4e8df1af718ac4b;hb=52e2f8ec3ebcb9d58fe2b01d70530f2fa44666cb;hp=52430936817eca32b9df6c5308732c77b736df0e;hpb=cdc35bff0dd4c41d1e764d3f48efa70d9f33a8f7;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/subscription.go b/pkg/control/subscription.go index 5243093..58f0adf 100644 --- a/pkg/control/subscription.go +++ b/pkg/control/subscription.go @@ -21,9 +21,8 @@ package control import ( "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap" - "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/xapptweaks" "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" - //"reflect" + "sync" ) @@ -31,20 +30,33 @@ import ( // //----------------------------------------------------------------------------- type Subscription struct { - mutex sync.Mutex // Lock - valid bool // valid - registry *Registry // Registry - ReqId RequestId // ReqId (Requestor Id + Seq Nro a.k.a subsid) - Meid *xapp.RMRMeid // Meid/ RanName - EpList xapptweaks.RmrEndpointList // Endpoints - TransLock sync.Mutex // Lock transactions, only one executed per time for subs - TheTrans TransactionIf // Ongoing transaction - SubReqMsg *e2ap.E2APSubscriptionRequest // Subscription information - SubRFMsg interface{} // Subscription information + mutex sync.Mutex // Lock + valid bool // valid + registry *Registry // Registry + ReqId RequestId // ReqId (Requestor Id + Seq Nro a.k.a subsid) + Meid *xapp.RMRMeid // Meid/RanName + EpList xapp.RmrEndpointList // Endpoints + RMRRouteCreated bool // Does subscription have RMR route + TransLock sync.Mutex // Lock transactions, only one executed per time for subs + TheTrans TransactionIf // Ongoing transaction + SubReqMsg *e2ap.E2APSubscriptionRequest // Subscription information + SubRFMsg interface{} // Subscription information + OngoingReqCount int // Subscription create process is ongoing. In merge case it can ongoing for more than one endpoint + OngoingDelCount int // Subscription delete process is ongoing. In merge case it can ongoing for more than one endpoint + PolicyUpdate bool // This is true when policy subscrition is being updated. Used not to send delete for update after timeout or restart + RetryFromXapp bool // Retry form xApp for subscription that already exist + SubRespRcvd bool // Subscription response received + DeleteFromDb bool // Delete subscription from db + NoRespToXapp bool // Send no response for subscription delete to xApp after restart + DoNotWaitSubResp bool // Test flag. Response is not waited for Subscription Request } func (s *Subscription) String() string { - return "subs(" + s.ReqId.String() + "/" + (&xapptweaks.RMRMeid{s.Meid}).String() + "/" + s.EpList.String() + ")" + meidstr := "N/A" + if s.Meid != nil { + meidstr = s.Meid.String() + } + return "subs(" + s.ReqId.String() + "/" + meidstr + "/" + s.EpList.String() + ")" } func (s *Subscription) GetCachedResponse() (interface{}, bool) { @@ -70,10 +82,7 @@ func (s *Subscription) GetReqId() *RequestId { func (s *Subscription) GetMeid() *xapp.RMRMeid { s.mutex.Lock() defer s.mutex.Unlock() - if s.Meid != nil { - return s.Meid - } - return nil + return s.Meid } func (s *Subscription) GetTransaction() TransactionIf { @@ -154,8 +163,6 @@ func (s *Subscription) IsMergeable(trans *TransactionXapp, subReqMsg *e2ap.E2APS return false } } - //reflect.DeepEqual(acts.ActionDefinitionChoice, actt.ActionDefinitionChoice) - if acts.SubsequentAction.Present != actt.SubsequentAction.Present || acts.SubsequentAction.Type != actt.SubsequentAction.Type || acts.SubsequentAction.TimetoWait != actt.SubsequentAction.TimetoWait { @@ -163,6 +170,5 @@ func (s *Subscription) IsMergeable(trans *TransactionXapp, subReqMsg *e2ap.E2APS } } } - return true }