All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sdi.wap.demo.bean.AccountBean

java.lang.Object
   |
   +----com.sdi.wap.demo.bean.BeanImpl
           |
           +----com.sdi.wap.demo.bean.AccountBean

public class AccountBean
extends BeanImpl
implements Account, Serializable

Variable Index

 o accountID
Instance information (stored in DBMS)
 o address
 o connection
Cached information (computed and stored with the session, not in the database)
 o email
 o name
 o whenCreated

Constructor Index

 o AccountBean(Connection, Identifier, Name, Email)
Insert the method's description here.

Method Index

 o defineAccount(Name, Email)
Create this account (in RAM AND in DBMS)
 o finalize()
Finalize by returning this account's connection to the pool.
 o getAccountID()
Insert the method's description here.
 o getAddress()
Return the address information for this account.
 o getConnection()
Returns a connection for this account, caching a new one from the ConnectionPool if necessary.
 o getEmail()
Insert the method's description here.
 o getName()
Insert the method's description here.
 o getWhenCreated()
Insert the method's description here.
 o hasRole(Role)
Does this account play the indicated role?.
 o isValid()
Determine validity of user-supplied information
 o load(Connection, Identifier)
 o returnConnection(Connection)
Insert the method's description here.
 o save(Connection)
 o setAddress(AddressBean)
Insert the method's description here.
 o setName(Name)
Set the name field of this account.
 o setWhenCreated(Timestamp)
Set the creation date
 o toString()

Variables

 o accountID
 private Identifier accountID
Instance information (stored in DBMS)

 o name
 private Name name
 o email
 private Email email
 o whenCreated
 private Timestamp whenCreated
 o connection
 private transient Connection connection
Cached information (computed and stored with the session, not in the database)

 o address
 private AddressBean address

Constructors

 o AccountBean
 private AccountBean(Connection connection,
                     Identifier accountID,
                     Name name,
                     Email email) throws Exception
Insert the method's description here. Creation date: (02/14/00 18:48:07)

Parameters:
s - java.lang.String

Methods

 o defineAccount
 public static final AccountBean defineAccount(Name name,
                                               Email email) throws Exception
Create this account (in RAM AND in DBMS)

 o finalize
 public void finalize()
Finalize by returning this account's connection to the pool.

Overrides:
finalize in class Object
 o getAccountID
 public Identifier getAccountID()
Insert the method's description here.

Returns:
java.lang.String
 o getAddress
 public AddressBean getAddress() throws Exception
Return the address information for this account. (cached) Creation date: (04/30/00 13:13:36)

 o getConnection
 public Connection getConnection() throws Exception
Returns a connection for this account, caching a new one from the ConnectionPool if necessary. The Connection will be returned to the pool by the finalize method. This is an possibly dangerous experiment trying to simplify connection pool management by JSP programs. Without this (or something) similar every JSP program will need to get a connection from the pool, remember to return it, and pass it as an argument to all methods that might need to touch the database at some point. This was becoming impossibly tedious, so I'm looking for a way to hide this. Creation date: (05/03/00 17:08:37)

Returns:
java.sql.Connection
 o getEmail
 public Email getEmail() throws Exception
Insert the method's description here. Creation date: (04/30/00 13:13:36)

 o getName
 public Name getName()
Insert the method's description here. Creation date: (04/30/00 13:13:36)

 o getWhenCreated
 public Timestamp getWhenCreated()
Insert the method's description here. Creation date: (05/09/00 20:17:09)

Returns:
long
 o hasRole
 public boolean hasRole(Role role) throws Exception
Does this account play the indicated role?.

 o isValid
 public boolean isValid()
Determine validity of user-supplied information

Returns:
boolean
Overrides:
isValid in class BeanImpl
 o load
 public static AccountBean load(Connection connection,
                                Identifier accountID) throws Exception
 o returnConnection
 public void returnConnection(Connection connection)
Insert the method's description here. Creation date: (05/03/00 20:19:15)

 o save
 public Identifier save(Connection connection) throws Exception
 o setAddress
 public void setAddress(AddressBean address)
Insert the method's description here. Creation date: (01/24/00 22:46:48)

Parameters:
newStatus - java.lang.String
 o setName
 public void setName(Name name)
Set the name field of this account. Changing the name does NOT and must not affect the account identifier!

 o setWhenCreated
 public void setWhenCreated(Timestamp newWhenCreated)
Set the creation date

Parameters:
newWhenCreated - Timestamp
 o toString
 public String toString()
Returns:
java.lang.String
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index