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 GroupPeerManager

    java.lang.Object
      org.apache.turbine.services.security.torque.GroupPeerManager

All Implemented Interfaces:
  GroupPeerManagerConstants

    public class GroupPeerManager

extends Object
implements GroupPeerManagerConstants

This class capsulates all direct Peer access for the Group entities. It allows the exchange of the default Turbine supplied TurbineGroupPeer class against a custom class.

Version:
  $Id: GroupPeerManager.java 1096130 2011-04-23 10:37:19Z ludwig $
Author:
  Henning P. Schmiedehausen

Field Summary

Fields inherited from interface org.apache.turbine.services.security.torque.GroupPeerManagerConstants
`GROUP_CLASS_KEY, GROUP_ID_COLUMN_DEFAULT, GROUP_ID_COLUMN_KEY, GROUP_ID_PROPERTY_DEFAULT, GROUP_ID_PROPERTY_KEY, GROUP_NAME_COLUMN_DEFAULT, GROUP_NAME_COLUMN_KEY, GROUP_NAME_PROPERTY_DEFAULT, GROUP_NAME_PROPERTY_KEY, GROUP_PEER_CLASS_DEFAULT, GROUP_PEER_CLASS_KEY`

Constructor Summary
`GroupPeerManager()`

Method Summary
`static org.apache.torque.util.Criteria` | `buildCriteria(Group group)` Calls buildCriteria(Group group) in the configured GroupPeer.
`static boolean` | `checkExists(Group group)` Checks if a Group is defined in the system.
`static void` | `doDelete(org.apache.torque.util.Criteria criteria)` Invokes doDelete(Criteria c) on the configured Peer Object
`static void` | `doInsert(org.apache.torque.util.Criteria criteria)` Invokes doInsert(Criteria c) on the configured Peer Object
`static List` | `doSelect(org.apache.torque.util.Criteria criteria)` Invokes doSelect(Criteria c) on the configured Peer Object
`static void` | `doUpdate(org.apache.torque.util.Criteria criteria)` Invokes doUpdate(Criteria c) on the configured Peer Object
`static String` | `getColumnName(String name)` Returns the full name of a column.
`static String` | `getGroupName(org.apache.torque.om.Persistent obj)` Invokes getName() on the supplied base object
`static Integer` | `getIdAsObj(org.apache.torque.om.Persistent obj)` Invokes getId() on the supplied base object
`static String` | `getIdColumn()` Returns the fully qualified name of the Column to use as the Id Column for a group
`static String` | `getNameColumn()` Returns the fully qualified name of the Column to use as the Name Column for a group
`static Group` | `getNewGroup(org.apache.torque.om.Persistent p)` Returns a new, configured Group Object with a supplied Persistent object at its core
`static String` | `getTableName()` Get the name of this table.
`static void` | `init(org.apache.commons.configuration.Configuration conf)` Initializes the GroupPeerManager, loading the class object for the Peer used to retrieve Group objects
`static org.apache.torque.om.Persistent` | `newPersistentInstance()` Returns a new, empty object for the underlying peer.
`static GroupSet` | `retrieveSet()` Retrieves/assembles a GroupSet of all of the Groups.
`static GroupSet` | `retrieveSet(org.apache.torque.util.Criteria criteria)` Retrieves/assembles a GroupSet based on the Criteria passed in
`static void` | `setGroupName(org.apache.torque.om.Persistent obj, String name)` Invokes setName(String s) on the supplied base object
`static void` | `setId(org.apache.torque.om.Persistent obj, int id)` Invokes setId(int n) on the supplied base object

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

Constructor Detail

### GroupPeerManager

    public GroupPeerManager()

Method Detail

### init

    public static void init(org.apache.commons.configuration.Configuration conf)
                     throws InitializationException

  Initializes the GroupPeerManager, loading the class object for the Peer used to retrieve Group objects

  Parameters:
    `conf` - The configuration object used to configure the Manager
  Throws:
    `InitializationException` - A problem occured during initialization

### getTableName

    public static String getTableName()

  Get the name of this table.

  Returns:
    A String with the name of the table.

### getNameColumn

    public static String getNameColumn()

  Returns the fully qualified name of the Column to use as the Name Column for a group

  Returns:
    A String containing the column name

### getIdColumn

    public static String getIdColumn()

  Returns the fully qualified name of the Column to use as the Id Column for a group

  Returns:
    A String containing the column id

