Symptom data collection
[ric-plt/submgr.git] / pkg / control / transaction.go
index 1298925..c7ca812 100644 (file)
@@ -21,7 +21,6 @@ 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"
@@ -53,7 +52,11 @@ type Transaction struct {
 }
 
 func (t *Transaction) String() string {
-       return "trans(" + strconv.FormatUint(uint64(t.Seq), 10) + "/" + (&xapptweaks.RMRMeid{t.Meid}).String() + ")"
+       meidstr := "N/A"
+       if t.Meid != nil {
+               meidstr = t.Meid.String()
+       }
+       return "trans(" + strconv.FormatUint(uint64(t.Seq), 10) + "/" + meidstr + ")"
 }
 
 func (t *Transaction) SendEvent(event interface{}, waittime time.Duration) (bool, bool) {
@@ -126,7 +129,7 @@ func (t *TransactionSubs) Release() {
 //
 //-----------------------------------------------------------------------------
 type TransactionXappKey struct {
-       RmrEndpoint
+       xapp.RmrEndpoint
        Xid string // xapp xid in req
 }
 
@@ -139,8 +142,8 @@ func (key *TransactionXappKey) String() string {
 //-----------------------------------------------------------------------------
 type TransactionXapp struct {
        Transaction
-       XappKey *TransactionXappKey
-       SubId   uint32
+       XappKey   *TransactionXappKey
+       RequestId e2ap.RequestId
 }
 
 func (t *TransactionXapp) String() string {
@@ -148,10 +151,10 @@ func (t *TransactionXapp) String() string {
        if t.XappKey != nil {
                transkey = t.XappKey.String()
        }
-       return "transxapp(" + t.Transaction.String() + "/" + transkey + "/" + strconv.FormatUint(uint64(t.SubId), 10) + ")"
+       return "transxapp(" + t.Transaction.String() + "/" + transkey + "/" + strconv.FormatUint(uint64(t.RequestId.InstanceId), 10) + ")"
 }
 
-func (t *TransactionXapp) GetEndpoint() *RmrEndpoint {
+func (t *TransactionXapp) GetEndpoint() *xapp.RmrEndpoint {
        t.mutex.Lock()
        defer t.mutex.Unlock()
        if t.XappKey != nil {
@@ -181,7 +184,7 @@ func (t *TransactionXapp) GetSrc() string {
 func (t *TransactionXapp) GetSubId() uint32 {
        t.mutex.Lock()
        defer t.mutex.Unlock()
-       return t.SubId
+       return t.RequestId.InstanceId
 }
 
 func (t *TransactionXapp) Release() {