You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by re...@locus.apache.org on 2000/11/25 02:34:56 UTC
cvs commit: jakarta-slide/src/share/org/apache/slide/structure Structure.java StructureImpl.java
remm 00/11/24 17:34:56
Modified: src/share/org/apache/slide/authenticate
CredentialsToken.java
src/share/org/apache/slide/common Namespace.java
NamespaceAccessToken.java
NamespaceAccessTokenImpl.java Service.java
ServiceImpl.java XMLMarshaller.java
XMLUnmarshaller.java
src/share/org/apache/slide/content Content.java
ContentImpl.java
src/share/org/apache/slide/lock Lock.java LockImpl.java
src/share/org/apache/slide/macro Macro.java MacroImpl.java
src/share/org/apache/slide/security Security.java
SecurityImpl.java
src/share/org/apache/slide/store StandardStore.java
src/share/org/apache/slide/structure Structure.java
StructureImpl.java
Added: src/share/org/apache/slide/common SlideToken.java
Log:
- API change : Introduce a SlideToken objects which wraps the
CredentialsToken. The SlideToken also takes over the handling of the
lock tokens.
- It will break client programs, but it's very easy to fix them. Use a SlideToken
created like this : new SlideToken(credentialsToken) everywhere you used
to use a CredentialsToken.
- Introduce a Service.begin() API call, matching Service.commit().
Revision Changes Path
1.4 +3 -75 jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java
Index: CredentialsToken.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CredentialsToken.java 2000/09/26 02:44:02 1.3
+++ CredentialsToken.java 2000/11/25 01:34:48 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java,v 1.3 2000/09/26 02:44:02 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/09/26 02:44:02 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java,v 1.4 2000/11/25 01:34:48 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/11/25 01:34:48 $
*
* ====================================================================
*
@@ -85,7 +85,6 @@
public CredentialsToken(String credentials) {
this.credentials = credentials;
this.trusted = false;
- this.enforceLockTokens = false;
}
@@ -97,7 +96,6 @@
public CredentialsToken(Principal principal) {
this.credentials = principal.getName();
this.trusted = true;
- this.enforceLockTokens = false;
}
@@ -116,18 +114,6 @@
private boolean trusted;
- /**
- * Use lock tokens for lock resolution.
- */
- private boolean enforceLockTokens;
-
-
- /**
- * Lock tokens.
- */
- private Hashtable lockTokens = new Hashtable();
-
-
// ------------------------------------------------------------- Properties
@@ -159,64 +145,6 @@
*/
public String getPublicCredentials() {
return credentials;
- }
-
- /**
- * Use lock tokens in lock resolution ?
- *
- * @return boolean
- */
- public boolean isEnforceLockTokens() {
- return enforceLockTokens;
- }
-
-
- /**
- * Enforce lock tokens flag mutator.
- *
- * @param enforceLockTokens New flag value
- */
- public void setEnforceLockTokens(boolean enforceLockTokens) {
- this.enforceLockTokens = enforceLockTokens;
- }
-
-
- /**
- * Add a new lock token to the lock token list.
- *
- * @param lockToken Lock token to add
- */
- public void addLockToken(String lockId) {
- lockTokens.put(lockId, lockId);
- }
-
-
- /**
- * Removes a lock token from the lock token list.
- *
- * @param lockToken Lock token to remove
- */
- public void removeLockToken(String lockId) {
- lockTokens.remove(lockId);
- }
-
-
- /**
- * Clears the lock token list.
- */
- public void clearLockTokens() {
- lockTokens.clear();
- }
-
-
- /**
- * Checks if the given lock token is present.
- *
- * @param lockToken Lock token to check
- * @return boolean True if the given lock token is present
- */
- public boolean checkLockToken(String lockToken) {
- return lockTokens.contains(lockToken);
}
1.11 +7 -6 jakarta-slide/src/share/org/apache/slide/common/Namespace.java
Index: Namespace.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Namespace.java 2000/11/19 04:18:35 1.10
+++ Namespace.java 2000/11/25 01:34:49 1.11
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.10 2000/11/19 04:18:35 remm Exp $
- * $Revision: 1.10 $
- * $Date: 2000/11/19 04:18:35 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.11 2000/11/25 01:34:49 remm Exp $
+ * $Revision: 1.11 $
+ * $Date: 2000/11/25 01:34:49 $
*
* ====================================================================
*
@@ -85,7 +85,7 @@
* Namespace class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public final class Namespace {
@@ -558,8 +558,9 @@
NamespaceAccessToken token =
new NamespaceAccessTokenImpl(this);
- token.importData(new CredentialsToken(new String("/")),
- namespaceBaseDataDefinition);
+ token.importData
+ (new SlideToken(new CredentialsToken(new String("/"))),
+ namespaceBaseDataDefinition);
// Then, destroy the temp action
tempActionUri.getStore().removeObject(tempActionUri, tempAction);
1.8 +8 -8 jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java
Index: NamespaceAccessToken.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- NamespaceAccessToken.java 2000/09/26 02:44:04 1.7
+++ NamespaceAccessToken.java 2000/11/25 01:34:49 1.8
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java,v 1.7 2000/09/26 02:44:04 remm Exp $
- * $Revision: 1.7 $
- * $Date: 2000/09/26 02:44:04 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessToken.java,v 1.8 2000/11/25 01:34:49 remm Exp $
+ * $Revision: 1.8 $
+ * $Date: 2000/11/25 01:34:49 $
*
* ====================================================================
*
@@ -84,7 +84,7 @@
* Namespace access token interface.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public interface NamespaceAccessToken {
@@ -103,14 +103,14 @@
/**
* Import data from Avalon configuration object.
*
- * @param token CredentialsToken, used for access to the namespace
+ * @param token SlideToken, used for access to the namespace
* @param objectNodeConfiguration Configuration object
* @exception ConfigurationException Something went wrong during the
* reading of the XML
* @exception UnknownObjectClassException Object class not found
* @exception ServiceAccessException Error accessing service
*/
- void importData(CredentialsToken token,
+ void importData(SlideToken token,
Configuration objectNodeConfiguration)
throws ConfigurationException, UnknownObjectClassException,
ServiceAccessException;
@@ -122,7 +122,7 @@
* @param writer Writer
* @exception SlideException
*/
- void exportData(CredentialsToken token, Writer writer)
+ void exportData(SlideToken token, Writer writer)
throws SlideException;
@@ -133,7 +133,7 @@
* @param startNode Start generating XML from this node of the Slide tree
* @exception SlideException
*/
- void exportData(CredentialsToken token, Writer writer, String startNode)
+ void exportData(SlideToken token, Writer writer, String startNode)
throws SlideException;
1.8 +8 -9 jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java
Index: NamespaceAccessTokenImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- NamespaceAccessTokenImpl.java 2000/09/26 02:44:05 1.7
+++ NamespaceAccessTokenImpl.java 2000/11/25 01:34:49 1.8
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java,v 1.7 2000/09/26 02:44:05 remm Exp $
- * $Revision: 1.7 $
- * $Date: 2000/09/26 02:44:05 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java,v 1.8 2000/11/25 01:34:49 remm Exp $
+ * $Revision: 1.8 $
+ * $Date: 2000/11/25 01:34:49 $
*
* ====================================================================
*
@@ -83,7 +83,7 @@
* Namespace accessor class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public final class NamespaceAccessTokenImpl implements NamespaceAccessToken {
@@ -221,15 +221,14 @@
/**
* Import data from Avalon configuration object.
*
- * @param token CredentialsToken, used for access to the namespace
+ * @param token SlideToken, used for access to the namespace
* @param dataConfiguration Configuration object
* @exception ConfigurationException Something went wrong during the
* reading of the XML
* @exception UnknownObjectClassException Object class not found
* @exception ServiceAccessException Error accessing service
*/
- public void importData(CredentialsToken token,
- Configuration dataConfiguration)
+ public void importData(SlideToken token, Configuration dataConfiguration)
throws ConfigurationException, UnknownObjectClassException,
ServiceAccessException {
@@ -244,7 +243,7 @@
* @param writer Writer
* @exception SlideException
*/
- public void exportData(CredentialsToken token, Writer writer)
+ public void exportData(SlideToken token, Writer writer)
throws SlideException {
exportData(token, writer, "/");
}
@@ -257,7 +256,7 @@
* @param startNode Start generating XML from this node of the Slide tree
* @exception SlideException
*/
- public void exportData(CredentialsToken token, Writer writer,
+ public void exportData(SlideToken token, Writer writer,
String startNode)
throws SlideException {
1.3 +15 -4 jakarta-slide/src/share/org/apache/slide/common/Service.java
Index: Service.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Service.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Service.java 2000/09/26 02:44:05 1.2
+++ Service.java 2000/11/25 01:34:49 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Service.java,v 1.2 2000/09/26 02:44:05 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/09/26 02:44:05 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Service.java,v 1.3 2000/11/25 01:34:49 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/11/25 01:34:49 $
*
* ====================================================================
*
@@ -70,7 +70,7 @@
* Slide Service interface.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public interface Service {
@@ -134,13 +134,24 @@
void reset()
throws ServiceResetFailedException;
+
/**
+ * Begin a new transaction.
+ *
+ * @exception ServiceAccessException Service access error
+ */
+ void begin()
+ throws ServiceAccessException;
+
+
+ /**
* Try to commit the data managed by the service to the repository.
*
* @exception ServiceAccessException Service access error
*/
void commit()
throws ServiceAccessException;
+
/**
* This function tells whether or not the service is connected.
1.3 +19 -6 jakarta-slide/src/share/org/apache/slide/common/ServiceImpl.java
Index: ServiceImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/ServiceImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ServiceImpl.java 2000/09/26 02:44:06 1.2
+++ ServiceImpl.java 2000/11/25 01:34:49 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/ServiceImpl.java,v 1.2 2000/09/26 02:44:06 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/09/26 02:44:06 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/ServiceImpl.java,v 1.3 2000/11/25 01:34:49 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/11/25 01:34:49 $
*
* ====================================================================
*
@@ -70,7 +70,7 @@
* Slide Service interface.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public abstract class ServiceImpl implements Service {
@@ -136,12 +136,25 @@
/**
+ * Begin a new transaction.
+ *
+ * @exception ServiceAccessException Service access error
+ */
+ public void begin()
+ throws ServiceAccessException {
+ // Do nothing by default.
+ }
+
+
+ /**
* Try to commit the data managed by the service to the repository.
*
* @exception ServiceAccessException Service access error
*/
- public abstract void commit()
- throws ServiceAccessException;
+ public void commit()
+ throws ServiceAccessException {
+ // Do nothing by default.
+ }
/**
1.6 +5 -5 jakarta-slide/src/share/org/apache/slide/common/XMLMarshaller.java
Index: XMLMarshaller.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLMarshaller.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLMarshaller.java 2000/09/26 02:44:08 1.5
+++ XMLMarshaller.java 2000/11/25 01:34:50 1.6
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLMarshaller.java,v 1.5 2000/09/26 02:44:08 remm Exp $
- * $Revision: 1.5 $
- * $Date: 2000/09/26 02:44:08 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLMarshaller.java,v 1.6 2000/11/25 01:34:50 remm Exp $
+ * $Revision: 1.6 $
+ * $Date: 2000/11/25 01:34:50 $
*
* ====================================================================
*
@@ -80,7 +80,7 @@
* XMLMarshaller helper class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public final class XMLMarshaller {
@@ -96,7 +96,7 @@
* @exception SlideException
*/
public static void marshal(NamespaceAccessToken accessToken,
- CredentialsToken token, Writer writer,
+ SlideToken token, Writer writer,
String startNode)
throws SlideException {
/*
1.9 +8 -8 jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java
Index: XMLUnmarshaller.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XMLUnmarshaller.java 2000/09/26 02:44:08 1.8
+++ XMLUnmarshaller.java 2000/11/25 01:34:50 1.9
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v 1.8 2000/09/26 02:44:08 remm Exp $
- * $Revision: 1.8 $
- * $Date: 2000/09/26 02:44:08 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v 1.9 2000/11/25 01:34:50 remm Exp $
+ * $Revision: 1.9 $
+ * $Date: 2000/11/25 01:34:50 $
*
* ====================================================================
*
@@ -84,7 +84,7 @@
* XMLUnmarshaller class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public final class XMLUnmarshaller {
@@ -103,7 +103,7 @@
* @exception ServiceAccessException Error accessing service
*/
public static void unmarshal(NamespaceAccessToken accessToken,
- CredentialsToken token,
+ SlideToken token,
Configuration dataConfiguration)
throws ConfigurationException, UnknownObjectClassException,
ServiceAccessException {
@@ -129,7 +129,7 @@
* reading of the XML
*/
private static void loadObjectNode
- (NamespaceAccessToken accessToken, CredentialsToken token,
+ (NamespaceAccessToken accessToken, SlideToken token,
Configuration objectDefinition)
throws ServiceAccessException, ConfigurationException,
UnknownObjectClassException {
@@ -262,7 +262,7 @@
* @exception SlideException A data access error occured
*/
private static void loadObjectRevision(NamespaceAccessToken accessToken,
- CredentialsToken token, String uri,
+ SlideToken token, String uri,
Configuration revisionDefinition)
throws ServiceAccessException, ConfigurationException,
AccessDeniedException, ObjectNotFoundException,
@@ -331,7 +331,7 @@
* @exception SlideException A data access error occured
*/
private static void loadProperties(NamespaceAccessToken accessToken,
- CredentialsToken token,
+ SlideToken token,
ObjectNode slideObject)
throws ServiceAccessException {
1.1 jakarta-slide/src/share/org/apache/slide/common/SlideToken.java
Index: SlideToken.java
===================================================================
/*
* $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideToken.java,v 1.1 2000/11/25 01:34:50 remm Exp $
* $Revision: 1.1 $
* $Date: 2000/11/25 01:34:50 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* 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
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* 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
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.slide.common;
import java.security.Principal;
import java.util.Hashtable;
import org.apache.slide.authenticate.CredentialsToken;
/**
* Slide token class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
*/
public final class SlideToken {
// ------------------------------------------------------------ Constructor
/**
* Constructor.
*
* @param credentials Credentials stored in this token
*/
public SlideToken(CredentialsToken credentialsToken) {
this.credentialsToken = credentialsToken;
}
/**
* Constructor.
*
* @param credentials Credentials stored in this token
*/
public SlideToken() {
}
// ----------------------------------------------------- Instance Variables
/**
* Credentials.
*/
private CredentialsToken credentialsToken;
/**
* Use lock tokens for lock resolution.
*/
private boolean enforceLockTokens = false;
/**
* Lock tokens.
*/
private Hashtable lockTokens = new Hashtable();
// ------------------------------------------------------------- Properties
/**
* Returns the credentials token.
*
* @return String
*/
public CredentialsToken getCredentialsToken() {
return credentialsToken;
}
/**
* Returns the credentials token.
*
* @return String
*/
public void setCredentialsToken(CredentialsToken credentialsToken) {
this.credentialsToken = credentialsToken;
}
/**
* Use lock tokens in lock resolution ?
*
* @return boolean
*/
public boolean isEnforceLockTokens() {
return enforceLockTokens;
}
/**
* Enforce lock tokens flag mutator.
*
* @param enforceLockTokens New flag value
*/
public void setEnforceLockTokens(boolean enforceLockTokens) {
this.enforceLockTokens = enforceLockTokens;
}
/**
* Add a new lock token to the lock token list.
*
* @param lockToken Lock token to add
*/
public void addLockToken(String lockId) {
lockTokens.put(lockId, lockId);
}
/**
* Removes a lock token from the lock token list.
*
* @param lockToken Lock token to remove
*/
public void removeLockToken(String lockId) {
lockTokens.remove(lockId);
}
/**
* Clears the lock token list.
*/
public void clearLockTokens() {
lockTokens.clear();
}
/**
* Checks if the given lock token is present.
*
* @param lockToken Lock token to check
* @return boolean True if the given lock token is present
*/
public boolean checkLockToken(String lockToken) {
return lockTokens.containsKey(lockToken);
}
}
1.6 +17 -17 jakarta-slide/src/share/org/apache/slide/content/Content.java
Index: Content.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/Content.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Content.java 2000/09/26 02:44:13 1.5
+++ Content.java 2000/11/25 01:34:51 1.6
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/Content.java,v 1.5 2000/09/26 02:44:13 remm Exp $
- * $Revision: 1.5 $
- * $Date: 2000/09/26 02:44:13 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/Content.java,v 1.6 2000/11/25 01:34:51 remm Exp $
+ * $Revision: 1.6 $
+ * $Date: 2000/11/25 01:34:51 $
*
* ====================================================================
*
@@ -76,7 +76,7 @@
* Content.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public interface Content {
@@ -90,7 +90,7 @@
* @param strUri Uri
* @return NodeRevisionDescriptors
*/
- NodeRevisionDescriptors retrieve(CredentialsToken token, String strUri)
+ NodeRevisionDescriptors retrieve(SlideToken token, String strUri)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
ObjectLockedException;
@@ -103,7 +103,7 @@
* @param revisionNumber Node revision number
*/
NodeRevisionDescriptor retrieve
- (CredentialsToken token, NodeRevisionDescriptors revisionDescriptors,
+ (SlideToken token, NodeRevisionDescriptors revisionDescriptors,
NodeRevisionNumber revisionNumber)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
@@ -117,7 +117,7 @@
* @param revisionDescriptors Node revision descriptors
*/
NodeRevisionDescriptor retrieve
- (CredentialsToken token, NodeRevisionDescriptors revisionDescriptors)
+ (SlideToken token, NodeRevisionDescriptors revisionDescriptors)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
RevisionDescriptorNotFoundException, ObjectLockedException;
@@ -129,7 +129,7 @@
* @param revisionDescriptors Node revision descriptors
* @param revisionDescriptor Node revision descriptor
*/
- NodeRevisionContent retrieve(CredentialsToken token,
+ NodeRevisionContent retrieve(SlideToken token,
NodeRevisionDescriptors revisionDescriptors,
NodeRevisionDescriptor revisionDescriptor)
throws ObjectNotFoundException, AccessDeniedException,
@@ -144,7 +144,7 @@
* @param strUri Uri
* @param revisionDescriptor Node revision descriptor
*/
- NodeRevisionContent retrieve(CredentialsToken token, String strUri,
+ NodeRevisionContent retrieve(SlideToken token, String strUri,
NodeRevisionDescriptor revisionDescriptor)
throws ObjectNotFoundException, AccessDeniedException,
RevisionNotFoundException, LinkedObjectNotFoundException,
@@ -159,7 +159,7 @@
* @param revisionDescriptor New Node revision descriptor
* @param revisionContent New Node revision content
*/
- void create(CredentialsToken token, String strUri,
+ void create(SlideToken token, String strUri,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
throws ObjectNotFoundException, AccessDeniedException,
@@ -176,7 +176,7 @@
* @param newRevisionDescriptor New revision descriptor
* @param revisionContent Node revision content
*/
- void create(CredentialsToken token, String strUri,
+ void create(SlideToken token, String strUri,
NodeRevisionDescriptor oldRevisionDescriptor,
NodeRevisionDescriptor newRevisionDescriptor,
NodeRevisionContent revisionContent)
@@ -196,7 +196,7 @@
* @param newRevisionDescriptor New revision descriptor
* @param revisionContent Node revision content
*/
- void fork(CredentialsToken token, String strUri, String branchName,
+ void fork(SlideToken token, String strUri, String branchName,
NodeRevisionDescriptor basedOnRevisionDescriptor,
NodeRevisionDescriptor newRevisionDescriptor,
NodeRevisionContent revisionContent)
@@ -213,7 +213,7 @@
* @param newRevisionDescriptor New revision descriptor
* @param revisionContent Node revision content
*/
- void merge(CredentialsToken token, String strUri,
+ void merge(SlideToken token, String strUri,
Vector mergedRevisionDescriptor,
NodeRevisionDescriptor newRevisionDescriptor,
NodeRevisionContent revisionContent)
@@ -229,7 +229,7 @@
* @param revisionDescriptor Revision descriptor
* @param revisionContent Revision content
*/
- void store(CredentialsToken token, String strUri,
+ void store(SlideToken token, String strUri,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
throws ObjectNotFoundException, AccessDeniedException,
@@ -242,7 +242,7 @@
*
* @param revisionDescriptors Node revision descriptors
*/
- void remove(CredentialsToken token,
+ void remove(SlideToken token,
NodeRevisionDescriptors revisionDescriptors)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
@@ -255,7 +255,7 @@
* @param strUri Uri
* @param revisionDescriptor Node revision descriptor
*/
- void remove(CredentialsToken token, String strUri,
+ void remove(SlideToken token, String strUri,
NodeRevisionDescriptor revisionDescriptor)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
@@ -268,7 +268,7 @@
* @param strUri Uri
* @param revisionNumber Revision number
*/
- void remove(CredentialsToken token, String strUri,
+ void remove(SlideToken token, String strUri,
NodeRevisionNumber revisionNumber)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
1.8 +17 -17 jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java
Index: ContentImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ContentImpl.java 2000/11/22 19:15:48 1.7
+++ ContentImpl.java 2000/11/25 01:34:51 1.8
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java,v 1.7 2000/11/22 19:15:48 remm Exp $
- * $Revision: 1.7 $
- * $Date: 2000/11/22 19:15:48 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java,v 1.8 2000/11/25 01:34:51 remm Exp $
+ * $Revision: 1.8 $
+ * $Date: 2000/11/25 01:34:51 $
*
* ====================================================================
*
@@ -77,7 +77,7 @@
* Implementation of the content interface.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public final class ContentImpl implements Content {
@@ -147,7 +147,7 @@
* @param strUri Uri
* @return NodeRevisionDescriptors
*/
- public NodeRevisionDescriptors retrieve(CredentialsToken token,
+ public NodeRevisionDescriptors retrieve(SlideToken token,
String strUri)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
@@ -184,7 +184,7 @@
* @param revisionNumber Node revision number
*/
public NodeRevisionDescriptor retrieve
- (CredentialsToken token, NodeRevisionDescriptors revisionDescriptors,
+ (SlideToken token, NodeRevisionDescriptors revisionDescriptors,
NodeRevisionNumber revisionNumber)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
@@ -212,7 +212,7 @@
* @param revisionDescriptors Node revision descriptors
*/
public NodeRevisionDescriptor retrieve
- (CredentialsToken token, NodeRevisionDescriptors revisionDescriptors)
+ (SlideToken token, NodeRevisionDescriptors revisionDescriptors)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
RevisionDescriptorNotFoundException, ObjectLockedException {
@@ -228,7 +228,7 @@
* @param revisionDescriptor Node revision descriptor
*/
public NodeRevisionContent retrieve
- (CredentialsToken token, NodeRevisionDescriptors revisionDescriptors,
+ (SlideToken token, NodeRevisionDescriptors revisionDescriptors,
NodeRevisionDescriptor revisionDescriptor)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
@@ -246,7 +246,7 @@
* @param revisionDescriptor Node revision descriptor
*/
public NodeRevisionContent retrieve
- (CredentialsToken token, String strUri,
+ (SlideToken token, String strUri,
NodeRevisionDescriptor revisionDescriptor)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
@@ -275,7 +275,7 @@
* @param revisionDescriptor New Node revision descriptor
* @param revisionContent New Node revision content
*/
- public void create(CredentialsToken token, String strUri,
+ public void create(SlideToken token, String strUri,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
throws ObjectNotFoundException, AccessDeniedException,
@@ -441,7 +441,7 @@
* @param newRevisionDescriptor New revision descriptor
* @param revisionContent Node revision content
*/
- public void create(CredentialsToken token, String strUri,
+ public void create(SlideToken token, String strUri,
NodeRevisionDescriptor oldRevisionDescriptor,
NodeRevisionDescriptor newRevisionDescriptor,
NodeRevisionContent revisionContent)
@@ -548,7 +548,7 @@
* @param newRevisionDescriptor New revision descriptor
* @param revisionContent Node revision content
*/
- public void fork(CredentialsToken token, String strUri, String branchName,
+ public void fork(SlideToken token, String strUri, String branchName,
NodeRevisionDescriptor basedOnRevisionDescriptor,
NodeRevisionDescriptor newRevisionDescriptor,
NodeRevisionContent revisionContent)
@@ -584,7 +584,7 @@
* @param newRevisionDescriptor New revision descriptor
* @param revisionContent Node revision content
*/
- public void merge(CredentialsToken token, String strUri,
+ public void merge(SlideToken token, String strUri,
Vector mergedRevisionDescriptor,
NodeRevisionDescriptor newRevisionDescriptor,
NodeRevisionContent revisionContent)
@@ -619,7 +619,7 @@
* @param revisionDescriptor Revision descriptor
* @param revisionContent Revision content
*/
- public void store(CredentialsToken token, String strUri,
+ public void store(SlideToken token, String strUri,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
throws ObjectNotFoundException, AccessDeniedException,
@@ -652,7 +652,7 @@
*
* @param revisionDescriptors Node revision descriptors
*/
- public void remove(CredentialsToken token,
+ public void remove(SlideToken token,
NodeRevisionDescriptors revisionDescriptors)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
@@ -687,7 +687,7 @@
* @param strUri Uri
* @param revisionDescriptor Node revision descriptor
*/
- public void remove(CredentialsToken token, String strUri,
+ public void remove(SlideToken token, String strUri,
NodeRevisionDescriptor revisionDescriptor)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
@@ -702,7 +702,7 @@
* @param strUri Uri
* @param revisionNumber Revision number
*/
- public void remove(CredentialsToken token, String strUri,
+ public void remove(SlideToken token, String strUri,
NodeRevisionNumber revisionNumber)
throws ObjectNotFoundException, AccessDeniedException,
LinkedObjectNotFoundException, ServiceAccessException,
1.7 +19 -19 jakarta-slide/src/share/org/apache/slide/lock/Lock.java
Index: Lock.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/lock/Lock.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Lock.java 2000/09/26 03:17:23 1.6
+++ Lock.java 2000/11/25 01:34:52 1.7
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/lock/Lock.java,v 1.6 2000/09/26 03:17:23 remm Exp $
- * $Revision: 1.6 $
- * $Date: 2000/09/26 03:17:23 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/lock/Lock.java,v 1.7 2000/11/25 01:34:52 remm Exp $
+ * $Revision: 1.7 $
+ * $Date: 2000/11/25 01:34:52 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* Lock helper class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public interface Lock {
@@ -99,7 +99,7 @@
* @exception AccessDeniedException Insufficient credentials to allow
* object locking
*/
- void lock(CredentialsToken credentialsToken, NodeLock token)
+ void lock(SlideToken slideToken, NodeLock token)
throws ServiceAccessException, ObjectIsAlreadyLockedException,
AccessDeniedException, ObjectNotFoundException;
@@ -113,7 +113,7 @@
* @exception LockTokenNotFoundException Cannot find the Lock in the
* Lock Store service
*/
- void unlock(CredentialsToken credentialsToken, NodeLock token)
+ void unlock(SlideToken slideToken, NodeLock token)
throws ServiceAccessException, LockTokenNotFoundException;
@@ -128,7 +128,7 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- void unlock(CredentialsToken credentialsToken, String objectUri,
+ void unlock(SlideToken slideToken, String objectUri,
String lockId)
throws ServiceAccessException, LockTokenNotFoundException,
ObjectNotFoundException;
@@ -144,7 +144,7 @@
* @exception LockTokenNotFoundException Cannot find the Lock in the
* Lock Store service
*/
- void renew(CredentialsToken credentialsToken, NodeLock token,
+ void renew(SlideToken slideToken, NodeLock token,
Date newExpirationDate)
throws ServiceAccessException, LockTokenNotFoundException;
@@ -161,7 +161,7 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- void renew(CredentialsToken credentialsToken, String objectUri,
+ void renew(SlideToken slideToken, String objectUri,
String lockId, Date newExpirationDate)
throws ServiceAccessException, LockTokenNotFoundException,
ObjectNotFoundException;
@@ -180,7 +180,7 @@
* @exception AccessDeniedException Insufficient credentials to allow
* forced removal of locks
*/
- void kill(CredentialsToken credentialsToken, SubjectNode subject)
+ void kill(SlideToken slideToken, SubjectNode subject)
throws ServiceAccessException, AccessDeniedException,
LockTokenNotFoundException, ObjectNotFoundException;
@@ -188,13 +188,13 @@
/**
* Enumerate locks on a subject.
*
- * @param credentialsToken Credentials token
+ * @param slideToken Credentials token
* @param objectUri Object on which we want to enumerate locks
* @exception ServiceAccessException Low level service access exception
* @exception ObjectNotFoundException One of the objects referenced in
* the lock token were not found
*/
- Enumeration enumerateLocks(CredentialsToken credentialsToken,
+ Enumeration enumerateLocks(SlideToken slideToken,
String objectUri)
throws ServiceAccessException, ObjectNotFoundException,
LockTokenNotFoundException;
@@ -203,7 +203,7 @@
/**
* Utility function for lock checking. Mirrors Security.checkCredentials.
*
- * @param credentialsToken Credetials token
+ * @param slideToken Credetials token
* @param subject Object on which the action is performed
* @param action Action to test
* @exception ObjectLockedException Can't perform specified action
@@ -212,7 +212,7 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- void checkLock(CredentialsToken credentialsToken, ObjectNode object,
+ void checkLock(SlideToken slideToken, ObjectNode object,
ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
ObjectLockedException;
@@ -221,7 +221,7 @@
/**
* Check locking for a specific action and credential.
*
- * @param credentialsToken Credetials token
+ * @param slideToken Credetials token
* @param subject Subject to test
* @param user User to test
* @param action Action to test
@@ -231,7 +231,7 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- void checkLock(CredentialsToken credentialsToken, ObjectNode subject,
+ void checkLock(SlideToken slideToken, ObjectNode subject,
SubjectNode user, ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
ObjectLockedException;
@@ -249,7 +249,7 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- boolean isLocked(CredentialsToken credentialsToken, ObjectNode subject,
+ boolean isLocked(SlideToken slideToken, ObjectNode subject,
SubjectNode user, ActionNode action, boolean tryToLock)
throws ServiceAccessException, ObjectNotFoundException;
@@ -271,7 +271,7 @@
* @exception ObjectNotFoundException One of the objects referenced in
* the lock token were not found
*/
- boolean isLocked(CredentialsToken credentialsToken, ObjectNode subject,
+ boolean isLocked(SlideToken slideToken, ObjectNode subject,
SubjectNode user, ActionNode action, boolean inheritance,
boolean tryToLock)
throws ServiceAccessException, ObjectNotFoundException;
@@ -286,7 +286,7 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- boolean isLocked(CredentialsToken credentialsToken, NodeLock token,
+ boolean isLocked(SlideToken slideToken, NodeLock token,
boolean tryToLock)
throws ServiceAccessException, ObjectNotFoundException;
1.11 +40 -39 jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java
Index: LockImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- LockImpl.java 2000/11/19 04:18:36 1.10
+++ LockImpl.java 2000/11/25 01:34:52 1.11
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v 1.10 2000/11/19 04:18:36 remm Exp $
- * $Revision: 1.10 $
- * $Date: 2000/11/19 04:18:36 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v 1.11 2000/11/25 01:34:52 remm Exp $
+ * $Revision: 1.11 $
+ * $Date: 2000/11/25 01:34:52 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* Lock helper class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public final class LockImpl implements Lock {
@@ -137,11 +137,11 @@
* @exception AccessDeniedException Insufficient credentials to allow
* object locking
*/
- public void lock(CredentialsToken credentialsToken, NodeLock token)
+ public void lock(SlideToken slideToken, NodeLock token)
throws ServiceAccessException, ObjectIsAlreadyLockedException,
AccessDeniedException, ObjectNotFoundException {
- boolean canLock = !isLocked(credentialsToken, token, true);
+ boolean canLock = !isLocked(slideToken, token, true);
// Then we try to lock the subject.
// If the User doesn't have enough priviledges to accomplish this
@@ -152,7 +152,7 @@
ObjectNode lockedObject = objectUri.getStore()
.retrieveObject(objectUri);
securityHelper
- .checkCredentials(credentialsToken, lockedObject,
+ .checkCredentials(slideToken, lockedObject,
namespaceConfig.getLockObjectAction());
Uri lockedUri = namespace.getUri(token.getObjectUri());
lockedUri.getStore().putLock(lockedUri, token);
@@ -172,7 +172,7 @@
* @exception LockTokenNotFoundException Cannot find the Lock in the
* Lock Store service
*/
- public void unlock(CredentialsToken credentialsToken, NodeLock token)
+ public void unlock(SlideToken slideToken, NodeLock token)
throws ServiceAccessException, LockTokenNotFoundException {
Uri lockedUri = namespace.getUri(token.getObjectUri());
lockedUri.getStore().removeLock(lockedUri, token);
@@ -189,16 +189,16 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- public void unlock(CredentialsToken credentialsToken, String objectUri,
+ public void unlock(SlideToken slideToken, String objectUri,
String lockId)
throws ServiceAccessException, LockTokenNotFoundException,
ObjectNotFoundException {
- Enumeration locksList = enumerateLocks(credentialsToken, objectUri);
+ Enumeration locksList = enumerateLocks(slideToken, objectUri);
while (locksList.hasMoreElements()) {
NodeLock currentLock = (NodeLock) locksList.nextElement();
if (currentLock.getLockId().equals(lockId)) {
- unlock(credentialsToken, currentLock);
+ unlock(slideToken, currentLock);
}
}
@@ -215,7 +215,7 @@
* @exception LockTokenNotFoundException Cannot find the Lock in
* the Lock Store service
*/
- public void renew(CredentialsToken credentialsToken, NodeLock token,
+ public void renew(SlideToken slideToken, NodeLock token,
Date newExpirationDate)
throws ServiceAccessException, LockTokenNotFoundException {
token.setExpirationDate(newExpirationDate);
@@ -234,16 +234,16 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- public void renew(CredentialsToken credentialsToken, String objectUri,
+ public void renew(SlideToken slideToken, String objectUri,
String lockId, Date newExpirationDate)
throws ServiceAccessException, LockTokenNotFoundException,
ObjectNotFoundException {
- Enumeration locksList = enumerateLocks(credentialsToken, objectUri);
+ Enumeration locksList = enumerateLocks(slideToken, objectUri);
while (locksList.hasMoreElements()) {
NodeLock currentLock = (NodeLock) locksList.nextElement();
if (currentLock.getLockId().equals(lockId)) {
- renew(credentialsToken, currentLock, newExpirationDate);
+ renew(slideToken, currentLock, newExpirationDate);
}
}
@@ -263,7 +263,7 @@
* @exception AccessDeniedException Insufficient credentials to allow
* forced removal of locks
*/
- public void kill(CredentialsToken credentialsToken, SubjectNode subject)
+ public void kill(SlideToken slideToken, SubjectNode subject)
throws ServiceAccessException, AccessDeniedException,
LockTokenNotFoundException, ObjectNotFoundException {
@@ -275,7 +275,7 @@
// Then, try to kill each individual lock.
while (locks.hasMoreElements()) {
securityHelper
- .checkCredentials(credentialsToken, subject,
+ .checkCredentials(slideToken, subject,
namespaceConfig.getKillLockAction());
subjectUri.getStore()
.killLock(subjectUri, (NodeLock) locks.nextElement());
@@ -287,13 +287,13 @@
/**
* Enumerate locks on a subject.
*
- * @param credentialsToken Credentials token
+ * @param slideToken Credentials token
* @param objectUri Object on which we want to enumerate locks
* @exception ServiceAccessException Low level service access exception
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- public Enumeration enumerateLocks(CredentialsToken credentialsToken,
+ public Enumeration enumerateLocks(SlideToken slideToken,
String objectUri)
throws ServiceAccessException, ObjectNotFoundException,
LockTokenNotFoundException {
@@ -337,7 +337,7 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- public void checkLock(CredentialsToken token,
+ public void checkLock(SlideToken token,
ObjectNode object, ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
ObjectLockedException {
@@ -348,8 +348,9 @@
ObjectNode realObject = objectUri.getStore()
.retrieveObject(objectUri);
Uri subjectUri = null;
- subjectUri = namespace.getUri(namespaceConfig.getUsersPath() + "/"
- + token.getPublicCredentials());
+ subjectUri = namespace.getUri
+ (namespaceConfig.getUsersPath() + "/"
+ + token.getCredentialsToken().getPublicCredentials());
SubjectNode subject = (SubjectNode) subjectUri
.getStore().retrieveObject(subjectUri);
checkLock(token, realObject, subject, action);
@@ -361,7 +362,7 @@
/**
* Check locking for a specific action and credential.
*
- * @param credentialsToken Credetials token
+ * @param slideToken Credetials token
* @param subject Subject to test
* @param user User to test
* @param action Action to test
@@ -371,14 +372,14 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- public void checkLock(CredentialsToken credentialsToken,
+ public void checkLock(SlideToken slideToken,
ObjectNode subject, SubjectNode user,
ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
ObjectLockedException {
if (Configuration.useIntegratedLocking()) {
- if (isLocked(credentialsToken, subject, user, action, false)) {
+ if (isLocked(slideToken, subject, user, action, false)) {
throw new ObjectLockedException(subject.getUri());
}
}
@@ -398,13 +399,13 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- public boolean isLocked(CredentialsToken credentialsToken,
+ public boolean isLocked(SlideToken slideToken,
ObjectNode subject, SubjectNode user,
ActionNode action, boolean tryToLock)
throws ServiceAccessException, ObjectNotFoundException {
NodeLock token = new NodeLock(subject, user, action,
new Date(), false);
- return isLocked(credentialsToken, token, tryToLock);
+ return isLocked(slideToken, token, tryToLock);
}
@@ -424,14 +425,14 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- public boolean isLocked(CredentialsToken credentialsToken,
+ public boolean isLocked(SlideToken slideToken,
ObjectNode subject, SubjectNode user,
ActionNode action, boolean inheritance,
boolean tryToLock)
throws ServiceAccessException, ObjectNotFoundException {
NodeLock token = new NodeLock(subject, user, action, new Date(),
inheritance);
- return isLocked(credentialsToken, token, tryToLock);
+ return isLocked(slideToken, token, tryToLock);
}
@@ -444,7 +445,7 @@
* @exception ObjectNotFoundException One of the objects referenced
* in the lock token were not found
*/
- public boolean isLocked(CredentialsToken credentialsToken, NodeLock token,
+ public boolean isLocked(SlideToken slideToken, NodeLock token,
boolean tryToLock)
throws ServiceAccessException, ObjectNotFoundException {
@@ -468,7 +469,7 @@
while (locks.hasMoreElements()) {
NodeLock currentLockToken = (NodeLock) locks.nextElement();
- if (!isCompatible(credentialsToken, token, currentLockToken,
+ if (!isCompatible(slideToken, token, currentLockToken,
tryToLock)) {
isLocked = true;
}
@@ -491,7 +492,7 @@
while (locks.hasMoreElements()) {
NodeLock currentLockToken = (NodeLock) locks.nextElement();
- if (!isCompatible(credentialsToken, token,
+ if (!isCompatible(slideToken, token,
currentLockToken, tryToLock)) {
isLocked = true;
}
@@ -530,16 +531,16 @@
* Return true if a lock token for this lock has been given in the
* credentials token.
*
- * @param credentialsToken Current credentials token
+ * @param slideToken Current credentials token
* @param token Lock token
*/
- private boolean checkLockToken(CredentialsToken credentialsToken,
+ private boolean checkLockToken(SlideToken slideToken,
NodeLock token) {
- if (!credentialsToken.isEnforceLockTokens())
+ if (!slideToken.isEnforceLockTokens())
return true;
- return (credentialsToken.checkLockToken(token.getLockId()));
+ return (slideToken.checkLockToken(token.getLockId()));
}
@@ -552,7 +553,7 @@
* @param tryToLock True if we want to check for a lock creation
* @return boolean True if the locks are compatible
*/
- private boolean isCompatible(CredentialsToken credentialsToken,
+ private boolean isCompatible(SlideToken slideToken,
NodeLock token1, NodeLock token2,
boolean tryToLock) {
boolean compatible = true;
@@ -578,9 +579,9 @@
// The lockType is exclusive
boolean condition4 = token1.isExclusive();
// Was a proper lock token given out ?
- boolean condition5 = checkLockToken(credentialsToken, token2);
+ boolean condition5 = checkLockToken(slideToken, token2);
// Are lock tokens enforced ?
- boolean condition6 = credentialsToken.isEnforceLockTokens();
+ boolean condition6 = slideToken.isEnforceLockTokens();
if ((condition1 && condition4)
|| (condition3 && !condition2 && !condition6)
|| (condition3 && !condition5 && condition6)) {
1.5 +16 -16 jakarta-slide/src/share/org/apache/slide/macro/Macro.java
Index: Macro.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/Macro.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Macro.java 2000/09/26 02:44:18 1.4
+++ Macro.java 2000/11/25 01:34:53 1.5
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/Macro.java,v 1.4 2000/09/26 02:44:18 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2000/09/26 02:44:18 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/Macro.java,v 1.5 2000/11/25 01:34:53 remm Exp $
+ * $Revision: 1.5 $
+ * $Date: 2000/11/25 01:34:53 $
*
* ====================================================================
*
@@ -76,7 +76,7 @@
* Macro helper class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public interface Macro {
@@ -104,12 +104,12 @@
/**
* Recursive copy with overwrite macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param sourceUri Uri of the source
* @param destinationUri Uri of the destination
* @exception CopyMacroException Generic Slide exception
*/
- void copy(CredentialsToken credToken, String sourceUri,
+ void copy(SlideToken token, String sourceUri,
String destinationUri)
throws CopyMacroException, DeleteMacroException;
@@ -117,13 +117,13 @@
/**
* Copy macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param sourceUri Uri of the source
* @param destinationUri Uri of the destination
* @param parameters Macro parameters
* @exception CopyMacroException Generic Slide exception
*/
- void copy(CredentialsToken credToken, String sourceUri,
+ void copy(SlideToken token, String sourceUri,
String destinationUri, MacroParameters parameters)
throws CopyMacroException, DeleteMacroException;
@@ -131,13 +131,13 @@
/**
* Recursive move with overwrite macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param sourceUri Uri of the source
* @param destinationUri Uri of the destination
* @exception CopyMacroException Exception occured during copy
* @exception DeleteMacroException Exception occured during deletion
*/
- void move(CredentialsToken credToken, String sourceUri,
+ void move(SlideToken token, String sourceUri,
String destinationUri)
throws CopyMacroException, DeleteMacroException;
@@ -145,14 +145,14 @@
/**
* Move macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param sourceUri Uri of the source
* @param destinationUri Uri of the destination
* @param parameters Macro parameters
* @exception CopyMacroException Exception occured during copy
* @exception DeleteMacroException Exception occured during deletion
*/
- void move(CredentialsToken credToken, String sourceUri,
+ void move(SlideToken token, String sourceUri,
String destinationUri, MacroParameters parameters)
throws CopyMacroException, DeleteMacroException;
@@ -160,24 +160,24 @@
/**
* Recursive delete.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param targetUri Uri of the object to delete
* @exception DeleteMacroException Generic Slide exception
*/
- void delete(CredentialsToken credToken, String targetUri)
+ void delete(SlideToken token, String targetUri)
throws DeleteMacroException;
/**
* Delete macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param targetUri Uri of the source
* @param parameters Macro parameters, not used right now,
* so it can be null
* @exception DeleteMacroException Generic Slide exception
*/
- void delete(CredentialsToken credToken, String targetUri,
+ void delete(SlideToken token, String targetUri,
MacroParameters parameters)
throws DeleteMacroException;
1.6 +49 -50 jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java
Index: MacroImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MacroImpl.java 2000/11/20 17:57:10 1.5
+++ MacroImpl.java 2000/11/25 01:34:53 1.6
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v 1.5 2000/11/20 17:57:10 remm Exp $
- * $Revision: 1.5 $
- * $Date: 2000/11/20 17:57:10 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v 1.6 2000/11/25 01:34:53 remm Exp $
+ * $Revision: 1.6 $
+ * $Date: 2000/11/25 01:34:53 $
*
* ====================================================================
*
@@ -71,13 +71,12 @@
import org.apache.slide.structure.*;
import org.apache.slide.security.*;
import org.apache.slide.content.*;
-import org.apache.slide.authenticate.CredentialsToken;
/**
* Macro helper class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public final class MacroImpl implements Macro {
@@ -143,15 +142,15 @@
/**
* Recursive copy with overwrite macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param sourceUri Uri of the source
* @param destinationUri Uri of the destination
* @exception CopyMacroException Generic Slide exception
*/
- public void copy(CredentialsToken credToken, String sourceUri,
+ public void copy(SlideToken token, String sourceUri,
String destinationUri)
throws CopyMacroException, DeleteMacroException {
- this.copy(credToken, sourceUri, destinationUri,
+ this.copy(token, sourceUri, destinationUri,
RECURSIVE_OVERWRITE_PARAMETERS);
}
@@ -159,13 +158,13 @@
/**
* Copy macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param sourceUri Uri of the source
* @param destinationUri Uri of the destination
* @param parameters Macro parameters
* @exception CopyMacroException Generic Slide exception
*/
- public void copy(CredentialsToken credToken, String sourceUri,
+ public void copy(SlideToken token, String sourceUri,
String destinationUri, MacroParameters parameters)
throws CopyMacroException, DeleteMacroException {
@@ -174,22 +173,22 @@
if (parameters.isOverwrite()) {
try {
// We make sure the object we want to overwrite exists
- structureHelper.retrieve(credToken, destinationUri);
- delete(credToken, destinationUri);
+ structureHelper.retrieve(token, destinationUri);
+ delete(token, destinationUri);
} catch(ObjectNotFoundException e) {
// Silent catch, the target doesn't exist
} catch(SlideException e) {
// We try to delete the target anyway.
// It will probably fail again, but we will get a properly
// packaged exception
- delete(credToken, destinationUri);
+ delete(token, destinationUri);
}
}
// Now performing the actual copy
CopyMacroException e = new CopyMacroException("Copy failed");
- copyObject(credToken, sourceUri, destinationUri, parameters, e);
+ copyObject(token, sourceUri, destinationUri, parameters, e);
// If there were errors, we throw the nested exception
if (!e.isEmpty()) {
@@ -202,16 +201,16 @@
/**
* Recursive move with overwrite macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param sourceUri Uri of the source
* @param destinationUri Uri of the destination
* @exception CopyMacroException Exception occured during copy
* @exception DeleteMacroException Exception occured during deletion
*/
- public void move(CredentialsToken credToken, String sourceUri,
+ public void move(SlideToken token, String sourceUri,
String destinationUri)
throws CopyMacroException, DeleteMacroException {
- move(credToken, sourceUri, destinationUri,
+ move(token, sourceUri, destinationUri,
RECURSIVE_OVERWRITE_PARAMETERS);
}
@@ -219,51 +218,51 @@
/**
* Move macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param sourceUri Uri of the source
* @param destinationUri Uri of the destination
* @param parameters Macro parameters
* @exception CopyMacroException Exception occured during copy
* @exception DeleteMacroException Exception occured during deletion
*/
- public void move(CredentialsToken credToken, String sourceUri,
+ public void move(SlideToken token, String sourceUri,
String destinationUri, MacroParameters parameters)
throws CopyMacroException, DeleteMacroException {
- copy(credToken, sourceUri, destinationUri, parameters);
- delete(credToken, sourceUri, parameters);
+ copy(token, sourceUri, destinationUri, parameters);
+ delete(token, sourceUri, parameters);
}
/**
* Recursive delete.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param targetUri Uri of the object to delete
* @exception DeleteMacroException Generic Slide exception
*/
- public void delete(CredentialsToken credToken, String targetUri)
+ public void delete(SlideToken token, String targetUri)
throws DeleteMacroException {
- delete(credToken, targetUri, RECURSIVE_OVERWRITE_PARAMETERS);
+ delete(token, targetUri, RECURSIVE_OVERWRITE_PARAMETERS);
}
/**
* Delete macro.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param targetUri Uri of the source
* @param parameters Macro parameters, not used right now,
* so it can be null
* @exception DeleteMacroException Generic Slide exception
*/
- public void delete(CredentialsToken credToken, String targetUri,
+ public void delete(SlideToken token, String targetUri,
MacroParameters parameters)
throws DeleteMacroException {
Domain.info("Delete " + targetUri);
DeleteMacroException e = new DeleteMacroException("Delete failed");
- deleteObject(credToken, targetUri, e);
+ deleteObject(token, targetUri, e);
// If there were errors, we throw the nested exception
if (!e.isEmpty()) {
@@ -279,13 +278,13 @@
/**
* Copy object.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param sourceUri Uri of the source
* @param destinationUri Uri of the destination
* @param parameters Macro parameters
* @param CopyMacroException Exception occured during copy
*/
- private void copyObject(CredentialsToken credToken, String sourceUri,
+ private void copyObject(SlideToken token, String sourceUri,
String destinationUri, MacroParameters parameters,
CopyMacroException e) {
@@ -297,17 +296,17 @@
Vector childrenListVector = new Vector();
// Copying structure
- ObjectNode object = structureHelper.retrieve(credToken, sourceUri);
+ ObjectNode object = structureHelper.retrieve(token, sourceUri);
// Creating the copy
- structureHelper.create(credToken, object.copyObject(),
+ structureHelper.create(token, object.copyObject(),
destinationUri);
// Trying to recreate permissions
try {
Enumeration permissions = securityHelper
- .enumeratePermissions(credToken, object);
+ .enumeratePermissions(token, object);
while (permissions.hasMoreElements()) {
NodePermission permission =
@@ -317,11 +316,11 @@
permission.getSubjectUri(),
permission.getActionUri(),
permission.isInheritable());
- securityHelper.grantPermission(credToken, newPermission);
+ securityHelper.grantPermission(token, newPermission);
}
/*
- public void grantPermission(CredentialsToken token,
+ public void grantPermission(SlideToken token,
ObjectNode object,
SubjectNode subject, ActionNode action,
boolean inheritable)
@@ -339,7 +338,7 @@
// Now copying revision descriptors and content
NodeRevisionDescriptors revisionDescriptors =
- contentHelper.retrieve(credToken, sourceUri);
+ contentHelper.retrieve(token, sourceUri);
// Iterators
NodeRevisionNumber currentRevisionNumber =
@@ -352,16 +351,16 @@
// Creating the initial revision
currentRevisionDescriptor = contentHelper
- .retrieve(credToken, revisionDescriptors,
+ .retrieve(token, revisionDescriptors,
currentRevisionNumber);
if (currentRevisionDescriptor.getContentLength() > 0) {
currentRevisionContent = contentHelper
- .retrieve(credToken, revisionDescriptors,
+ .retrieve(token, revisionDescriptors,
currentRevisionDescriptor);
} else {
currentRevisionContent = null;
}
- contentHelper.create(credToken, destinationUri,
+ contentHelper.create(token, destinationUri,
currentRevisionDescriptor,
currentRevisionContent);
@@ -375,14 +374,14 @@
// We copy each of this object's children
- object = structureHelper.retrieve(credToken, sourceUri);
+ object = structureHelper.retrieve(token, sourceUri);
Enumeration childrenList = object.enumerateChildren();
while(childrenList.hasMoreElements()) {
String childUri = (String) childrenList.nextElement();
String childDestinationUri = destinationUri + childUri
.substring(object.getUri().length());
- copyObject(credToken, childUri, childDestinationUri,
+ copyObject(token, childUri, childDestinationUri,
parameters, e);
}
@@ -397,20 +396,20 @@
/**
* Delete object function. Recursive for now.
*
- * @param credToken Credentials token
+ * @param token Credentials token
* @param targetUri Uri of the source
* @param parameters Macro parameters, not used right now, so it can
* be null
* @param e Nested exception
*/
- private void deleteObject(CredentialsToken credToken, String targetUri,
+ private void deleteObject(SlideToken token, String targetUri,
MacroException e) {
Domain.info("Delete object : " + targetUri);
try {
- ObjectNode currentObject = structureHelper.retrieve(credToken,
+ ObjectNode currentObject = structureHelper.retrieve(token,
targetUri);
//System.out.println("Uri : " + targetUri + " Object : "
@@ -420,32 +419,32 @@
if (currentObject.hasChildren()) {
Enumeration children = currentObject.enumerateChildren();
while (children.hasMoreElements()) {
- deleteObject(credToken, (String) children.nextElement(),
+ deleteObject(token, (String) children.nextElement(),
e);
}
}
// Removing all revisions
NodeRevisionDescriptors revisionDescriptors =
- contentHelper.retrieve(credToken, targetUri);
+ contentHelper.retrieve(token, targetUri);
// For now, only delete the initial revision
if (revisionDescriptors.hasRevisions()) {
- contentHelper.remove(credToken, targetUri,
+ contentHelper.remove(token, targetUri,
revisionDescriptors.getInitialRevision());
}
// Removing object
- structureHelper.remove(credToken, currentObject);
+ structureHelper.remove(token, currentObject);
// TODO : Remove permissions
/*
try {
NodeProperties properties =
- structureHelper.retrieve(credToken, currentObject);
- structureHelper.remove(credToken, properties);
- structureHelper.remove(credToken, currentObject);
+ structureHelper.retrieve(token, currentObject);
+ structureHelper.remove(token, properties);
+ structureHelper.remove(token, currentObject);
} catch(StructureException ex) {
// Perhaps there were no properties associated with
// this object ...
1.8 +15 -15 jakarta-slide/src/share/org/apache/slide/security/Security.java
Index: Security.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/Security.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Security.java 2000/10/03 06:16:44 1.7
+++ Security.java 2000/11/25 01:34:54 1.8
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/Security.java,v 1.7 2000/10/03 06:16:44 remm Exp $
- * $Revision: 1.7 $
- * $Date: 2000/10/03 06:16:44 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/Security.java,v 1.8 2000/11/25 01:34:54 remm Exp $
+ * $Revision: 1.8 $
+ * $Date: 2000/11/25 01:34:54 $
*
* ====================================================================
*
@@ -73,7 +73,7 @@
* Security helper.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public interface Security {
@@ -91,7 +91,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- Enumeration enumeratePermissions(CredentialsToken token, ObjectNode object)
+ Enumeration enumeratePermissions(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException;
@@ -106,7 +106,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- Enumeration enumeratePermissions(CredentialsToken token, String object)
+ Enumeration enumeratePermissions(SlideToken token, String object)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException;
@@ -121,7 +121,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- NodePermissions getPermissions(CredentialsToken token, ObjectNode object)
+ NodePermissions getPermissions(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException;
@@ -139,7 +139,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- void grantPermission(CredentialsToken token, ObjectNode object,
+ void grantPermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException;
@@ -155,7 +155,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- void grantPermission(CredentialsToken token, NodePermission permission)
+ void grantPermission(SlideToken token, NodePermission permission)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException;
@@ -173,7 +173,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- void grantPermission(CredentialsToken token, ObjectNode object,
+ void grantPermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action,
boolean inheritable)
throws ServiceAccessException, ObjectNotFoundException,
@@ -193,7 +193,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- void denyPermission(CredentialsToken token, ObjectNode object,
+ void denyPermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException;
@@ -209,7 +209,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- void denyPermission(CredentialsToken token, NodePermission permission)
+ void denyPermission(SlideToken token, NodePermission permission)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException;
@@ -227,7 +227,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- void denyPermission(CredentialsToken token, ObjectNode object,
+ void denyPermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action,
boolean inheritable)
throws ServiceAccessException, ObjectNotFoundException,
@@ -246,7 +246,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- void revokePermission(CredentialsToken token, ObjectNode object,
+ void revokePermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException;
@@ -263,7 +263,7 @@
* @exception AccessDeniedException The credentials does not grant
* the permission to perform the specified action
*/
- void checkCredentials(CredentialsToken token, ObjectNode object,
+ void checkCredentials(SlideToken token, ObjectNode object,
ActionNode action)
throws ServiceAccessException, AccessDeniedException;
1.11 +23 -21 jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java
Index: SecurityImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- SecurityImpl.java 2000/11/19 04:18:37 1.10
+++ SecurityImpl.java 2000/11/25 01:34:54 1.11
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v 1.10 2000/11/19 04:18:37 remm Exp $
- * $Revision: 1.10 $
- * $Date: 2000/11/19 04:18:37 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v 1.11 2000/11/25 01:34:54 remm Exp $
+ * $Revision: 1.11 $
+ * $Date: 2000/11/25 01:34:54 $
*
* ====================================================================
*
@@ -73,7 +73,7 @@
* Security helper.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public final class SecurityImpl implements Security {
@@ -124,7 +124,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public void grantPermission(CredentialsToken token, ObjectNode object,
+ public void grantPermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException {
@@ -145,7 +145,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public void grantPermission(CredentialsToken token, ObjectNode object,
+ public void grantPermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action,
boolean inheritable)
throws ServiceAccessException, ObjectNotFoundException,
@@ -166,7 +166,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public void grantPermission(CredentialsToken token,
+ public void grantPermission(SlideToken token,
NodePermission permission)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException {
@@ -205,7 +205,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public void denyPermission(CredentialsToken token, ObjectNode object,
+ public void denyPermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException {
@@ -226,7 +226,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public void denyPermission(CredentialsToken token, ObjectNode object,
+ public void denyPermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action,
boolean inheritable)
throws ServiceAccessException, ObjectNotFoundException,
@@ -247,7 +247,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public void denyPermission(CredentialsToken token,
+ public void denyPermission(SlideToken token,
NodePermission permission)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException {
@@ -271,7 +271,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public void revokePermission(CredentialsToken token, ObjectNode object,
+ public void revokePermission(SlideToken token, ObjectNode object,
SubjectNode subject, ActionNode action)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException {
@@ -297,7 +297,7 @@
* @exception AccessDeniedException The credentials does not grant
* the permission to perform the specified action
*/
- public void checkCredentials(CredentialsToken token, ObjectNode object,
+ public void checkCredentials(SlideToken token, ObjectNode object,
ActionNode action)
throws ServiceAccessException, AccessDeniedException {
try {
@@ -306,17 +306,19 @@
ObjectNode realObject = objectUri.getStore()
.retrieveObject(objectUri);
Uri subjectUri = null;
- subjectUri = namespace.getUri(namespaceConfig.getUsersPath()
- + "/"
- + token.getPublicCredentials());
+ subjectUri =
+ namespace.getUri
+ (namespaceConfig.getUsersPath() + "/"
+ + token.getCredentialsToken().getPublicCredentials());
SubjectNode subject = (SubjectNode) subjectUri
.getStore().retrieveObject(subjectUri);
checkPermission(realObject, subject, action);
}
} catch (ObjectNotFoundException e) {
- throw new AccessDeniedException(object.getUri(),
- token.getPublicCredentials(),
- action.getUri());
+ throw new AccessDeniedException
+ (object.getUri(),
+ token.getCredentialsToken().getPublicCredentials(),
+ action.getUri());
}
}
@@ -410,7 +412,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public Enumeration enumeratePermissions(CredentialsToken token,
+ public Enumeration enumeratePermissions(SlideToken token,
ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException {
@@ -428,7 +430,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public Enumeration enumeratePermissions(CredentialsToken token,
+ public Enumeration enumeratePermissions(SlideToken token,
String object)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException {
@@ -447,7 +449,7 @@
* in the DataSource
* @exception AccessDeniedException Insufficent credentials
*/
- public NodePermissions getPermissions(CredentialsToken token,
+ public NodePermissions getPermissions(SlideToken token,
ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException {
1.2 +22 -5 jakarta-slide/src/share/org/apache/slide/store/StandardStore.java
Index: StandardStore.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/store/StandardStore.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StandardStore.java 2000/11/19 04:18:38 1.1
+++ StandardStore.java 2000/11/25 01:34:54 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/store/StandardStore.java,v 1.1 2000/11/19 04:18:38 remm Exp $
- * $Revision: 1.1 $
- * $Date: 2000/11/19 04:18:38 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/store/StandardStore.java,v 1.2 2000/11/25 01:34:54 remm Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/11/25 01:34:54 $
*
* ====================================================================
*
@@ -80,7 +80,7 @@
* Abstract implementation of a store. Handles all caching operations.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class StandardStore extends ServiceImpl
implements Store {
@@ -315,7 +315,24 @@
/**
- * Does nothing.
+ * Begin a new transaction.
+ *
+ * @exception ServiceAccessException Service access error
+ */
+ public void begin()
+ throws ServiceAccessException {
+
+ lockStore.begin();
+ nodeStore.begin();
+ securityStore.begin();
+ revisionDescriptorsStore.begin();
+ revisionDescriptorStore.begin();
+
+ }
+
+
+ /**
+ * Commit transaction.
*
* @exception ServiceAccessException Service access error
*/
1.5 +12 -12 jakarta-slide/src/share/org/apache/slide/structure/Structure.java
Index: Structure.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/Structure.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Structure.java 2000/09/26 02:44:26 1.4
+++ Structure.java 2000/11/25 01:34:55 1.5
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/Structure.java,v 1.4 2000/09/26 02:44:26 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2000/09/26 02:44:26 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/Structure.java,v 1.5 2000/11/25 01:34:55 remm Exp $
+ * $Revision: 1.5 $
+ * $Date: 2000/11/25 01:34:55 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* Structure helper.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public interface Structure {
@@ -97,7 +97,7 @@
* by the object were not found
* @exception LinkedObjectNotFoundException Cannot happen
*/
- Enumeration getChildren(CredentialsToken token, ObjectNode object)
+ Enumeration getChildren(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
LinkedObjectNotFoundException;
@@ -116,7 +116,7 @@
* @exception AccessDeniedException Credentials token does not
* have permission to perform the action
*/
- ObjectNode getParent(CredentialsToken token, ObjectNode object)
+ ObjectNode getParent(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
LinkedObjectNotFoundException, AccessDeniedException;
@@ -136,7 +136,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- ObjectNode retrieve(CredentialsToken token, String strUri)
+ ObjectNode retrieve(SlideToken token, String strUri)
throws ServiceAccessException, ObjectNotFoundException,
LinkedObjectNotFoundException, AccessDeniedException;
@@ -157,7 +157,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- ObjectNode retrieve(CredentialsToken token, String strUri,
+ ObjectNode retrieve(SlideToken token, String strUri,
boolean translateLastUriElement)
throws ServiceAccessException, ObjectNotFoundException,
LinkedObjectNotFoundException, AccessDeniedException;
@@ -180,7 +180,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- void create(CredentialsToken token, ObjectNode object, String strUri)
+ void create(SlideToken token, ObjectNode object, String strUri)
throws ServiceAccessException, ObjectAlreadyExistsException,
ObjectNotFoundException, LinkedObjectNotFoundException,
AccessDeniedException;
@@ -205,7 +205,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- void createLink(CredentialsToken token, LinkNode link, String linkUri,
+ void createLink(SlideToken token, LinkNode link, String linkUri,
ObjectNode linkedObject)
throws ServiceAccessException, ObjectAlreadyExistsException,
ObjectNotFoundException, LinkedObjectNotFoundException,
@@ -225,7 +225,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- void store(CredentialsToken token, ObjectNode object)
+ void store(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException, LinkedObjectNotFoundException;
@@ -245,7 +245,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- void remove(CredentialsToken token, ObjectNode object)
+ void remove(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
ObjectHasChildrenException, AccessDeniedException,
LinkedObjectNotFoundException;
1.8 +17 -16 jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java
Index: StructureImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- StructureImpl.java 2000/11/19 04:18:38 1.7
+++ StructureImpl.java 2000/11/25 01:34:55 1.8
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.7 2000/11/19 04:18:38 remm Exp $
- * $Revision: 1.7 $
- * $Date: 2000/11/19 04:18:38 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.8 2000/11/25 01:34:55 remm Exp $
+ * $Revision: 1.8 $
+ * $Date: 2000/11/25 01:34:55 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* Data helper class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public final class StructureImpl implements Structure {
@@ -143,7 +143,7 @@
* the object were not found
* @exception LinkedObjectNotFoundException Cannot happen
*/
- public Enumeration getChildren(CredentialsToken token, ObjectNode object)
+ public Enumeration getChildren(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
LinkedObjectNotFoundException {
Enumeration childrenUri = object.enumerateChildren();
@@ -174,7 +174,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- public ObjectNode getParent(CredentialsToken token, ObjectNode object)
+ public ObjectNode getParent(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
LinkedObjectNotFoundException, AccessDeniedException {
String objectUri = object.getUri();
@@ -199,7 +199,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- public ObjectNode retrieve(CredentialsToken token, String strUri)
+ public ObjectNode retrieve(SlideToken token, String strUri)
throws ServiceAccessException, ObjectNotFoundException,
LinkedObjectNotFoundException, AccessDeniedException {
return retrieve(token, strUri, true);
@@ -222,7 +222,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- public ObjectNode retrieve(CredentialsToken token, String strUri,
+ public ObjectNode retrieve(SlideToken token, String strUri,
boolean translateLastUriElement)
throws ServiceAccessException, ObjectNotFoundException,
LinkedObjectNotFoundException, AccessDeniedException {
@@ -344,7 +344,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- public void create(CredentialsToken token, ObjectNode object,
+ public void create(SlideToken token, ObjectNode object,
String strUri)
throws ServiceAccessException, ObjectAlreadyExistsException,
ObjectNotFoundException, LinkedObjectNotFoundException,
@@ -412,8 +412,8 @@
// object in the configuration files.
// This would then be the default behavior.
NodePermission grantedPermission = null;
- String userUri = namespaceConfig.getUsersPath()
- + token.getPublicCredentials();
+ String userUri = namespaceConfig.getUsersPath() + "/"
+ + token.getCredentialsToken().getPublicCredentials();
Domain.info("Checking basic permissions on new object");
/*
try {
@@ -459,8 +459,9 @@
newObject.addPermission(grantedPermission);
}
*/
- Domain.info("Basic permissions granted for user "
- + token.getPublicCredentials());
+ Domain.info
+ ("Basic permissions granted for user "
+ + token.getCredentialsToken().getPublicCredentials());
// Now creating the new object
newObject.setUri(courUri.toString());
@@ -544,7 +545,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- public void createLink(CredentialsToken token, LinkNode link,
+ public void createLink(SlideToken token, LinkNode link,
String linkUri, ObjectNode linkedObject)
throws ServiceAccessException, ObjectAlreadyExistsException,
ObjectNotFoundException, LinkedObjectNotFoundException,
@@ -568,7 +569,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- public void store(CredentialsToken token, ObjectNode object)
+ public void store(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
AccessDeniedException, LinkedObjectNotFoundException {
ObjectNode realObject = retrieve(token, object.getUri(), false);
@@ -595,7 +596,7 @@
* @exception AccessDeniedException Credentials token does not have
* permission to perform the action
*/
- public void remove(CredentialsToken token, ObjectNode object)
+ public void remove(SlideToken token, ObjectNode object)
throws ServiceAccessException, ObjectNotFoundException,
ObjectHasChildrenException, AccessDeniedException,
LinkedObjectNotFoundException {