org.liquidsite.core.data
Class AttributePeer

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

public class AttributePeer
extends AbstractPeer

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


Method Summary
static long doCalculateDomainSize(DataSource src, java.lang.String domain)
          Calculates the aggregate size in the database of all attributes in a domain.
static void doDelete(DataSource src, AttributeData data)
          Deletes an attribute object from the data source.
static void doDeleteContent(DataSource src, int id)
          Deletes all attributes for a content object from the data source.
static void doDeleteDomain(DataSource src, java.lang.String domain)
          Deletes all attributes for a domain from the data source.
static void doDeleteRevision(DataSource src, int id, int revision)
          Deletes all attributes for a content revision from the data source.
static void doInsert(DataSource src, AttributeData data)
          Inserts a new attribute object into the data source.
static AttributeData doSelectByName(DataSource src, int id, int revision, java.lang.String name)
          Returns the attribute object with the specified content id, content revision, and attribute name.
static java.util.ArrayList doSelectByRevision(DataSource src, int id, int revision)
          Returns a list of all attribute objects with the specified content id and revision.
static void doUpdate(DataSource src, AttributeData data)
          Updates an attribute in the data source.
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

doCalculateDomainSize

public static long doCalculateDomainSize(DataSource src,
                                         java.lang.String domain)
                                  throws DataObjectException
Calculates the aggregate size in the database of all attributes in a domain.

Parameters:
src - the data source to use
domain - the domain name
Returns:
the size in bytes of all the attributes in the domain
Throws:
DataObjectException - if the data source couldn't be accessed properly

doSelectByRevision

public static java.util.ArrayList doSelectByRevision(DataSource src,
                                                     int id,
                                                     int revision)
                                              throws DataObjectException
Returns a list of all attribute objects with the specified content id and revision.

Parameters:
src - the data source to use
id - the content id
revision - the content revision
Returns:
the list of attribute objects found
Throws:
DataObjectException - if the data source couldn't be accessed properly

doSelectByName

public static AttributeData doSelectByName(DataSource src,
                                           int id,
                                           int revision,
                                           java.lang.String name)
                                    throws DataObjectException
Returns the attribute object with the specified content id, content revision, and attribute name.

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

doInsert

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

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

doUpdate

public static void doUpdate(DataSource src,
                            AttributeData data)
                     throws DataObjectException
Updates an attribute in the data source.

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

doDelete

public static void doDelete(DataSource src,
                            AttributeData data)
                     throws DataObjectException
Deletes an attribute object from the data source.

Parameters:
src - the data source to use
data - the attribute data object
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 attributes for a 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

doDeleteContent

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

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

doDeleteRevision

public static void doDeleteRevision(DataSource src,
                                    int id,
                                    int revision)
                             throws DataObjectException
Deletes all attributes for a content revision from the data source.

Parameters:
src - the data source to use
id - the content object id
revision - the content revision
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