Klasse TorqueAbstractPermissionManager

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
Alle implementierten Schnittstellen:
Serializable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.thread.ThreadSafe, PermissionManager
Bekannte direkte Unterklassen:
PeerPermissionManager, TorqueDynamicPermissionManagerImpl

public abstract class TorqueAbstractPermissionManager extends AbstractPermissionManager
This implementation persists to a database via Torque.
Version:
$Id:$
Autor:
Thomas Vandahl
Siehe auch:
  • Konstruktordetails

    • TorqueAbstractPermissionManager

      public TorqueAbstractPermissionManager()
  • Methodendetails

    • configure

      public void configure(org.apache.avalon.framework.configuration.Configuration conf) throws org.apache.avalon.framework.configuration.ConfigurationException
      Avalon Service lifecycle method
      Angegeben von:
      configure in Schnittstelle org.apache.avalon.framework.configuration.Configurable
      Setzt außer Kraft:
      configure in Klasse AbstractEntityManager
      Löst aus:
      org.apache.avalon.framework.configuration.ConfigurationException
    • doSelectAllPermissions

      protected abstract <T extends Permission> List<T> doSelectAllPermissions(Connection con) throws org.apache.torque.TorqueException
      Get all specialized Permissions
      Parameter:
      con - a database connection
      Gibt zurück:
      a List of Permission instances
      Löst aus:
      org.apache.torque.TorqueException - if any database error occurs
    • doSelectByName

      protected abstract <T extends Permission> T doSelectByName(String name, Connection con) throws org.apache.torque.NoRowsException, org.apache.torque.TooManyRowsException, org.apache.torque.TorqueException
      Get a specialized Permission by name
      Parameter:
      name - the name of the group
      con - a database connection
      Gibt zurück:
      a Permission instance
      Löst aus:
      org.apache.torque.NoRowsException - if no such group exists
      org.apache.torque.TooManyRowsException - if multiple groups with the given name exist
      org.apache.torque.TorqueException - if any database error occurs if any other database error occurs
    • doSelectById

      protected abstract <T extends Permission> T doSelectById(Integer id, Connection con) throws org.apache.torque.NoRowsException, org.apache.torque.TooManyRowsException, org.apache.torque.TorqueException
      Get a specialized Permission by id
      Parameter:
      id - the id of the group
      con - a database connection
      Gibt zurück:
      a Permission instance
      Löst aus:
      org.apache.torque.NoRowsException - if no such group exists
      org.apache.torque.TooManyRowsException - if multiple groups with the given id exist
      org.apache.torque.TorqueException - if any database error occurs if any other database error occurs
    • renamePermission

      public void renamePermission(Permission permission, String name) throws DataBackendException, UnknownEntityException
      Renames an existing Permission.
      Parameter:
      permission - The object describing the permission to be renamed.
      name - the new name for the permission.
      Löst aus:
      DataBackendException - if there was an error accessing the data backend.
      UnknownEntityException - if the permission does not exist.
    • removePermission

      public void removePermission(Permission permission) throws DataBackendException, UnknownEntityException
      Removes a Permission from the system.
      Parameter:
      permission - The object describing the permission to be removed.
      Löst aus:
      DataBackendException - if there was an error accessing the data backend.
      UnknownEntityException - if the permission does not exist.
    • persistNewPermission

      protected <T extends Permission> T persistNewPermission(T permission) throws DataBackendException
      Creates a new permission with specified attributes.
      Angegeben von:
      persistNewPermission in Klasse AbstractPermissionManager
      Parameter:
      permission - the object describing the permission to be created.
      Gibt zurück:
      a new Permission object that has id set up properly.
      Löst aus:
      DataBackendException - if there was an error accessing the data backend.
    • getAllPermissions

      public PermissionSet getAllPermissions() throws DataBackendException
      Retrieves all permissions defined in the system.
      Gibt zurück:
      the names of all roles defined in the system.
      Löst aus:
      DataBackendException - if there was an error accessing the data backend.
    • checkExists

      public boolean checkExists(String permissionName) throws DataBackendException
      Determines if the Permission exists in the security system.
      Parameter:
      permissionName - a Permission value
      Gibt zurück:
      true if the permission name exists in the system, false otherwise
      Löst aus:
      DataBackendException - when more than one Permission with the same name exists.
    • getPermissionById

      public <T extends Permission> T getPermissionById(Object id) throws DataBackendException, UnknownEntityException
      Retrieve a Permission object with specified id.
      Angegeben von:
      getPermissionById in Schnittstelle PermissionManager
      Setzt außer Kraft:
      getPermissionById in Klasse AbstractPermissionManager
      Parameter:
      id - the id of the Permission.
      Gibt zurück:
      an object representing the Permission with specified id.
      Löst aus:
      DataBackendException - if there was an error accessing the data backend.
      UnknownEntityException - if the permission does not exist.
    • getPermissionByName

      public <T extends Permission> T getPermissionByName(String name) throws DataBackendException, UnknownEntityException
      Retrieve a Permission object with specified name.
      Angegeben von:
      getPermissionByName in Schnittstelle PermissionManager
      Setzt außer Kraft:
      getPermissionByName in Klasse AbstractPermissionManager
      Parameter:
      name - the name of the Group.
      Gibt zurück:
      an object representing the Group with specified name.
      Löst aus:
      DataBackendException - if there was an error accessing the data backend.
      UnknownEntityException - if the group does not exist.