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 java.lang.Object
implements User

Concrete implementation of AbstractUser.

Since:
Struts 1.1
Version:
$Rev: 471754 $

Constructor Summary
AbstractUser(UserDatabase 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.
 
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,
                    java.lang.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 java.lang.String getFromAddress()
Description copied from interface: User
Return the from address.

Specified by:
getFromAddress in interface User

setFromAddress

public void setFromAddress(java.lang.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 java.lang.String getFullName()
Description copied from interface: User
Return the full name.

Specified by:
getFullName in interface User

setFullName

public void setFullName(java.lang.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 java.lang.String getPassword()
Description copied from interface: User
Return the password.

Specified by:
getPassword in interface User

setPassword

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

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

getReplyToAddress

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

Specified by:
getReplyToAddress in interface User

setReplyToAddress

public void setReplyToAddress(java.lang.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 java.lang.String getUsername()
The username (must be unique).

Specified by:
getUsername in interface User

createSubscription

public Subscription createSubscription(java.lang.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:
java.lang.IllegalArgumentException - if the host name is not unique for this user

findSubscription

public Subscription findSubscription(java.lang.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:
java.lang.IllegalArgumentException - if the specified subscription is not associated with this User


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