org.apache.turbine.services.security.torque
Class UserPeerManager

java.lang.Object
  extended byorg.apache.turbine.services.security.torque.UserPeerManager
All Implemented Interfaces:
java.io.Serializable, UserPeerManagerConstants

public class UserPeerManager
extends java.lang.Object
implements UserPeerManagerConstants

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

Version:
$Id: UserPeerManager.java 534527 2007-05-02 16:10:59Z tv $
Author:
Henning P. Schmiedehausen
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.turbine.services.security.torque.UserPeerManagerConstants
USER_CLASS_KEY, USER_CONFIRM_COLUMN_DEFAULT, USER_CONFIRM_COLUMN_KEY, USER_CONFIRM_PROPERTY_DEFAULT, USER_CONFIRM_PROPERTY_KEY, USER_CREATE_COLUMN_DEFAULT, USER_CREATE_COLUMN_KEY, USER_CREATE_PROPERTY_DEFAULT, USER_CREATE_PROPERTY_KEY, USER_EMAIL_COLUMN_DEFAULT, USER_EMAIL_COLUMN_KEY, USER_EMAIL_PROPERTY_DEFAULT, USER_EMAIL_PROPERTY_KEY, USER_FIRST_NAME_COLUMN_DEFAULT, USER_FIRST_NAME_COLUMN_KEY, USER_FIRST_NAME_PROPERTY_DEFAULT, USER_FIRST_NAME_PROPERTY_KEY, USER_ID_COLUMN_DEFAULT, USER_ID_COLUMN_KEY, USER_ID_PROPERTY_DEFAULT, USER_ID_PROPERTY_KEY, USER_LAST_LOGIN_COLUMN_DEFAULT, USER_LAST_LOGIN_COLUMN_KEY, USER_LAST_LOGIN_PROPERTY_DEFAULT, USER_LAST_LOGIN_PROPERTY_KEY, USER_LAST_NAME_COLUMN_DEFAULT, USER_LAST_NAME_COLUMN_KEY, USER_LAST_NAME_PROPERTY_DEFAULT, USER_LAST_NAME_PROPERTY_KEY, USER_NAME_COLUMN_DEFAULT, USER_NAME_COLUMN_KEY, USER_NAME_PROPERTY_DEFAULT, USER_NAME_PROPERTY_KEY, USER_OBJECTDATA_COLUMN_DEFAULT, USER_OBJECTDATA_COLUMN_KEY, USER_OBJECTDATA_PROPERTY_DEFAULT, USER_OBJECTDATA_PROPERTY_KEY, USER_PASSWORD_COLUMN_DEFAULT, USER_PASSWORD_COLUMN_KEY, USER_PASSWORD_PROPERTY_DEFAULT, USER_PASSWORD_PROPERTY_KEY, USER_PEER_CLASS_DEFAULT, USER_PEER_CLASS_KEY
 
Constructor Summary
UserPeerManager()
           
 
Method Summary
static org.apache.torque.util.Criteria buildCriteria(User user)
          Calls buildCriteria(User user) in the configured UserPeer.
static boolean checkExists(User user)
          Checks if a User 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 java.util.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 java.lang.String getColumnName(java.lang.String name)
          Returns the full name of a column.
static java.lang.String getConfirmColumn()
          Returns the fully qualified name of the Column to use as the Confirm Column for a role
static java.lang.String getCreateDateColumn()
          Returns the fully qualified name of the Column to use as the CreateDate Column for a role
static java.lang.String getEmailColumn()
          Returns the fully qualified name of the Column to use as the Email Column for a role
static java.lang.String getFirstNameColumn()
          Returns the fully qualified name of the Column to use as the FirstName Column for a role
 java.lang.String getFullColumnName(java.lang.String name)
          Deprecated. use getColumnName(String name)
static java.lang.Integer getIdAsObj(org.apache.torque.om.Persistent obj)
          Invokes getId() on the supplied base object
static java.lang.String getIdColumn()
          Returns the fully qualified name of the Column to use as the Id Column for a group
static java.lang.String getLastLoginColumn()
          Returns the fully qualified name of the Column to use as the LastLogin Column for a role
static java.lang.String getLastNameColumn()
          Returns the fully qualified name of the Column to use as the LastName Column for a role
static java.lang.String getName(org.apache.torque.om.Persistent obj)
          Invokes getName() on the supplied base object
static java.lang.String getNameColumn()
          Returns the fully qualified name of the Column to use as the Name Column for a group
static User getNewUser(org.apache.torque.om.Persistent p)
          Returns a new, configured User Object with a supplied Persistent object at its core
static java.lang.String getObjectdataColumn()
          Returns the fully qualified name of the Column to use as the objectdata Column for a role
static java.lang.String getPasswordColumn()
          Returns the fully qualified name of the Column to use as the Password Column for a role
static java.lang.String getTableName()
          Get the name of this table.
static java.lang.String getUserConfirmed(org.apache.torque.om.Persistent obj)
          Invokes getConfirmed() on the supplied base object