### getColumnName

    public static String getColumnName(String name)

  Returns the full name of a column.

  Parameters:
    `name` - The column to fully qualify
  Returns:
    A String with the full name of the column.

### newPersistentInstance

    public static org.apache.torque.om.Persistent newPersistentInstance()

  Returns a new, empty object for the underlying peer. Used to create a new underlying object

  Returns:
    A new object which is compatible to the Peer and can be used as a Group object

### retrieveSet

    public static GroupSet retrieveSet()
                                throws Exception

  Retrieves/assembles a GroupSet of all of the Groups.

  Returns:
    A set of all the Groups in the system
  Throws:
    `Exception` - A generic exception.

### retrieveSet

    public static GroupSet retrieveSet(org.apache.torque.util.Criteria criteria)
                                throws Exception

  Retrieves/assembles a GroupSet based on the Criteria passed in

  Parameters:
    `criteria` - A criteria containing a pre-assembled set of criterias for the GroupSet
  Returns:
    A Set of groups which fulfil the required criterias
  Throws:
    `Exception` - A generic exception

### checkExists

    public static boolean checkExists(Group group)
                               throws DataBackendException,
                                      Exception

  Checks if a Group is defined in the system. The name is used as query criteria.

  Parameters:
    `group` - The Group to be checked.
  Returns:
    `true` if given Group exists in the system.
  Throws:
    `DataBackendException` - when more than one Group with the same name exists.
    `Exception` - A generic exception.

### buildCriteria

    public static org.apache.torque.util.Criteria buildCriteria(Group group)

  Calls buildCriteria(Group group) in the configured GroupPeer. If you get a ClassCastException in this routine, you put a Group 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:
    `group` - An object which implements the Group interface
  Returns:
    A criteria for the supplied group object

### doUpdate

    public static void doUpdate(org.apache.torque.util.Criteria criteria)
                         throws org.apache.torque.TorqueException

  Invokes doUpdate(Criteria c) on the configured Peer Object

  Parameters:
    `criteria` - A Criteria Object
  Throws:
    `org.apache.torque.TorqueException` - A problem occured.

### doInsert

    public static void doInsert(org.apache.torque.util.Criteria criteria)
                         throws org.apache.torque.TorqueException

  Invokes doInsert(Criteria c) on the configured Peer Object

  Parameters:
    `criteria` - A Criteria Object
  Throws:
    `org.apache.torque.TorqueException` - A problem occured.

### doSelect

    public static List doSelect(org.apache.torque.util.Criteria criteria)
                         throws org.apache.torque.TorqueException

  Invokes doSelect(Criteria c) on the configured Peer Object

  Parameters:
    `criteria` - A Criteria Object
  Returns:
    A List of Group Objects selected by the Criteria
  Throws:
    `org.apache.torque.TorqueException` - A problem occured.

### doDelete

    public static void doDelete(org.apache.torque.util.Criteria criteria)
                         throws org.apache.torque.TorqueException

  Invokes doDelete(Criteria c) on the configured Peer Object

  Parameters:
    `criteria` - A Criteria Object
  Throws:
    `org.apache.torque.TorqueException` - A problem occured.

### setGroupName

    public static void setGroupName(org.apache.torque.om.Persistent obj,
                                    String name)

  Invokes setName(String s) on the supplied base object

  Parameters:
    `obj` - The object to use for setting the name
    `name` - The Name to set

### getGroupName

    public static String getGroupName(org.apache.torque.om.Persistent obj)

  Invokes getName() on the supplied base object

  Parameters:
    `obj` - The object to use for getting the name
  Returns:
    A string containing the name

### setId

    public static void setId(org.apache.torque.om.Persistent obj,
                             int id)

  Invokes setId(int n) on the supplied base object

  Parameters:
    `obj` - The object to use for setting the name
    `id` - The new Id

### getIdAsObj

    public static Integer getIdAsObj(org.apache.torque.om.Persistent obj)

  Invokes getId() on the supplied base object

  Parameters:
    `obj` - The object to use for getting the id
  Returns:
    The Id of this object

### getNewGroup

    public static Group getNewGroup(org.apache.torque.om.Persistent p)

  Returns a new, configured Group Object with a supplied Persistent object at its core

  Parameters:
    `p` - The persistent object
  Returns:
    a new, configured Group Object
  Throws:
    `Exception` - Could not create a new Object

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.