Skip to content

Commit 4a3bc37

Browse files
committed
+ManuallyLockedException
Signed-off-by: Maxence Lange <[email protected]>
1 parent 3eb3c3f commit 4a3bc37

File tree

3 files changed

+85
-0
lines changed

3 files changed

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

0 commit comments

Comments
 (0)