KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lucane > applications > jmail > base > Profile


1 package org.lucane.applications.jmail.base;
2
3 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
4  * This file is part of JMail *
5  * Copyright (C) 2002-2003 Yvan Norsa <norsay@wanadoo.fr> *
6  * *
7  * JMail is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * any later version. *
11  * *
12  * JMail is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License along *
18  * with JMail; if not, write to the Free Software Foundation, Inc., *
19  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20  * *
21  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

22
23 import org.lucane.applications.jmail.Account;
24
25 /** Class which represents a user profile */
26 public class Profile
27 {
28     /** Profile name */
29     private String JavaDoc profileName;
30
31     private String JavaDoc profilePassword;
32     private String JavaDoc unhashedProfilePassword;
33
34     /** User email */
35     private String JavaDoc email;
36
37     private String JavaDoc replyTo;
38
39     /** Incoming server's type (protocol) */
40     private String JavaDoc type;
41
42     /** Incoming server */
43     private String JavaDoc incoming;
44
45     /** Incoming server's port number */
46     private int incomingPort;
47
48     private boolean useSSL;
49
50     /** Outgoing server */
51     private String JavaDoc outgoing;
52
53     /** Outgoing server's port number */
54     private int outgoingPort;
55
56     /** User login */
57     private String JavaDoc login;
58
59     /** User password */
60     private String JavaDoc password;
61
62     private String JavaDoc decryptedMailPassword;
63
64     private String JavaDoc signature;
65     
66     private int refreshInterval = 200000;
67
68     public Profile(Account a)
69     {
70         this("", "", a.address, a.address, a.type, a.inHost, a.inPort, false, a.outHost,
71                 a.outPort, a.login, "", "");
72         this.setDecryptedMailPassword(a.password);
73         this.refreshInterval = a.refreshInterval*60*1000; //ms to mn
74
}
75     
76     /** Constructor
77      * @param profileName profile name
78      * @param profilePassword profile password (hashed)
79      * @param email user email
80      * @param type incoming server type
81      * @param incoming incoming server
82      * @param incomingPort incoming server's port number
83      * @param outgoing outgoing server
84      * @param outgoingPort outgoing server's port number
85      * @param login user login
86      * @param password user password
87      * @param signature signature file
88      */

89     protected Profile(String JavaDoc profileName, String JavaDoc profilePassword, String JavaDoc email, String JavaDoc replyTo,
90             String JavaDoc type, String JavaDoc incoming, int incomingPort, boolean useSSL, String JavaDoc outgoing,
91             int outgoingPort, String JavaDoc login, String JavaDoc password, String JavaDoc signature)
92     {
93     this.profileName = profileName;
94     this.profilePassword = profilePassword;
95     this.email = email;
96     this.replyTo = replyTo;
97     this.type = type;
98     this.incoming = incoming;
99     this.incomingPort = incomingPort;
100     this.useSSL = useSSL;
101     this.outgoing = outgoing;
102     this.outgoingPort = outgoingPort;
103     this.login = login;
104     this.password = password;
105     this.signature = signature;
106     this.refreshInterval = 200000;
107     }
108
109
110     /** Returns the profile name
111      * @return profile name
112      */

113     protected final String JavaDoc getProfileName()
114     {
115     return(profileName);
116     }
117
118     protected final String JavaDoc getProfilePassword()
119     {
120     return(profilePassword);
121     }
122
123     protected final void setProfilePassword(String JavaDoc profilePassword)
124     {
125     this.profilePassword = profilePassword;
126     }
127
128     protected final String JavaDoc getUnhashedProfilePassword()
129     {
130     return(unhashedProfilePassword);
131     }
132
133     protected final void setUnhashedProfilePassword(String JavaDoc unhashedProfilePassword)
134     {
135     this.unhashedProfilePassword = unhashedProfilePassword;
136     }
137
138     /** Returns the email address
139      * @return the email address
140      */

141     protected final String JavaDoc getEmail()
142     {
143     return(email);
144     }
145
146     /** Sets the new email address
147      * @param email the new email address
148      */

149     protected final void setEmail(String JavaDoc email)
150     {
151     this.email = email;
152     }
153
154     protected final String JavaDoc getReplyTo()
155     {
156     return(replyTo);
157     }
158
159     protected final void setReplyTo(String JavaDoc replyTo)
160     {
161     this.replyTo = replyTo;
162     }
163
164     /** Returns the server's type
165      * @return server type
166      */

167     protected final String JavaDoc getType()
168     {
169     return(type);
170     }
171
172     /** Sets the new server type
173      * @param type the new type
174      */

175     protected final void setType(String JavaDoc type)
176     {
177     this.type = type;
178     }
179
180     /** Returns the incoming server
181      * @return incoming server
182      */

183     protected final String JavaDoc getIncoming()
184     {
185     return(incoming);
186     }
187
188     /** Sets the new incoming server
189      * @param incoming new incoming server
190      */

191     protected final void setIncoming(String JavaDoc incoming)
192     {
193     this.incoming = incoming;
194     }
195
196     /** Returns the incoming server's port number
197      * @return incoming server's port number
198      */

199     protected final int getIncomingPort()
200     {
201     return(incomingPort);
202     }
203
204     /** Sets the new incoming server's port number
205      * @param incomingPort the new incoming server's port number
206      */

207     protected final void setIncomingPort(int incomingPort)
208     {
209     this.incomingPort = incomingPort;
210     }
211
212     protected final boolean getUseSSL()
213     {
214     return(useSSL);
215     }
216
217     protected final void setUseSSL(boolean useSSL)
218     {
219     this.useSSL = useSSL;
220     }
221
222     /** Returns the outgoing server
223      * @return outgoing server
224      */

225     protected final String JavaDoc getOutgoing()
226     {
227     return(outgoing);
228     }
229
230     /** Sets the new outgoing server
231      * @param outgoing the new outgoing server
232      */

233     protected final void setOutgoing(String JavaDoc outgoing)
234     {
235     this.outgoing = outgoing;
236     }
237
238     /** Returns the outgoing server's port number
239      * @return outgoing server's port number
240      */

241     protected final int getOutgoingPort()
242     {
243     return(outgoingPort);
244     }
245
246     /** Sets the new outgoing server's port number
247      * @param outgoingPort the new outgoing server's port number
248      */

249     protected final void setOutgoingPort(int outgoingPort)
250     {
251     this.outgoingPort = outgoingPort;
252     }
253
254     /** Returns the login
255      * @return login
256      */

257     protected final String JavaDoc getLogin()
258     {
259     return(login);
260     }
261
262     /** Sets the new login
263      * @param login new login
264      */

265     protected final void setLogin(String JavaDoc login)
266     {
267     this.login = login;
268     }
269
270     /** Returns the password
271      * @return password
272      */

273     protected final String JavaDoc getPassword()
274     {
275     return(password);
276     }
277
278     /** Sets the new password
279      * @param password new password
280      */

281     protected final void setPassword(String JavaDoc password)
282     {
283     this.password = password;
284     }
285
286     protected final String JavaDoc getDecryptedMailPassword()
287     {
288     return(decryptedMailPassword);
289     }
290
291     protected final void setDecryptedMailPassword(String JavaDoc decryptedMailPassword)
292     {
293     this.decryptedMailPassword = decryptedMailPassword;
294     }
295
296     protected final String JavaDoc getSignature()
297     {
298     return(signature);
299     }
300
301     protected final void setSignature(String JavaDoc signature)
302     {
303     this.signature = signature;
304     }
305     
306     public int getRefreshInterval()
307     {
308         return refreshInterval;
309     }
310 }
311
Popular Tags