2022-08-10 04:41:59 -04:00
|
|
|
<?php
|
2022-08-28 14:54:21 -04:00
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2022-08-10 04:41:59 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2022-08-10 04:41:59 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace OCP\Collaboration\Reference;
|
|
|
|
|
|
2022-08-15 03:11:22 -04:00
|
|
|
/**
|
|
|
|
|
* @since 25.0.0
|
|
|
|
|
*/
|
2022-08-10 04:41:59 -04:00
|
|
|
interface IReferenceProvider {
|
2022-08-15 03:11:22 -04:00
|
|
|
/**
|
|
|
|
|
* Validate that a given reference identifier matches the current provider
|
|
|
|
|
*
|
|
|
|
|
* @since 25.0.0
|
|
|
|
|
*/
|
2022-08-12 12:22:52 -04:00
|
|
|
public function matchReference(string $referenceText): bool;
|
2022-08-15 03:11:22 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return a reference with its metadata for a given reference identifier
|
|
|
|
|
*
|
|
|
|
|
* @since 25.0.0
|
|
|
|
|
*/
|
2022-08-10 04:41:59 -04:00
|
|
|
public function resolveReference(string $referenceText): ?IReference;
|
2022-08-15 03:11:22 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return true if the reference metadata can be globally cached
|
|
|
|
|
*
|
|
|
|
|
* @since 25.0.0
|
|
|
|
|
*/
|
2022-08-30 13:53:12 -04:00
|
|
|
public function getCachePrefix(string $referenceId): string;
|
2022-08-15 03:11:22 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return a custom cache key to be used for caching the metadata
|
|
|
|
|
* This could be for example the current user id if the reference
|
|
|
|
|
* access permissions are different for each user
|
|
|
|
|
*
|
2022-08-30 13:53:12 -04:00
|
|
|
* Should return null, if the cache is only related to the
|
|
|
|
|
* reference id and has no further dependency
|
|
|
|
|
*
|
2022-08-15 03:11:22 -04:00
|
|
|
* @since 25.0.0
|
|
|
|
|
*/
|
2022-08-30 13:53:12 -04:00
|
|
|
public function getCacheKey(string $referenceId): ?string;
|
2022-08-10 04:41:59 -04:00
|
|
|
}
|