package com.ecyrd.jspwiki;

import java.util.Date;

public class PageLock
{
    private WikiPage m_page;
    private String   m_locker;
    private Date     m_lockAcquired;
    private Date     m_lockExpiry;

    public PageLock( WikiPage page, 
                     String locker,
                     Date acquired,
                     Date expiry )
    {
        m_page         = page;
        m_locker       = locker;
        m_lockAcquired = acquired;
        m_lockExpiry   = expiry;
    }

    public WikiPage getPage()
    {
        return m_page;
    }

    public String getLocker()
    {
        return m_locker;
    }

    public Date getAcquisitionTime()
    {
        return m_lockAcquired;
    }

    public Date getExpiryTime()
    {
        return m_lockExpiry;
    }

    /**
     *  Returns the amount of time left in minutes, rounded up to the nearest
     *  minute (so you get a zero only at the last minute).
     */
    public long getTimeLeft()
    {
        long time = m_lockExpiry.getTime() - new Date().getTime();

        return (time / (1000L * 60)) + 1;
    }
}

@@ -21,16 +21,45 @@
 pwiki;%0A%0A
+import java.io.Serializable;%0A
 import j
@@ -96,16 +96,44 @@
 ageLock%0A
+    implements Serializable%0A
 %7B%0A    pr
@@ -138,24 +138,24 @@
 private 
-WikiPage
+String  
  m_page;
@@ -434,24 +434,34 @@
       = page
+.getName()
 ;%0A        m_
@@ -569,24 +569,22 @@
  public 
-WikiPage
+String
  getPage

Is now serializable.