Package org.silverpeas.core.wbe
Class WbeFileLock
- java.lang.Object
-
- org.silverpeas.core.wbe.WbeFileLock
-
public class WbeFileLock extends Object
This class permits to handle Web Browser Edition file locking from point of view of the HOST.When a lock is set, it is alive for 30 minutes.
- Author:
- silveryocha
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WbeFileLock()
-
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.
-
-