ICloudFederationProvider.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCP\Federation;
  7. use OCP\Federation\Exceptions\ActionNotSupportedException;
  8. use OCP\Federation\Exceptions\AuthenticationFailedException;
  9. use OCP\Federation\Exceptions\BadRequestException;
  10. use OCP\Federation\Exceptions\ProviderCouldNotAddShareException;
  11. use OCP\Share\Exceptions\ShareNotFound;
  12. /**
  13. * Interface ICloudFederationProvider
  14. *
  15. * Enable apps to create their own cloud federation provider
  16. *
  17. * @since 14.0.0
  18. *
  19. */
  20. interface ICloudFederationProvider {
  21. /**
  22. * get the name of the share type, handled by this provider
  23. *
  24. * @return string
  25. *
  26. * @since 14.0.0
  27. */
  28. public function getShareType();
  29. /**
  30. * share received from another server
  31. *
  32. * @param ICloudFederationShare $share
  33. * @return string provider specific unique ID of the share
  34. *
  35. * @throws ProviderCouldNotAddShareException
  36. *
  37. * @since 14.0.0
  38. */
  39. public function shareReceived(ICloudFederationShare $share);
  40. /**
  41. * notification received from another server
  42. *
  43. * @param string $notificationType (e.g SHARE_ACCEPTED)
  44. * @param string $providerId share ID
  45. * @param array $notification provider specific notification
  46. * @return array<string> $data send back to sender
  47. *
  48. * @throws ShareNotFound
  49. * @throws ActionNotSupportedException
  50. * @throws BadRequestException
  51. * @throws AuthenticationFailedException
  52. *
  53. * @since 14.0.0
  54. */
  55. public function notificationReceived($notificationType, $providerId, array $notification);
  56. /**
  57. * get the supported share types, e.g. "user", "group", etc.
  58. *
  59. * @return array
  60. *
  61. * @since 14.0.0
  62. */
  63. public function getSupportedShareTypes();
  64. }