org.liquidsite.core.data
Class GroupPeer

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

public class GroupPeer
extends AbstractPeer

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


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

doSelectByDomain

public static java.util.ArrayList doSelectByDomain(DataSource src,
                                                   java.lang.String domain,
                                                   java.lang.String filter)
                                            throws DataObjectException
Returns a list of matching groups in a specified domain. Only groups with matching names will be returned.

Parameters:
src - the data source to use
domain - the domain name
filter - the search filter (empty for all)
Returns:
a list of matching groups in the domain
Throws:
DataObjectException - if the data source couldn't be accessed properly

doSelectByName

public static GroupData doSelectByName(DataSource src,
                                       java.lang.String domain,
                                       java.lang.String name)
                                throws DataObjectException
Returns a group with a specified name.

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

doInsert

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

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

doUpdate

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

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

doDelete

public static void doDelete(DataSource src,
                            GroupData data)
                     throws DataObjectException
Deletes a group from the data source. This method also deletes all related user group and permission entries.

Parameters:
src - the data source to use
data - the group 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 groups in a domain from the data source. This method also deletes all user group entries in the domain.

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