com.mycompany.messages
Class EmployeeRegistryBean

java.lang.Object
  extended bycom.mycompany.messages.EmployeeRegistryBean
All Implemented Interfaces:
java.io.Serializable

public class EmployeeRegistryBean
extends java.lang.Object
implements java.io.Serializable

This class is an example of an application specific interface to a data source (faked here, but it could be a database). It contains methods for authenticating a user, and retrieving and updating user information.

Version:
1.0
Author:
Hans Bergsten, Gefion software
See Also:
Serialized Form

Field Summary
private  java.util.Map dataSource
           
 
Constructor Summary
EmployeeRegistryBean()
           
 
Method Summary
 EmployeeBean authenticate(java.lang.String username, java.lang.String password)
          Returns an EmployeeBean if the specified user name and password match an employee in the database, otherwise null.
 EmployeeBean getEmployee(java.lang.String username)
          Returns an EmployeeBean initialized with the information found in the database for the specified employee, or null if not found.
 void saveEmployee(EmployeeBean empInfo)
          Inserts the information about the specified employee, or updates the information if it's already defined.
 void setDataSource(java.util.Map dataSource)
          Sets the dataSource property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSource

private java.util.Map dataSource
Constructor Detail

EmployeeRegistryBean

public EmployeeRegistryBean()
Method Detail

setDataSource

public void setDataSource(java.util.Map dataSource)
Sets the dataSource property value.


authenticate

public EmployeeBean authenticate(java.lang.String username,
                                 java.lang.String password)
Returns an EmployeeBean if the specified user name and password match an employee in the database, otherwise null.


getEmployee

public EmployeeBean getEmployee(java.lang.String username)
Returns an EmployeeBean initialized with the information found in the database for the specified employee, or null if not found.


saveEmployee

public void saveEmployee(EmployeeBean empInfo)
Inserts the information about the specified employee, or updates the information if it's already defined.