ILockProvider.php 811 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Files\Lock;
  8. use OCP\PreConditionNotMetException;
  9. /**
  10. * @since 24.0.0
  11. */
  12. interface ILockProvider {
  13. /**
  14. * @throws PreConditionNotMetException
  15. * @throws NoLockProviderException
  16. * @psalm-return list<ILock>
  17. * @since 24.0.0
  18. */
  19. public function getLocks(int $fileId): array;
  20. /**
  21. * @throws PreConditionNotMetException
  22. * @throws OwnerLockedException
  23. * @throws NoLockProviderException
  24. * @since 24.0.0
  25. */
  26. public function lock(LockContext $lockInfo): ILock;
  27. /**
  28. * @throws PreConditionNotMetException
  29. * @throws NoLockProviderException
  30. * @since 24.0.0
  31. */
  32. public function unlock(LockContext $lockInfo): void;
  33. }