xapp-frame v0.8.2 integration to submgr
[ric-plt/submgr.git] / pkg / control / tracker.go
index 2f54237..df3d56e 100644 (file)
@@ -21,6 +21,7 @@ package control
 
 import (
        "fmt"
+       "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
        "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
        "sync"
 )
@@ -50,27 +51,21 @@ func (t *Tracker) initTransaction(transBase *Transaction) {
 func (t *Tracker) NewSubsTransaction(subs *Subscription) *TransactionSubs {
        trans := &TransactionSubs{}
        trans.Meid = subs.GetMeid()
-       rid := subs.GetReqId()
-       if rid != nil {
-               trans.ReqId = *rid
-       }
        t.initTransaction(&trans.Transaction)
        xapp.Logger.Debug("CREATE %s", trans.String())
        return trans
 }
 
 func (t *Tracker) NewXappTransaction(
-       endpoint *RmrEndpoint,
+       endpoint *xapp.RmrEndpoint,
        xid string,
-       reqId *RequestId,
+       requestId e2ap.RequestId,
        meid *xapp.RMRMeid) *TransactionXapp {
 
        trans := &TransactionXapp{}
-       trans.XappKey = &TransactionXappKey{*endpoint, xid}
+       trans.XappKey = &TransactionXappKey{requestId.Id, *endpoint, xid}
        trans.Meid = meid
-       if reqId != nil {
-               trans.ReqId = *reqId
-       }
+       trans.RequestId = requestId
        t.initTransaction(&trans.Transaction)
        xapp.Logger.Debug("CREATE %s", trans.String())
        return trans
@@ -109,5 +104,5 @@ func (t *Tracker) UnTrackTransaction(xappKey TransactionXappKey) (*TransactionXa
                //xapp.Logger.Debug("Tracker: transtable=%v", t.transactionXappTable)
                return trans, nil
        }
-       return nil, fmt.Errorf("Tracker: No record %s", xappKey)
+       return nil, fmt.Errorf("Tracker: No record %v", xappKey)
 }