Package sonia.scm.repository.spi
Interface FileLockCommand
public interface FileLockCommand
Interface for lock implementations.
- Since:
- 2.26.0
-
Method Summary
Modifier and TypeMethodDescriptiongetAll()
Returns all locks for the repository.lock
(LockCommandRequest request) Locks a given file.status
(LockStatusCommandRequest request) Returns the lock of a file, if it exists.unlock
(UnlockCommandRequest request) Unlocks a given file.
-
Method Details
-
lock
Locks a given file.- Parameters:
request
- The details of the lock creation.- Returns:
- The result of the lock creation.
- Throws:
FileLockedException
- if the file is already locked.
-
unlock
Unlocks a given file.- Parameters:
request
- The details of the lock removal.- Returns:
- The result of the lock removal.
- Throws:
FileLockedException
- if the file is locked and the lock cannot be removed.
-
status
Returns the lock of a file, if it exists.- Parameters:
request
- Details of the status request.- Returns:
Optional
with the lock, if the file is locked, orOptional.empty()
, if the file is not locked
-
getAll
Collection<FileLock> getAll()Returns all locks for the repository.
-