2018-04-18 10:05:11 -04:00
|
|
|
<?php
|
|
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2018-04-18 10:05:11 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCP\Federation;
|
|
|
|
|
|
2018-05-09 11:06:35 -04:00
|
|
|
use OCP\Federation\Exceptions\ActionNotSupportedException;
|
2018-05-29 10:21:13 -04:00
|
|
|
use OCP\Federation\Exceptions\AuthenticationFailedException;
|
|
|
|
|
use OCP\Federation\Exceptions\BadRequestException;
|
2018-04-30 05:49:24 -04:00
|
|
|
use OCP\Federation\Exceptions\ProviderCouldNotAddShareException;
|
2019-11-22 14:52:10 -05:00
|
|
|
use OCP\Share\Exceptions\ShareNotFound;
|
2018-04-18 10:05:11 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Interface ICloudFederationProvider
|
|
|
|
|
*
|
|
|
|
|
* Enable apps to create their own cloud federation provider
|
|
|
|
|
*
|
|
|
|
|
* @since 14.0.0
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
interface ICloudFederationProvider {
|
|
|
|
|
/**
|
|
|
|
|
* get the name of the share type, handled by this provider
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
2018-04-30 05:49:24 -04:00
|
|
|
*
|
|
|
|
|
* @since 14.0.0
|
2018-04-18 10:05:11 -04:00
|
|
|
*/
|
|
|
|
|
public function getShareType();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* share received from another server
|
|
|
|
|
*
|
|
|
|
|
* @param ICloudFederationShare $share
|
|
|
|
|
* @return string provider specific unique ID of the share
|
|
|
|
|
*
|
2018-04-30 05:49:24 -04:00
|
|
|
* @throws ProviderCouldNotAddShareException
|
|
|
|
|
*
|
2018-04-18 10:05:11 -04:00
|
|
|
* @since 14.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function shareReceived(ICloudFederationShare $share);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* notification received from another server
|
|
|
|
|
*
|
2018-05-09 11:06:35 -04:00
|
|
|
* @param string $notificationType (e.g SHARE_ACCEPTED)
|
2018-05-28 11:13:19 -04:00
|
|
|
* @param string $providerId share ID
|
|
|
|
|
* @param array $notification provider specific notification
|
2023-06-14 03:44:03 -04:00
|
|
|
* @return array<string> $data send back to sender
|
2018-04-18 10:05:11 -04:00
|
|
|
*
|
2018-06-07 08:40:12 -04:00
|
|
|
* @throws ShareNotFound
|
2018-05-09 11:06:35 -04:00
|
|
|
* @throws ActionNotSupportedException
|
2018-05-29 10:21:13 -04:00
|
|
|
* @throws BadRequestException
|
|
|
|
|
* @throws AuthenticationFailedException
|
2018-04-18 10:05:11 -04:00
|
|
|
*
|
|
|
|
|
* @since 14.0.0
|
|
|
|
|
*/
|
2018-05-28 11:13:19 -04:00
|
|
|
public function notificationReceived($notificationType, $providerId, array $notification);
|
2018-04-18 10:05:11 -04:00
|
|
|
|
2018-06-13 08:46:23 -04:00
|
|
|
/**
|
|
|
|
|
* get the supported share types, e.g. "user", "group", etc.
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @since 14.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getSupportedShareTypes();
|
2018-04-18 10:05:11 -04:00
|
|
|
}
|