org.apache.turbine.om.security.peer
Class PermissionPeer

java.lang.Object
  |
  +--org.apache.turbine.om.peer.BasePeer
        |
        +--org.apache.turbine.om.security.peer.PermissionPeer

public class PermissionPeer
extends BasePeer

This class handles all the database access for the PERMISSION table. This table contains all the permissions that are used in the system.

Version:
$Id: PermissionPeer.java,v 1.1.1.1 2001/08/16 05:08:44 jvanzyl Exp $
Author:
Frank Y. Kim, John D. McNally, Brett McLaughlin

Field Summary
private static TurbineMapBuilder mapBuilder
           
static java.lang.String NAME
          The column name for the name field.
static java.lang.String OBJECTDATA
          The column name for the ObjectData field
static java.lang.String PERMISSION_ID
          The column name for the permission id field.
private static java.lang.String SEQUENCE_NAME
          The Oracle sequence name for this peer.
private static java.lang.String TABLE_NAME
          The table name for this peer.
 
Fields inherited from class org.apache.turbine.om.peer.BasePeer
DEFAULT_MAP_BUILDER, IGNORE_CASE, mapBuilders, ORDER_BY
 
Constructor Summary
PermissionPeer()
           
 
Method Summary
static Criteria buildCriteria(Permission permission)
          Builds a criteria object based upon an Permission object
static boolean checkExists(Permission permission)
          Checks if a Permission is defined in the system.
static java.util.Vector doSelect(Criteria criteria)
          Issues a select based on a criteria.
static void doUpdate(Criteria criteria)
          Issues an update based on a criteria.
static java.lang.String getColumnName(java.lang.String name)
          Returns the full name of a column.
static java.util.Vector getDifference(java.util.Vector some, java.util.Vector all)
          Pass in two Vector's of Permission Objects.
static java.lang.String getTableName()
          Get the name of this table.
static PermissionSet retrieveSet(Criteria criteria)
          Retrieves/assembles a PermissionSet
static PermissionSet retrieveSet(Role role)
          Retrieves a set of Permissions associated with a particular Role.
 
Methods inherited from class org.apache.turbine.om.peer.BasePeer
beginTransaction, commitTransaction, createPreparedStatement, createQueryString, deleteAll, deleteAll, doDelete, doDelete, doInsert, doInsert, doPSSelect, doPSSelect, doSelect, doUpdate, doUpdate, doUpdate, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeStatement, executeStatement, executeStatement, getMalformedColumnNameException, getMapBuilder, getMapBuilder, getPrimaryKey, getSelectResults, getSelectResults, getSelectResults, getSelectResults, handleMultiple, handleMultipleRecords, hashtableToByteArray, initColumnNames, initCriteriaKeys, initTableColumns, initTableSchema, initTableSchema, insertOrUpdateRecord, rollBackTransaction, setLimit
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

mapBuilder

private static final TurbineMapBuilder mapBuilder

TABLE_NAME

private static final java.lang.String TABLE_NAME
The table name for this peer.

PERMISSION_ID

public static final java.lang.String PERMISSION_ID
The column name for the permission id field.

NAME

public static final java.lang.String NAME
The column name for the name field.

OBJECTDATA

public static final java.lang.String OBJECTDATA
The column name for the ObjectData field

SEQUENCE_NAME

private static final java.lang.String SEQUENCE_NAME
The Oracle sequence name for this peer.
Constructor Detail

PermissionPeer

public PermissionPeer()
Method Detail

retrieveSet

public static PermissionSet retrieveSet(Criteria criteria)
                                 throws java.lang.Exception
Retrieves/assembles a PermissionSet
Parameters:
criteria - The criteria to use.
Returns:
A PermissionSet.
Throws:
Exception, - a generic exception.

retrieveSet

public static PermissionSet retrieveSet(Role role)
                                 throws java.lang.Exception
Retrieves a set of Permissions associated with a particular Role.
Parameters:
role - The role to query permissions of.
Returns:
A set of permissions associated with the Role.
Throws:
Exception, - a generic exception.

doSelect

public static java.util.Vector doSelect(Criteria criteria)
                                 throws java.lang.Exception
Issues a select based on a criteria.
Parameters:
criteria - Object containing data that is used to create the SELECT statement.
Returns:
Vector containing Permission objects.
Throws:
Exception, - a generic exception.

buildCriteria

public static Criteria buildCriteria(Permission permission)
Builds a criteria object based upon an Permission object

doUpdate

public static void doUpdate(Criteria criteria)
                     throws java.lang.Exception
Issues an update based on a criteria.
Parameters:
criteria - Object containing data that is used to create the UPDATE statement.
Throws:
Exception, - a generic exception.

checkExists

public static boolean checkExists(Permission permission)
                           throws DataBackendException,
                                  java.lang.Exception
Checks if a Permission is defined in the system. The name is used as query criteria.
Parameters:
permission - The Permission to be checked.
Returns:
true if given Permission exists in the system.
Throws:
DataBackendException - when more than one Permission with the same name exists.
Exception, - a generic exception.

getTableName

public static java.lang.String getTableName()
Get the name of this table.
Returns:
A String with the name of the table.

getColumnName

public static java.lang.String getColumnName(java.lang.String name)
Returns the full name of a column.
Returns:
A String with the full name of the column.

getDifference

public static final java.util.Vector getDifference(java.util.Vector some,
                                                   java.util.Vector all)
Pass in two Vector's of Permission Objects. It will return a new Vector with the difference of the two Vectors: C = (A - B).
Parameters:
some - Vector B in C = (A - B).
all - Vector A in C = (A - B).
Returns:
Vector C in C = (A - B).


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.