org.liquidsite.core.data
Class PermissionPeer

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

public class PermissionPeer
extends AbstractPeer

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


Method Summary
static void doDelete(DataSource src, java.lang.String domain, int id)
          Deletes all permissions for a content object from the data source.
static void doDeleteDomain(DataSource src, java.lang.String domain)
          Deletes all permissions for a domain from the data source.
static void doDeleteGroup(DataSource src, java.lang.String domain, java.lang.String group)
          Deletes all permissions for a group from the data source.
static void doDeleteUser(DataSource src, java.lang.String domain, java.lang.String user)
          Deletes all permissions for a user from the data source.
static void doInsert(DataSource src, PermissionData data)
          Inserts a new permission object into the data source.
static java.util.ArrayList doSelectByContent(DataSource src, java.lang.String domain, int content)
          Returns a list of all permission objects with the specified domain and content id.
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

doSelectByContent

public static java.util.ArrayList doSelectByContent(DataSource src,
                                                    java.lang.String domain,
                                                    int content)
                                             throws DataObjectException
Returns a list of all permission objects with the specified domain and content id. If the content id is zero (0), the permissions for the domain root is returned.

Parameters:
src - the data source to use
domain - the domain name
content - the content id, or zero (0)
Returns:
the list of permission objects found
Throws:
DataObjectException - if the data source couldn't be accessed properly

doInsert

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

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

doDelete

public static void doDelete(DataSource src,
                            java.lang.String domain,
                            int id)
                     throws DataObjectException
Deletes all permissions for a content object from the data source.

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

doDeleteUser

public static void doDeleteUser(DataSource src,
                                java.lang.String domain,
                                java.lang.String user)
                         throws DataObjectException
Deletes all permissions for a 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 permissions for a 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