You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by qu...@apache.org on 2003/03/20 16:09:32 UTC
cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/om/security TurbineUser.java
quintonm 2003/03/20 07:09:32
Modified: src/java/org/apache/turbine/om/security TurbineUser.java
Log:
TurbineUser now overrides getName and setName from SecurityObject. This makes it behave more
like the other subclasses of SecurityObject.
Revision Changes Path
1.8 +31 -9 jakarta-turbine-2/src/java/org/apache/turbine/om/security/TurbineUser.java
Index: TurbineUser.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/om/security/TurbineUser.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TurbineUser.java 9 Mar 2003 02:45:15 -0000 1.7
+++ TurbineUser.java 20 Mar 2003 15:09:31 -0000 1.8
@@ -68,7 +68,7 @@
/**
* A generic implementation of User interface.
- *
+ * <p>
* This basic implementation contains the functionality that is
* expected to be common among all User implementations.
* You are welcome to extend this class if you wish to have
@@ -103,6 +103,7 @@
/**
* Constructor.
+ * <p>
* Create a new User and set the createDate.
*/
public TurbineUser()
@@ -278,10 +279,10 @@
}
/**
- * Returns the username for this user. If this is defined, then
- * the user is considered logged in.
+ * Returns the username for this user.
*
* @return A String with the username.
+ * @deprecated use {@link #getName} instead.
*/
public String getUserName()
{
@@ -301,8 +302,7 @@
}
/**
- * Returns the first name for this user. If this is defined, then
- * the user is considered logged in.
+ * Returns the first name for this user.
*
* @return A String with the user's first name.
*/
@@ -324,8 +324,7 @@
}
/**
- * Returns the last name for this user. If this is defined, then
- * the user is considered logged in.
+ * Returns the last name for this user.
*
* @return A String with the user's last name.
*/
@@ -545,6 +544,7 @@
* Sets the username for this user.
*
* @param username The user's username.
+ * @deprecated use {@link #setName} instead
*/
public void setUserName(String username)
{
@@ -624,7 +624,7 @@
/**
* Updates the last login date in the database.
*
- * @exception Exception, a generic exception.
+ * @exception Exception a generic exception.
*/
public void updateLastLogin()
throws Exception
@@ -708,6 +708,28 @@
public void save(String dbname) throws Exception
{
throw new Exception("not implemented");
+ }
+
+ /**
+ * Returns the name of this user. This will be the user name/
+ * login name.
+ *
+ * @return The name of the user.
+ */
+ public String getName()
+ {
+ return (String) getPerm(User.USERNAME);
+ }
+
+ /**
+ * Sets the name of this user. This will be the user name/
+ * login name.
+ *
+ * @param name The name of the object.
+ */
+ public void setName(String name)
+ {
+ setPerm(User.USERNAME, name);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org