Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.turbine.services.security.torque
Class TorquePermission

    java.lang.Object
      org.apache.turbine.services.security.torque.TorqueObject
          org.apache.turbine.services.security.torque.TorquePermission

All Implemented Interfaces:
  Serializable, Comparable, org.apache.torque.om.Persistent, Permission, SecurityEntity

    public class TorquePermission

extends TorqueObject
implements Permission, Comparable

This class represents a permission given to a Role associated with the current Session. It is separated from the actual Torque peer object to be able to replace the Peer with an user supplied Peer (and Object)

Version:
  $Id: TorquePermission.java 534527 2007-05-02 16:10:59Z tv $
Author:
  Frank Y. Kim, John D. McNally, Brett McLaughlin, Martin Poeschl, Henning P. Schmiedehausen
See Also:
  Serialized Form

Field Summary

Fields inherited from class org.apache.turbine.services.security.torque.TorqueObject
`obj`

Constructor Summary
`TorquePermission()` Constructs a Permission
`TorquePermission(org.apache.torque.om.Persistent obj)` The package private Constructor is used when the PermissionPeerManager has retrieved a list of Database Objects from the peer and must 'wrap' them into TorquePermission Objects.
`TorquePermission(String name)` Constructs a new Permission with the sepcified name.

Method Summary
`static Permission` | `create(String name)` Deprecated. Please use the createPermission method in TurbineSecurity.
`int` | `getId()` Gets the Id of this object
`Integer` | `getIdAsObj()` Gets the Id of this object
`String` | `getName()` Returns the name of this object.
`org.apache.torque.om.Persistent` | `getPersistentObj()` Returns the underlying Object for the Peer Used in the PermissionPeerManager when building a new Criteria.
`void` | `remove()` Removes a permission from the system.
`void` | `rename(String name)` Renames the permission.
`void` | `save()` Makes changes made to the Permission attributes permanent.
`void` | `setId(int id)` Sets the Id of this object
`void` | `setName(String name)` Sets the name of this object.

Methods inherited from class org.apache.turbine.services.security.torque.TorqueObject
`compareTo, equals, equals, getPrimaryKey, hashCode, isModified, isNew, save, save, setModified, setNew, setPrimaryKey, setPrimaryKey`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface java.lang.Comparable
`compareTo`

Constructor Detail

### TorquePermission

    public TorquePermission()

  Constructs a Permission

### TorquePermission

    public TorquePermission(String name)

  Constructs a new Permission with the sepcified name.

  Parameters:
    `name` - The name of the new object.

### TorquePermission

    public TorquePermission(org.apache.torque.om.Persistent obj)

  The package private Constructor is used when the PermissionPeerManager has retrieved a list of Database Objects from the peer and must 'wrap' them into TorquePermission Objects. You should not use it directly!

  Parameters:
    `obj` - An Object from the peer

Method Detail

### getPersistentObj

    public org.apache.torque.om.Persistent getPersistentObj()

  Returns the underlying Object for the Peer Used in the PermissionPeerManager when building a new Criteria.

  Specified by:
    `getPersistentObj` in class `TorqueObject`
  Returns:
    The underlying Persistent Object

### getName

    public String getName()

  Returns the name of this object.

  Specified by:
    `getName` in interface `SecurityEntity`
  Specified by:
    `getName` in class `TorqueObject`
  Returns:
    The name of the object.

### setName

    public void setName(String name)

  Sets the name of this object.

  Specified by:
    `setName` in interface `SecurityEntity`
  Specified by:
    `setName` in class `TorqueObject`
  Parameters:
    `name` - The name of the object.

### getId

    public int getId()

  Gets the Id of this object

  Specified by:
    `getId` in interface `SecurityEntity`
  Returns:
    The Id of the object

### getIdAsObj

    public Integer getIdAsObj()

  Gets the Id of this object

  Specified by:
    `getIdAsObj` in interface `SecurityEntity`
  Returns:
    The Id of the object

### setId

    public void setId(int id)

  Sets the Id of this object

  Specified by:
    `setId` in interface `SecurityEntity`
  Parameters:
    `id` - The new Id

### create

    public static Permission create(String name)
                             throws TurbineSecurityException

  Deprecated. Please use the createPermission method in TurbineSecurity.

  Creates a new Permission in the system.

  Parameters:
    `name` - The name of the new Permission.
  Returns:
    An object representing the new Permission.
  Throws:
    `TurbineSecurityException` - if the Permission could not be created.

### save

    public void save()
              throws TurbineSecurityException

  Makes changes made to the Permission attributes permanent.

  Specified by:
    `save` in interface `org.apache.torque.om.Persistent`
  Specified by:
    `save` in interface `Permission`
  Specified by:
    `save` in class `TorqueObject`
  Throws:
    `TurbineSecurityException` - if there is a problem while saving data.

### remove

    public void remove()
                throws TurbineSecurityException

  Removes a permission from the system.

  Specified by:
    `remove` in interface `Permission`
  Throws:
    `TurbineSecurityException` - if the Permission could not be removed.

### rename

    public void rename(String name)
                throws TurbineSecurityException

  Renames the permission.

  Specified by:
    `rename` in interface `Permission`
  Parameters:
    `name` - The new Permission name.
  Throws:
    `TurbineSecurityException` - if the Permission could not be renamed.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.