diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-04-06 17:47:45 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-04-07 11:52:16 +0200 |
commit | 9b408d556d32ea81883e1f6a61a821e1959025e6 (patch) | |
tree | a1229f2fccf12dc50e30ce7a39d15352a6f1434e | |
parent | 40f1ad60c245bfe35998b718aab2fe0f726f3798 (diff) | |
download | nextcloud-server-9b408d556d32ea81883e1f6a61a821e1959025e6.tar.gz nextcloud-server-9b408d556d32ea81883e1f6a61a821e1959025e6.zip |
Adapt LockScope to LockContext rename
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 2 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Lock/LockManager.php | 12 | ||||
-rw-r--r-- | lib/public/Files/Lock/ILockManager.php | 4 | ||||
-rw-r--r-- | lib/public/Files/Lock/ILockProvider.php | 4 | ||||
-rw-r--r-- | lib/public/Files/Lock/LockContext.php (renamed from lib/public/Files/Lock/LockScope.php) | 5 |
6 files changed, 15 insertions, 14 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 45724ba3a85..027e12d30d3 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -298,7 +298,7 @@ return array( 'OCP\\Files\\Lock\\ILock' => $baseDir . '/lib/public/Files/Lock/ILock.php', 'OCP\\Files\\Lock\\ILockManager' => $baseDir . '/lib/public/Files/Lock/ILockManager.php', 'OCP\\Files\\Lock\\ILockProvider' => $baseDir . '/lib/public/Files/Lock/ILockProvider.php', - 'OCP\\Files\\Lock\\LockScope' => $baseDir . '/lib/public/Files/Lock/LockScope.php', + 'OCP\\Files\\Lock\\LockContext' => $baseDir . '/lib/public/Files/Lock/LockContext.php', 'OCP\\Files\\Lock\\NoLockProviderException' => $baseDir . '/lib/public/Files/Lock/NoLockProviderException.php', 'OCP\\Files\\Lock\\OwnerLockedException' => $baseDir . '/lib/public/Files/Lock/OwnerLockedException.php', 'OCP\\Files\\Mount\\IMountManager' => $baseDir . '/lib/public/Files/Mount/IMountManager.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index f5bd2e5ef98..8dc021af16b 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -327,7 +327,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OCP\\Files\\Lock\\ILock' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/ILock.php', 'OCP\\Files\\Lock\\ILockManager' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/ILockManager.php', 'OCP\\Files\\Lock\\ILockProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/ILockProvider.php', - 'OCP\\Files\\Lock\\LockScope' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/LockScope.php', + 'OCP\\Files\\Lock\\LockContext' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/LockContext.php', 'OCP\\Files\\Lock\\NoLockProviderException' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/NoLockProviderException.php', 'OCP\\Files\\Lock\\OwnerLockedException' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/OwnerLockedException.php', 'OCP\\Files\\Mount\\IMountManager' => __DIR__ . '/../../..' . '/lib/public/Files/Mount/IMountManager.php', diff --git a/lib/private/Files/Lock/LockManager.php b/lib/private/Files/Lock/LockManager.php index 59022613fdb..e2af532a01c 100644 --- a/lib/private/Files/Lock/LockManager.php +++ b/lib/private/Files/Lock/LockManager.php @@ -5,12 +5,12 @@ namespace OC\Files\Lock; use OCP\Files\Lock\ILock; use OCP\Files\Lock\ILockManager; use OCP\Files\Lock\ILockProvider; -use OCP\Files\Lock\LockScope; +use OCP\Files\Lock\LockContext; use OCP\PreConditionNotMetException; class LockManager implements ILockManager { private ?ILockProvider $lockProvider = null; - private ?LockScope $lockInScope = null; + private ?LockContext $lockInScope = null; public function registerLockProvider(ILockProvider $lockProvider): void { if ($this->lockProvider) { @@ -24,7 +24,7 @@ class LockManager implements ILockManager { return $this->lockProvider !== null; } - public function runInScope(LockScope $lock, callable $callback): void { + public function runInScope(LockContext $lock, callable $callback): void { if (!$this->lockProvider) { $callback(); return; @@ -42,7 +42,7 @@ class LockManager implements ILockManager { } } - public function getLockInScope(): ?LockScope { + public function getLockInScope(): ?LockContext { return $this->lockInScope; } @@ -54,7 +54,7 @@ class LockManager implements ILockManager { return $this->lockProvider->getLocks($fileId); } - public function lock(LockScope $lockInfo): ILock { + public function lock(LockContext $lockInfo): ILock { if (!$this->lockProvider) { throw new PreConditionNotMetException('No lock provider available'); } @@ -62,7 +62,7 @@ class LockManager implements ILockManager { return $this->lockProvider->lock($lockInfo); } - public function unlock(LockScope $lockInfo): void { + public function unlock(LockContext $lockInfo): void { if (!$this->lockProvider) { throw new PreConditionNotMetException('No lock provider available'); } diff --git a/lib/public/Files/Lock/ILockManager.php b/lib/public/Files/Lock/ILockManager.php index bd6d7db69d6..cad66380e93 100644 --- a/lib/public/Files/Lock/ILockManager.php +++ b/lib/public/Files/Lock/ILockManager.php @@ -59,11 +59,11 @@ interface ILockManager extends ILockProvider { * * @since 24.0.0 */ - public function runInScope(LockScope $lock, callable $callback): void; + public function runInScope(LockContext $lock, callable $callback): void; /** * @throws NoLockProviderException if there is no lock provider available * @since 24.0.0 */ - public function getLockInScope(): ?LockScope; + public function getLockInScope(): ?LockContext; } diff --git a/lib/public/Files/Lock/ILockProvider.php b/lib/public/Files/Lock/ILockProvider.php index 5df28aaef44..50326c427e4 100644 --- a/lib/public/Files/Lock/ILockProvider.php +++ b/lib/public/Files/Lock/ILockProvider.php @@ -47,12 +47,12 @@ interface ILockProvider { * @throws NoLockProviderException * @since 24.0.0 */ - public function lock(LockScope $lockInfo): ILock; + public function lock(LockContext $lockInfo): ILock; /** * @throws PreConditionNotMetException * @throws NoLockProviderException * @since 24.0.0 */ - public function unlock(LockScope $lockInfo): void; + public function unlock(LockContext $lockInfo): void; } diff --git a/lib/public/Files/Lock/LockScope.php b/lib/public/Files/Lock/LockContext.php index 4d68f4c68c7..1466cb41ae1 100644 --- a/lib/public/Files/Lock/LockScope.php +++ b/lib/public/Files/Lock/LockContext.php @@ -29,13 +29,14 @@ namespace OCP\Files\Lock; use OCP\Files\Node; /** - * Structure to identify a specific lock scope + * Structure to identify a specific lock context to request or + * describe a lock with the affected node and ownership information * * This is used to match a lock/unlock request or file operation to existing locks * * @since 24.0.0 */ -final class LockScope { +final class LockContext { private Node $node; private int $type; private string $owner; |