001: /*
002: JSPWiki - a JSP-based WikiWiki clone.
003:
004: Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
005:
006: This program is free software; you can redistribute it and/or modify
007: it under the terms of the GNU Lesser General Public License as published by
008: the Free Software Foundation; either version 2.1 of the License, or
009: (at your option) any later version.
010:
011: This program is distributed in the hope that it will be useful,
012: but WITHOUT ANY WARRANTY; without even the implied warranty of
013: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: GNU Lesser General Public License for more details.
015:
016: You should have received a copy of the GNU Lesser General Public License
017: along with this program; if not, write to the Free Software
018: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: */
020: package com.ecyrd.jspwiki.auth.user;
021:
022: import java.util.Date;
023:
024: /**
025: * Class for representing wiki user information, such as the login name, full
026: * name, wiki name, and e-mail address. Note that since 2.6 the wiki name is
027: * required to be automatically computed from the full name.
028: * @author Andrew Jaquith
029: * @since 2.3
030: */
031: public interface UserProfile {
032:
033: /**
034: * Returns the creation date.
035: * @return the creation date
036: */
037: public Date getCreated();
038:
039: /**
040: * Returns the user's e-mail address.
041: * @return the e-mail address
042: */
043: public String getEmail();
044:
045: /**
046: * Returns the user's full name.
047: * @return the full name
048: */
049: public String getFullname();
050:
051: /**
052: * Returns the last-modified date.
053: * @return the date and time of last modification
054: */
055: public Date getLastModified();
056:
057: /**
058: * Returns the user's login name.
059: * @return the login name
060: */
061: public String getLoginName();
062:
063: /**
064: * Returns the user password for use with custom authentication. Note that
065: * the password field is not meaningful for container authentication; the
066: * user's private credentials are generally stored elsewhere. While it
067: * depends on the {@link UserDatabase}implementation, in most cases the
068: * value returned by this method will be a password hash, not the password
069: * itself.
070: * @return the password
071: */
072: public String getPassword();
073:
074: /**
075: * Returns the user's wiki name, based on the full name with all
076: * whitespace removed.
077: * @return the wiki name.
078: */
079: public String getWikiName();
080:
081: /**
082: * Returns <code>true</code> if the profile has never been
083: * saved before. Implementing classes might check the
084: * last modified date, for example, to determine this.
085: * @return whether the profile is new
086: */
087: public boolean isNew();
088:
089: /**
090: * Sets the created date.
091: * @param date the creation date
092: */
093: public void setCreated(Date date);
094:
095: /**
096: * Sets the user's e-mail address.
097: * @param email the e-mail address
098: */
099: public void setEmail(String email);
100:
101: /**
102: * Sets the user's full name. For example, "Janne Jalkanen."
103: * @param arg the full name
104: */
105: public void setFullname(String arg);
106:
107: /**
108: * Sets the last-modified date
109: * @param date the last-modified date
110: */
111: public void setLastModified(Date date);
112:
113: /**
114: * Sets the name by which the user logs in. The login name is used as the
115: * username for custom authentication (see
116: * {@link com.ecyrd.jspwiki.auth.AuthenticationManager#login(WikiSession, String, String)},
117: * {@link com.ecyrd.jspwiki.auth.login.UserDatabaseLoginModule}). The login
118: * name is typically a short name ("jannej"). In contrast, the wiki name is
119: * typically of type FirstnameLastName ("JanneJalkanen").
120: * @param name the login name
121: */
122: public void setLoginName(String name);
123:
124: /**
125: * Sets the user's password for use with custom authentication. It is
126: * <em>not</em> the responsibility of implementing classes to hash the
127: * password; that responsibility is borne by the UserDatabase implementation
128: * during save operations (see {@link UserDatabase#save(UserProfile)}).
129: * Note that the password field is not meaningful for container
130: * authentication; the user's private credentials are generally stored
131: * elsewhere.
132: * @param arg the password
133: */
134: public void setPassword(String arg);
135:
136: /**
137: * No-op method. In previous versions of JSPWiki, the method
138: * set the user's wiki name directly. Now, the wiki name is automatically
139: * calculated based on the full name.
140: * @param name the wiki name
141: * @deprecated This method will be removed in a future release.
142: */
143: public void setWikiName(String name);
144:
145: /**
146: * Returns a string representation of this user profile.
147: * @return the string
148: */
149: public String toString();
150: }
|