com.pow2.user
Class User

java.lang.Object
  extended bycom.pow2.user.User

public class User
extends Object

Pow2 User class.
This class encapsulates the basic user informations; if you'd like to have a more specialized User entity, extend this class and provide your own implementation.

Author:
Luca Fossato

Field Summary
protected  boolean authenticated
          user authentication flag
protected  org.apache.log4j.Category cat
          Log4J category
protected  String city
          user city
protected  UserDAO dao
          the single instance of the UserDAO object
protected  String email
          user email
protected  String fax
          user fax number
protected  String firstName
          user first name
protected  String id
          user identifier
protected  String lastName
          user last name
protected  String login
          user login
protected  String mobile
          user mobile number
protected  String passwd
          user password
protected  String phone
          user phone number
protected  String state
          user state
protected  String street
          user street
 String USER_ID_NOTPERSISTED
          user id value for user objects that are not yet persisted into the database.
protected  String zipCode
          user zip code
 
Constructor Summary
User()
          Default User constructor.
User(String login, String passwd)
          User constructor.
 
Method Summary
 String getCity()
          Gets the city attribute of the User object
 String getEmail()
          Gets the email attribute of the User object
 String getFax()
          Gets the fax attribute of the User object
 String getFirstName()
          Gets the firstName attribute of the User object
 String getId()
          Gets the id attribute of the User object
 String getLastName()
          Gets the lastName attribute of the User object
 String getLogin()
          Gets the login attribute of the User object
 String getMobile()
          Gets the mobile attribute of the User object
 String getPasswd()
          Gets the passwd attribute of the User object
 String getPhone()
          Gets the phone attribute of the User object
 void getProfile()
          Gets the user profile (its informations) from the database.
 String getState()
          Gets the state attribute of the User object
 String getStreet()
          Gets the street attribute of the User object
 String getZipCode()
          Gets the zipCode attribute of the User object
 boolean isAuthenticated()
          Tests if the user is authenticated
 void setAuthentication(boolean v)
          Sets the user authentication flag.
 void setCity(String city)
          Sets the city attribute of the User object
 void setEmail(String v)
          Sets the email attribute of the User object
 void setFax(String fax)
          Sets the fax attribute of the User object
 void setFirstName(String v)
          Sets the firstName attribute of the User object
 void setId(String v)
          Sets the id attribute of the User object
 void setLastName(String v)
          Sets the lastName attribute of the User object
 void setLogin(String v)
          Sets the login attribute of the User object
 void setMobile(String mobile)
          Sets the mobile attribute of the User object
 void setPasswd(String v)
          Sets the passwd attribute of the User object
 void setPhone(String phone)
          Sets the phone attribute of the User object
 void setState(String state)
          Sets the state attribute of the User object
 void setStreet(String street)
          Sets the street attribute of the User object
 void setZipCode(String zipCode)
          Sets the zipCode attribute of the User object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_ID_NOTPERSISTED

public final String USER_ID_NOTPERSISTED
user id value for user objects that are not yet persisted into the database.

See Also:
Constant Field Values

cat

protected org.apache.log4j.Category cat
Log4J category


authenticated

protected boolean authenticated
user authentication flag


city

protected String city
user city


dao

protected UserDAO dao
the single instance of the UserDAO object


email

protected String email
user email


fax

protected String fax
user fax number


firstName

protected String firstName
user first name


id

protected String id
user identifier


lastName

protected String lastName
user last name


login

protected String login
user login


mobile

protected String mobile
user mobile number


passwd

protected String passwd
user password


phone

protected String phone
user phone number


state

protected String state
user state


street

protected String street
user street


zipCode

protected String zipCode
user zip code

Constructor Detail

User

public User()
Default User constructor.


User

public User(String login,
            String passwd)
User constructor.
Initialize the User object using the login and passwd properties to retrieve the user informations from the database.
If the authentication fails (login and password user properties don't match the database properties), isAuthenticated method returns false.

Parameters:
login - Description of the Parameter
passwd - Description of the Parameter
Method Detail

getCity

public String getCity()
Gets the city attribute of the User object

Returns:
The city value

getEmail

public String getEmail()
Gets the email attribute of the User object

Returns:
The email value

getFax

public String getFax()
Gets the fax attribute of the User object

Returns:
The fax value

getFirstName

public String getFirstName()
Gets the firstName attribute of the User object

Returns:
The firstName value

getId

public String getId()
Gets the id attribute of the User object

Returns:
The id value

getLastName

public String getLastName()
Gets the lastName attribute of the User object

Returns:
The lastName value

getLogin

public String getLogin()
Gets the login attribute of the User object

Returns:
The login value

getMobile

public String getMobile()
Gets the mobile attribute of the User object

Returns:
The mobile value

getPasswd

public String getPasswd()
Gets the passwd attribute of the User object

Returns:
The passwd value

getPhone

public String getPhone()
Gets the phone attribute of the User object

Returns:
The phone value

getProfile

public void getProfile()
Gets the user profile (its informations) from the database.
This method uses the login and passwd properties to retrieve the user informations from the database.
If the user authentication fails (login and password user properties don't match the database properties), isAuthenticated method returns false.


getState

public String getState()
Gets the state attribute of the User object

Returns:
The state value

getStreet

public String getStreet()
Gets the street attribute of the User object

Returns:
The street value

getZipCode

public String getZipCode()
Gets the zipCode attribute of the User object

Returns:
The zipCode value

isAuthenticated

public boolean isAuthenticated()
Tests if the user is authenticated

Returns:
true if the user is authenticated; false otherwise.

setAuthentication

public void setAuthentication(boolean v)
Sets the user authentication flag.
An user is authenticated if its informations are retrieved from the underlying database, using a login and password couple that matches with the same database properties.

Parameters:
v - true if the user is authenticated versus the database; false otherwise.

setCity

public void setCity(String city)
Sets the city attribute of the User object

Parameters:
city - The new city value

setEmail

public void setEmail(String v)
Sets the email attribute of the User object

Parameters:
v - The new email value

setFax

public void setFax(String fax)
Sets the fax attribute of the User object

Parameters:
fax - The new fax value

setFirstName

public void setFirstName(String v)
Sets the firstName attribute of the User object

Parameters:
v - The new firstName value

setId

public void setId(String v)
Sets the id attribute of the User object

Parameters:
v - The new id value

setLastName

public void setLastName(String v)
Sets the lastName attribute of the User object

Parameters:
v - The new lastName value

setLogin

public void setLogin(String v)
Sets the login attribute of the User object

Parameters:
v - The new login value

setMobile

public void setMobile(String mobile)
Sets the mobile attribute of the User object

Parameters:
mobile - The new mobile value

setPasswd

public void setPasswd(String v)
Sets the passwd attribute of the User object

Parameters:
v - The new passwd value

setPhone

public void setPhone(String phone)
Sets the phone attribute of the User object

Parameters:
phone - The new phone value

setState

public void setState(String state)
Sets the state attribute of the User object

Parameters:
state - The new state value

setStreet

public void setStreet(String street)
Sets the street attribute of the User object

Parameters:
street - The new street value

setZipCode

public void setZipCode(String zipCode)
Sets the zipCode attribute of the User object

Parameters:
zipCode - The new zipCode value


Copyright © 2002-2004 Power Of Two S.R.L. All Rights Reserved.