|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.struts.webapp.example.memory.MemoryUser
Concrete implementation of User for an in-memory
database backed by an XML data file.
| Field Summary | |
private MemoryUserDatabase |
database
The UserDatabasewith which we are associated. |
private String |
fromAddress
The email address from which messages are sent. |
private String |
fullName
The full name of this user, included in from addresses. |
private String |
password
The password (in clear text). |
private String |
replyToAddress
The EMAIL address to which replies should be sent. |
private HashMap |
subscriptions
The Subscriptions for this User, keyed by hostname. |
private String |
username
The username for this user. |
| Constructor Summary | |
MemoryUser(MemoryUserDatabase database,
String username)
Construct a new User associated with the specified UserDatabase. |
|
| Method Summary | |
Subscription |
createSubscription(String host)
Create and return a new Subscriptionassociated with this User,
for the specified host name. |
Subscription |
findSubscription(String host)
Find and return the Subscriptionassociated with the specified
host. |
UserDatabase |
getDatabase()
The UserDatabasewith which we are associated. |
String |
getFromAddress()
Return the from address. |
String |
getFullName()
Return the full name. |
String |
getPassword()
Return the password. |
String |
getReplyToAddress()
Return the reply-to address. |
Subscription[] |
getSubscriptions()
Find and return all Subscriptions associated with this user. |
String |
getUsername()
The username (must be unique). |
void |
removeSubscription(Subscription subscription)
Remove the specified Subscriptionfrom being associated with
this User. |
void |
setFromAddress(String fromAddress)
Set the from address. |
void |
setFullName(String fullName)
Set the full name. |
void |
setPassword(String password)
Set the password. |
void |
setReplyToAddress(String replyToAddress)
Set the reply-to address. |
String |
toString()
Return a String representation of this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private MemoryUserDatabase database
UserDatabasewith which we are associated.
private HashMap subscriptions
Subscriptions for this User, keyed by hostname.
private String username
private String fromAddress
private String fullName
private String password
private String replyToAddress
| Constructor Detail |
public MemoryUser(MemoryUserDatabase database,
String username)
Construct a new User associated with the specified UserDatabase.
database - The user database with which we are associatedusername - The username of this user| Method Detail |
public UserDatabase getDatabase()
UserDatabasewith which we are associated.
getDatabase in interface Userpublic String getFromAddress()
User
getFromAddress in interface Userpublic void setFromAddress(String fromAddress)
User
setFromAddress in interface UserfromAddress - The new from addresspublic String getFullName()
User
getFullName in interface Userpublic void setFullName(String fullName)
User
setFullName in interface UserfullName - The new full namepublic String getPassword()
User
getPassword in interface Userpublic void setPassword(String password)
User
setPassword in interface Userpassword - The new passwordpublic String getReplyToAddress()
User
getReplyToAddress in interface Userpublic void setReplyToAddress(String replyToAddress)
User
setReplyToAddress in interface UserreplyToAddress - The new reply-to addresspublic Subscription[] getSubscriptions()
Subscriptions associated with this user. If
there are none, a zero-length array is returned.
getSubscriptions in interface Userpublic String getUsername()
getUsername in interface Userpublic Subscription createSubscription(String host)
Subscriptionassociated with this User,
for the specified host name.
createSubscription in interface Userhost - Host name for which to create a subscription
IllegalArgumentException - if the host name is not unique for this userpublic Subscription findSubscription(String host)
Subscriptionassociated with the specified
host. If none is found, return null.
findSubscription in interface Userhost - Host name to look uppublic void removeSubscription(Subscription subscription)
Subscriptionfrom being associated with
this User.
removeSubscription in interface Usersubscription - Subscription to be removed
IllegalArgumentException - if the specified subscription is not associated with this
Userpublic String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||