org.liquidsite.core.data
Class LockPeer

java.lang.Object
  extended byorg.liquidsite.core.data.AbstractPeer
      extended byorg.liquidsite.core.data.LockPeer

public class LockPeer
extends AbstractPeer

A content lock database peer. This class contains static methods that handles all accesses to the LS_LOCK table.


Method Summary
static void doDelete(DataSource src, LockData data)
          Deletes a lock object from the data source.
static void doDeleteContent(DataSource src, int content)
          Deletes a lock object from the data source.
static void doDeleteDomain(DataSource src, java.lang.String domain)
          Deletes all lock objects in a specified domain from the data source.
static void doDeleteOutdated(DataSource src)
          Deletes all lock objects that are outdated.
static void doInsert(DataSource src, LockData data)
          Inserts a new lock object into the data source.
static LockData doSelectByContent(DataSource src, int content)
          Returns the lock object with the specified content id.
protected  AbstractData getDataObject()
          Returns a new instance of the data object.
 
Methods inherited from class org.liquidsite.core.data.AbstractPeer
count, delete, insert, select, selectList, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doSelectByContent

public static LockData doSelectByContent(DataSource src,
                                         int content)
                                  throws DataObjectException
Returns the lock object with the specified content id.

Parameters:
src - the data source to use
content - the content id
Returns:
the lock found, or null if no matching lock existed
Throws:
DataObjectException - if the data source couldn't be accessed properly

doInsert

public static void doInsert(DataSource src,
                            LockData data)
                     throws DataObjectException
Inserts a new lock object into the data source.

Parameters:
src - the data source to use
data - the lock data object
Throws:
DataObjectException - if the data source couldn't be accessed properly

doDelete

public static void doDelete(DataSource src,
                            LockData data)
                     throws DataObjectException
Deletes a lock object from the data source.

Parameters:
src - the data source to use
data - the lock data object
Throws:
DataObjectException - if the data source couldn't be accessed properly

doDeleteContent

public static void doDeleteContent(DataSource src,
                                   int content)
                            throws DataObjectException
Deletes a lock object from the data source.

Parameters:
src - the data source to use
content - the content object id
Throws:
DataObjectException - if the data source couldn't be accessed properly

doDeleteDomain

public static void doDeleteDomain(DataSource src,
                                  java.lang.String domain)
                           throws DataObjectException
Deletes all lock objects in a specified domain from the data source.

Parameters:
src - the data source to use
domain - the domain name
Throws:
DataObjectException - if the data source couldn't be accessed properly

doDeleteOutdated

public static void doDeleteOutdated(DataSource src)
                             throws DataObjectException
Deletes all lock objects that are outdated. The outdated locks are all the locks created more than 24 hours ago.

Parameters:
src - the data source to use
Throws:
DataObjectException - if the data source couldn't be accessed properly

getDataObject

protected AbstractData getDataObject()
Returns a new instance of the data object.

Specified by:
getDataObject in class AbstractPeer
Returns:
a new instance of the data object