Mercurial Hosting > nabble
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/nabble/model/User.java Thu Mar 21 19:15:52 2019 -0600 @@ -0,0 +1,86 @@ +/* + +Copyright (C) 2003 Franklin Schmidt <frank@gustos.com> + +*/ + +package nabble.model; + +import fschmidt.db.DbObject; +import fschmidt.db.LongKey; + +import java.awt.image.BufferedImage; +import java.util.Collection; +import java.util.Comparator; +import java.util.Date; +import java.util.Map; + + +public interface User extends Person, DbObject<LongKey,UserImpl> { + public long getId(); + public String getEmail(); + public void setEmail(String email) throws ModelException; + public String getPasswordDigest(); + public void setPasswordDigest(String passwordDigest); + public void setPassword(String password) throws ModelException; + public void register() throws ModelException; // insert into db + public void register(Date registerDate) throws ModelException; // insert into db + public boolean isRegistered(); + public void update(); + public java.util.Date getRegistered(); + public User getGoodCopy(); + + public int getExternalHash(String url); // not used anywhere + + public NodeIterator<? extends Node> getPendingPosts(); + + public User setSignature( String signature, Message.Format signatureFormat ) throws ModelException; + + public boolean isSubscribed(Node node); + public Subscription getSubscription(Node node); + public Subscription subscribe(Node node,Subscription.To to,Subscription.Type type); + + public String getDecoratedAddress(Node node); + + public void deactivate(); + public boolean isDeactivated(); + + public void saveAvatar(BufferedImage smallImage,BufferedImage bigImage) throws ModelException; + public void deleteAvatar(); + public boolean hasAvatar(); + + public boolean hasTooManyPosts(); + + public static final Comparator<User> BY_NAME_COMPARATOR = new Comparator<User>() { + public int compare(User o1, User o2) { + return o1.getName().compareToIgnoreCase(o2.getName()); + } + }; + + 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 + + public Comparator<User> nodeCountComparatorDesc = new Comparator<User>(){ + public int compare(User u1,User u2) { + return u2.getNodeCount(null) - u1.getNodeCount(null); + } + }; + + public void moveToRegisteredAccount(String cookie); + public <T> T getExtension(ExtensionFactory<User,T> factory); + + public Long lastVisitedNodeId(long nodeId); + public Map<Long,Long> lastVisitedNodeIds(Collection<Long> nodeIds); + public void markVisited(Node node, long lastNodeId); + public void unmarkVisited(Node node); + + public String getProperty(String key); + public void setProperty(String key,String value); + + public String getPasscookie(); + public boolean checkPassword(String password); + public boolean checkPasscookie(String passcookie); + public String getResetcode(); + public boolean checkResetcode(String resetcode); + + public void setNoArchive(boolean noArchive); +}