-/*
-Retreives the transaction table entry for the given request.
-Returns error in case the transaction cannot be found.
-*/
-func (t *Tracker) Update_transaction(SubID uint16, trans_type Action, xact Transaction) error{
- key := Transaction_key{SubID, trans_type}
- if _, ok := t.transaction_table[key]; ok {
- // TODO: Implement merge related check here. If the key is same but the value is different.
- err := fmt.Errorf("Transaction tracker: Similar transaction with sub id %d and type %s is ongoing", key.SubID, key.trans_type )
+func (t *Tracker) NewSubsTransaction(subs *Subscription) *TransactionSubs {
+ trans := &TransactionSubs{}
+ trans.Meid = subs.GetMeid()
+ t.initTransaction(&trans.Transaction)
+ xapp.Logger.Debug("CREATE %s", trans.String())
+ return trans
+}
+
+func (t *Tracker) NewXappTransaction(
+ endpoint *xapp.RmrEndpoint,
+ xid string,
+ requestId e2ap.RequestId,
+ meid *xapp.RMRMeid) *TransactionXapp {
+
+ trans := &TransactionXapp{}
+ trans.XappKey = &TransactionXappKey{requestId.Id, *endpoint, xid}
+ trans.Meid = meid
+ trans.RequestId = requestId
+ t.initTransaction(&trans.Transaction)
+ xapp.Logger.Debug("CREATE %s", trans.String())
+ return trans
+}
+
+func (t *Tracker) Track(trans *TransactionXapp) error {
+
+ if trans.GetEndpoint() == nil {
+ err := fmt.Errorf("Tracker: No valid endpoint given in %s", trans.String())