org.liquidsite.core.data
Class HostPeer

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

public class HostPeer
extends AbstractPeer

A host database peer. This class contains static methods that handles all accesses to the LS_HOST table.


Method Summary
static void doDelete(DataSource src, HostData data)
          Deletes a host from the data source.
static void doDeleteDomain(DataSource src, java.lang.String domain)
          Deletes all hosts in a domain from the data source.
static void doInsert(DataSource src, HostData data)
          Inserts a new host into the data source.
static java.util.ArrayList doSelectAll(DataSource src)
          Returns a list of all hosts in the data source.
static java.util.ArrayList doSelectByDomain(DataSource src, java.lang.String domain)
          Returns a list of all hosts in a certain domain.
static HostData doSelectByName(DataSource src, java.lang.String name)
          Returns a host with a specified name.
static void doUpdate(DataSource src, HostData data)
          Updates a host 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

doSelectAll

public static java.util.ArrayList doSelectAll(DataSource src)
                                       throws DataObjectException
Returns a list of all hosts in the data source.

Parameters:
src - the data source to use
Returns:
a list of all hosts in the database
Throws:
DataObjectException - if the data source couldn't be accessed properly

doSelectByDomain

public static java.util.ArrayList doSelectByDomain(DataSource src,
                                                   java.lang.String domain)
                                            throws DataObjectException
Returns a list of all hosts in a certain domain.

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

doSelectByName

public static HostData doSelectByName(DataSource src,
                                      java.lang.String name)
                               throws DataObjectException
Returns a host with a specified name.

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

doInsert

public static void doInsert(DataSource src,
                            HostData data)
                     throws DataObjectException
Inserts a new host into the data source.

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

doUpdate

public static void doUpdate(DataSource src,
                            HostData data)
                     throws DataObjectException
Updates a host in the data source.

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

doDelete

public static void doDelete(DataSource src,
                            HostData data)
                     throws DataObjectException
Deletes a host from the data source.

Parameters:
src - the data source to use
data - the host 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 hosts in 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

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