static java.util.Date getUserCreateDate(org.apache.torque.om.Persistent obj)
          Invokes getCreateDate() on the supplied base object
static java.lang.String getUserEmail(org.apache.torque.om.Persistent obj)
          Invokes getEmail() on the supplied base object
static java.lang.String getUserFirstName(org.apache.torque.om.Persistent obj)
          Invokes getFirstName() on the supplied base object
static java.util.Date getUserLastLogin(org.apache.torque.om.Persistent obj)
          Invokes getLastLogin() on the supplied base object
static java.lang.String getUserLastName(org.apache.torque.om.Persistent obj)
          Invokes getLastName() on the supplied base object
static java.lang.String getUserName(org.apache.torque.om.Persistent obj)
          Deprecated. use getName(obj)
static byte[] getUserObjectdata(org.apache.torque.om.Persistent obj)
          Invokes getObjectdata() on the supplied base object
static java.lang.String getUserPassword(org.apache.torque.om.Persistent obj)
          Invokes getPassword() on the supplied base object
static void init(org.apache.commons.configuration.Configuration conf)
          Initializes the UserPeerManager, loading the class object for the Peer used to retrieve User objects
static org.apache.torque.om.Persistent newPersistentInstance()
          Returns a new, empty object for the underlying peer.
static java.util.List selectAllConfirmedUsers()
          Returns a List of all confirmed User objects.
static java.util.List selectAllUsers()
          Returns a List of all User objects.
static void setId(org.apache.torque.om.Persistent obj, int id)
          Invokes setId(int n) on the supplied base object
static void setUserConfirmed(org.apache.torque.om.Persistent obj, java.lang.String confirm)
          Invokes setConfirmed(String s) on the supplied base object
static void setUserCreateDate(org.apache.torque.om.Persistent obj, java.util.Date createDate)
          Invokes setCreateDate(java.util.Date date) on the supplied base object
static void setUserEmail(org.apache.torque.om.Persistent obj, java.lang.String email)
          Invokes setEmail(String s) on the supplied base object
static void setUserFirstName(org.apache.torque.om.Persistent obj, java.lang.String firstName)
          Invokes setFirstName(String s) on the supplied base object
static void setUserLastLogin(org.apache.torque.om.Persistent obj, java.util.Date lastLogin)
          Invokes setLastLogin(java.util.Date date) on the supplied base object
static void setUserLastName(org.apache.torque.om.Persistent obj, java.lang.String lastName)
          Invokes setLastName(String s) on the supplied base object
static void setUserName(org.apache.torque.om.Persistent obj, java.lang.String name)
          Invokes setName(String s) on the supplied base object
static void setUserObjectdata(org.apache.torque.om.Persistent obj, byte[] objectdata)
          Invokes setObjectdata(byte [] date) on the supplied base object
static void setUserPassword(org.apache.torque.om.Persistent obj, java.lang.String password)
          Invokes setPassword(String s) 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

UserPeerManager

public UserPeerManager()
Method Detail

init

public static void init(org.apache.commons.configuration.Configuration conf)
                 throws InitializationException
Initializes the UserPeerManager, loading the class object for the Peer used to retrieve User objects

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

getTableName

public static java.lang.String getTableName()
Get the name of this table.

Returns:
A String with the name of the table.

getNameColumn

public static java.lang.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 java.lang.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

getPasswordColumn

public static java.lang.String getPasswordColumn()
Returns the fully qualified name of the Column to use as the Password Column for a role

Returns:
A String containing the column name

getFirstNameColumn

public static java.lang.String getFirstNameColumn()
Returns the fully qualified name of the Column to use as the FirstName Column for a role

Returns:
A String containing the column name

getLastNameColumn

public static java.lang.String getLastNameColumn()
Returns the fully qualified name of the Column to use as the LastName Column for a role

Returns:
A String containing the column name

getEmailColumn

public static java.lang.String getEmailColumn()
Returns the fully qualified name of the Column to use as the Email Column for a role

Returns:
A String containing the column name

getConfirmColumn

public static java.lang.String getConfirmColumn()
Returns the fully qualified name of the Column to use as the Confirm Column for a role

Returns:
A String containing the column name

getCreateDateColumn

public static java.lang.String getCreateDateColumn()
Returns the fully qualified name of the Column to use as the CreateDate Column for a role

Returns:
A String containing the column name

getLastLoginColumn

public static java.lang.String getLastLoginColumn()
Returns the fully qualified name of the Column to use as the LastLogin Column for a role

Returns:
A String containing the column name

getObjectdataColumn

public static java.lang.String getObjectdataColumn()
Returns the fully qualified name of the Column to use as the objectdata Column for a role

Returns:
A String containing the column name

getColumnName

