X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fdomain%2Fsubscription_repo.py;h=4012b587fbcd4a0ab30f7ee6fa15ce5689f8f732;hb=58994b7d851b47456eed1820d36cc06803777e3b;hp=d12c00d53365776d65abaff562b2b038165b870a;hpb=9625c5b766377f641d9641471f10dd491a61447f;p=pti%2Fo2.git diff --git a/o2ims/domain/subscription_repo.py b/o2ims/domain/subscription_repo.py index d12c00d..4012b58 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, *args, **kwargs) -> \ + Tuple[int, List[subobj.Subscription]]: + return self._list(*args, **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