Package org.silverpeas.core.wopi
Class WopiFileLock
- java.lang.Object
-
- org.silverpeas.core.wopi.WopiFileLock
-
public class WopiFileLock extends Object
This class permits to handle WOPI file locking from point of view of WOPI host.When a lock is set, it is alive for 30 minutes.
- Author:
- silveryocha
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WopiFileLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the lock identifier and the associated timer.boolean
exists()
Indicates if a lock exists.String
id()
Gets the identifier of the lock if any.void
setId(String id)
Sets a new lock identifier.String
toString()
-
-
-
Method Detail
-
id
public String id()
Gets the identifier of the lock if any.- Returns:
- a string if any, empty string if none or if the lock timer is over.
-
setId
public void setId(String id)
Sets a new lock identifier.The lock timer is set with
OffsetDateTime.now()
.- Parameters:
id
- a lock identifier.
-
clear
public void clear()
Clears the lock identifier and the associated timer.
-
exists
public boolean exists()
Indicates if a lock exists.Even if
setId(String)
orclear()
have not been called, if lock timer is over, no lock is concidered.- Returns:
- true if exists, false otherwise.
-
-