Mercurial Hosting > nabble
comparison src/nabble/model/User.java @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children | cc5b7d515580 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7ecd1a4ef557 |
---|---|
1 /* | |
2 | |
3 Copyright (C) 2003 Franklin Schmidt <frank@gustos.com> | |
4 | |
5 */ | |
6 | |
7 package nabble.model; | |
8 | |
9 import fschmidt.db.DbObject; | |
10 import fschmidt.db.LongKey; | |
11 | |
12 import java.awt.image.BufferedImage; | |
13 import java.util.Collection; | |
14 import java.util.Comparator; | |
15 import java.util.Date; | |
16 import java.util.Map; | |
17 | |
18 | |
19 public interface User extends Person, DbObject<LongKey,UserImpl> { | |
20 public long getId(); | |
21 public String getEmail(); | |
22 public void setEmail(String email) throws ModelException; | |
23 public String getPasswordDigest(); | |
24 public void setPasswordDigest(String passwordDigest); | |
25 public void setPassword(String password) throws ModelException; | |
26 public void register() throws ModelException; // insert into db | |
27 public void register(Date registerDate) throws ModelException; // insert into db | |
28 public boolean isRegistered(); | |
29 public void update(); | |
30 public java.util.Date getRegistered(); | |
31 public User getGoodCopy(); | |
32 | |
33 public int getExternalHash(String url); // not used anywhere | |
34 | |
35 public NodeIterator<? extends Node> getPendingPosts(); | |
36 | |
37 public User setSignature( String signature, Message.Format signatureFormat ) throws ModelException; | |
38 | |
39 public boolean isSubscribed(Node node); | |
40 public Subscription getSubscription(Node node); | |
41 public Subscription subscribe(Node node,Subscription.To to,Subscription.Type type); | |
42 | |
43 public String getDecoratedAddress(Node node); | |
44 | |
45 public void deactivate(); | |
46 public boolean isDeactivated(); | |
47 | |
48 public void saveAvatar(BufferedImage smallImage,BufferedImage bigImage) throws ModelException; | |
49 public void deleteAvatar(); | |
50 public boolean hasAvatar(); | |
51 | |
52 public boolean hasTooManyPosts(); | |
53 | |
54 public static final Comparator<User> BY_NAME_COMPARATOR = new Comparator<User>() { | |
55 public int compare(User o1, User o2) { | |
56 return o1.getName().compareToIgnoreCase(o2.getName()); | |
57 } | |
58 }; | |
59 | |
60 public Node newRootNode(Node.Kind kind,String subject,String message,Message.Format msgFmt,Site site,String type) throws ModelException; // will be already inserted into db | |
61 | |
62 public Comparator<User> nodeCountComparatorDesc = new Comparator<User>(){ | |
63 public int compare(User u1,User u2) { | |
64 return u2.getNodeCount(null) - u1.getNodeCount(null); | |
65 } | |
66 }; | |
67 | |
68 public void moveToRegisteredAccount(String cookie); | |
69 public <T> T getExtension(ExtensionFactory<User,T> factory); | |
70 | |
71 public Long lastVisitedNodeId(long nodeId); | |
72 public Map<Long,Long> lastVisitedNodeIds(Collection<Long> nodeIds); | |
73 public void markVisited(Node node, long lastNodeId); | |
74 public void unmarkVisited(Node node); | |
75 | |
76 public String getProperty(String key); | |
77 public void setProperty(String key,String value); | |
78 | |
79 public String getPasscookie(); | |
80 public boolean checkPassword(String password); | |
81 public boolean checkPasscookie(String passcookie); | |
82 public String getResetcode(); | |
83 public boolean checkResetcode(String resetcode); | |
84 | |
85 public void setNoArchive(boolean noArchive); | |
86 } |