Skip to content

Commit 9bdc582

Browse files
committed
+ManuallyLockedException
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 3eb3c3f commit 9bdc582

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

lib/composer/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@
349349
'OCP\\LDAP\\ILDAPProviderFactory' => $baseDir . '/lib/public/LDAP/ILDAPProviderFactory.php',
350350
'OCP\\Lock\\ILockingProvider' => $baseDir . '/lib/public/Lock/ILockingProvider.php',
351351
'OCP\\Lock\\LockedException' => $baseDir . '/lib/public/Lock/LockedException.php',
352+
'OCP\\Lock\\ManuallyLockedException' => $baseDir . '/lib/public/Lock/ManuallyLockedException.php',
352353
'OCP\\Lockdown\\ILockdownManager' => $baseDir . '/lib/public/Lockdown/ILockdownManager.php',
353354
'OCP\\Log\\IFileBased' => $baseDir . '/lib/public/Log/IFileBased.php',
354355
'OCP\\Log\\ILogFactory' => $baseDir . '/lib/public/Log/ILogFactory.php',

lib/composer/composer/autoload_static.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
378378
'OCP\\LDAP\\ILDAPProviderFactory' => __DIR__ . '/../../..' . '/lib/public/LDAP/ILDAPProviderFactory.php',
379379
'OCP\\Lock\\ILockingProvider' => __DIR__ . '/../../..' . '/lib/public/Lock/ILockingProvider.php',
380380
'OCP\\Lock\\LockedException' => __DIR__ . '/../../..' . '/lib/public/Lock/LockedException.php',
381+
'OCP\\Lock\\ManuallyLockedException' => __DIR__ . '/../../..' . '/lib/public/Lock/ManuallyLockedException.php',
381382
'OCP\\Lockdown\\ILockdownManager' => __DIR__ . '/../../..' . '/lib/public/Lockdown/ILockdownManager.php',
382383
'OCP\\Log\\IFileBased' => __DIR__ . '/../../..' . '/lib/public/Log/IFileBased.php',
383384
'OCP\\Log\\ILogFactory' => __DIR__ . '/../../..' . '/lib/public/Log/ILogFactory.php',
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?php declare(strict_types=1);
2+
3+
4+
5+
/**
6+
* This file is licensed under the Affero General Public License version 3 or
7+
* later. See the COPYING file.
8+
*
9+
* @author Maxence Lange <maxence@artificial-owl.com>
10+
* @copyright 2019, Maxence Lange <maxence@artificial-owl.com>
11+
* @license GNU AGPL version 3 or any later version
12+
*
13+
* This program is free software: you can redistribute it and/or modify
14+
* it under the terms of the GNU Affero General Public License as
15+
* published by the Free Software Foundation, either version 3 of the
16+
* License, or (at your option) any later version.
17+
*
18+
* This program is distributed in the hope that it will be useful,
19+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
* GNU Affero General Public License for more details.
22+
*
23+
* You should have received a copy of the GNU Affero General Public License
24+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25+
*
26+
*/
27+
28+
29+
namespace OCP\Lock;
30+
31+
32+
/**
33+
* Class ManuallyLockedException
34+
*
35+
* @package OCP\Lock
36+
* @since 18.0.0
37+
*/
38+
class ManuallyLockedException extends LockedException {
39+
40+
41+
/**
42+
* owner of the lock
43+
*
44+
* @var string|null
45+
*/
46+
private $owner = null;
47+
48+
/**
49+
* estimated timeout for the lock
50+
*
51+
* @var int
52+
* @since 18.0.0
53+
*/
54+
private $timeout = -1;
55+
56+
57+
/**
58+
* ManuallyLockedException constructor.
59+
*
60+
* @param string $path locked path
61+
* @param \Exception|null $previous previous exception for cascading
62+
* @param string $existingLock
63+
* @param string|null $owner
64+
* @param int $timeout
65+
*
66+
* @since 18.0.0
67+
*/
68+
public function __construct(string $path, \Exception $previous = null, string $existingLock = null, string $owner = null, int $timeout = -1) {
69+
parent::__construct($path, $previous, $existingLock);
70+
$this->owner = $owner;
71+
$this->timeout = $timeout;
72+
}
73+
74+
75+
/**
76+
* @return int
77+
* @since 18.0.0
78+
*/
79+
public function getTimeout(): int {
80+
return $this->timeout;
81+
}
82+
83+
/**
84+
* @return string|null
85+
* @since 18.0.0
86+
*/
87+
public function getOwner(): ?string {
88+
return $this->owner;
89+
}
90+
91+
}

0 commit comments

Comments
 (0)