public interface VFSLockService
Modifier and Type | Method and Description |
---|---|
LockResult |
acquireLock(Path path)
Creates a lock file for the specified
Path , to be held by the
currently authenticated user. |
LockResult |
forceReleaseLock(Path path)
Deletes the lock file for the specified
Path even if the requesting
user does not own the lock. |
LockResult |
releaseLock(Path path)
Deletes the lock file for the specified
Path . |
LockInfo |
retrieveLockInfo(Path path)
Retrieves the lock information for the specified
Path . |
List<LockInfo> |
retrieveLockInfos(Path path,
boolean excludeOwnedLocks)
Retrieves all locks for children (files or directories) of the provided
path.
|
LockResult acquireLock(Path path) throws IllegalArgumentException, IOException
Path
, to be held by the
currently authenticated user. If successful, this method associates the
created lock with the user's HTTP session so locks can automatically be
released when the session ends, expires or is destroyed.path
- the path of the file or directory to lock.LockResult
, indicating success or failure and
containing the last read LockInfo
.IllegalArgumentException
- If the provided path is invalid or null.IOException
- If a lock file can't be written or an existing lock can't be
read.LockResult releaseLock(Path path) throws IllegalArgumentException, IOException
Path
. The requesting user
needs to own the lock for this operation to succeed.path
- the path of the file or directory currently assumed locked.LockResult
, indicating success or failure and
containing the last read LockInfo
.IllegalArgumentException
- If the provided path is invalid or null.IOException
- If a lock file can't be deleted or an existing lock can't be
read.LockResult forceReleaseLock(Path path) throws IllegalArgumentException, IOException
Path
even if the requesting
user does not own the lock.path
- the path of the file or directory currently assumed locked.LockResult
, indicating success or failure and
containing the last read LockInfo
.IllegalArgumentException
- If the provided path is invalid or null.IOException
- If a lock file can't be deleted or an existing lock can't be
read.LockInfo retrieveLockInfo(Path path) throws IllegalArgumentException, IOException
Path
.path
- the path of the file or directory.LockInfo
for the provided Path
.IllegalArgumentException
- If the provided path is invalid or null.IOException
- If a lock file can't be read.List<LockInfo> retrieveLockInfos(Path path, boolean excludeOwnedLocks) throws IllegalArgumentException, IOException
path
- the path of the directory.excludeOwnedLocks
- filters the resulting list so it doesn't contain locks owned
by the currently authenticated user.LockInfo
s for children of the provided path
that are currently locked, or an empty list if no such locks
exist.IllegalArgumentException
- If the provided path is invalid or null.IOException
- If a lock file can't be read.Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.