KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > drftpd > master > usermanager > User


1 /*
2  * This file is part of DrFTPD, Distributed FTP Daemon.
3  *
4  * DrFTPD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * DrFTPD is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with DrFTPD; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package net.sf.drftpd.master.usermanager;
19
20 import java.util.List JavaDoc;
21
22 import net.sf.drftpd.DuplicateElementException;
23
24 /**
25  * @author mog
26  * @version $Id: User.java,v 1.36 2004/04/20 04:11:49 mog Exp $
27  */

28 public interface User {
29
30     public void addGroup(String JavaDoc group) throws DuplicateElementException;
31
32     public void addIPMask(String JavaDoc mask) throws DuplicateElementException;
33     public void addRacesLost();
34     public void addRacesParticipated();
35
36     public void addRacesWon();
37     public void addRequests();
38     public void addRequestsFilled();
39     public boolean checkIP(String JavaDoc masks[], boolean useIdent);
40     public boolean checkPassword(String JavaDoc password);
41
42     /**
43      * Commit changes.
44      * @throws UserFileException if an error saving the userfile occured.
45      */

46     public void commit() throws UserFileException;
47
48     public String JavaDoc getComment();
49     /**
50      * authenticates and logs in the user.
51      * @param user given password
52      */

53     public long getCreated();
54
55     /**
56      * Returns the credits.
57      * @return long
58      */

59     public long getCredits();
60     public long getDownloadedBytes();
61     public long getDownloadedBytesDay();
62     public long getDownloadedBytesForPeriod(int period);
63     public long getDownloadedBytesMonth();
64     public long getDownloadedBytesWeek();
65
66     public int getDownloadedFiles();
67     public int getDownloadedFilesDay();
68     public int getDownloadedFilesForPeriod(int i);
69     public int getDownloadedFilesMonth();
70     public int getDownloadedFilesWeek();
71     
72     public long getDownloadedMilliseconds();
73
74     public long getDownloadedMillisecondsForPeriod(int i);
75     public short getGroupLeechSlots();
76     public String JavaDoc getGroupName();
77     public List JavaDoc getGroups();
78
79     public short getGroupSlots();
80     /**
81      * Returns the idleTime.
82      * @return long
83      */

84     public int getIdleTime();
85     public List JavaDoc getIpMasks();
86     public List JavaDoc getIpMasks2();
87     /**
88      * Get last access time
89      */

90     public long getLastAccessTime();
91     /**
92      * Returns the lastNuked.
93      * @return long
94      */

95     public long getLastNuked();
96     public long getLastReset();
97     /**
98      * Returns the logins.
99      * @return int
100      */

101     public int getLogins();
102
103     /**
104      * Returns the maxLogins.
105      * @return int
106      */

107     public int getMaxLogins();
108     /**
109      * Returns the maxLoginsPerIP.
110      * @return int
111      */

112     public int getMaxLoginsPerIP();
113     public int getMaxSimDownloads();
114     /**
115      * Returns the maxSimUploads.
116      * @return int
117      */

118     public int getMaxSimUploads();
119
120     /**
121      * Returns the nukedBytes.
122      * @return long
123      */

124     public long getNukedBytes();
125     public int getRacesLost();
126     public int getRacesParticipated();
127     /**
128      * Returns the downloadedSecondsWeek.
129      * @return int
130      */

131
132     public int getRacesWon();
133     /**
134      * Returns the ratio.
135      * @return float
136      */

137     public float getRatio();
138     public int getRequests();
139     public int getRequestsFilled();
140     /**
141      * Returns the tagline.
142      * @return String
143      */

144     public String JavaDoc getTagline();
145
146     /**
147      * Returns the nuked.
148      * @return int
149      */

150     public int getTimesNuked();
151
152     /**
153      * Returns the uploadedBytes.
154      * @return long
155      */

156     public long getUploadedBytes();
157     /**
158      * Returns the uploadedBytesDay.
159      * @return long
160      */

161     public long getUploadedBytesDay();
162     public long getUploadedBytesForPeriod(int period);
163     /**
164      * Returns the uploadedBytesMonth.
165      * @return long
166      */

167     public long getUploadedBytesMonth();
168     /**
169      * Returns the uploadedBytesWeek.
170      * @return long
171      */

172     public long getUploadedBytesWeek();
173     /**
174      * Returns the uploadedFiles.
175      * @return int
176      */

177     public int getUploadedFiles();
178     /**
179      * Returns the uploadedFilesDay.
180      * @return int
181      */

182     public int getUploadedFilesDay();
183
184     public int getUploadedFilesForPeriod(int period);
185     /**
186      * Returns the uploadedFilesMonth.
187      * @return int
188      */

189     public int getUploadedFilesMonth();
190     /**
191      * Returns the uploadedFilesWeek.
192      * @return int
193      */

194     public int getUploadedFilesWeek();
195     public long getUploadedMilliseconds();
196
197     public long getUploadedMillisecondsForPeriod(int i);
198
199     public String JavaDoc getUsername();
200     public long getWeeklyAllotment();
201     public boolean isAdmin();
202
203     /**
204      * Check if user is a member of the "anonymous" group.
205      *
206      * If your implementation of User does not use "anonymous"
207      * group for indicating an anonymous user you must still return
208      * "anonymous" in getGroups() and isMemberOf()
209      */

210     public boolean isAnonymous();
211     /**
212      * Returns the deleted.
213      * @return boolean
214      */

215     public boolean isDeleted();
216     public boolean isExempt();
217     public boolean isGroupAdmin();
218     public boolean isMemberOf(String JavaDoc group);
219     /**
220      * Returns the nuker.
221      * @return boolean
222      */

223     public boolean isNuker();
224     /**
225      * User login.
226      */

227     public void login();
228     /**
229      * User logout
230      */

231     public void logout();
232
233     public void purge();
234     public void removeGroup(String JavaDoc group) throws NoSuchFieldException JavaDoc;
235     public void removeIpMask(String JavaDoc mask) throws NoSuchFieldException JavaDoc;
236     public void rename(String JavaDoc username)
237         throws UserExistsException, UserFileException;
238
239     public void setComment(String JavaDoc comment);
240     public void setCreated(long created);
241     /**
242      * Sets the credits.
243      * @param credits The credits to set
244      */

245     public void setCredits(long credits);
246     /**
247      * Sets the deleted.
248      * @param deleted The deleted to set
249      */

250     public void setDeleted(boolean deleted);
251     public void setDownloadedBytes(long bytes);
252     public void setDownloadedBytesDay(long bytes);
253
254     public void setDownloadedBytesForPeriod(int period, long bytes);
255     public void setDownloadedBytesMonth(long bytes);
256     public void setDownloadedBytesWeek(long bytes);
257
258     public void setDownloadedFiles(int files);
259     
260     public void setDownloadedFilesDay(int files);
261
262     public void setDownloadedFilesForPeriod(int period, int files);
263
264     public void setDownloadedFilesMonth(int files);
265     
266     public void setDownloadedFilesWeek(int files);
267
268     public void setDownloadedMilliseconds(long millis);
269     public void setDownloadedMillisecondsDay(long millis);
270
271     public void setDownloadedMillisecondsForPeriod(int i, long millis);
272     public void setDownloadedMillisecondsMonth(long millis);
273     public void setDownloadedMillisecondsWeek(long millis);
274     public void setDownloadedSeconds(int millis);
275     public void setDownloadedSecondsDay(int millis);
276     public void setDownloadedSecondsMonth(int millis);
277     public void setDownloadedSecondsWeek(int millis);
278     public void setGroup(String JavaDoc group);
279     public void setGroupLeechSlots(short s);
280
281     public void setGroupSlots(short s);
282
283     /**
284      * Sets the idleTime.
285      * @param idleTime The idleTime to set
286      */

287     public void setIdleTime(int idleTime);
288
289     /**
290      * Sets the lastAccessTime.
291      * @param lastAccessTime The lastAccessTime to set
292      */

293     public void setLastAccessTime(long lastAccessTime);
294     /**
295      * Sets the lastNuked.
296      * @param lastNuked The lastNuked to set
297      */

298     public void setLastNuked(long lastNuked);
299     /**
300      * Sets the logins.
301      * @param logins The logins to set
302      */

303     public void setLogins(int logins);
304
305     /**
306      * Sets the maxLogins.
307      * @param maxLogins The maxLogins to set
308      */

309     public void setMaxLogins(int maxLogins);
310     /**
311      * Sets the maxLoginsPerIP.
312      * @param maxLoginsPerIP The maxLoginsPerIP to set
313      */

314     public void setMaxLoginsPerIP(int maxLoginsPerIP);
315     public void setMaxSimDownloads(int maxSimDownloads);
316     /**
317      * Sets the maxSimUploads.
318      * @param maxSimUploads The maxSimUploads to set
319      */

320     public void setMaxSimUploads(int maxSimUploads);
321
322     /**
323      * Sets the nukedBytes.
324      * @param nukedBytes The nukedBytes to set
325      */

326     public void setNukedBytes(long nukedBytes);
327     public void setPassword(String JavaDoc password);
328     /**
329      * Sets the ratio.
330      * @param ratio The ratio to set
331      */

332     public void setRatio(float ratio);
333
334     /**
335      * Sets the tagline.
336      * @param tagline The tagline to set
337      */

338
339     public void setTagline(String JavaDoc tagline);
340     public void setTimesNuked(int nuked);
341     public void setUploadedBytes(long bytes);
342     public void setUploadedBytesDay(long bytes);
343     public void setUploadedBytesForPeriod(int i, long l);
344     public void setUploadedBytesMonth(long bytes);
345     public void setUploadedBytesWeek(long bytes);
346     
347     public void setUploadedFiles(int files);
348     
349     public void setUploadedFilesDay(int files);
350
351     public void setUploadedFilesForPeriod(int period, int files);
352         
353     public void setUploadedFilesMonth(int files);
354     
355     public void setUploadedFilesWeek(int files);
356
357     public void setUploadedMilliseconds(long millis);
358     public void setUploadedMillisecondsDay(long millis);
359
360     public void setUploadedMillisecondsForPeriod(int i, long millis);
361     public void setUploadedMillisecondsMonth(long millis);
362     public void setUploadedMillisecondsWeek(long millis);
363     public void setUploadedSeconds(int millis);
364     public void setUploadedSecondsDay(int millis);
365     public void setUploadedSecondsMonth(int millis);
366     public void setUploadedSecondsWeek(int millis);
367
368     public void setWeeklyAllotment(long weeklyAllotment);
369
370     public void toggleGroup(String JavaDoc string);
371     public void updateCredits(long credits);
372     public void updateDownloadedBytes(long bytes);
373     public void updateDownloadedFiles(int i);
374     public void updateDownloadedMilliseconds(long millis);
375     /**
376      * Hit user - update last access time
377      */

378     public void updateLastAccessTime();
379     public void updateNukedBytes(long bytes);
380     public void updateTimesNuked(int timesNuked);
381     public void updateUploadedBytes(long bytes);
382     public void updateUploadedFiles(int i);
383     public void updateUploadedMilliseconds(long millis);
384 }
385
Popular Tags