1
0

CloudFederationFactory.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Federation;
  7. use OCP\Federation\ICloudFederationFactory;
  8. use OCP\Federation\ICloudFederationNotification;
  9. use OCP\Federation\ICloudFederationShare;
  10. class CloudFederationFactory implements ICloudFederationFactory {
  11. /**
  12. * get a CloudFederationShare Object to prepare a share you want to send
  13. *
  14. * @param string $shareWith
  15. * @param string $name resource name (e.g. document.odt)
  16. * @param string $description share description (optional)
  17. * @param string $providerId resource UID on the provider side
  18. * @param string $owner provider specific UID of the user who owns the resource
  19. * @param string $ownerDisplayName display name of the user who shared the item
  20. * @param string $sharedBy provider specific UID of the user who shared the resource
  21. * @param string $sharedByDisplayName display name of the user who shared the resource
  22. * @param string $sharedSecret used to authenticate requests across servers
  23. * @param string $shareType ('group' or 'user' share)
  24. * @param $resourceType ('file', 'calendar',...)
  25. * @return ICloudFederationShare
  26. *
  27. * @since 14.0.0
  28. */
  29. public function getCloudFederationShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $sharedSecret, $shareType, $resourceType) {
  30. return new CloudFederationShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $shareType, $resourceType, $sharedSecret);
  31. }
  32. /**
  33. * get a Cloud FederationNotification object to prepare a notification you
  34. * want to send
  35. *
  36. * @return ICloudFederationNotification
  37. *
  38. * @since 14.0.0
  39. */
  40. public function getCloudFederationNotification() {
  41. return new CloudFederationNotification();
  42. }
  43. }