IRegistry.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>
  5. *
  6. * @author Julius Härtl <jus@bitgrid.net>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. *
  10. * @license GNU AGPL version 3 or any later version
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License as
  14. * published by the Free Software Foundation, either version 3 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. *
  25. */
  26. namespace OCP\Support\Subscription;
  27. use OCP\Notification\IManager;
  28. use OCP\Support\Subscription\Exception\AlreadyRegisteredException;
  29. /**
  30. * @since 17.0.0
  31. */
  32. interface IRegistry {
  33. /**
  34. * Register a subscription instance. In case it is called multiple times an
  35. * exception is thrown
  36. *
  37. * @param ISubscription $subscription
  38. * @throws AlreadyRegisteredException
  39. *
  40. * @since 17.0.0
  41. * @deprecated 20.0.0 use registerService
  42. */
  43. public function register(ISubscription $subscription): void;
  44. /**
  45. * Register a subscription handler. The service has to implement the ISubscription interface.
  46. * In case this is called multiple times an exception is thrown.
  47. *
  48. * @param string $subscriptionService
  49. * @throws AlreadyRegisteredException
  50. *
  51. * @since 20.0.0
  52. */
  53. public function registerService(string $subscriptionService): void;
  54. /**
  55. * Fetches the list of app IDs that are supported by the subscription
  56. *
  57. * @since 17.0.0
  58. */
  59. public function delegateGetSupportedApps(): array;
  60. /**
  61. * Indicates if a valid subscription is available
  62. *
  63. * @since 17.0.0
  64. */
  65. public function delegateHasValidSubscription(): bool;
  66. /**
  67. * Indicates if the subscription has extended support
  68. *
  69. * @since 17.0.0
  70. */
  71. public function delegateHasExtendedSupport(): bool;
  72. /**
  73. * Indicates if a hard user limit is reached and no new users should be created
  74. *
  75. * @param IManager|null $notificationManager
  76. * @since 21.0.0
  77. */
  78. public function delegateIsHardUserLimitReached(?IManager $notificationManager = null): bool;
  79. }