public class PageLock extends Object implements Serializable
The PageLock keeps no reference to a WikiPage because otherwise it could keep a reference to a page for a long time.
Constructor and Description |
---|
PageLock(WikiPage page,
String locker,
Date acquired,
Date expiry)
Creates a new PageLock.
|
Modifier and Type | Method and Description |
---|---|
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).
|
boolean |
isExpired() |
public PageLock(WikiPage page, String locker, Date acquired, Date expiry)
page
- WikiPage which is locked.locker
- The username who locked this page (for display purposes).acquired
- The timestamp when the lock is acquiredexpiry
- The timestamp when the lock expires.public String getPage()
public Date getAcquisitionTime()
public Date getExpiryTime()
public long getTimeLeft()
public boolean isExpired()
Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.