-func (s *Subscription) Confirmed() {
- s.mutex.Lock()
- defer s.mutex.Unlock()
- s.Active = true
-}
-
-func (s *Subscription) UnConfirmed() {
- s.mutex.Lock()
- defer s.mutex.Unlock()
- s.Active = false
-}
-
-func (s *Subscription) IsConfirmed() bool {
- s.mutex.Lock()
- defer s.mutex.Unlock()
- return s.Active
-}
-
-func (s *Subscription) SetTransaction(trans *Transaction) error {
- s.mutex.Lock()
- defer s.mutex.Unlock()
-
- subString := strconv.FormatUint(uint64(s.Seq), 10) + "/" + s.RmrEndpoint.String() + "/" + s.Meid.RanName
-
- if (s.RmrEndpoint.Addr != trans.RmrEndpoint.Addr) || (s.RmrEndpoint.Port != trans.RmrEndpoint.Port) {
- return fmt.Errorf("Subscription: %s endpoint mismatch with trans: %s", subString, trans)
- }
- if s.Trans != nil {
- return fmt.Errorf("Subscription: %s trans %s exist, can not register %s", subString, s.Trans, trans)
- }
- trans.Subs = s
- s.Trans = trans
- return nil
-}
-
-func (s *Subscription) UnSetTransaction(trans *Transaction) bool {