X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fdomain%2Fsubscription_repo.py;h=44d7b0e8f0e51a8e5327eaee77c9e697c1d1691b;hb=bd72340e71574c7095e94aa2719df66c3f711545;hp=d12c00d53365776d65abaff562b2b038165b870a;hpb=b37a7d8e36bd9fdf862cb1aad29f9a29052e725f;p=pti%2Fo2.git diff --git a/o2ims/domain/subscription_repo.py b/o2ims/domain/subscription_repo.py index d12c00d..44d7b0e 100644 --- a/o2ims/domain/subscription_repo.py +++ b/o2ims/domain/subscription_repo.py @@ -13,7 +13,7 @@ # limitations under the License. import abc -from typing import List, Set +from typing import List, Set, Tuple from o2ims.domain import subscription_obj as subobj @@ -31,8 +31,12 @@ class SubscriptionRepository(abc.ABC): self.seen.add(subscription) return subscription - def list(self) -> List[subobj.Subscription]: - return self._list() + def list(self, **kwargs) -> List[subobj.Subscription]: + return self._list(**kwargs)[1] + + def list_with_count(self, **kwargs) -> \ + Tuple[int, List[subobj.Subscription]]: + return self._list(**kwargs) def update(self, subscription: subobj.Subscription): self._update(subscription) @@ -52,6 +56,10 @@ class SubscriptionRepository(abc.ABC): def _update(self, subscription: subobj.Subscription): raise NotImplementedError + @abc.abstractmethod + def _list(self, **kwargs) -> Tuple[int, List[subobj.Subscription]]: + raise NotImplementedError + @abc.abstractmethod def _delete(self, subscription_id): raise NotImplementedError