Package org.uberfire.backend.vfs
Interface VFSLockService
-
public interface VFSLockServiceProvides methods to manage locks in UberFire's virtual file system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.uberfire.backend.vfs.impl.LockResultacquireLock(org.uberfire.backend.vfs.Path path)Creates a lock file for the specifiedPath, to be held by the currently authenticated user.org.uberfire.backend.vfs.impl.LockResultforceReleaseLock(org.uberfire.backend.vfs.Path path)Deletes the lock file for the specifiedPatheven if the requesting user does not own the lock.org.uberfire.backend.vfs.impl.LockResultreleaseLock(org.uberfire.backend.vfs.Path path)Deletes the lock file for the specifiedPath.org.uberfire.backend.vfs.impl.LockInforetrieveLockInfo(org.uberfire.backend.vfs.Path path)Retrieves the lock information for the specifiedPath.List<org.uberfire.backend.vfs.impl.LockInfo>retrieveLockInfos(org.uberfire.backend.vfs.Path path, boolean excludeOwnedLocks)Retrieves all locks for children (files or directories) of the provided path.
-
-
-
Method Detail
-
acquireLock
org.uberfire.backend.vfs.impl.LockResult acquireLock(org.uberfire.backend.vfs.Path path) throws IllegalArgumentException, org.uberfire.java.nio.IOExceptionCreates a lock file for the specifiedPath, 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.- Parameters:
path- the path of the file or directory to lock.- Returns:
- the
LockResult, indicating success or failure and containing the last readLockInfo. - Throws:
IllegalArgumentException- If the provided path is invalid or null.org.uberfire.java.nio.IOException- If a lock file can't be written or an existing lock can't be read.
-
releaseLock
org.uberfire.backend.vfs.impl.LockResult releaseLock(org.uberfire.backend.vfs.Path path) throws IllegalArgumentException, org.uberfire.java.nio.IOExceptionDeletes the lock file for the specifiedPath. The requesting user needs to own the lock for this operation to succeed.- Parameters:
path- the path of the file or directory currently assumed locked.- Returns:
- the
LockResult, indicating success or failure and containing the last readLockInfo. - Throws:
IllegalArgumentException- If the provided path is invalid or null.org.uberfire.java.nio.IOException- If a lock file can't be deleted or an existing lock can't be read.
-
forceReleaseLock
org.uberfire.backend.vfs.impl.LockResult forceReleaseLock(org.uberfire.backend.vfs.Path path) throws IllegalArgumentException, org.uberfire.java.nio.IOExceptionDeletes the lock file for the specifiedPatheven if the requesting user does not own the lock.- Parameters:
path- the path of the file or directory currently assumed locked.- Returns:
- the
LockResult, indicating success or failure and containing the last readLockInfo. - Throws:
IllegalArgumentException- If the provided path is invalid or null.org.uberfire.java.nio.IOException- If a lock file can't be deleted or an existing lock can't be read.
-
retrieveLockInfo
org.uberfire.backend.vfs.impl.LockInfo retrieveLockInfo(org.uberfire.backend.vfs.Path path) throws IllegalArgumentException, org.uberfire.java.nio.IOExceptionRetrieves the lock information for the specifiedPath.- Parameters:
path- the path of the file or directory.- Returns:
- the
LockInfofor the providedPath. - Throws:
IllegalArgumentException- If the provided path is invalid or null.org.uberfire.java.nio.IOException- If a lock file can't be read.
-
retrieveLockInfos
List<org.uberfire.backend.vfs.impl.LockInfo> retrieveLockInfos(org.uberfire.backend.vfs.Path path, boolean excludeOwnedLocks) throws IllegalArgumentException, org.uberfire.java.nio.IOException
Retrieves all locks for children (files or directories) of the provided path.- Parameters:
path- the path of the directory.excludeOwnedLocks- filters the resulting list so it doesn't contain locks owned by the currently authenticated user.- Returns:
- the list of
LockInfos for children of the provided path that are currently locked, or an empty list if no such locks exist. - Throws:
IllegalArgumentException- If the provided path is invalid or null.org.uberfire.java.nio.IOException- If a lock file can't be read.
-
-