juergen 01/09/10 02:20:56
Modified: src/share/org/apache/slide/common SlideToken.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.6 +45 -151 jakarta-slide/src/share/org/apache/slide/common/SlideToken.java
Index: SlideToken.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideToken.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SlideToken.java 2001/08/30 14:43:49 1.5
+++ SlideToken.java 2001/09/10 09:20:56 1.6
@@ -1,13 +1,13 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideToken.java,v 1.5
2001/08/30 14:43:49 remm Exp $
- * $Revision: 1.5 $
- * $Date: 2001/08/30 14:43:49 $
+ * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/SlideToken.java,v 1.6
2001/09/10 09:20:56 juergen Exp $
+ * $Revision: 1.6 $
+ * $Date: 2001/09/10 09:20:56 $
*
* ====================================================================
*
* 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 org.apache.slide.common;
@@ -70,248 +70,142 @@
/**
* Slide token class.
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
*/
-public final class SlideToken {
-
+public interface 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() {
- }
-
-
- /**
- * Constructor.
- *
- * @param credentials Credentials stored in this token
- * @param parameters Token parameters
- */
- public SlideToken(CredentialsToken credentialsToken,
- Hashtable parameters) {
- this.credentialsToken = credentialsToken;
- this.parameters = parameters;
- }
-
-
- // ----------------------------------------------------- Instance Variables
-
-
- /**
- * Credentials.
- */
- private CredentialsToken credentialsToken;
- /**
- * CacheInfo.
- */
- private CacheInfoToken cacheInfoToken;
-
-
- /**
- * Use lock tokens for lock resolution.
- */
- private boolean enforceLockTokens = false;
-
-
- /**
- * Always use a transaction for all operations. That will cause Slide to
- * enlist the store in the current transaction for all operations,
- * to be able to prevent dirty reads when doing complex updates.
- */
- private boolean forceStoreEnlistment = false;
-
-
- /**
- * Lock tokens.
- */
- private Hashtable lockTokens = new Hashtable();
-
-
- /**
- * Parameters.
- */
- private Hashtable parameters = new Hashtable();
-
// ------------------------------------------------------------- Properties
/**
* Returns the credentials token.
- *
- * @return String
+ *
+ * @return String
*/
- public CredentialsToken getCredentialsToken() {
- return credentialsToken;
- }
+ public CredentialsToken getCredentialsToken();
/**
* Credentials token mutator.
*/
- public void setCredentialsToken(CredentialsToken credentialsToken) {
- this.credentialsToken = credentialsToken;
- }
+ public void setCredentialsToken(CredentialsToken credentialsToken);
/**
* Returns the CacheInfo token.
- *
- * @return CacheInfoToken
+ *
+ * @return CacheInfoToken
*/
- public CacheInfoToken getCacheInfoToken() {
- return cacheInfoToken;
- }
+ public CacheInfoToken getCacheInfoToken() ;
/**
* CacheInfo token mutator.
*/
- public void setCacheInfoToken(CacheInfoToken cacheInfoToken) {
- this.cacheInfoToken = cacheInfoToken;
- }
+ public void setCacheInfoToken(CacheInfoToken cacheInfoToken) ;
/**
* Use lock tokens in lock resolution ?
- *
+ *
* @return boolean
*/
- public boolean isEnforceLockTokens() {
- return enforceLockTokens;
- }
+ public boolean isEnforceLockTokens() ;
/**
* Enforce lock tokens flag mutator.
- *
+ *
* @param enforceLockTokens New flag value
*/
- public void setEnforceLockTokens(boolean enforceLockTokens) {
- this.enforceLockTokens = enforceLockTokens;
- }
+ public void setEnforceLockTokens(boolean enforceLockTokens) ;
/**
- * Force store enlistment flag accessor. If true, that will cause Slide to
- * enlist the store in the current transaction for all operations,
+ * Force store enlistment flag accessor. If true, that will cause Slide to
+ * enlist the store in the current transaction for all operations,
* to be able to prevent dirty reads when doing complex updates.
- *
+ *
* @return boolean
*/
- public boolean isForceStoreEnlistment() {
- return forceStoreEnlistment;
- }
+ public boolean isForceStoreEnlistment() ;
/**
- * Force store enlistment flag mutator. If set to true, that will cause
- * Slide to enlist the store in the current transaction for all
- * operations, to be able to prevent dirty reads when doing complex
+ * Force store enlistment flag mutator. If set to true, that will cause
+ * Slide to enlist the store in the current transaction for all
+ * operations, to be able to prevent dirty reads when doing complex
* updates. That value should be set to true only in some very specific
* critical sections of the code, as this would greatly decrease the
* ability of Slide to handle multiple concurrent requests.
- *
+ *
* @param forceStoreEnlistment New flag value
*/
- public void setForceStoreEnlistment(boolean forceStoreEnlistment) {
- this.forceStoreEnlistment = forceStoreEnlistment;
- }
+ public void setForceStoreEnlistment(boolean forceStoreEnlistment) ;
/**
* 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);
- }
+ public void addLockToken(String lockId) ;
/**
* Removes a lock token from the lock token list.
- *
+ *
* @param lockToken Lock token to remove
*/
- public void removeLockToken(String lockId) {
- lockTokens.remove(lockId);
- }
+ public void removeLockToken(String lockId) ;
/**
* Clears the lock token list.
*/
- public void clearLockTokens() {
- lockTokens.clear();
- }
+ public void clearLockTokens() ;
/**
* 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);
- }
+ public boolean checkLockToken(String lockToken) ;
/**
* Add a new parameter to the parameter list.
- *
+ *
* @param parameterName Parameter to add
* @param parameterValue Parameter value
*/
- public void addParameter(String parameterName, Object parameterValue) {
- parameters.put(parameterName, parameterValue);
- }
+ public void addParameter(String parameterName, Object parameterValue) ;
/**
* Removes a parameter from the parameter list.
- *
+ *
* @param parameterName Parameter to remove
*/
- public void removeParameter(String parameterName) {
- parameters.remove(parameterName);
- }
+ public void removeParameter(String parameterName) ;
/**
* Clears the parameter list.
*/
- public void clearParameters() {
- parameters.clear();
- }
+ public void clearParameters() ;
/**
* Return parameter list.
*/
- public Enumeration getParameterNames() {
- return parameters.keys();
- }
+ public Enumeration getParameterNames() ;
}