IProviderFactory.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Roeland Jago Douma <roeland@famdouma.nl>
  6. *
  7. * @license AGPL-3.0
  8. *
  9. * This code is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License, version 3,
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. namespace OCP\Share;
  23. use OC\Share20\Exception\ProviderException;
  24. use OCP\IServerContainer;
  25. /**
  26. * Interface IProviderFactory
  27. *
  28. * @package OC\Share20
  29. * @since 9.0.0
  30. */
  31. interface IProviderFactory {
  32. /**
  33. * IProviderFactory constructor.
  34. * @param IServerContainer $serverContainer
  35. * @since 9.0.0
  36. */
  37. public function __construct(IServerContainer $serverContainer);
  38. /**
  39. * @param string $id
  40. * @return IShareProvider
  41. * @throws ProviderException
  42. * @since 9.0.0
  43. */
  44. public function getProvider($id);
  45. /**
  46. * @param int $shareType
  47. * @return IShareProvider
  48. * @throws ProviderException
  49. * @since 9.0.0
  50. */
  51. public function getProviderForType($shareType);
  52. /**
  53. * @return IShareProvider[]
  54. * @since 11.0.0
  55. */
  56. public function getAllProviders();
  57. }