org.apache.wiki
Class PageLock

java.lang.Object
  extended by org.apache.wiki.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 Summary
PageLock(WikiPage page, String locker, Date acquired, Date expiry)
          Creates a new PageLock.
 
Method Summary
 Date getAcquisitionTime()
          Returns the timestamp on which this lock was acquired.
 Date getExpiryTime()
          Returns the timestamp on which this lock will expire.
 String getLocker()
          Returns the locker name.
 String getPage()
          Returns the name of the page which is locked.
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageLock

public PageLock(WikiPage 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 Detail

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

public Date 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.


Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.