org.liquidsite.core.data
Class UserGroupPeer

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

public class UserGroupPeer
extends AbstractPeer

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


Method Summary
static int doCountByGroup(DataSource src, java.lang.String domain, java.lang.String group)
          Returns a list of all user groups for a certain group.
static void doDelete(DataSource src, UserGroupData data)
          Deletes a user group from the data source.
static void doDeleteDomain(DataSource src, java.lang.String domain)
          Deletes all user groups in a domain from the data source.
static void doDeleteGroup(DataSource src, java.lang.String domain, java.lang.String group)
          Deletes all user groups connected to a specified group from the data source.
static void doDeleteUser(DataSource src, java.lang.String domain, java.lang.String user)
          Deletes all user groups connected to a specified user from the data source.
static void doInsert(DataSource src, UserGroupData data)
          Inserts a new user group into the data source.
static java.util.ArrayList doSelectByGroup(DataSource src, java.lang.String domain, java.lang.String group, int startPos, int maxLength)
          Returns a list of all user groups for a certain group.
static java.util.ArrayList doSelectByUser(DataSource src, java.lang.String domain, java.lang.String user)
          Returns a list of all user groups for a certain user.
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

doCountByGroup

public static int doCountByGroup(DataSource src,
                                 java.lang.String domain,
                                 java.lang.String group)
                          throws DataObjectException
Returns a list of all user groups for a certain group.

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

doSelectByUser

public static java.util.ArrayList doSelectByUser(DataSource src,
                                                 java.lang.String domain,
                                                 java.lang.String user)
                                          throws DataObjectException
Returns a list of all user groups for a certain user.

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

doSelectByGroup

public static java.util.ArrayList doSelectByGroup(DataSource src,
                                                  java.lang.String domain,
                                                  java.lang.String group,
                                                  int startPos,
                                                  int maxLength)
                                           throws DataObjectException
Returns a list of all user groups for a certain group. Only a limited interval of the matching user groups will be returned.

Parameters:
src - the data source to use
domain - the domain name
group - the group name
startPos - the list interval start position
maxLength - the list interval maximum length
Returns:
a list of all user groups for the group
Throws:
DataObjectException - if the data source couldn't be accessed properly

doInsert

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

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

doDelete

public static void doDelete(DataSource src,
                            UserGroupData data)
                     throws DataObjectException
Deletes a user group from the data source.

Parameters:
src - the data source to use
data - the user 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 user groups 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

doDeleteUser

public static void doDeleteUser(DataSource src,
                                java.lang.String domain,
                                java.lang.String user)
                         throws DataObjectException
Deletes all user groups connected to a specified user from the data source.

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

doDeleteGroup

public static void doDeleteGroup(DataSource src,
                                 java.lang.String domain,
                                 java.lang.String group)
                          throws DataObjectException
Deletes all user groups connected to a specified group from the data source.

Parameters:
src - the data source to use
domain - the domain name
group - the group 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