org.apache.struts.apps.mailreader.dao.impl
Class AbstractUser

java.lang.Object
  extended by org.apache.struts.apps.mailreader.dao.impl.AbstractUser
All Implemented Interfaces:
User
Direct Known Subclasses:
MemoryUser

public abstract class AbstractUser
extends Object
implements User

Concrete implementation of AbstractUser.

Since:
Struts 1.1
Version:
$Rev: 471754 $

Constructor Summary
AbstractUser(UserDatabase database, String username)
          Construct a new User associated with the specified UserDatabase.
 
Method Summary
 Subscription createSubscription(String host)
          Create and return a new Subscription associated with this User, for the specified host name.
 Subscription findSubscription(String host)
          Find and return the Subscription associated with the specified host.
 UserDatabase getDatabase()
          The UserDatabase with 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 Subscription from 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractUser

public AbstractUser(UserDatabase database,
                    String username)

Construct a new User associated with the specified UserDatabase.

Parameters:
database - The user database with which we are associated
username - The username of this user
Method Detail

getDatabase

public UserDatabase getDatabase()
The UserDatabase with which we are associated.

Specified by:
getDatabase in interface User

getFromAddress

public String getFromAddress()
Description copied from interface: User
Return the from address.

Specified by:
getFromAddress in interface User

setFromAddress

public void setFromAddress(String fromAddress)
Description copied from interface: User
Set the from address.

Specified by:
setFromAddress in interface User
Parameters:
fromAddress - The new from address

getFullName

public String getFullName()
Description copied from interface: User
Return the full name.

Specified by:
getFullName in interface User

setFullName

public void setFullName(String fullName)
Description copied from interface: User
Set the full name.

Specified by:
setFullName in interface User
Parameters:
fullName - The new full name

getPassword

public String getPassword()
Description copied from interface: User
Return the password.

Specified by:
getPassword in interface User

setPassword

public void setPassword(String password)
Description copied from interface: User
Set the password.

Specified by:
setPassword in interface User
Parameters:
password - The new password

getReplyToAddress

public String getReplyToAddress()
Description copied from interface: User
Return the reply-to address.

Specified by:
getReplyToAddress in interface User

setReplyToAddress

public void setReplyToAddress(String replyToAddress)
Description copied from interface: User
Set the reply-to address.

Specified by:
setReplyToAddress in interface User
Parameters:
replyToAddress - The new reply-to address

getSubscriptions

public Subscription[] getSubscriptions()
Find and return all Subscriptions associated with this user. If there are none, a zero-length array is returned.

Specified by:
getSubscriptions in interface User

getUsername

public String getUsername()
The username (must be unique).

Specified by:
getUsername in interface User

createSubscription

public Subscription createSubscription(String host)
Create and return a new Subscription associated with this User, for the specified host name.

Specified by:
createSubscription in interface User
Parameters:
host - Host name for which to create a subscription
Throws:
IllegalArgumentException - if the host name is not unique for this user

findSubscription

public Subscription findSubscription(String host)
Find and return the Subscription associated with the specified host. If none is found, return null.

Specified by:
findSubscription in interface User
Parameters:
host - Host name to look up

removeSubscription

public void removeSubscription(Subscription subscription)
Remove the specified Subscription from being associated with this User.

Specified by:
removeSubscription in interface User
Parameters:
subscription - Subscription to be removed
Throws:
IllegalArgumentException - if the specified subscription is not associated with this User


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.