public static java.lang.String getColumnName(java.lang.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.

getFullColumnName

public java.lang.String getFullColumnName(java.lang.String name)
Deprecated. use 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 User object

checkExists

public static boolean checkExists(User user)
                           throws DataBackendException,
                                  java.lang.Exception
Checks if a User is defined in the system. The name is used as query criteria.

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

selectAllUsers

public static java.util.List selectAllUsers()
                                     throws java.lang.Exception
Returns a List of all User objects.

Returns:
A List with all users in the system.
Throws:
java.lang.Exception - A generic exception.

selectAllConfirmedUsers

public static java.util.List selectAllConfirmedUsers()
                                              throws java.lang.Exception
Returns a List of all confirmed User objects.

Returns:
A List with all confirmed users in the system.
Throws:
java.lang.Exception - A generic exception.

buildCriteria

public static org.apache.torque.util.Criteria buildCriteria(User user)
Calls buildCriteria(User user) in the configured UserPeer. If you get a ClassCastException in this routine, you put a User 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:
user - An object which implements the User interface
Returns:
A criteria for the supplied user 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 java.util.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 User 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.

setUserName

public static void setUserName(org.apache.torque.om.Persistent obj,
                               java.lang.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

getUserName

public static java.lang.String getUserName(org.apache.torque.om.Persistent obj)
Deprecated. use getName(obj)

Invokes getName() on the supplied base object

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

getName

public static java.lang.String getName(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

setUserPassword

public static void setUserPassword(org.apache.torque.om.Persistent obj,
                                   java.lang.String password)
Invokes setPassword(String s) on the supplied base object

Parameters:
obj - The object to use for setting the password
password - The Password to set

getUserPassword

public static java.lang.String getUserPassword(org.apache.torque.om.Persistent obj)
Invokes getPassword() on the supplied base object

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

setUserFirstName

public static void setUserFirstName(org.apache.torque.om.Persistent obj,
                                    java.lang.String firstName)
Invokes setFirstName(String s) on the supplied base object

Parameters:
obj - The object to use for setting the first name
firstName - The first name to set

getUserFirstName

public static java.lang.String getUserFirstName(org.apache.torque.om.Persistent obj)
Invokes getFirstName() on the supplied base object

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

setUserLastName

public static void setUserLastName(org.apache.torque.om.Persistent obj,
                                   java.lang.String lastName)
Invokes setLastName(String s) on the supplied base object

Parameters:
obj - The object to use for setting the last name
lastName - The Last Name to set

getUserLastName

public static java.lang.String getUserLastName(org.apache.torque.om.Persistent obj)
Invokes getLastName() on the supplied base object

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

setUserEmail

public static void setUserEmail(org.apache.torque.om.Persistent obj,
                                java.lang.String email)
Invokes setEmail(String s) on the supplied base object

Parameters:
obj - The object to use for setting the email
email - The Email to set

getUserEmail

public static java.lang.String getUserEmail(org.apache.torque.om.Persistent obj)
Invokes getEmail() on the supplied base object

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

setUserConfirmed

public static void setUserConfirmed(org.apache.torque.om.Persistent obj,
                                    java.lang.String confirm)
Invokes setConfirmed(String s) on the supplied base object

Parameters:
obj - The object to use for setting the confirm value
confirm - The confirm value to set

getUserConfirmed

public static java.lang.String getUserConfirmed(org.apache.torque.om.Persistent obj)
Invokes getConfirmed() on the supplied base object

Parameters:
obj - The object to use for getting the confirm value
Returns:
A string containing the confirm value

setUserCreateDate

public static void setUserCreateDate(org.apache.torque.om.Persistent obj,
                                     java.util.Date createDate)
Invokes setCreateDate(java.util.Date date) on the supplied base object

Parameters:
obj - The object to use for setting the create date
createDate - The create date to set

getUserCreateDate

public static java.util.Date getUserCreateDate(org.apache.torque.om.Persistent obj)
Invokes getCreateDate() on the supplied base object

Parameters:
obj - The object to use for getting the create date
Returns:
A string containing the create date

setUserLastLogin

public static void setUserLastLogin(org.apache.torque.om.Persistent obj,
                                    java.util.Date lastLogin)
Invokes setLastLogin(java.util.Date date) on the supplied base object

Parameters:
obj - The object to use for setting the last login daet
lastLogin - The last login date to set

getUserLastLogin

public static java.util.Date getUserLastLogin(org.apache.torque.om.Persistent obj)
Invokes getLastLogin() on the supplied base object

Parameters:
obj - The object to use for getting the last login date
Returns:
A string containing the last login date

setUserObjectdata

public static void setUserObjectdata(org.apache.torque.om.Persistent obj,
                                     byte[] objectdata)
Invokes setObjectdata(byte [] date) on the supplied base object

Parameters:
obj - The object to use for setting the last login daet
objectdata - The objectdata to use

getUserObjectdata

public static byte[] getUserObjectdata(org.apache.torque.om.Persistent obj)
Invokes getObjectdata() on the supplied base object

Parameters:
obj - The object to use for getting the last login date
Returns:
A string containing the last login date

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 java.lang.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

getNewUser

public static User getNewUser(org.apache.torque.om.Persistent p)
Returns a new, configured User Object with a supplied Persistent object at its core

Parameters:
p - The persistent object
Returns:
a new, configured User Object
Throws:
java.lang.Exception - Could not create a new Object


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