X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=inline;f=pkg%2Fcontrol%2Ftransaction.go;h=1298925e3a6401ac80c565a83c6f6ed637ee332a;hb=d708a43badb0742684b22866977f14cc1c03a1ba;hp=df4d7db4147a34c101a05330b2d5a3184bb5dd74;hpb=a9bf76cb8dec6e52e7699edf1631c214647f8beb;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/transaction.go b/pkg/control/transaction.go index df4d7db..1298925 100644 --- a/pkg/control/transaction.go +++ b/pkg/control/transaction.go @@ -21,6 +21,7 @@ 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" "strconv" "sync" @@ -46,14 +47,13 @@ type Transaction struct { Seq uint64 //transaction sequence tracker *Tracker //tracker instance Meid *xapp.RMRMeid //meid transaction related - ReqId RequestId // Mtype int //Encoded message type to be send Payload *e2ap.PackedData //Encoded message to be send EventChan chan interface{} } func (t *Transaction) String() string { - return "trans(" + strconv.FormatUint(uint64(t.Seq), 10) + "/" + t.Meid.RanName + "/" + t.ReqId.String() + ")" + return "trans(" + strconv.FormatUint(uint64(t.Seq), 10) + "/" + (&xapptweaks.RMRMeid{t.Meid}).String() + ")" } func (t *Transaction) SendEvent(event interface{}, waittime time.Duration) (bool, bool) { @@ -83,12 +83,6 @@ func (t *Transaction) WaitEvent(waittime time.Duration) (interface{}, bool) { return event, false } -func (t *Transaction) GetReqId() *RequestId { - t.mutex.Lock() - defer t.mutex.Unlock() - return &t.ReqId -} - func (t *Transaction) GetMtype() int { t.mutex.Lock() defer t.mutex.Unlock() @@ -144,8 +138,9 @@ func (key *TransactionXappKey) String() string { // //----------------------------------------------------------------------------- type TransactionXapp struct { - Transaction // - XappKey *TransactionXappKey // + Transaction + XappKey *TransactionXappKey + SubId uint32 } func (t *TransactionXapp) String() string { @@ -153,7 +148,7 @@ func (t *TransactionXapp) String() string { if t.XappKey != nil { transkey = t.XappKey.String() } - return "transxapp(" + t.Transaction.String() + "/" + transkey + ")" + return "transxapp(" + t.Transaction.String() + "/" + transkey + "/" + strconv.FormatUint(uint64(t.SubId), 10) + ")" } func (t *TransactionXapp) GetEndpoint() *RmrEndpoint { @@ -183,6 +178,12 @@ func (t *TransactionXapp) GetSrc() string { return "" } +func (t *TransactionXapp) GetSubId() uint32 { + t.mutex.Lock() + defer t.mutex.Unlock() + return t.SubId +} + func (t *TransactionXapp) Release() { t.mutex.Lock() xapp.Logger.Debug("RELEASE %s", t.String())