001: /* CVS ID: $Id: UserData.java,v 1.1.1.1 2002/10/02 18:42:51 wastl Exp $ */
002: package net.wastl.webmail.server;
003:
004: import net.wastl.webmail.exceptions.*;
005:
006: import java.util.*;
007:
008: /**
009: * UserData.java
010: *
011: * Created: Wed Mar 24 1999
012: *
013: * Copyright (C) 1999-2000 Sebastian Schaffert
014: *
015: * This program is free software; you can redistribute it and/or
016: * modify it under the terms of the GNU General Public License
017: * as published by the Free Software Foundation; either version 2
018: * of the License, or (at your option) any later version.
019: *
020: * This program is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * You should have received a copy of the GNU General Public License
026: * along with this program; if not, write to the Free Software
027: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
028: */
029: /**
030: *
031: * @author Sebastian Schaffert
032: * @version $Revision: 1.1.1.1 $
033: */
034: /* 9/25/2000 devink -- changed for new challenge/response authentication */
035: public interface UserData {
036:
037: public void login();
038:
039: public void logout();
040:
041: /**
042: * Add a mailbox to this user's data.
043: * The new mailbox will be stored in the user configuration and used
044: * for connection.
045: *
046: * @param name Name used to represent the mailhost in WebMail
047: * @param host This will usually be the URL to the mailhost, constructed
048: * from the protocol and the hostname
049: * @param login The login name used for the host
050: * @param password The corresponding password
051: */
052: public void addMailHost(String name, String host, String login,
053: String password);
054:
055: /**
056: * Remove the mailhost with the given name.
057: *
058: * @param name The WebMail internal name of this mailbox
059: */
060: public void removeMailHost(String name);
061:
062: /**
063: * Return the mailhost data for the mailbox with the given name.
064: *
065: * @param name The WebMail internal name of this mailbox
066: * @returns the MailHostData representation of the mailbox
067: * @see MailHostData
068: */
069: public MailHostData getMailHost(String name);
070:
071: /**
072: * Return the list of mailbox names of the mailboxes this user has.
073: *
074: * @returns list of mailbox names for this user
075: */
076: public Enumeration mailHosts();
077:
078: /**
079: * Return the value that the user configured as maximum number of
080: * messages to display on one page of the message list.
081: */
082: public int getMaxShowMessages();
083:
084: /**
085: * Set the number of maximum messages to display on one page of the
086: * messagelist.
087: *
088: * @param i maximum number of messages on one page
089: */
090: public void setMaxShowMessages(int i);
091:
092: /**
093: * Break lines at this maximum length.Only applicable if the user configured
094: * to break lines.
095: *
096: * @see wantsBreakLines()
097: */
098: public int getMaxLineLength();
099:
100: /**
101: * Set the maximum column count for messages. Only applicable if the user
102: * configured to break lines.
103: *
104: * @param i maximum column count
105: * @see wantsBreakLines()
106: */
107: public void setMaxLineLength(int i);
108:
109: /**
110: * Check whether the user wants to force line breaks.
111: * If this is set to true, lines in composed and shown messages are
112: * smartly broken at the configured positions.
113: *
114: * @see getMaxLineLength()
115: */
116: public boolean wantsBreakLines();
117:
118: /**
119: * Set whether the user wants to force line breaks or not.
120: *
121: * @param b true if the user wants linebreaks
122: */
123: public void setBreakLines(boolean b);
124:
125: /**
126: * Returns the username concatenated with '@' and the virtual domain.
127: * As of WebMail 0.7.0 this is different from the username, because it
128: * consists of the username and the domain.
129: *
130: * @see getUserName()
131: */
132: public String getLogin();
133:
134: /**
135: * Return the full name (christian and last name) of the user.
136: */
137: public String getFullName();
138:
139: /**
140: * Set the full name (christian and last name) of the user.
141: *
142: * @param s the String containing the full name of the user
143: */
144: public void setFullName(String s);
145:
146: /**
147: * Return the signature of this user that should be appended to
148: * composed messages.
149: */
150: public String getSignature();
151:
152: /**
153: * Set the signature that should be appended to composed messages.
154: *
155: * @param s String containing the signature
156: */
157: public void setSignature(String s);
158:
159: /**
160: * Get the email address of the user.
161: * This will be used for outgoing mail.
162: */
163: public String getEmail();
164:
165: /**
166: * Set the email address of the user.
167: * This will be used for outgoing mail.
168: *
169: * @param s String containing the Email address
170: */
171: public void setEmail(String s);
172:
173: /**
174: * Return the locale that this user configured.
175: *
176: * @returns a Locale object constructed from the locale string
177: */
178: public Locale getPreferredLocale();
179:
180: /**
181: * Set the preferred locale for this user
182: *
183: * @param newloc name of the new locale (e.g. de_DE)
184: */
185: public void setPreferredLocale(String newloc);
186:
187: /**
188: * Return the theme that the user configured.
189: * (Reserved for future use, just returns "default").
190: */
191: public String getTheme();
192:
193: /**
194: * Change the theme for this user.
195: *
196: * @param theme name of the theme
197: */
198: public void setTheme(String theme);
199:
200: /**
201: * Get a localized string containing the date when the user first logged in.
202: */
203: public String getFirstLogin();
204:
205: /**
206: * Get a localized string containing the date when the user logged in
207: * the last time.
208: */
209: public String getLastLogin();
210:
211: /**
212: * Get a string containing the total count of logins for the user.
213: */
214: public String getLoginCount();
215:
216: /**
217: * Check the given password against the user's password.
218: *
219: * @param s String with the password that is to be checked
220: * @see SimpleAuthenticator
221: */
222: public boolean checkPassword(String s);
223:
224: /**
225: * Change the users password.
226: *
227: * @param newpasswd new password
228: * @param verify new password again to verify that it was not misspelled
229: */
230: public void setPassword(String newpasswd, String verify)
231: throws InvalidPasswordException;
232:
233: /**
234: * Set the password data for a user. This can contain any string which
235: * will then become password data for a user. It can be encoded
236: * however the authenticator chooses.
237: * Note that when switching authenticators, this password data will
238: * most likely not be valid anymore, and the user will be locked out
239: * of their account.
240: *
241: * @param data The new data to use
242: */
243: public void setPasswordData(String data);
244:
245: /**
246: * Get the password data for this user.
247: *
248: * @return The saved password data
249: */
250: public String getPasswordData();
251:
252: /**
253: * Check whether the user wants attached images to be shown inlined in
254: * the messages or not.
255: *
256: * @return true, if the user wants images to be shown inline
257: */
258: public boolean wantsShowImages();
259:
260: /**
261: * Set whether the user wants attached images to be shown inlined in the messages.
262: *
263: * @param b true if images are to be shown inline
264: */
265: public void setShowImages(boolean b);
266:
267: /**
268: * Check whether the user wants some graphical enhancements (image smileys, etc).
269: *
270: * @returns true if the user wants graphical enhancements.
271: */
272: public boolean wantsShowFancy();
273:
274: /**
275: * Set whether the user wants some graphical enhancements (image smileys, etc).
276: *
277: * @param b true if the user wants graphical enhancements.
278: */
279: public void setShowFancy(boolean b);
280:
281: /**
282: * Check whether write mode is enabled on mailboxes.
283: * This influences many things like setting message flags, copying/moving messages, deleting
284: * messages and the like.
285: *
286: * @see net.wastl.webmail.server.WebMailSession.getMessage()
287: * @see net.wastl.webmail.server.WebMailSession.copyMoveMessage()
288: * @see net.wastl.webmail.server.WebMailSession.setFlags()
289: */
290: public boolean wantsSetFlags();
291:
292: /**
293: * Enable/disable write mode on mailboxes.
294: * This influences many things like setting message flags, copying/moving messages, deleting
295: * messages and the like.
296: *
297: * @param b true: enable write mode
298: * @see net.wastl.webmail.server.WebMailSession.getMessage()
299: * @see net.wastl.webmail.server.WebMailSession.copyMoveMessage()
300: * @see net.wastl.webmail.server.WebMailSession.setFlags()
301: */
302: public void setSetFlags(boolean b);
303:
304: /**
305: * Set whether the user wants to save sent messages or not. The folder where sent messages
306: * will be stored has to be configured also.
307: *
308: * @param b true if the user wants to save sent messages
309: * @see getSentFolder()
310: * @see setSentFolder()
311: */
312: public void setSaveSent(boolean b);
313:
314: /**
315: * Check whether the user wants to save sent messages or not. The folder where sent messages
316: * will be stored has to be configured also.
317: *
318: * @returns true if the user wants to save sent messages
319: * @see getSentFolder()
320: * @see setSentFolder()
321: */
322: public boolean wantsSaveSent();
323:
324: /**
325: * Return the id of the folder that should be used to store sent messages.
326: * This is only applicable if the user enabled the storage of sent messages.
327: *
328: * @see net.wastl.webmail.server.WebMailSession.generateFolderHash()
329: * @see wantsSaveSent()
330: * @see setSaveSent()
331: */
332: public String getSentFolder();
333:
334: /**
335: * Set the id of the folder that should be used to store sent messages.
336: * This is only applicable if the user enabled the storage of sent messages.
337: *
338: * @see net.wastl.webmail.server.WebMailSession.generateFolderHash()
339: * @see wantsSaveSent()
340: * @see setSaveSent()
341: */
342: public void setSentFolder(String s);
343:
344: /**
345: * Return the name of the virtual domain this user is in.
346: */
347: public String getDomain();
348:
349: /**
350: * Set the name of the virtual domain this user is in.
351: *
352: * @param s name of the virtual domain
353: */
354: public void setDomain(String s);
355:
356: /**
357: * Return the username without the domain (in contrast to getLogin()).
358: * @see getLogin()
359: */
360: public String getUserName();
361: }
|