juergen 01/09/10 02:21:03
Modified: src/wrappers/catalina SlideRealm.java
Log:
preparation to get request a URI for read or write. The default in SlideToken may be
overwritten. Please note: SlideToken is now an interface, the implementation is
loacted in SlideTokenImpl.
Revision Changes Path
1.8 +20 -19 jakarta-slide/src/wrappers/catalina/SlideRealm.java
Index: SlideRealm.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/wrappers/catalina/SlideRealm.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SlideRealm.java 2001/09/08 20:03:12 1.7
+++ SlideRealm.java 2001/09/10 09:21:03 1.8
@@ -1,13 +1,13 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/wrappers/catalina/SlideRealm.java,v 1.7
2001/09/08 20:03:12 remm Exp $
- * $Revision: 1.7 $
- * $Date: 2001/09/08 20:03:12 $
+ * $Header: /home/cvs/jakarta-slide/src/wrappers/catalina/SlideRealm.java,v 1.8
2001/09/10 09:21:03 juergen Exp $
+ * $Revision: 1.8 $
+ * $Date: 2001/09/10 09:21:03 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
+ * from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
@@ -59,7 +59,7 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package wrappers.catalina;
@@ -79,6 +79,7 @@
import org.apache.slide.common.NamespaceAccessToken;
import org.apache.slide.common.Domain;
import org.apache.slide.common.SlideToken;
+import org.apache.slide.common.SlideTokenImpl;
import org.apache.slide.common.SlideException;
import org.apache.slide.content.Content;
import org.apache.slide.content.NodeRevisionDescriptors;
@@ -97,9 +98,9 @@
* The namespace used will have the same name as the container to which the
* realm is associated. If such a namespace doesn't exist, it falls back
* to tomcat, webdav or default.
- *
+ *
* @author Remy Maucherat
- * @version $Revision: 1.7 $ $Date: 2001/09/08 20:03:12 $
+ * @version $Revision: 1.8 $ $Date: 2001/09/10 09:21:03 $
*/
public final class SlideRealm
@@ -113,7 +114,7 @@
* Descriptive information about this Realm implementation.
*/
private static final String info =
- "wrappers.catalina.SlideRealm/1.2";
+ "wrappers.catalina.SlideRealm/1.2";
/**
@@ -193,7 +194,7 @@
public boolean hasRole(Principal principal, String role) {
CredentialsToken credToken = new CredentialsToken(principal);
- SlideToken slideToken = new SlideToken(credToken);
+ SlideToken slideToken = new SlideTokenImpl(credToken);
try {
return securityHelper.hasRole(slideToken, role);
} catch (SlideException e) {
@@ -240,7 +241,7 @@
Principal userPrincipal = getPrincipal(username);
CredentialsToken credToken = new CredentialsToken(userPrincipal);
- SlideToken slideToken = new SlideToken(credToken);
+ SlideToken slideToken = new SlideTokenImpl(credToken);
// Fetch the Slide object representing the user.
try {
@@ -259,7 +260,7 @@
contentHelper.retrieve(slideToken, usersPath + "/" + username);
NodeRevisionDescriptor revisionDescriptor =
contentHelper.retrieve(slideToken, revisionDescriptors);
- NodeProperty password =
+ NodeProperty password =
revisionDescriptor.getProperty
("password", NodeProperty.SLIDE_NAMESPACE);
if (password != null) {
@@ -272,7 +273,7 @@
}
if (passwordValue == null) {
- log("User " + username
+ log("User " + username
+ " doesn't have his password property set : "
+ "can't authenticate");
}
@@ -286,7 +287,7 @@
* Return the Principal associated with the given user name.
*/
protected Principal getPrincipal(String username) {
- return new SlideRealmPrincipal(username);
+ return new SlideRealmPrincipal(username);
}
@@ -312,7 +313,7 @@
*/
public SlideRealmPrincipal(String username) {
- this.username = username;
+ this.username = username;
}
@@ -322,7 +323,7 @@
*/
public String getName() {
- return (username);
+ return (username);
}