|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.apache.struts.examples.mailreader.memory.MemoryUser
Concrete implementation of User for an in-memory
database backed by an XML data file.
| Field Summary | |
private MemoryUserDatabase |
database
The UserDatabase with which we are associated. |
private java.lang.String |
fromAddress
The email address from which messages are sent. |
private java.lang.String |
fullName
The full name of this user, included in from addresses. |
private java.lang.String |
password
The password (in clear text). |
private java.lang.String |
replyToAddress
The EMAIL address to which replies should be sent. |
private java.util.HashMap |
subscriptions
The Subscriptions for this User, keyed by hostname. |
private java.lang.String |
username
The username for this user. |
| Constructor Summary | |
MemoryUser(MemoryUserDatabase database,
java.lang.String username)
Construct a new User associated with the specified UserDatabase. |
|
| Method Summary | |
Subscription |
createSubscription(java.lang.String host)
Create and return a new Subscription associated with this
User, for the specified host name. |
Subscription |
findSubscription(java.lang.String host)
Find and return the Subscription associated with the specified
host. |
UserDatabase |
getDatabase()
The UserDatabase with which we are associated. |
java.lang.String |
getFromAddress()
Return the from address. |
java.lang.String |
getFullName()
Return the full name. |
java.lang.String |
getPassword()
Return the password. |
java.lang.String |
getReplyToAddress()
Return the reply-to address. |
Subscription[] |
getSubscriptions()
Find and return all Subscriptions associated with this user. |
java.lang.String |
getUsername()
The username (must be unique). |
void |
removeSubscription(Subscription subscription)
Remove the specified Subscription from being associated
with this User. |
void |
setFromAddress(java.lang.String fromAddress)
Set the from address. |
void |
setFullName(java.lang.String fullName)
Set the full name. |
void |
setPassword(java.lang.String password)
Set the password. |
void |
setReplyToAddress(java.lang.String replyToAddress)
Set the reply-to address. |
java.lang.String |
toString()
Return a String representation of this object. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private MemoryUserDatabase database
UserDatabase with which we are associated.private java.util.HashMap subscriptions
Subscriptions for this User, keyed by hostname.private java.lang.String username
private java.lang.String fromAddress
private java.lang.String fullName
private java.lang.String password
private java.lang.String replyToAddress
| Constructor Detail |
public MemoryUser(MemoryUserDatabase database,
java.lang.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()
UserDatabase with which we are associated.getDatabase in interface Userpublic java.lang.String getFromAddress()
UsergetFromAddress in interface Userpublic void setFromAddress(java.lang.String fromAddress)
UsersetFromAddress in interface Userorg.apache.struts.examples.mailreader.UserfromAddress - The new from addresspublic java.lang.String getFullName()
UsergetFullName in interface Userpublic void setFullName(java.lang.String fullName)
UsersetFullName in interface Userorg.apache.struts.examples.mailreader.UserfullName - The new full namepublic java.lang.String getPassword()
UsergetPassword in interface Userpublic void setPassword(java.lang.String password)
UsersetPassword in interface Userorg.apache.struts.examples.mailreader.Userpassword - The new passwordpublic java.lang.String getReplyToAddress()
UsergetReplyToAddress in interface Userpublic void setReplyToAddress(java.lang.String replyToAddress)
UsersetReplyToAddress in interface Userorg.apache.struts.examples.mailreader.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 java.lang.String getUsername()
getUsername in interface Userpublic Subscription createSubscription(java.lang.String host)
Subscription associated with this
User, for the specified host name.createSubscription in interface Userhost - Host name for which to create a subscriptionjava.lang.IllegalArgumentException - if the host name is not unique
for this userpublic Subscription findSubscription(java.lang.String host)
Subscription associated with the specified
host. If none is found, return null.findSubscription in interface Userhost - Host name to look uppublic void removeSubscription(Subscription subscription)
Subscription from being associated
with this User.removeSubscription in interface Usersubscription - Subscription to be removedjava.lang.IllegalArgumentException - if the specified subscription is not
associated with this Userpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||