org.apache.shale.usecases.logic
Class LogonLogic

java.lang.Object
  extended by org.apache.shale.usecases.logic.LogonLogic

public class LogonLogic
extends Object

Business logic for manipulating user profile information and validating logon credentials. The UsersDAO object used to access the underlying persistent data must be injected before any of the logic methods in this class may be used.

$Id: LogonLogic.java 464373 2006-10-16 04:21:54Z rahul $


Constructor Summary
LogonLogic()
           
 
Method Summary
 User authenticate(String username, String password)
          Validate the specified logon credientials.
 User createUser()
          Create and return a User object that may be populated and then passed to insertUser() for persistence.
 User findUser(int id)
          Pass-through method to retrieve a User by id.
 User findUser(String username)
          Pass-through method to retrieve a User by username.
 UsersDAO getDao()
           
 void insertUser(User user)
          Insert a newly created User into persistent storage.
 void setDao(UsersDAO dao)
           
 void updateUser(User user)
          Update an existing User into persistent storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogonLogic

public LogonLogic()
Method Detail

getDao

public UsersDAO getDao()

setDao

public void setDao(UsersDAO dao)

authenticate

public User authenticate(String username,
                         String password)

Validate the specified logon credientials. If valid credentials are specified, return the corresponding User instance. Otherwise, return null.

Parameters:
username - Username creditial that was entered
password - Password credential that was entered

createUser

public User createUser()

Create and return a User object that may be populated and then passed to insertUser() for persistence.


findUser

public User findUser(int id)

Pass-through method to retrieve a User by id.

Parameters:
id - Identifier of the User to return

findUser

public User findUser(String username)

Pass-through method to retrieve a User by username.

Parameters:
username - Username of the User to return

insertUser

public void insertUser(User user)

Insert a newly created User into persistent storage.

Parameters:
user - Created User to be persisted

updateUser

public void updateUser(User user)

Update an existing User into persistent storage.

Parameters:
user - Updated User to be persisted


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.