This class capsulates all direct Peer access for the Permission entities.
It allows the exchange of the default Turbine supplied TurbinePermissionPeer
class against a custom class.
author: Henning P. Schmiedehausen version: $Id: PermissionPeerManager.java 534527 2007-05-02 16:10:59Z tv $
public static Criteria buildCriteria(Permission permission)(Code)
Calls buildCriteria(Permission permission) in
the configured PermissionPeer. If you get a
ClassCastException in this routine, you put a
Permission object into this method which
can't be cast into an object for the
TorqueSecurityService. This is a configuration error most of
the time.
Parameters: permission - An object which implementsthe Permission interface A criteria for the supplied permission object
Checks if a Permission is defined in the system. The name
is used as query criteria.
Parameters: permission - The Permission to be checked. true if given Permission exists in the system. throws: DataBackendException - when more than one Permission withthe same name exists. throws: Exception - A generic exception.
doDelete
public static void doDelete(Criteria criteria) throws TorqueException(Code)
Invokes doDelete(Criteria c) on the configured Peer Object
Parameters: criteria - A Criteria Object exception: TorqueException - A problem occured.
doInsert
public static void doInsert(Criteria criteria) throws TorqueException(Code)
Invokes doInsert(Criteria c) on the configured Peer Object
Parameters: criteria - A Criteria Object exception: TorqueException - A problem occured.
doSelect
public static List doSelect(Criteria criteria) throws TorqueException(Code)
Invokes doSelect(Criteria c) on the configured Peer Object
Parameters: criteria - A Criteria Object A List of Permission Objects selected by the Criteria exception: TorqueException - A problem occured.
doUpdate
public static void doUpdate(Criteria criteria) throws TorqueException(Code)
Invokes doUpdate(Criteria c) on the configured Peer Object
Parameters: criteria - A Criteria Object exception: TorqueException - A problem occured.
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). Parameters: all - Vector A in C = (A - B). Vector C in C = (A - B).
getIdAsObj
public static Integer getIdAsObj(Persistent obj)(Code)
Invokes getId() on the supplied base object
Parameters: obj - The object to use for getting the id The Id of this object
Returns a new, configured Permission Object with
a supplied Persistent object at its core
Parameters: p - The persistent object a new, configured Permission Object exception: Exception - Could not create a new Object
getPermissionName
public static String getPermissionName(Persistent obj)(Code)
Invokes getName() on the supplied base object
Parameters: obj - The object to use for getting the name A string containing the name
Initializes the PermissionPeerManager, loading the class object for the
Peer used to retrieve Permission objects
Parameters: conf - The configuration object used to configure the Manager exception: InitializationException - A problem occured during initialization
newPersistentInstance
public static Persistent newPersistentInstance()(Code)
Returns a new, empty object for the underlying peer.
Used to create a new underlying object
A new object which is compatible to the Peerand can be used as a User object
Retrieves a set of Permissions associated with a particular Role.
Parameters: role - The role to query permissions of. A set of permissions associated with the Role. exception: Exception - A generic Exception.
setId
public static void setId(Persistent obj, int id)(Code)
Invokes setId(int n) on the supplied base object
Parameters: obj - The object to use for setting the name Parameters: id - The new Id
setPermissionName
public static void setPermissionName(Persistent obj, String name)(Code)
Invokes setName(String s) on the supplied base object
Parameters: obj - The object to use for setting the name Parameters: name - The Name to set