|
12 | 12 | use OCP\PreConditionNotMetException; |
13 | 13 |
|
14 | 14 | /** |
15 | | - * Manage app integrations with files_lock with collaborative editors |
| 15 | + * Manage app integrations with the files_lock app and collaborative editors. |
16 | 16 | * |
17 | | - * The OCP parts are mainly for exposing the ability to lock/unlock for apps and |
18 | | - * to give the files_lock app a way to register and then be triggered by the apps |
19 | | - * while the actual locking implementation is kept in the LockProvider and DAV |
20 | | - * plugin from files_lock app. |
| 17 | + * This public API exposes locking operations to apps and allows a lock provider |
| 18 | + * from files_lock to be registered. The actual locking implementation remains |
| 19 | + * in the provider and the DAV plugin of the files_lock app. |
21 | 20 | * |
22 | 21 | * @since 24.0.0 |
23 | 22 | */ |
24 | 23 | interface ILockManager extends ILockProvider { |
25 | 24 | /** |
26 | | - * @throws PreConditionNotMetException if there is already a lock provider registered |
| 25 | + * Register the lock provider implementation. |
| 26 | + * |
| 27 | + * @throws PreConditionNotMetException if a lock provider is already registered |
27 | 28 | * @since 24.0.0 |
28 | 29 | * @deprecated 30.0.0 Use registerLazyLockProvider |
29 | 30 | */ |
30 | 31 | public function registerLockProvider(ILockProvider $lockProvider): void; |
31 | 32 |
|
32 | 33 | /** |
33 | | - * @param string $lockProviderClass |
34 | | - * @return void |
| 34 | + * Register a lock provider class for lazy resolution from the server container. |
| 35 | + * |
| 36 | + * @throws PreConditionNotMetException if a lock provider is already registered |
35 | 37 | * @since 30.0.0 |
36 | 38 | */ |
37 | 39 | public function registerLazyLockProvider(string $lockProviderClass): void; |
38 | 40 |
|
39 | 41 | /** |
40 | | - * @return bool |
| 42 | + * Check whether a lock provider is currently available. |
| 43 | + * |
| 44 | + * If a provider class was registered lazily, this may attempt to resolve it. |
| 45 | + * |
41 | 46 | * @since 24.0.0 |
42 | 47 | */ |
43 | 48 | public function isLockProviderAvailable(): bool; |
44 | 49 |
|
45 | 50 | /** |
46 | | - * Run within the scope of a given lock condition |
| 51 | + * Run a callback within the scope of the given lock context. |
47 | 52 | * |
48 | | - * The callback will also be executed if no lock provider is present |
| 53 | + * The callback is also executed if no lock provider is available. |
49 | 54 | * |
| 55 | + * @throws PreConditionNotMetException if another lock scope is already active |
50 | 56 | * @since 24.0.0 |
51 | 57 | */ |
52 | 58 | public function runInScope(LockContext $lock, callable $callback): void; |
53 | 59 |
|
54 | 60 | /** |
55 | | - * @throws NoLockProviderException if there is no lock provider available |
| 61 | + * Get the lock context currently active in this scope. |
| 62 | + * |
| 63 | + * Returns null if no lock scope is active. |
| 64 | + * |
56 | 65 | * @since 24.0.0 |
57 | 66 | */ |
58 | 67 | public function getLockInScope(): ?LockContext; |
|
0 commit comments