[Mulgara-svn] r468 - branches/nw-interface/src/jar/itql/java/org/mulgara/itql
pag at mulgara.org
pag at mulgara.org
Wed Oct 10 21:04:14 UTC 2007
Author: pag
Date: 2007-10-10 16:04:14 -0500 (Wed, 10 Oct 2007)
New Revision: 468
Modified:
branches/nw-interface/src/jar/itql/java/org/mulgara/itql/TqlAutoInterpreter.java
Log:
Need to expose some internal mechanisms to enable old behaviour of ItqlInterpreterBean
Modified: branches/nw-interface/src/jar/itql/java/org/mulgara/itql/TqlAutoInterpreter.java
===================================================================
--- branches/nw-interface/src/jar/itql/java/org/mulgara/itql/TqlAutoInterpreter.java 2007-10-10 20:28:35 UTC (rev 467)
+++ branches/nw-interface/src/jar/itql/java/org/mulgara/itql/TqlAutoInterpreter.java 2007-10-10 21:04:14 UTC (rev 468)
@@ -14,6 +14,7 @@
import java.net.URI;
import java.util.Collection;
import java.util.LinkedList;
+import java.util.Map;
import org.apache.log4j.Logger;
import org.mulgara.connection.Connection;
@@ -38,7 +39,8 @@
public class TqlAutoInterpreter {
/** The logger. */
private final static Logger logger = Logger.getLogger(TqlAutoInterpreter.class.getName());
-
+
+ /** A connection for receiving state changes to the local machine. */
private static Connection localStateConnection = new DummyConnection();
/** The parser and AST builder for commands. */
@@ -61,6 +63,13 @@
/** All the connections involved in the current transaction. */
private Collection<Connection> transConnections = new LinkedList<Connection>();
+
+ /**
+ * Holds the client security domain. Need to connect this to URIs,
+ * but the old interfaces don't know how to do this.
+ * <em>Security is currently unimplemented.</em>
+ */
+ private URI securityDomain = null;
/**
* Creates a new autointerpreter with no prior connections.
@@ -103,8 +112,28 @@
// test if the command wants the user to quit - return false if it does
return !(cmd.isLocalOperation() && ((LocalCommand)cmd).isQuitCommand());
}
+
+
+ /**
+ * Sets the security domain for the client.
+ * <em>Security is currently unimplemented.</em>
+ * @param domain The URI of the service which authenticates the client.
+ * e.g. ldap://ldap.domain.net/o=mycompany
+ */
+ public void setSecurityDomain(URI domain) {
+ securityDomain = domain;
+ }
+
+ /**
+ * Query for the currently used security domain.
+ * <em>Security is currently unimplemented.</em>
+ */
+ public URI getSecurityDomain() {
+ return securityDomain;
+ }
+
/**
* Perform any actions required on the update of the state of a connection.
* @param conn The connection whose state needs checking.
@@ -170,12 +199,14 @@
/**
* Returns a connection to the server with the given URI.
+ * NB: Not for general use. Available to ItqlInterpreterBean only to support
+ * legacy requests to get a session.
* @param serverUri The URI for the server to get a connection to.
* @return A connection to the server, cached if available.
* @throws ConnectionException It was not possible to create a connection to the described server.
* @throws QueryException There is a transaction underway, but the new connection cannot turn off autocommit.
*/
- private Connection establishConnection(URI serverUri) throws ConnectionException, QueryException {
+ Connection establishConnection(URI serverUri) throws ConnectionException, QueryException {
Connection connection = (serverUri == null) ? localStateConnection : connectionFactory.newConnection(serverUri);
// If in a transaction, turn off autocommit
if (inTransaction && connection.getAutoCommit()) {
@@ -185,4 +216,17 @@
}
return connection;
}
+
+
+ /**
+ * Returns the current alias map. Needs to treat the internal interpreter
+ * explicitly as a TqlInterpreter.
+ * @deprecated Available to ItqlInterpreterBean only to support legacy requests.
+ * @return The mapping of namespaces to the URI for that space.
+ */
+ Map<String,URI> getAliasesInUse() {
+ return ((TqlInterpreter)interpreter).getAliasMap();
+ }
+
+
}
More information about the Mulgara-svn
mailing list