Class PageLock

java.lang.Object
org.apache.wiki.pages.PageLock
All Implemented Interfaces:
Serializable

public class PageLock
extends Object
implements Serializable
Describes a lock acquired by an user on a page. For the most part, the regular developer does not have to instantiate this class.

The PageLock keeps no reference to a WikiPage because otherwise it could keep a reference to a page for a long time.

See Also:
Serialized Form
  • Constructor Details

    • PageLock

      public PageLock​(Page page, String locker, Date acquired, Date expiry)
      Creates a new PageLock. The lock is not attached to any objects at this point.
      Parameters:
      page - WikiPage which is locked.
      locker - The username who locked this page (for display purposes).
      acquired - The timestamp when the lock is acquired
      expiry - The timestamp when the lock expires.
  • Method Details

    • getPage

      public String getPage()
      Returns the name of the page which is locked.
      Returns:
      The name of the page.
    • getLocker

      public String getLocker()
      Returns the locker name.
      Returns:
      The name of the locker.
    • getAcquisitionTime

      Returns the timestamp on which this lock was acquired.
      Returns:
      The acquisition time.
    • getExpiryTime

      public Date getExpiryTime()
      Returns the timestamp on which this lock will expire.
      Returns:
      The expiry date.
    • getTimeLeft

      public long getTimeLeft()
      Returns the amount of time left in minutes, rounded up to the nearest minute (so you get a zero only at the last minute).
      Returns:
      Time left in minutes.
    • isExpired

      public boolean isExpired()