1
0

IRegistry.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Support\Subscription;
  8. use OCP\Notification\IManager;
  9. use OCP\Support\Subscription\Exception\AlreadyRegisteredException;
  10. /**
  11. * @since 17.0.0
  12. */
  13. interface IRegistry {
  14. /**
  15. * Register a subscription instance. In case it is called multiple times an
  16. * exception is thrown
  17. *
  18. * @param ISubscription $subscription
  19. * @throws AlreadyRegisteredException
  20. *
  21. * @since 17.0.0
  22. * @deprecated 20.0.0 use registerService
  23. */
  24. public function register(ISubscription $subscription): void;
  25. /**
  26. * Register a subscription handler. The service has to implement the ISubscription interface.
  27. * In case this is called multiple times an exception is thrown.
  28. *
  29. * @param string $subscriptionService
  30. * @throws AlreadyRegisteredException
  31. *
  32. * @since 20.0.0
  33. */
  34. public function registerService(string $subscriptionService): void;
  35. /**
  36. * Fetches the list of app IDs that are supported by the subscription
  37. *
  38. * @since 17.0.0
  39. */
  40. public function delegateGetSupportedApps(): array;
  41. /**
  42. * Indicates if a valid subscription is available
  43. *
  44. * @since 17.0.0
  45. */
  46. public function delegateHasValidSubscription(): bool;
  47. /**
  48. * Indicates if the subscription has extended support
  49. *
  50. * @since 17.0.0
  51. */
  52. public function delegateHasExtendedSupport(): bool;
  53. /**
  54. * Indicates if a hard user limit is reached and no new users should be created
  55. *
  56. * @param IManager|null $notificationManager
  57. * @since 21.0.0
  58. */
  59. public function delegateIsHardUserLimitReached(?IManager $notificationManager = null): bool;
  60. }