001: package org.lucane.applications.jmail.base;
002:
003: /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
004: * This file is part of JMail *
005: * Copyright (C) 2002-2003 Yvan Norsa <norsay@wanadoo.fr> *
006: * *
007: * JMail is free software; you can redistribute it and/or modify *
008: * it under the terms of the GNU General Public License as published by *
009: * the Free Software Foundation; either version 2 of the License, or *
010: * any later version. *
011: * *
012: * JMail is distributed in the hope that it will be useful, *
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
015: * GNU General Public License for more details. *
016: * *
017: * You should have received a copy of the GNU General Public License along *
018: * with JMail; if not, write to the Free Software Foundation, Inc., *
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
020: * *
021: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
022:
023: import org.lucane.applications.jmail.Account;
024:
025: /** Class which represents a user profile */
026: public class Profile {
027: /** Profile name */
028: private String profileName;
029:
030: private String profilePassword;
031: private String unhashedProfilePassword;
032:
033: /** User email */
034: private String email;
035:
036: private String replyTo;
037:
038: /** Incoming server's type (protocol) */
039: private String type;
040:
041: /** Incoming server */
042: private String incoming;
043:
044: /** Incoming server's port number */
045: private int incomingPort;
046:
047: private boolean useSSL;
048:
049: /** Outgoing server */
050: private String outgoing;
051:
052: /** Outgoing server's port number */
053: private int outgoingPort;
054:
055: /** User login */
056: private String login;
057:
058: /** User password */
059: private String password;
060:
061: private String decryptedMailPassword;
062:
063: private String signature;
064:
065: private int refreshInterval = 200000;
066:
067: public Profile(Account a) {
068: this ("", "", a.address, a.address, a.type, a.inHost, a.inPort,
069: false, a.outHost, a.outPort, a.login, "", "");
070: this .setDecryptedMailPassword(a.password);
071: this .refreshInterval = a.refreshInterval * 60 * 1000; //ms to mn
072: }
073:
074: /** Constructor
075: * @param profileName profile name
076: * @param profilePassword profile password (hashed)
077: * @param email user email
078: * @param type incoming server type
079: * @param incoming incoming server
080: * @param incomingPort incoming server's port number
081: * @param outgoing outgoing server
082: * @param outgoingPort outgoing server's port number
083: * @param login user login
084: * @param password user password
085: * @param signature signature file
086: */
087: protected Profile(String profileName, String profilePassword,
088: String email, String replyTo, String type, String incoming,
089: int incomingPort, boolean useSSL, String outgoing,
090: int outgoingPort, String login, String password,
091: String signature) {
092: this .profileName = profileName;
093: this .profilePassword = profilePassword;
094: this .email = email;
095: this .replyTo = replyTo;
096: this .type = type;
097: this .incoming = incoming;
098: this .incomingPort = incomingPort;
099: this .useSSL = useSSL;
100: this .outgoing = outgoing;
101: this .outgoingPort = outgoingPort;
102: this .login = login;
103: this .password = password;
104: this .signature = signature;
105: this .refreshInterval = 200000;
106: }
107:
108: /** Returns the profile name
109: * @return profile name
110: */
111: protected final String getProfileName() {
112: return (profileName);
113: }
114:
115: protected final String getProfilePassword() {
116: return (profilePassword);
117: }
118:
119: protected final void setProfilePassword(String profilePassword) {
120: this .profilePassword = profilePassword;
121: }
122:
123: protected final String getUnhashedProfilePassword() {
124: return (unhashedProfilePassword);
125: }
126:
127: protected final void setUnhashedProfilePassword(
128: String unhashedProfilePassword) {
129: this .unhashedProfilePassword = unhashedProfilePassword;
130: }
131:
132: /** Returns the email address
133: * @return the email address
134: */
135: protected final String getEmail() {
136: return (email);
137: }
138:
139: /** Sets the new email address
140: * @param email the new email address
141: */
142: protected final void setEmail(String email) {
143: this .email = email;
144: }
145:
146: protected final String getReplyTo() {
147: return (replyTo);
148: }
149:
150: protected final void setReplyTo(String replyTo) {
151: this .replyTo = replyTo;
152: }
153:
154: /** Returns the server's type
155: * @return server type
156: */
157: protected final String getType() {
158: return (type);
159: }
160:
161: /** Sets the new server type
162: * @param type the new type
163: */
164: protected final void setType(String type) {
165: this .type = type;
166: }
167:
168: /** Returns the incoming server
169: * @return incoming server
170: */
171: protected final String getIncoming() {
172: return (incoming);
173: }
174:
175: /** Sets the new incoming server
176: * @param incoming new incoming server
177: */
178: protected final void setIncoming(String incoming) {
179: this .incoming = incoming;
180: }
181:
182: /** Returns the incoming server's port number
183: * @return incoming server's port number
184: */
185: protected final int getIncomingPort() {
186: return (incomingPort);
187: }
188:
189: /** Sets the new incoming server's port number
190: * @param incomingPort the new incoming server's port number
191: */
192: protected final void setIncomingPort(int incomingPort) {
193: this .incomingPort = incomingPort;
194: }
195:
196: protected final boolean getUseSSL() {
197: return (useSSL);
198: }
199:
200: protected final void setUseSSL(boolean useSSL) {
201: this .useSSL = useSSL;
202: }
203:
204: /** Returns the outgoing server
205: * @return outgoing server
206: */
207: protected final String getOutgoing() {
208: return (outgoing);
209: }
210:
211: /** Sets the new outgoing server
212: * @param outgoing the new outgoing server
213: */
214: protected final void setOutgoing(String outgoing) {
215: this .outgoing = outgoing;
216: }
217:
218: /** Returns the outgoing server's port number
219: * @return outgoing server's port number
220: */
221: protected final int getOutgoingPort() {
222: return (outgoingPort);
223: }
224:
225: /** Sets the new outgoing server's port number
226: * @param outgoingPort the new outgoing server's port number
227: */
228: protected final void setOutgoingPort(int outgoingPort) {
229: this .outgoingPort = outgoingPort;
230: }
231:
232: /** Returns the login
233: * @return login
234: */
235: protected final String getLogin() {
236: return (login);
237: }
238:
239: /** Sets the new login
240: * @param login new login
241: */
242: protected final void setLogin(String login) {
243: this .login = login;
244: }
245:
246: /** Returns the password
247: * @return password
248: */
249: protected final String getPassword() {
250: return (password);
251: }
252:
253: /** Sets the new password
254: * @param password new password
255: */
256: protected final void setPassword(String password) {
257: this .password = password;
258: }
259:
260: protected final String getDecryptedMailPassword() {
261: return (decryptedMailPassword);
262: }
263:
264: protected final void setDecryptedMailPassword(
265: String decryptedMailPassword) {
266: this .decryptedMailPassword = decryptedMailPassword;
267: }
268:
269: protected final String getSignature() {
270: return (signature);
271: }
272:
273: protected final void setSignature(String signature) {
274: this .signature = signature;
275: }
276:
277: public int getRefreshInterval() {
278: return refreshInterval;
279: }
280: }
|