Compoze Software, Inc.

com.compoze.examples
Class JdbcUserAuthenticationFactory


java.lang.Object

  |

  +--com.compoze.examples.JdbcUserAuthenticationFactory

All Implemented Interfaces:
IUserAuthenticationFactory, java.io.Serializable

public class JdbcUserAuthenticationFactory
extends java.lang.Object
implements IUserAuthenticationFactory, java.io.Serializable

This class uses a database to store basic set of users and groups for the example applications. This class is provided for illustrative purposes only and the source is included in the product delivery at %HARMONY_HOME%\examples\source.

See Also:
Serialized Form

Constructor Summary
JdbcUserAuthenticationFactory()
          Constructor.
 
Method Summary
static User createUser(java.lang.String sName, java.lang.String sPassword, java.lang.String sEmailAddress, java.lang.String groups)
          Creates a new user with the default locale and time zone.
static User createUser(java.lang.String sName, java.lang.String sPassword, java.lang.String sEmailAddress, java.lang.String groups, java.util.Locale locale, java.util.TimeZone timeZone)
          Gets a user by name.
 User getAnonymousAuthentication()
          Gets the anonymous authentication.
 User getUserAuthentication(UserInfo userInfo)
          Gets the user authentication from the given user info.
 java.util.List groups()
          Gets the list of groups (optional operation).
 java.util.List users()
          Gets the list of users (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcUserAuthenticationFactory


public JdbcUserAuthenticationFactory()
Constructor.
Method Detail

getUserAuthentication


public User getUserAuthentication(UserInfo userInfo)
                           throws InvalidAuthenticationException
Description copied from interface: IUserAuthenticationFactory
Gets the user authentication from the given user info.
Specified by:
getUserAuthentication in interface IUserAuthenticationFactory
Following copied from interface: com.compoze.security.IUserAuthenticationFactory
Parameters:
userInfo - the user information
Returns:
the user authentication collected from the user info or null if user can not be determined
Throws:
InvalidAuthenticationException - occurs if the user authentication cannot be validated (ie. the user exists but cannot be authenticated with the specified user information credentials)

getAnonymousAuthentication


public User getAnonymousAuthentication()
Description copied from interface: IUserAuthenticationFactory
Gets the anonymous authentication.
Specified by:
getAnonymousAuthentication in interface IUserAuthenticationFactory
Following copied from interface: com.compoze.security.IUserAuthenticationFactory
Returns:
the anonymous authentication or null if none can be determined

users


public java.util.List users()
                     throws java.lang.UnsupportedOperationException
Description copied from interface: IUserAuthenticationFactory
Gets the list of users (optional operation).
Specified by:
users in interface IUserAuthenticationFactory
Following copied from interface: com.compoze.security.IUserAuthenticationFactory
Returns:
the list of User objects
Throws:
java.lang.UnsupportedOperationException - obtaining a list of users is not supported by this authentication factory

groups


public java.util.List groups()
                      throws java.lang.UnsupportedOperationException
Description copied from interface: IUserAuthenticationFactory
Gets the list of groups (optional operation).
Specified by:
groups in interface IUserAuthenticationFactory
Following copied from interface: com.compoze.security.IUserAuthenticationFactory
Returns:
the list of Group objects
Throws:
java.lang.UnsupportedOperationException - obtaining a list of groups is not supported by this authentication factory

createUser


public static User createUser(java.lang.String sName,
                              java.lang.String sPassword,
                              java.lang.String sEmailAddress,
                              java.lang.String groups)
Creates a new user with the default locale and time zone.
Parameters:
sName - the user name (may not be null)
sPassword - the password for the user
sEmailAddress - the email address for the user
groups - a comma separated list of groups the user is member of

createUser


public static User createUser(java.lang.String sName,
                              java.lang.String sPassword,
                              java.lang.String sEmailAddress,
                              java.lang.String groups,
                              java.util.Locale locale,
                              java.util.TimeZone timeZone)
Gets a user by name.
Parameters:
sName - the user name (may not be null)
sPassword - the password for the user
sEmailAddress - the email address for the user
groups - a comma separated list of groups the user is member of
locale - the locale for the user
timeZone - the time zone for the user

Compoze Software, Inc.

Copyright ©1999-2001 Compoze Software, Inc. All rights reserved.