org.liquidsite.core.data
Class UserPeer

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

public class UserPeer
extends AbstractPeer

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


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

doCountByDomain

public static int doCountByDomain(DataSource src,
                                  java.lang.String domain,
                                  java.lang.String filter)
                           throws DataObjectException
Returns the number of users in a specified domain. Only users with matching names will be counted.

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

doSelectByDomain

public static java.util.ArrayList doSelectByDomain(DataSource src,
                                                   java.lang.String domain,
                                                   java.lang.String filter,
                                                   int startPos,
                                                   int maxLength)
                                            throws DataObjectException
Returns a list of matching users in a specified domain. Only users with matching names will be returned. Also, only a limited interval of the matching users will be returned.

Parameters:
src - the data source to use
domain - the domain name
filter - the search filter (empty for all)
startPos - the list interval start position
maxLength - the list interval maximum length
Returns:
a list of matching users in the domain
Throws:
DataObjectException - if the data source couldn't be accessed properly

doSelectByName

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

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

doInsert

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

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

doUpdate

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

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

doDelete

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

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