2
* Copyright 1999-2002,2004 The Apache Software Foundation.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
18
package org.apache.struts.webapp.example;
22
* <p>A <strong>User</strong> which is stored, along with his or her
23
* associated {@link Subscription}s, in a {@link UserDatabase}.</p>
25
* @author Craig R. McClanahan
26
* @version $Revision: 1.2 $ $Date: 2004/03/08 02:49:52 $
30
public interface User {
33
// ------------------------------------------------------------- Properties
37
* Return the {@link UserDatabase} with which we are associated.
39
public UserDatabase getDatabase();
43
* Return the from address.
45
public String getFromAddress();
49
* Set the from address.
51
* @param fromAddress The new from address
53
public void setFromAddress(String fromAddress);
57
* Return the full name.
59
public String getFullName();
65
* @param fullName The new full name
67
public void setFullName(String fullName);
71
* Return the password.
73
public String getPassword();
79
* @param password The new password
81
public void setPassword(String password);
85
* Return the reply-to address.
87
public String getReplyToAddress();
91
* Set the reply-to address.
93
* @param replyToAddress The new reply-to address
95
public void setReplyToAddress(String replyToAddress);
99
* Find and return all {@link Subscription}s associated with this user.
100
* If there are none, a zero-length array is returned.
102
public Subscription[] getSubscriptions();
106
* Return the username.
108
public String getUsername();
111
// --------------------------------------------------------- Public Methods
115
* Create and return a new {@link Subscription} associated with this
116
* User, for the specified host name.
118
* @param host Host name for which to create a subscription
120
* @exception IllegalArgumentException if the host name is not unique
123
public Subscription createSubscription(String host);
127
* Find and return the {@link Subscription} associated with the specified
128
* host. If none is found, return <code>null</code>.
130
* @param host Host name to look up
132
public Subscription findSubscription(String host);
136
* Remove the specified {@link Subscription} from being associated
139
* @param subscription Subscription to be removed
141
* @exception IllegalArgumentException if the specified subscription is not
142
* associated with this User
144
public void removeSubscription(Subscription subscription);