001: /*
002: * This file is part of DrFTPD, Distributed FTP Daemon.
003: *
004: * DrFTPD is free software; you can redistribute it and/or modify it under the
005: * terms of the GNU General Public License as published by the Free Software
006: * Foundation; either version 2 of the License, or (at your option) any later
007: * version.
008: *
009: * DrFTPD is distributed in the hope that it will be useful, but WITHOUT ANY
010: * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
011: * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
012: *
013: * You should have received a copy of the GNU General Public License along with
014: * DrFTPD; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
015: * Suite 330, Boston, MA 02111-1307 USA
016: */
017: package org.drftpd.usermanager;
018:
019: import java.util.List;
020:
021: import net.sf.drftpd.DuplicateElementException;
022:
023: import org.drftpd.GlobalContext;
024: import org.drftpd.dynamicdata.Key;
025: import org.drftpd.dynamicdata.KeyedMap;
026:
027: /**
028: * @author mog
029: * @version $Id: User.java 1265 2005-09-13 03:34:32Z tdsoul $
030: */
031: public abstract class User implements Entity {
032: public abstract UserManager getUserManager();
033:
034: public abstract KeyedMap<Key, Object> getKeyedMap();
035:
036: public abstract void addAllMasks(
037: HostMaskCollection hostMaskCollection);
038:
039: public abstract void addIPMask(String mask)
040: throws DuplicateElementException;
041:
042: public abstract void addSecondaryGroup(String group)
043: throws DuplicateElementException;
044:
045: public abstract boolean checkPassword(String password);
046:
047: /**
048: * Commit changes.
049: *
050: * @throws UserFileException
051: * if an error saving the userfile occured.
052: */
053: public abstract void commit() throws UserFileException;
054:
055: public abstract long getCredits();
056:
057: public abstract long getDownloadedBytes();
058:
059: public abstract long getDownloadedBytesDay();
060:
061: public abstract long getDownloadedBytesForTrialPeriod(int period);
062:
063: public abstract long getDownloadedBytesMonth();
064:
065: public abstract long getDownloadedBytesWeek();
066:
067: public abstract int getDownloadedFiles();
068:
069: public abstract int getDownloadedFilesDay();
070:
071: public abstract int getDownloadedFilesForTrialPeriod(int i);
072:
073: public abstract int getDownloadedFilesMonth();
074:
075: public abstract int getDownloadedFilesWeek();
076:
077: public abstract long getDownloadedTime();
078:
079: public abstract long getDownloadedTimeForTrialPeriod(int i);
080:
081: public abstract String getGroup();
082:
083: public abstract List getGroups();
084:
085: public abstract HostMaskCollection getHostMaskCollection();
086:
087: /**
088: * Returns the idleTime.
089: *
090: * @return int
091: */
092: public abstract int getIdleTime();
093:
094: // /**
095: // * Returns the nukedBytes.
096: // *
097: // * @return long
098: // */
099: // public abstract long getNukedBytes();
100: // public abstract int getRacesLost();
101: //
102: // public abstract int getRacesParticipated();
103: // /**
104: // * Returns the downloadedSecondsWeek.
105: // *
106: // * @return int
107: // */
108: // public abstract int getRacesWon();
109:
110: /**
111: * Returns the ratio.
112: *
113: * @return float
114: */
115:
116: //public abstract float getRatio();
117: // public abstract int getRequests();
118: //
119: // public abstract int getRequestsFilled();
120: // /**
121: // * Returns the nuked.
122: // *
123: // * @return int
124: // */
125: // public abstract int getTimesNuked();
126: /**
127: * Returns the uploadedBytes.
128: *
129: * @return long
130: */
131: public abstract long getUploadedBytes();
132:
133: /**
134: * Returns the uploadedBytesDay.
135: *
136: * @return long
137: */
138: public abstract long getUploadedBytesDay();
139:
140: public abstract long getUploadedBytesForTrialPeriod(int period);
141:
142: /**
143: * Returns the uploadedBytesMonth.
144: *
145: * @return long
146: */
147: public abstract long getUploadedBytesMonth();
148:
149: /**
150: * Returns the uploadedBytesWeek.
151: *
152: * @return long
153: */
154: public abstract long getUploadedBytesWeek();
155:
156: /**
157: * Returns the uploadedFiles.
158: *
159: * @return int
160: */
161: public abstract int getUploadedFiles();
162:
163: /**
164: * Returns the uploadedFilesDay.
165: *
166: * @return int
167: */
168: public abstract int getUploadedFilesDay();
169:
170: public abstract int getUploadedFilesForTrialPeriod(int period);
171:
172: /**
173: * Returns the uploadedFilesMonth.
174: *
175: * @return int
176: */
177: public abstract int getUploadedFilesMonth();
178:
179: /**
180: * Returns the uploadedFilesWeek.
181: *
182: * @return int
183: */
184: public abstract int getUploadedFilesWeek();
185:
186: public abstract long getUploadedTime();
187:
188: public abstract long getUploadedTimeForTrialPeriod(int i);
189:
190: public abstract String getName();
191:
192: public abstract boolean isAdmin();
193:
194: /**
195: * Returns the deleted.
196: *
197: * @return boolean
198: */
199: public abstract boolean isDeleted();
200:
201: public abstract boolean isExempt();
202:
203: public abstract boolean isGroupAdmin();
204:
205: public abstract boolean isMemberOf(String group);
206:
207: /**
208: * Returns the nuker.
209: *
210: * @return boolean
211: */
212: public abstract boolean isNuker();
213:
214: /**
215: * User logout
216: */
217: public abstract void logout();
218:
219: public abstract void purge();
220:
221: public abstract void removeIpMask(String mask)
222: throws NoSuchFieldException;
223:
224: public abstract void removeSecondaryGroup(String group)
225: throws NoSuchFieldException;
226:
227: public abstract void rename(String username)
228: throws UserExistsException, UserFileException;
229:
230: public abstract void reset(GlobalContext manager)
231: throws UserFileException;
232:
233: /**
234: * Sets the credits.
235: *
236: * @param credits
237: * The credits to set
238: */
239: public abstract void setCredits(long credits);
240:
241: /**
242: * Sets the deleted.
243: *
244: * @param deleted
245: * The deleted to set
246: */
247: public abstract void setDeleted(boolean deleted);
248:
249: public abstract void setDownloadedBytes(long bytes);
250:
251: public abstract void setDownloadedBytesDay(long bytes);
252:
253: public abstract void setDownloadedBytesForTrialPeriod(int period,
254: long bytes);
255:
256: public abstract void setDownloadedBytesMonth(long bytes);
257:
258: public abstract void setDownloadedBytesWeek(long bytes);
259:
260: public abstract void setDownloadedFiles(int files);
261:
262: public abstract void setDownloadedFilesDay(int files);
263:
264: public abstract void setDownloadedFilesForTrialPeriod(int period,
265: int files);
266:
267: public abstract void setDownloadedFilesMonth(int files);
268:
269: public abstract void setDownloadedFilesWeek(int files);
270:
271: public abstract void setDownloadedTime(long millis);
272:
273: public abstract void setDownloadedTimeDay(long millis);
274:
275: public abstract void setDownloadedTimeForTrialPeriod(int i,
276: long millis);
277:
278: public abstract void setDownloadedTimeMonth(long millis);
279:
280: public abstract void setDownloadedTimeWeek(long millis);
281:
282: public abstract void setGroup(String group);
283:
284: /**
285: * Sets the idleTime.
286: *
287: * @param idleTime
288: * The idleTime to set
289: */
290: public abstract void setIdleTime(int idleTime);
291:
292: public abstract void setPassword(String password);
293:
294: // public abstract void setTimesNuked(int nuked);
295: public abstract void setUploadedBytes(long bytes);
296:
297: public abstract void setUploadedBytesDay(long bytes);
298:
299: public abstract void setUploadedBytesForTrialPeriod(int i, long l);
300:
301: public abstract void setUploadedBytesMonth(long bytes);
302:
303: public abstract void setUploadedBytesWeek(long bytes);
304:
305: public abstract void setUploadedFiles(int files);
306:
307: public abstract void setUploadedFilesDay(int files);
308:
309: public abstract void setUploadedFilesForTrialPeriod(int period,
310: int files);
311:
312: public abstract void setUploadedFilesMonth(int files);
313:
314: public abstract void setUploadedFilesWeek(int files);
315:
316: public abstract void setUploadedTime(long millis);
317:
318: public abstract void setUploadedTimeDay(long millis);
319:
320: public abstract void setUploadedTimeForTrialPeriod(int i,
321: long millis);
322:
323: public abstract void setUploadedTimeMonth(long millis);
324:
325: public abstract void setUploadedTimeWeek(long millis);
326:
327: public abstract void setUploadedTime(int millis);
328:
329: public abstract void setUploadedTimeDay(int millis);
330:
331: public abstract void setUploadedTimeMonth(int millis);
332:
333: public abstract void setUploadedTimeWeek(int millis);
334:
335: public abstract void toggleGroup(String string);
336:
337: public abstract void updateCredits(long credits);
338:
339: public abstract void updateDownloadedBytes(long bytes);
340:
341: public abstract void updateDownloadedFiles(int i);
342:
343: public abstract void updateDownloadedTime(long millis);
344:
345: /**
346: * Hit user - update last access time
347: */
348: public abstract void updateLastAccessTime();
349:
350: public abstract void updateUploadedBytes(long bytes);
351:
352: public abstract void updateUploadedFiles(int i);
353:
354: public abstract void updateUploadedTime(long millis);
355:
356: public abstract void setLastReset(long lastReset);
357:
358: public abstract long getLastReset();
359:
360: public abstract void setMaxSimUp(int maxup);
361:
362: public abstract void setMaxSimDown(int maxdown);
363:
364: public abstract int getMaxSimDown();
365:
366: public abstract int getMaxSimUp();
367:
368: public abstract float getMinRatio();
369:
370: public abstract float getMaxRatio();
371:
372: public abstract void setMinRatio(float minRatio);
373:
374: public abstract void setMaxRatio(float MaxRatio);
375: }
|