org.opencms.ade.sitemap
Class CmsAliasEditorLockTable

java.lang.Object
  extended by org.opencms.ade.sitemap.CmsAliasEditorLockTable

public class CmsAliasEditorLockTable
extends java.lang.Object

A class used to keep track of which user is editing the alias table from which sites.

It consists of a table from site roots to users. The entries of the table will be removed if they haven't been updated in a given interval of time, but can also be removed manually.


Field Summary
static long TIMEOUT_INTERVAL
          The interval after which a lock which has not been updated will be removed.
 
Constructor Summary
CmsAliasEditorLockTable()
          Creates a new lock table instance.
 
Method Summary
 void clear(CmsObject cms, java.lang.String siteRoot)
          Clears the entry for a given site root, but only if the user from the given CMS context matches the user in the entry.
 CmsUser update(CmsObject cms, java.lang.String siteRoot)
          Tries to update or create an entry for the given user/site root combination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMEOUT_INTERVAL

public static final long TIMEOUT_INTERVAL
The interval after which a lock which has not been updated will be removed.

See Also:
Constant Field Values
Constructor Detail

CmsAliasEditorLockTable

public CmsAliasEditorLockTable()
Creates a new lock table instance.

Method Detail

clear

public void clear(CmsObject cms,
                  java.lang.String siteRoot)
Clears the entry for a given site root, but only if the user from the given CMS context matches the user in the entry.

Parameters:
cms - the current CMS context
siteRoot - the site root for which the entry should be cleared

update

public CmsUser update(CmsObject cms,
                      java.lang.String siteRoot)
Tries to update or create an entry for the given user/site root combination.

If this method succeeds, it will return null, but if another user has created an entry for the site root, it will return that user.

Parameters:
cms - the current CMS context
siteRoot - the site root
Returns:
null of the user who has already created an entry