juergen 01/09/10 02:21:17
Modified: src/share/org/apache/slide/common Namespace.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.38 +30 -9 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.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- Namespace.java 2001/08/30 17:26:29 1.37
+++ Namespace.java 2001/09/10 09:21:17 1.38
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.37
2001/08/30 17:26:29 remm Exp $
- * $Revision: 1.37 $
- * $Date: 2001/08/30 17:26:29 $
+ * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.38
2001/09/10 09:21:17 juergen Exp $
+ * $Revision: 1.38 $
+ * $Date: 2001/09/10 09:21:17 $
*
* ====================================================================
*
@@ -94,7 +94,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
* @author Dirk Verbeeck
- * @version $Revision: 1.37 $
+ * @version $Revision: 1.38 $
*/
public final class Namespace {
@@ -163,7 +163,7 @@
/**
* Log channel for logger
*/
- private final static String LOG_CHANNEL = Namespace.class.getName();
+ private final static String LOG_CHANNEL = Namespace.class.getName();
/**
* Logger.
@@ -300,8 +300,8 @@
* @exception ServiceParameterErrorException Incorrect service parameter
* @exception ServiceParameterMissingException Service parameter missing
*/
- public void registerStore(String storeName, Class storeClass,
- Hashtable parameters, Scope scope,
+ public void registerStore(String storeName, Class storeClass,
+ Hashtable parameters, Scope scope,
Hashtable childStores)
throws ServiceRegistrationFailedException,
ServiceParameterErrorException, ServiceParameterMissingException {
@@ -556,7 +556,7 @@
/**
- * Builds a new uri object to access this namespace. This call will
+ * Builds a new uri object to access this namespace. This call will
* return a Uri which doesn't have its token field set. The store should
* accept such Uri as valid, and bypass any check that is made based on the
* state.
@@ -577,6 +577,21 @@
* @return Uri
*/
public Uri getUri(SlideToken token, String uri) {
+ return getUri(token, uri, token==null
+ ?false
+ :token.isForceStoreEnlistment());
+ }
+
+
+ /**
+ * Builds a new uri object to access this namespace.
+ *
+ * @param token SlideToken
+ * @param uri Requested Uri
+ * @param forcedEnlistment may differ from the value set in token
+ * @return Uri
+ */
+ public Uri getUri(SlideToken token, String uri, boolean forcedEnlistment) {
Uri result = null;
Object temp = null;
@@ -594,6 +609,12 @@
result.setToken(token);
}
+ // if a different forceEnlistment value want to be used
+ // wrap the used token to reflect the different value
+ if (token != null && token.isForceStoreEnlistment() != forcedEnlistment) {
+ result.setToken(new SlideTokenWrapper(token, forcedEnlistment));
+ }
+
return result;
}
@@ -716,7 +737,7 @@
getLogger().log("Import data into namespace " +
getName(),LOG_CHANNEL,Logger.INFO);
token.importData
- (new SlideToken(new CredentialsToken(new String("/"))),
+ (new SlideTokenImpl(new CredentialsToken(new String("/"))),
namespaceBaseDataDefinition);
// end the transaction, NOTE some operations are outside this TA