Author: rareddy
Date: 2009-07-02 15:57:16 -0400 (Thu, 02 Jul 2009)
New Revision: 1093
Added:
trunk/adminshell/src/main/java/org/
trunk/adminshell/src/main/java/org/teiid/
trunk/adminshell/src/main/java/org/teiid/AdminShell.java
trunk/build/assembly/adminshell/
trunk/build/assembly/adminshell/adminshell-dependencies.xml
trunk/build/assembly/adminshell/adminshell-dist.xml
trunk/build/assembly/client-jar.xml
trunk/build/kit-adminshell/
trunk/build/kit-adminshell/COPYRIGHT.txt
trunk/build/kit-adminshell/LICENSE-lgpl-2.1.txt
trunk/build/kit-adminshell/adminshell.bat
trunk/build/kit-adminshell/adminshell.sh
trunk/build/kit-adminshell/connection.properties
trunk/engine/src/main/java/com/metamatrix/dqp/service/ServerConnectionListener.java
Removed:
trunk/adminshell/src/main/java/com/metamatrix/script/shell/MMAdmin.java
trunk/adminshell/src/main/resources/scripts/dqp.bsh
trunk/adminshell/src/main/resources/scripts/dqpadmin.bsh
trunk/adminshell/src/main/resources/scripts/serveradmin.bsh
trunk/build/assembly/embedded/embedded-client-jar.xml
trunk/build/assembly/server/
trunk/build/kit-server/
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionListener.java
Modified:
trunk/adminshell/src/main/resources/commands/load.bsh
trunk/adminshell/src/main/resources/commands/printBanner.bsh
trunk/adminshell/src/main/resources/scripts/adminapi.bsh
trunk/adminshell/src/main/resources/scripts/server.bsh
trunk/adminshell/src/main/resources/scripts/util.bsh
trunk/build/kit-embedded/bin/run.bat
trunk/build/kit-embedded/bin/run.sh
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDriver.java
trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidDriver.java
trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
trunk/client/src/main/java/org/teiid/adminapi/Admin.java
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServiceRegistry.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPRuntimeStateAdminImpl.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPSecurityAdminImpl.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java
trunk/embedded/src/main/java/com/metamatrix/platform/security/authorization/service/AuthorizationServiceImpl.java
trunk/embedded/src/main/java/org/teiid/transport/LocalServerConnection.java
trunk/embedded/src/main/java/org/teiid/transport/LogonImpl.java
trunk/embedded/src/test/java/org/teiid/transport/TestCommSockets.java
trunk/embedded/src/test/java/org/teiid/transport/TestLogonImpl.java
trunk/engine/src/main/java/com/metamatrix/dqp/service/ConfigurationService.java
trunk/pom.xml
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
Log:
TEIID-698, TEIID-697: Adding the AdminShell kit to the build. Fixing the error with
session reporting through Admin API. Making the session tracking common between embedded
and server.
Deleted: trunk/adminshell/src/main/java/com/metamatrix/script/shell/MMAdmin.java
===================================================================
--- trunk/adminshell/src/main/java/com/metamatrix/script/shell/MMAdmin.java 2009-07-01
19:04:52 UTC (rev 1092)
+++ trunk/adminshell/src/main/java/com/metamatrix/script/shell/MMAdmin.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.script.shell;
-
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintStream;
-
-import bsh.Capabilities;
-import bsh.EvalError;
-import bsh.Interpreter;
-
-
-/**
- * Invokes the BeanShell window, specifically designed for the metamatrix purposes.
- * The difference with this shell is, it will plug in a customer parser on top the
- * BeanShell, and load up all the MetaMatrix commands.
- */
-public class MMAdmin {
-
- public static void main( String args[] ) throws IOException {
-
- boolean gui = Boolean.getBoolean("gui"); //$NON-NLS-1$
- System.setProperty("metamatrix.config.none", "true");
//$NON-NLS-1$ //$NON-NLS-2$
-
- if (args.length == 0) {
- if ( !Capabilities.classExists( "bsh.util.Util" ) ) //$NON-NLS-1$
- System.out.println("Can't find the BeanShell
utilities..."); //$NON-NLS-1$
-
- FileWriter logger = new FileWriter("adminscript.txt", true);
//$NON-NLS-1$
- PrintStream out = new FilePrintStream(System.out, "mmadmin.log");
//$NON-NLS-1$
-
- try {
- SimpleParser p = new SimpleParser();
- Interpreter interpreter = new Interpreter(new ReaderInterceptor(p,
logger), out, out, true);
- interpreter.eval("importCommands(\"commands\")");
//$NON-NLS-1$
- interpreter.eval("load(\"server\")"); //$NON-NLS-1$
-
- p.setInterpreter(interpreter);
-
- if (Capabilities.haveSwing() && gui) {
- //bsh.util.Util.startSplashScreen();
- interpreter.eval("desktop()"); //$NON-NLS-1$
- interpreter.getOut().flush();
- } else {
- interpreter.run();
- }
- } catch ( EvalError e ) {
- System.err.println("Couldn't start desktop: "+e);
//$NON-NLS-1$
- } finally {
- logger.close();
- out.close();
- }
- }
- else {
- // If we running a script file run as it is
- Interpreter.main(args);
- }
- }
-
-}
Copied: trunk/adminshell/src/main/java/org/teiid/AdminShell.java (from rev 1089,
trunk/adminshell/src/main/java/com/metamatrix/script/shell/MMAdmin.java)
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/AdminShell.java (rev
0)
+++ trunk/adminshell/src/main/java/org/teiid/AdminShell.java 2009-07-02 19:57:16 UTC (rev
1093)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintStream;
+
+import bsh.Capabilities;
+import bsh.EvalError;
+import bsh.Interpreter;
+
+import com.metamatrix.script.shell.FilePrintStream;
+import com.metamatrix.script.shell.ReaderInterceptor;
+import com.metamatrix.script.shell.SimpleParser;
+
+
+/**
+ * Invokes the BeanShell window, specifically designed for the metamatrix purposes.
+ * The difference with this shell is, it will plug in a customer parser on top the
+ * BeanShell, and load up all the MetaMatrix commands.
+ */
+public class AdminShell {
+
+ public static void main( String args[] ) throws IOException {
+
+ boolean gui = Boolean.getBoolean("gui"); //$NON-NLS-1$
+
+ if (args.length == 0) {
+ if ( !Capabilities.classExists( "bsh.util.Util" ) ) //$NON-NLS-1$
+ System.out.println("Can't find the BeanShell
utilities..."); //$NON-NLS-1$
+
+ String teiidHome = System.getenv("TEIID_HOME"); //$NON-NLS-1$
+ if (teiidHome == null) {
+ teiidHome = System.getProperty("user.dir"); //$NON-NLS-1$
+ }
+ File logDir = new File(teiidHome, "log"); //$NON-NLS-1$
+ if (!logDir.exists()) {
+ logDir.mkdirs();
+ }
+
+ FileWriter logger = new
FileWriter(teiidHome+"/log/adminscript.txt", true); //$NON-NLS-1$
+ PrintStream out = new FilePrintStream(System.out,
teiidHome+"/log/adminshell.log"); //$NON-NLS-1$
+
+ try {
+ SimpleParser p = new SimpleParser();
+ Interpreter interpreter = new Interpreter(new ReaderInterceptor(p,
logger), out, out, true);
+ interpreter.eval("importCommands(\"commands\")");
//$NON-NLS-1$
+ interpreter.eval("load(\"server\")"); //$NON-NLS-1$
+
+ p.setInterpreter(interpreter);
+
+ if (Capabilities.haveSwing() && gui) {
+ //bsh.util.Util.startSplashScreen();
+ interpreter.eval("desktop()"); //$NON-NLS-1$
+ interpreter.getOut().flush();
+ } else {
+ interpreter.run();
+ }
+ } catch ( EvalError e ) {
+ System.err.println("Couldn't start desktop: "+e);
//$NON-NLS-1$
+ } finally {
+ logger.close();
+ out.close();
+ }
+ }
+ else {
+ // If we running a script file run as it is
+ Interpreter.main(args);
+ }
+ }
+
+}
Modified: trunk/adminshell/src/main/resources/commands/load.bsh
===================================================================
--- trunk/adminshell/src/main/resources/commands/load.bsh 2009-07-01 19:04:52 UTC (rev
1092)
+++ trunk/adminshell/src/main/resources/commands/load.bsh 2009-07-02 19:57:16 UTC (rev
1093)
@@ -12,17 +12,7 @@
sourceInto( getResource("/scripts/context.bsh"), this.caller.namespace );
sourceInto( getResource("/scripts/assert.bsh"), this.caller.namespace );
sourceInto( getResource("/scripts/util.bsh"), this.caller.namespace );
-
- // DQP and server modules
- if (module.equalsIgnoreCase("dqp")) {
- //print("loading module: dqp...");
- sourceInto( getResource("/scripts/dqp.bsh"), this.caller.namespace );
- } else if (module.equalsIgnoreCase("server")) {
- //print("loading module: server...");
- sourceInto( getResource("/scripts/server.bsh"), this.caller.namespace
);
- } else {
- print("unknown module: "+module);
- }
+ sourceInto( getResource("/scripts/server.bsh"), this.caller.namespace );
}
Modified: trunk/adminshell/src/main/resources/commands/printBanner.bsh
===================================================================
--- trunk/adminshell/src/main/resources/commands/printBanner.bsh 2009-07-01 19:04:52 UTC
(rev 1092)
+++ trunk/adminshell/src/main/resources/commands/printBanner.bsh 2009-07-02 19:57:16 UTC
(rev 1093)
@@ -24,12 +24,13 @@
jconsole.println();
} else {
- print("**********************************************************************");
- print(" You are running Admin Shell in interactive mode. To see all ");
- print(" the commands available type 'help();' or 'exit();' to exit
the shell.");
- print(" Note: Every comand MUST end with semi-colon [;] and are ");
- print(" always in form 'command([param]*?);'");
- print("**********************************************************************");
+ print("======================================================================");
+ print(" You are running AdminShell in interactive mode. To see all ");
+ print(" the available commands type 'help();' or 'exit();' to
exit the shell.");
+ print("\n");
+ print(" Tip: All comands MUST end with semi-colon [;] and are in the
form");
+ print(" 'command([param]*?);' then followed by ENTER");
+ print("======================================================================");
print("\n\n");
}
}
Modified: trunk/adminshell/src/main/resources/scripts/adminapi.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2009-07-01 19:04:52 UTC (rev
1092)
+++ trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2009-07-02 19:57:16 UTC (rev
1093)
@@ -1,8 +1,4 @@
-import com.metamatrix.admin.api.core.*;
-import com.metamatrix.admin.api.objects.*;
-import com.metamatrix.admin.api.embedded.*;
-import com.metamatrix.admin.api.exception.*;
-import com.metamatrix.admin.objects.*;
+import org.teiid.adminapi.*;
import com.metamatrix.core.util.ObjectConverterUtil;
@@ -552,9 +548,9 @@
* The unique identifier for for an {@link AdminObject}.
* @param className
* The class name of the sub-interface of {@link AdminObject} you are setting
the property for.
- * All of these sub-interfaces are in package
<code>com.metamatrix.admin.api.objects</code>.
+ * All of these sub-interfaces are in package
<code>org.teiid.adminapi</code>.
* You may specify either the fully-qualified or unqualified classname.
- * For example "ConnectorBinding" or
"com.metamatrix.admin.api.objects.ConnectorBinding".
+ * For example "ConnectorBinding" or
"org.teiid.adminapi.ConnectorBinding".
* @param propertyName
* String Property key
* @param propertyValue
@@ -576,9 +572,9 @@
* The unique identifier for for an {@link AdminObject}.
* @param className
* The class name of the sub-interface of {@link AdminObject} you are setting
the property for.
- * All of these sub-interfaces are in package
<code>com.metamatrix.admin.api.objects</code>.
+ * All of these sub-interfaces are in package
<code>org.teiid.adminapi</code>.
* You may specify either the fully-qualified or unqualified classname.
- * For example "ConnectorBinding" or
"com.metamatrix.admin.api.objects.ConnectorBinding".
+ * For example "ConnectorBinding" or
"org.teiid.adminapi.ConnectorBinding".
* @param properties
* Properties to set.
* @throws AdminException
@@ -680,8 +676,28 @@
}
+/**
+ * Assign {@link ConnectorBinding}s to a {@link VDB}'s Model. If the supplied model
does not
+ * support MultiSource bindings, then only the first binding in the supplied array is
assigned and
+ * the remainder are ignored.
+ *
+ * @param connectorBindingNames
+ * Names of the ConnectorBindings
+ * @param vdbName
+ * Name of the VDB
+ * @param vdbVersion
+ * Version of the VDB
+ * @param modelName
+ * Name of the Model to map Connector Bindings
+ * @throws AdminException
+ * if there's a system error or if there's a user input error.
+ */
+void assignBindingsToModel(String[] connectorBindingNames, String vdbName, String
vdbVersion, String modelName) {
+ debug("Assigning the bindings to model");
+ checkAdmin();
+ currentContext().internalAdmin.assignBindingsToModel(connectorBindingNames, vdbName,
vdbVersion, modelName);
+}
-
//
*********************************************************************************************
// Monitor Methods
//
@@ -937,6 +953,22 @@
return result;
}
+/**
+ * Get the processes that correspond to the specified identifier pattern.
+ *
+ * @param processIdentifier the unique identifier for for a {@link
org.teiid.adminapi.ProcessObject ProcessObject}
+ * in the system or "{@link org.teiid.adminapi.AdminObject#DELIMITER
DELIMITER}"
+ * if all Processes are desired.
+ * @return Collection of {@link org.teiid.adminapi.ProcessObject ProcessObject}
+ * @throws AdminException if there's a system error.
+ * @since 4.3
+ */
+Collection getProcesses(String processIdentifier) {
+ checkAdmin();
+ result =currentContext().internalAdmin.getProcesses(processIdentifier);
+ debug(result);
+ return result;
+}
@@ -949,7 +981,7 @@
/**
* Start Connector Binding
*
- * @param connectorBindingIdentifier identifier for {@link
com.metamatrix.admin.api.objects.ConnectorBinding}
+ * @param connectorBindingIdentifier identifier for {@link
org.teiid.adminapi.ConnectorBinding}
* <ul>
* <li> <code>"*"</code> - for all connector bindings in
the system
* <li> <code>"name*"</code> - for all connector
bindings that begin with given name
@@ -967,7 +999,7 @@
/**
* Stop Connector Binding
*
- * @param connectorBindingIdentifier identifier for {@link
com.metamatrix.admin.api.objects.ConnectorBinding}
+ * @param connectorBindingIdentifier identifier for {@link
org.teiid.adminapi.ConnectorBinding}
* <ul>
* <li> <code>"*"</code> - for all connector bindings in
the system
* <li> <code>"name*"</code> - for all connector
bindings that begin with given name
@@ -984,7 +1016,7 @@
/**
* Clear the cache or caches specified by the cacheIdentifier.
- * @param cacheIdentifier Cache name identifier {@link
com.metamatrix.admin.api.objects.Cache}.
+ * @param cacheIdentifier Cache name identifier {@link org.teiid.adminapi.Cache}.
* No wild cards currently supported, must be explicit
* @throws AdminException if there's a system error.
* @since 4.3
@@ -997,7 +1029,7 @@
/**
* Terminate the Session
*
- * @param identifier Session Idenitfier {@link
com.metamatrix.admin.api.objects.Session}.
+ * @param identifier Session Idenitfier {@link org.teiid.adminapi.Session}.
* No wild cards currently supported, must be explicit
* @throws AdminException if there's a system error.
* @since 4.3
@@ -1011,7 +1043,7 @@
/**
* Cancel Request
*
- * @param identifier The request identifer defined by {@link
com.metamatrix.admin.api.objects.Request}
+ * @param identifier The request identifer defined by {@link
org.teiid.adminapi.Request}
* No wild cards currently supported, must be explicit
* @throws AdminException if there's a system error.
* @since 4.3
@@ -1025,7 +1057,7 @@
/**
* Cancel Source Request
*
- * @param identifier The request identifer defined by {@link
com.metamatrix.admin.api.objects.Request}
+ * @param identifier The request identifer defined by {@link
org.teiid.adminapi.Request}
* No wild cards currently supported, must be explicit
* @throws AdminException if there's a system error.
* @since 4.3
@@ -1087,6 +1119,241 @@
}
/**
+ * Set the log listener to install into MM Query. This log listener will receive all log
messages
+ * written by the MM Query at it's current log level and log contexts.
+ *
+ * @param listener The listener component
+ * @throws AdminException if there's a system error.
+ * @since 4.3
+ */
+void setLogListener(EmbeddedLogger listener) {
+ checkAdmin();
+ currentContext().internalAdmin.setLogListener(listener);
+}
+
+/**
+ * Stop the MM Query. If millisToWait is >0, then close to incoming queries, wait the
time period
+ * for work to stop, then stop the MM Query. Otherwise, stop immediately, aborting all
running queries.
+ * the current connection will be disconnected.
+ * @param millisToWait Milliseconds to wait (if >0) or <=0 for no wait before
stopping
+ * @throws AdminException
+ * @since 4.3
+ */
+void shutdown(int millisToWait) {
+ checkAdmin();
+ currentContext().internalAdmin.shutdown(millisToWait);
+ disconnect();
+}
+
+/**
+ * Restart System; the current connection will be disconnected.
+ * @throws AdminException if there's a system error.
+ * @since 4.3
+ */
+void restart() {
+ checkAdmin();
+ currentContext().internalAdmin.restart();
+ disconnect();
+}
+
+//*********************************************************************************************
+// Security Methods
+//
+//*********************************************************************************************
+
+/**
+ * Get the Collection of administrative role names possessed by the given group, if any.
+ *
+ * @param groupIdentifier
+ * The unique identifier for the {@link Group}. This is group name. A user is
a {@link Principal} and a
+ * Principal name is considered to be unique throughout the MetaMatrix system
across all Membership domains.
+ * The {@link AdminObject#WILDCARD WILDCARD} cannot be used here.
+ * @return The Collection of {@link Role}s.
+ * @throws AdminException
+ * if there's a system error.
+ * @since 4.3
+ */
+Collection getRolesForGroup(String groupIdentifier) {
+ checkAdmin();
+ result = currentContext().internalAdmin.getRolesForGroup(groupIdentifier);
+ debug(result);
+ return result;
+}
+
+/**
+ * Get the group memberships for the given user.
+ *
+ * @param userIdentifier
+ * The unique identifier for the {@link User}. This is generally a user name.
A user is a {@link Principal} and a
+ * Principal name is considered to be unique throughout the MetaMatrix system
across all Membership domains.
+ * The {@link AdminObject#WILDCARD WILDCARD} cannot be used here.
+ * @return The collection of groups in which the given user has membership.
+ * @throws AdminException
+ * if there's a system error.
+ * @since 4.3
+ */
+Collection getGroupsForUser(String userIdentifier) {
+ checkAdmin();
+ result = currentContext().internalAdmin.getGroupsForUser(userIdentifier);
+ debug(result);
+ return result;
+}
+
+/**
+ * Get the group denoted by the given <code>groupIdentifier</code>.
+ *
+ * @param groupIdentifier
+ * The unique identifier for the {@link Group}. This is generally a group
name. A group is a {@link Principal} and
+ * a Principal name is considered to be unique throughout the MetaMatrix
system across all Membership domains. <br>
+ * Note that by supplying the {@link AdminObject#WILDCARD WILDCARD}
identifier, all all users in the system will
+ * retrieved.</br>
+ * @return The Collection of users.
+ * @throws AdminException
+ * if there's a system error.
+ * @since 4.3
+ */
+Collection getGroups(String groupIdentifier) {
+ checkAdmin();
+ result = currentContext().internalAdmin.getGroups(groupIdentifier);
+ debug(result);
+ return result;
+}
+
+/**
+ * Assign to the given {@link Group} the given Administrative Role.
+ *
+ * @param roleIdentifier
+ * one of {@link AdminRoles}.
+ * @param groupIdentifier
+ * the unique identifier for the Principal. The {@link AdminObject#WILDCARD
WILDCARD} cannot be used here.
+ * @throws AdminException
+ * if there's a system error.
+ * @since 4.3
+ */
+void assignRoleToGroup(String roleIdentifier, String groupIdentifier) {
+ checkAdmin();
+ currentContext().internalAdmin.assignRoleToGroup(roleIdentifier, groupIdentifier);
+}
+
+/**
+ * Remove an administrative role from the given {@link Group}.
+ *
+ * @param roleIdentifier
+ * one of {@link AdminRoles}
+ * @param groupIdentifier
+ * the unique identifier for the Principal. The {@link AdminObject#WILDCARD
WILDCARD} cannot be used here.
+ * @throws AdminException
+ * if there's a system error.
+ * @since 4.3
+ */
+void removeRoleFromGroup(String roleIdentifier, String groupIdentifier) {
+ checkAdmin();
+ currentContext().internalAdmin.removeRoleFromGroup(roleIdentifier, groupIdentifier);
+}
+
+
+/**
+ * Import the data Roles for given vdb and version into the connected server
+ * @param vdbName - target name of the VDB, the roles to be imported under
+ * @param vdbVersion - target version of the vdb, the roles to be imported under
+ * @param filename - character data array containing the XML file which defines the roles
+ * @param options - options to overwrite in case the matching roles already exist.
+ * @throws AdminException
+ */
+void importDataRoles(String vdbName, String vdbVersion, String filename, int options) {
+ checkAdmin();
+ currentContext().internalAdmin.importDataRoles(vdbName, vdbVersion,
readTextFile(filename), new AdminOptions(options));
+}
+
+/**
+ * Import the data Roles for given vdb and version into the connected server
+ * @param vdbName - target name of the VDB, the roles to be imported under
+ * @param vdbVersion - target version of the vdb, the roles to be imported under
+ * @param filename - character data array containing the XML file which defines the roles
+ * @throws AdminException
+ */
+void importDataRoles(String vdbName, String vdbVersion, String filename) {
+ checkAdmin();
+ currentContext().internalAdmin.importDataRoles(vdbName, vdbVersion,
readTextFile(filename), null);
+}
+
+
+/**
+ * Export the data roles defined for the given vdb fromthe current system
+ * @param vdbName - Name of the vdb
+ * @param vdbVersion - version of the vdb
+ * @param filename - name of the file to export the contents under.
+ * @return - char[] stream containing the XML contents of the roles.
+ * @throws AdminException
+ */
+void exportDataRoles(String vdbName, String vdbVersion, String fileName) {
+ checkAdmin();
+ contents = currentContext().internalAdmin.exportDataRoles(vdbName, vdbVersion);
+ if (contents != null) {
+ ObjectConverterUtil.write(contents, fileName);
+ }
+ else {
+ throw new AdminProcessingException("Data roles not found for VDB "+
vdbName + " with version "+ vdbVersion);
+ }
+}
+
+
+/**
+ * @param domainprovidername is the name to be assigned to the newly created {@link
AuthenticationProvider}
+ * @param providertypename is the type of provider to create.
+ * There are 3 installed provider types and they are:
+ * <ul>
+ * <li> <code>File Membership Domain Provider</code>
+ * <li> <code>LDAP Membership Domain Provider</code>
+ * <li><code>Custom Membership Domain Provider</code>
+ * </ul>
+ * @param properties are the settings specified by the providertype to be used
+ * @throws AdminException
+ * if there's a system error.
+ * @since 5.5.2
+
+void addAuthorizationProvider(String domainprovidername, String providertypename,
Properties properties) {
+ checkAdmin();
+ currentContext().internalAdmin.addAuthorizationProvider(domainprovidername,
providertypename, properties);
+}
+ */
+
+/**
+ * Returns the active authorization provider domain names, in authentication order.
+ * @return List<String>
+ * @throws AdminException
+ */
+List getDomainNames() {
+ checkAdmin();
+ result = currentContext().internalAdmin.getDomainNames();
+ debug(result);
+ return result;
+}
+
+
+
+/**
+ * Return the {@link Group}s for a given domain. The domain name must be an specified
+ * exactly. See {@link #getActiveDomainNames()} for possible domain names.
+ * @param domainName
+ * @return
+ * @throws AdminException
+ */
+Collection getGroupsForDomain(String domainName){
+ checkAdmin();
+ result = currentContext().internalAdmin.getGroupsForDomain(domainName);
+ debug(result);
+ return result;
+}
+
+
+//*********************************************************************************************
+// Utility Methods
+//
+//*********************************************************************************************
+
+
+/**
* Checks to make sure the given VDB exists in the system
* @param vdbName - name of the VDB
* @return boolean - true if exists; false otherwise
Deleted: trunk/adminshell/src/main/resources/scripts/dqp.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/dqp.bsh 2009-07-01 19:04:52 UTC (rev
1092)
+++ trunk/adminshell/src/main/resources/scripts/dqp.bsh 2009-07-02 19:57:16 UTC (rev
1093)
@@ -1,90 +0,0 @@
-/**
- * This is connection helper to a MetaMatrix DQP using JDBC
- */
-source(getResource("/scripts/jdbc.bsh"));
-source(getResource("/scripts/dqpadmin.bsh"));
-
-import java.sql.*;
-import java.io.*;
-import java.util.Properties;
-import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
-
-/**
- * Connect to DQP
- * @param vdbName - Name of the VDB to connect
- * @param propFile - Properties file
- */
-Connection connect(String vdbName, String propFile) throws SQLException {
- connectDQP(vdbName, propFile);
-}
-
-/**
- * Connect to a DQP.
- * @param url - complete dqp url
- */
-Connection connect(String url) throws SQLException {
- com.metamatrix.jdbc.api.Connection mmConn =
connectDriver("com.metamatrix.jdbc.EmbeddedDriver", url);
- currentContext().internalAdmin = mmConn.getAdminAPI();
- currentContext().internalPrompt = "DQP:" + extractVDBName(url) + "$
";
-
- return mmConn;
-}
-
-
-private Connection connectDQP(String vdbName, String vdbVersion, String configFile)
throws SQLException {
- if(vdbName == null) {
- throw new SQLException("VDB name is null");
- }
- if(configFile == null) {
- throw new SQLException("DQP config file is null");
- }
-
- String url = "jdbc:metamatrix:" + vdbName + "@" + configFile;
- if(vdbVersion != null) {
- url += ";version=" + vdbVersion;
- }
-
- c = connect(url);
- currentContext().internalPrompt = "DQP:"+vdbName+"$ ";
- return c;
-}
-
-private Connection connectDQP(String vdbName, String configFile) throws SQLException {
- return connectDQP(vdbName, null, configFile);
-}
-
-/**
- * Disconnect the connection from the server
- */
-void disconnect() {
- closeConnection();
-}
-
-
-//help methods
-
-/**
- * List all of the methods currently available.
- */
-void help() {
- java.util.List urls = new ArrayList();
- urls.add(getResource("/scripts/adminapi.bsh"));
- urls.add(getResource("/scripts/dqpadmin.bsh"));
- urls.add(getResource("/scripts/dqp.bsh"));
- help(urls);
-}
-
-
-/**
- * List the javadoc for method(s) with the specified name.
- *
- * @param methodName
- * Name of the method for which to specify javadoc.
- */
-void help(String methodName) {
- java.util.List urls = new ArrayList();
- urls.add(getResource("/scripts/adminapi.bsh"));
- urls.add(getResource("/scripts/dqpadmin.bsh"));
- urls.add(getResource("/scripts/dqp.bsh"));
- help(urls, methodName);
-}
\ No newline at end of file
Deleted: trunk/adminshell/src/main/resources/scripts/dqpadmin.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/dqpadmin.bsh 2009-07-01 19:04:52 UTC (rev
1092)
+++ trunk/adminshell/src/main/resources/scripts/dqpadmin.bsh 2009-07-02 19:57:16 UTC (rev
1093)
@@ -1,49 +0,0 @@
-source(getResource("/scripts/adminapi.bsh"));
-
-import java.sql.*;
-import java.io.*;
-import java.util.Properties;
-import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
-
-
-//*********************************************************************************************
-//Runtime Methods
-//
-//*********************************************************************************************
-
-/**
- * Stop the DQP. If millisToWait is >0, then close to incoming queries, wait the time
period
- * for work to stop, then stop the DQP. Otherwise, stop immediately, aborting all
running queries.
- * @param millisToWait Milliseconds to wait (if >0) or <=0 for no wait before
stopping
- * @throws AdminException
- * @since 4.3
- */
-void stopDQP(int millisToWait) {
- debug("Stopping DQP in " + vdbFile + " milli seconds.");
- checkAdmin();
- currentContext().internalAdmin.stop(millisToWait);
-}
-
-/**
- * Restart DQP
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-void restartDQP() {
- debug("Restarting DQP.");
- checkAdmin();
- currentContext().internalAdmin.restart();
-}
-
-/**
- * Set the log listener to install into the DQP. This log listener will receive all log
messages
- * written by the DPQ at it's current log level and log contexts.
- *
- * @param listener The listener component
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-void setDQPLogListener(EmbeddedLogger listener) {
- checkAdmin();
- currentContext().internalAdmin.setLogListener(listener);
-}
Modified: trunk/adminshell/src/main/resources/scripts/server.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/server.bsh 2009-07-01 19:04:52 UTC (rev
1092)
+++ trunk/adminshell/src/main/resources/scripts/server.bsh 2009-07-02 19:57:16 UTC (rev
1093)
@@ -3,7 +3,7 @@
*/
source(getResource("/scripts/jdbc.bsh"));
-source(getResource("/scripts/serveradmin.bsh"));
+source(getResource("/scripts/adminapi.bsh"));
import java.sql.*;
@@ -12,12 +12,13 @@
// "connection.properties" those values will replace one below
String user_host = InetAddress.getLocalHost().getHostName();
int user_port = 31000;
-String user_id = "metamatrixadmin";
-String user_pwd = "mm";
+String user_id = "admin";
+String user_pwd = "teiid";
String user_protocol = "mm:"; // colon is important
-String user_driver = "com.metamatrix.jdbc.MMDriver";
-String user_vdb = "BQT";
+String user_driver = "org.teiid.jdbc.TeiidDriver";
+String user_vdb = "admin";
user_optional_url="";
+String connection_prefix="conn";
/**
* Connect to the server using the properties specified in the connection.properties
file.
@@ -40,7 +41,7 @@
Connection connect (String host, int port, String vdb, String user, String password,
String optional_url) {
String contextName = genConnectionName();
newContext(contextName);
- String url =
"jdbc:metamatrix:"+vdb+"@"+user_protocol+"//"+host+":"+port+";user="+user+";password="+password+";ApplicationName="+contextName;
+ String url =
"jdbc:teiid:"+vdb+"@"+user_protocol+"//"+host+":"+port+";user="+user+";password="+password+";ApplicationName="+contextName;
if (optional_url != null && optional_url.length() > 0) {
url = url + ";" + optional_url;
}
@@ -50,6 +51,12 @@
return mmConn;
}
+Connection connectEmbedded(String url) throws SQLException {
+ c = connectURL(url, "com.metamatrix.jdbc.EmbeddedDriver");
+ currentContext().internalPrompt = "embedded:["+extractVDBName(url)+"]$
";
+ return c;
+}
+
/**
* Current Connection Name.
*/
@@ -69,10 +76,14 @@
* @param url - complete url for connection
*/
Connection connect (String url) {
- if (url.startsWith("jdbc:metamatrix:")) {
+ return connectURL(url, user_driver);
+}
+
+private Connection connectURL (String url, String driver) {
+ if (url.startsWith("jdbc:metamatrix:") ||
url.startsWith("jdbc:teiid:")) {
String contextName = genConnectionName();
newContext(contextName);
- com.metamatrix.jdbc.api.Connection mmConn = connectDriver(user_driver, url);
+ com.metamatrix.jdbc.api.Connection mmConn = connectDriver(driver, url);
currentContext().internalPrompt =
contextName+"["+extractVDBName(url)+"@"+extractHost(url)+"] $
";
currentContext().internalAdmin = mmConn.getAdminAPI();
return mmConn;
@@ -104,7 +115,7 @@
newContext(contextName);
//url is in "jdbc URL format": connect via MMServerConnection
- currentContext().internalConnection =
connectDriver("com.metamatrix.jdbc.MMDriver", url, username, password);
+ currentContext().internalConnection =
connectDriver("org.teiid.jdbc.TeiidDriver", url, username, password);
currentContext().internalAdmin =
currentContext().internalConnection.getAdminAPI();
}
}
@@ -122,10 +133,13 @@
void disconnect() {
closeConnection();
- if (currentContext().internalAdmin != void && currentContext().internalAdmin
!= null) {
- currentContext().internalAdmin.close();
- currentContext().internalAdmin=null;
- }
+ try {
+ if (currentContext().internalAdmin != void && currentContext().internalAdmin
!= null) {
+ currentContext().internalAdmin=null;
+ }
+ }catch(e) {
+ //ignore..
+ }
currentContext().internalPrompt = null;
}
@@ -174,7 +188,6 @@
void help() {
java.util.List urls = new ArrayList();
urls.add(getResource("/scripts/adminapi.bsh"));
- urls.add(getResource("/scripts/serveradmin.bsh"));
urls.add(getResource("/scripts/server.bsh"));
urls.add(getResource("/scripts/jdbc.bsh"));
help(urls);
@@ -189,7 +202,6 @@
void help(String methodName) {
java.util.List urls = new ArrayList();
urls.add(getResource("/scripts/adminapi.bsh"));
- urls.add(getResource("/scripts/serveradmin.bsh"));
urls.add(getResource("/scripts/server.bsh"));
urls.add(getResource("/scripts/jdbc.bsh"));
help(urls, methodName);
Deleted: trunk/adminshell/src/main/resources/scripts/serveradmin.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/serveradmin.bsh 2009-07-01 19:04:52 UTC
(rev 1092)
+++ trunk/adminshell/src/main/resources/scripts/serveradmin.bsh 2009-07-02 19:57:16 UTC
(rev 1093)
@@ -1,635 +0,0 @@
-source(getResource("/scripts/adminapi.bsh"));
-
-import java.util.Date;
-import java.util.Properties;
-
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.platform.client.ServerAdminFactory;
-import com.metamatrix.common.util.PropertiesUtils;
-
-//
********************************************************************************************
-// Wrappers for methods in the ServerAdmin interface.
-// For the methods of the DQPAdmin and Admin (shared) interfaces, see adminapi.bsh,
dqp.bsh.
-//
********************************************************************************************
-
-// Configuration methods
-
-
-
-/**
- * Add a Host with Properties to MetaMatrix System
- *
- * @param hostIdentifier
- * Name of {@link com.metamatrix.admin.api.objects.Host Host} to add
- * @param properties
- * name,value
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void addHost(String hostIdentifier, Properties properties) {
- checkAdmin();
- currentContext().internalAdmin.addHost(hostIdentifier, properties);
-}
-
-
-/**
- * Enable Host in Configuration
- *
- * @param hostIdentifier
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void enableHost(String hostIdentifier) {
- checkAdmin();
- currentContext().internalAdmin.enableHost(hostIdentifier);
-}
-
-/**
- * Disable Host in Configuration
- *
- * @param identifier
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void disableHost(String identifier) {
- checkAdmin();
- currentContext().internalAdmin.disableHost(identifier);
-}
-
-/**
- * Delete Host in Configuration
- * <p>
- * Note that this method may invalidate your connection to the Admin API, if you are
connected to the host you are deleting.
- * You may receive an exception on the next call to the API, and then it will recover.
- * As a workaround, you can close your connection and obtain a new connection.
- * @param identifier
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void deleteHost(String identifier) {
- checkAdmin();
- currentContext().internalAdmin.deleteHost(identifier);
-}
-
-
-
-/**
- * Add Process to specified host in the processIdentifier
- *
- * @param processIdentifier
- * Process Identifiers is Host Name.Process Name e.g.
"myhost.MetaMatrixProcess"
- * @param properties
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void addProcess(String processIdentifier, Properties properties) {
- checkAdmin();
- currentContext().internalAdmin.addProcess(processIdentifier, properties);
-}
-
-
-/**
- * Enable Process in Configuration
- *
- * @param identifier
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void enableProcess(String identifier) {
- checkAdmin();
- currentContext().internalAdmin.enableProcess(identifier);
-}
-
-/**
- * Disable Process in Configuration
- *
- * @param identifier
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void disableProcess(String identifier) {
- checkAdmin();
- currentContext().internalAdmin.disableProcess(identifier);
-}
-
-/**
- * Delete Process in Configuration
- *
- * <p>
- * Note that this method may invalidate your connection to the Admin API, if you are
connected to the process you are deleting.
- * You may receive an exception on the next call to the API, and then it will recover.
- * As a workaround, you can close your connection and obtain a new connection.
- * @param identifier
- * Process Identifer
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void deleteProcess(String identifier) {
- checkAdmin();
- currentContext().internalAdmin.deleteProcess(identifier);
-}
-
-
-/**
- * Deploy the VDB from the MetaMatrix Repository
- *
- * @param name
- * @param version
- * @param repositoryLocation
- * @return status object indicating any warnings.
- * <p>A status code of <code>AdminStatus.CODE_SUCCESS</code> will be
returned there are no problems.
- * <p>A status code of <code>AdminStatus.CODE_DECRYPTION_FAILED</code>
will be returned if the VDB was added,
- * but some connector binding passwords could not be decrypted.
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-VDB addVDB(String name, String version, String repositoryLocation) {
- print("Adding VDB " + vdbName + " from " + repositoryLocation);
- checkAdmin();
- result = currentContext().internalAdmin.addVDB(name, version, repositoryLocation);
- debug(result);
- return result;
-}
-
-/**
- * Import the Configuration from a file in XML format.
- * NOTE: This imports the specified data to the "Next Startup" configuration.
- * The server must be restarted for the new configuration to take effect.
- *
- * @param filename Name of configuration file, in XML format, as exported by {@link
#exportConfiguration()}
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void importConfiguration(String filename) {
- checkAdmin();
- currentContext().internalAdmin.importConfiguration(readTextFile(filename));
-}
-
-/**
- * Deassign a {@link ConnectorBinding} from a {@link VDB}'s Model
- *
- * @param connectorBindingName
- * Name of the ConnectorBinding
- * @param vdbName
- * Name of the VDB
- * @param vdbVersion
- * Version of the VDB
- * @param modelName
- * Name of the Model to unmap Connector Binding
- * @throws AdminException
- * if there's a system error or if there's a user input error.
- */
-void deassignBindingFromModel(String connectorBindingName,String vdbName,String
vdbVersion,String modelName){
- checkAdmin();
- currentContext().internalAdmin.deassignBindingFromModel(connectorBindingName,
vdbName, vdbVersion, modelName);
-}
-
-/**
- * Assign {@link ConnectorBinding}s to a {@link VDB}'s Model. If the supplied model
does not
- * support MultiSource bindings, then only the first binding in the supplied array is
assigned and
- * the remainder are ignored.
- *
- * @param connectorBindingNames
- * Names of the ConnectorBindings
- * @param vdbName
- * Name of the VDB
- * @param vdbVersion
- * Version of the VDB
- * @param modelName
- * Name of the Model to map Connector Bindings
- * @throws AdminException
- * if there's a system error or if there's a user input error.
- */
-void assignBindingsToModel(String[] connectorBindingNames, String vdbName, String
vdbVersion, String modelName) {
- checkAdmin();
- currentContext().internalAdmin.assignBindingsToModel(connectorBindingNames, vdbName,
vdbVersion, modelName);
-}
-
-/**
- * Deassign {@link ConnectorBinding}s from a {@link VDB}'s Model. Any of the
supplied array of
- * bindings are deassigned from the supplied model.
- *
- * @param connectorBindingNames
- * Names of the ConnectorBindings
- * @param vdbName
- * Name of the VDB
- * @param vdbVersion
- * Version of the VDB
- * @param modelName
- * Name of the Model to unmap Connector Bindings
- * @throws AdminException
- * if there's a system error or if there's a user input error.
- */
-void deassignBindingsFromModel(String[] connectorBindingNames, String vdbName, String
vdbVersion, String modelName){
- checkAdmin();
- currentContext().internalAdmin.deassignBindingsFromModel(connectorBindingNames,
vdbName, vdbVersion, modelName);
-}
-
-
-
-// Monitoring methods
-
-/**
- * Get the hosts that correspond to the specified identifier pattern.
- *
- * @param hostIdentifier the unique identifier for for a {@link
com.metamatrix.admin.api.objects.Host Host}
- * in the system or "{@link com.metamatrix.admin.api.objects.AdminObject#DELIMITER
DELIMITER}"
- * if all hosts are desired.
- * @return Collection of {@link com.metamatrix.admin.api.objects.Host Host}
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-Collection getHosts(String hostIdentifier) {
- checkAdmin();
-
- result = currentContext().internalAdmin.getHosts(hostIdentifier);
- debug(result);
- return result;
-}
-
-/**
- * Get the processes that correspond to the specified identifier pattern.
- *
- * @param processIdentifier the unique identifier for for a {@link
com.metamatrix.admin.api.objects.ProcessObject ProcessObject}
- * in the system or "{@link com.metamatrix.admin.api.objects.AdminObject#DELIMITER
DELIMITER}"
- * if all Processes are desired.
- * @return Collection of {@link com.metamatrix.admin.api.objects.ProcessObject
ProcessObject}
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-Collection getProcesses(String processIdentifier) {
- checkAdmin();
- result =currentContext().internalAdmin.getProcesses(processIdentifier);
- debug(result);
- return result;
-}
-
-/**
- * Get the Connection Pools that correspond to the specified identifer pattern.
- *
- * @param poolIdentifier the unique poolIdentifier for for a {@link
com.metamatrix.admin.api.objects.ConnectionPool ConnectionPool}
- * in the system or "{@link com.metamatrix.admin.api.objects.AdminObject#DELIMITER
DELIMITER}"
- * if all Connection Pools are desired.
- * @return Collection of {@link com.metamatrix.admin.api.objects.ConnectionPool
ConnectionPool}s
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-Collection getConnectionPools(String poolIdentifier) {
- checkAdmin();
- result = currentContext().internalAdmin.getConnectionPools(poolIdentifier);
- debug(result);
- return result;
-}
-
-/**
- * Get the {@link com.metamatrix.admin.api.objects.DQP DQP}s that correspond to the
specified identifer pattern.
- *
- * @param dqpIdentifier the unique identifier for for a {@link
com.metamatrix.admin.api.objects.DQP DQP}
- * in the system or "{@link com.metamatrix.admin.api.objects.AdminObject#DELIMITER
DELIMITER}"
- * if all Resources are desired.
- * @return Collection of {@link com.metamatrix.admin.api.objects.DQP DQP}
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-Collection getDQPs(String dqpIdentifier) {
- checkAdmin();
- result = currentContext().internalAdmin.getDQPs(dqpIdentifier);
- debug(result);
- return result;
-}
-
-/**
- * Get the Resources that correspond to the specified identifer pattern.
- *
- * @param resourceIdentifier the unique resourceIdentifier for for a {@link
com.metamatrix.admin.api.objects.Resource Resource}
- * in the system or "{@link com.metamatrix.admin.api.objects.AdminObject#DELIMITER
DELIMITER}"
- * if all Resources are desired.
- * @return Collection of {@link com.metamatrix.admin.api.objects.Resource Resource}
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-Collection getResources(String resourceIdentifier) {
- checkAdmin();
- result = currentContext().internalAdmin.getResources(resourceIdentifier);
- debug(result);
- return result;
-}
-
-/**
- * Export the logs from the MetaMatrix system, az a zipfile
- *
- * @param filename
- * Name of file to write the logs to
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void exportLogs(String fileName) {
- checkAdmin();
- contents = currentContext().internalAdmin.exportLogs();
- if (contents != null) {
- ObjectConverterUtil.write(contents, fileName);
- }
- else {
- throw new AdminProcessingException("Log file is not found for
exporting");
- }
-
-}
-
-
-//RuntimeState methods
-
-/**
- * Stop and restart the entire system.
- * @param waitUntilDone If true, this method waits until the operation is finished before
returning.
- * This may take a long time to complete. If false, this method returns immediately,
even though the operation
- * may not be finished.
- * NOTE: If <code>waitUntilDone</code> is true, this method will wait until
the server is able to connect to,
- * but it may not wait until non-essential services are available.
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-void bounceSystem(boolean waitUntilDone) {
- checkAdmin();
- currentContext().internalAdmin.bounceSystem(waitUntilDone);
-}
-
-/**
- * Synchronize the entire system. Synchronization will attempt to make the
- * runtime state match the configuration.
- * @param waitUntilDone If true, this method waits until the operation is finished before
returning.
- * This may take a long time to complete. If false, this method returns immediately,
even though the operation
- * may not be finished.
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-void synchronizeSystem(boolean waitUntilDone) {
- checkAdmin();
- currentContext().internalAdmin.synchronizeSystem(waitUntilDone);
-}
-
-/**
- * Stop the entire system.
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-void stopSystem() {
- checkAdmin();
- currentContext().internalAdmin.stopSystem();
-}
-
-
-/**
- * Start the Host for this cluster
- * @param hostIdentifier the unique identifier for for a {@link
com.metamatrix.admin.api.objects.Host Host}
- * in the system.
- * @param waitUntilDone If true, this method waits until the operation is finished before
returning.
- * This may take a long time to complete. If false, this method returns immediately,
even though the operation
- * may not be finished.
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-void startHost(String hostIdentifier, boolean waitUntilDone) {
- checkAdmin();
- currentContext().internalAdmin.startHost(hostIdentifier, waitUntilDone);
-}
-
-/**
- * Stop the Host for this cluster
- * @param hostIdentifier the unique identifier for for a {@link
com.metamatrix.admin.api.objects.Host Host}
- * in the system.
- * @param stopNow If true, stop the host forcefully. If false, wait until any pending
work is done.
- * @param waitUntilDone If true, this method waits until the operation is finished before
returning.
- * This may take a long time to complete. If false, this method returns immediately,
even though the operation
- * may not be finished.
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-void stopHost(String hostIdentifier, boolean stopNow, boolean waitUntilDone) {
- checkAdmin();
- currentContext().internalAdmin.stopHost(hostIdentifier, stopNow, waitUntilDone);
-}
-
-/**
- * Start a Process in the system.
- * @param processIdentifier the unique identifier for for a
- * {@link com.metamatrix.admin.api.objects.ProcessObject ProcessObject} in the system.
- * @param waitUntilDone If true, this method waits until the operation is finished before
returning.
- * This may take a long time to complete. If false, this method returns immediately,
even though the operation
- * may not be finished.
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-void startProcess(String processIdentifier, boolean waitUntilDone) {
- checkAdmin();
- currentContext().internalAdmin.startProcess(processIdentifier, waitUntilDone);
-}
-
-/**
- * Stop Process running in the system.
- * @param processIdentifier the unique identifier for for a
- * {@link com.metamatrix.admin.api.objects.ProcessObject ProcessObject} in the system.
- * @param stopNow a <code>boolean</code> value indicating whether to halt the
process immediately
- * or let it finish processing first.
- * @param waitUntilDone If true, this method waits until the operation is finished before
returning.
- * This may take a long time to complete. If false, this method returns immediately,
even though the operation
- * may not be finished.
- * @throws AdminException if there's a system error.
- * @since 4.3
- */
-void stopProcess(String processIdentifier, boolean stopNow, boolean waitUntilDone) {
- checkAdmin();
- currentContext().internalAdmin.stopProcess(processIdentifier, stopNow,
waitUntilDone);
-}
-
-
-//Security methods
-
-/**
- * Get the Collection of administrative role names possessed by the given group, if any.
- *
- * @param groupIdentifier
- * The unique identifier for the {@link Group}. This is group name. A user is
a {@link Principal} and a
- * Principal name is considered to be unique throughout the MetaMatrix system
across all Membership domains.
- * The {@link AdminObject#WILDCARD WILDCARD} cannot be used here.
- * @return The Collection of {@link Role}s.
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-Collection getRolesForGroup(String groupIdentifier) {
- checkAdmin();
- result = currentContext().internalAdmin.getRolesForGroup(groupIdentifier);
- debug(result);
- return result;
-}
-
-/**
- * Get the Collection of administrative role names possessed by the given user, if any.
- *
- * @param userIdentifier
- * The unique identifier for the {@link User}. This is generally a user name.
A user is a {@link Principal} and a
- * Principal name is considered to be unique throughout the MetaMatrix system
across all Membership domains.
- * The {@link AdminObject#WILDCARD WILDCARD} cannot be used here.
- * @return The Collection of <code>String</code> role names.
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-Collection getRolesForUser(String userIdentifier) {
- checkAdmin();
- result = currentContext().internalAdmin.getRolesForUser(userIdentifier);
- debug(result);
- return result;
-}
-
-/**
- * Get the group memberships for the given user.
- *
- * @param userIdentifier
- * The unique identifier for the {@link User}. This is generally a user name.
A user is a {@link Principal} and a
- * Principal name is considered to be unique throughout the MetaMatrix system
across all Membership domains.
- * The {@link AdminObject#WILDCARD WILDCARD} cannot be used here.
- * @return The collection of groups in which the given user has membership.
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-Collection getGroupsForUser(String userIdentifier) {
- checkAdmin();
- result = currentContext().internalAdmin.getGroupsForUser(userIdentifier);
- debug(result);
- return result;
-}
-
-/**
- * Get the group denoted by the given <code>groupIdentifier</code>.
- *
- * @param groupIdentifier
- * The unique identifier for the {@link Group}. This is generally a group
name. A group is a {@link Principal} and
- * a Principal name is considered to be unique throughout the MetaMatrix
system across all Membership domains. <br>
- * Note that by supplying the {@link AdminObject#WILDCARD WILDCARD}
identifier, all all users in the system will
- * retrieved.</br>
- * @return The Collection of users.
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-Collection getGroups(String groupIdentifier) {
- checkAdmin();
- result = currentContext().internalAdmin.getGroups(groupIdentifier);
- debug(result);
- return result;
-}
-
-/**
- * Assign to the given {@link Group} the given Administrative Role.
- *
- * @param roleIdentifier
- * one of {@link AdminRoles}.
- * @param groupIdentifier
- * the unique identifier for the Principal. The {@link AdminObject#WILDCARD
WILDCARD} cannot be used here.
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void assignRoleToGroup(String roleIdentifier, String groupIdentifier) {
- checkAdmin();
- currentContext().internalAdmin.assignRoleToGroup(roleIdentifier, groupIdentifier);
-}
-
-/**
- * Remove an administrative role from the given {@link Group}.
- *
- * @param roleIdentifier
- * one of {@link AdminRoles}
- * @param groupIdentifier
- * the unique identifier for the Principal. The {@link AdminObject#WILDCARD
WILDCARD} cannot be used here.
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
- */
-void removeRoleFromGroup(String roleIdentifier, String groupIdentifier) {
- checkAdmin();
- currentContext().internalAdmin.removeRoleFromGroup(roleIdentifier, groupIdentifier);
-}
-
-
-/**
- * Import the data Roles for given vdb and version into the connected server
- * @param vdbName - target name of the VDB, the roles to be imported under
- * @param vdbVersion - target version of the vdb, the roles to be imported under
- * @param filename - character data array containing the XML file which defines the roles
- * @param options - options to overwrite in case the matching roles already exist.
- * @throws AdminException
- */
-void importDataRoles(String vdbName, String vdbVersion, String filename, int options) {
- checkAdmin();
- currentContext().internalAdmin.importDataRoles(vdbName, vdbVersion,
readTextFile(filename), new AdminOptions(options));
-}
-
-/**
- * Import the data Roles for given vdb and version into the connected server
- * @param vdbName - target name of the VDB, the roles to be imported under
- * @param vdbVersion - target version of the vdb, the roles to be imported under
- * @param filename - character data array containing the XML file which defines the roles
- * @throws AdminException
- */
-void importDataRoles(String vdbName, String vdbVersion, String filename) {
- checkAdmin();
- currentContext().internalAdmin.importDataRoles(vdbName, vdbVersion,
readTextFile(filename), null);
-}
-
-
-/**
- * Export the data roles defined for the given vdb fromthe current system
- * @param vdbName - Name of the vdb
- * @param vdbVersion - version of the vdb
- * @param filename - name of the file to export the contents under.
- * @return - char[] stream containing the XML contents of the roles.
- * @throws AdminException
- */
-void exportDataRoles(String vdbName, String vdbVersion, String fileName) {
- checkAdmin();
- contents = currentContext().internalAdmin.exportDataRoles(vdbName, vdbVersion);
- if (contents != null) {
- ObjectConverterUtil.write(contents, fileName);
- }
- else {
- throw new AdminProcessingException("Data roles not found for VDB "+
vdbName + " with version "+ vdbVersion);
- }
-}
-
-
-/**
- * @param domainprovidername is the name to be assigned to the newly created {@link
AuthenticationProvider}
- * @param providertypename is the type of provider to create.
- * There are 3 installed provider types and they are:
- * <ul>
- * <li> <code>File Membership Domain Provider</code>
- * <li> <code>LDAP Membership Domain Provider</code>
- * <li><code>Custom Membership Domain Provider</code>
- * </ul>
- * @param properties are the settings specified by the providertype to be used
- * @throws AdminException
- * if there's a system error.
- * @since 5.5.2
- */
-void addAuthorizationProvider(String domainprovidername, String providertypename,
Properties properties) {
- checkAdmin();
- currentContext().internalAdmin.addAuthorizationProvider(domainprovidername,
providertypename, properties);
-}
-
-
-
-
-
Modified: trunk/adminshell/src/main/resources/scripts/util.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/util.bsh 2009-07-01 19:04:52 UTC (rev
1092)
+++ trunk/adminshell/src/main/resources/scripts/util.bsh 2009-07-02 19:57:16 UTC (rev
1093)
@@ -1,6 +1,5 @@
import java.io.*;
-import com.metamatrix.admin.api.core.*;
-import com.metamatrix.admin.api.objects.*;
+import org.teiid.adminapi.*;
import com.metamatrix.core.util.*;
debug=false;
@@ -136,21 +135,33 @@
String extractVDBName(url) {
str = "jdbc:metamatrix:";
+ strteiid = "jdbc:teiid:";
if (url.startsWith(str)) {
int at = url.indexOf("@");
if (at != -1) {
return url.substring(str.length(), at);
}
}
+ else if (url.startsWith(strteiid)) {
+ int at = url.indexOf("@");
+ if (at != -1) {
+ return url.substring(strteiid.length(), at);
+ }
+ }
return "";
}
String extractHost(url) {
str = "jdbc:metamatrix:";
+ strteiid = "jdbc:teiid:";
if (url.startsWith(str)) {
int at = url.indexOf("@")+1;
return url.substring(at, url.indexOf(";", at));
}
+ else if (url.startsWith(strteiid)) {
+ int at = url.indexOf("@")+1;
+ return url.substring(at, url.indexOf(";", at));
+ }
return "";
}
Added: trunk/build/assembly/adminshell/adminshell-dependencies.xml
===================================================================
--- trunk/build/assembly/adminshell/adminshell-dependencies.xml
(rev 0)
+++ trunk/build/assembly/adminshell/adminshell-dependencies.xml 2009-07-02 19:57:16 UTC
(rev 1093)
@@ -0,0 +1,44 @@
+<!--This script builds a JAR for the CDK -->
+<assembly>
+
+ <id>adminshell-dependencies</id>
+
+ <formats>
+ <format>dir</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <baseDirectory>teiid-adminshell</baseDirectory>
+
+ <moduleSets>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+
+ <includes>
+ <include>org.jboss.teiid:teiid-adminshell</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <excludes>
+ <exclude>org.jboss.teiid:teiid-client</exclude>
+ <exclude>org.jboss.teiid:teiid-client-jdbc</exclude>
+ <exclude>org.jboss.teiid:teiid-common-core</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+
+ </binaries>
+
+ </moduleSet>
+ </moduleSets>
+
+</assembly>
\ No newline at end of file
Property changes on: trunk/build/assembly/adminshell/adminshell-dependencies.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/assembly/adminshell/adminshell-dist.xml
===================================================================
--- trunk/build/assembly/adminshell/adminshell-dist.xml (rev 0)
+++ trunk/build/assembly/adminshell/adminshell-dist.xml 2009-07-02 19:57:16 UTC (rev
1093)
@@ -0,0 +1,44 @@
+<!--This script builds a JAR for the CDK -->
+<assembly>
+
+ <id>adminshell-dist</id>
+
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <baseDirectory>teiid-adminshell-${version}</baseDirectory>
+
+
+ <fileSets>
+
+ <fileSet>
+
<directory>target/distribution/teiid-${version}-adminshell-dependencies.dir</directory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ <outputDirectory>lib</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>build/kit-adminshell</directory>
+ <outputDirectory>/</outputDirectory>
+ <excludes>
+ <exclude>**/*.foo</exclude>
+ </excludes>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/distribution</directory>
+ <includes>
+ <include>teiid-${version}-client.jar</include>
+ </includes>
+ <outputDirectory>lib</outputDirectory>
+ </fileSet>
+
+ </fileSets>
+
+
+
+</assembly>
\ No newline at end of file
Property changes on: trunk/build/assembly/adminshell/adminshell-dist.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/assembly/client-jar.xml
===================================================================
--- trunk/build/assembly/client-jar.xml (rev 0)
+++ trunk/build/assembly/client-jar.xml 2009-07-02 19:57:16 UTC (rev 1093)
@@ -0,0 +1,35 @@
+<!--This script builds a JAR for the Embedded Server Installation -->
+<assembly>
+
+ <id>client</id>
+
+ <formats>
+ <format>jar</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <baseDirectory>teiid-client</baseDirectory>
+
+ <moduleSets>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+
+ <includes>
+ <include>org.jboss.teiid:teiid-client</include>
+ <include>org.jboss.teiid:teiid-client-jdbc</include>
+ <include>org.jboss.teiid:teiid-common-core</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>false</includeDependencies>
+ <unpack>true</unpack>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>:jar:*</include>
+ </includes>
+ </binaries>
+
+ </moduleSet>
+ </moduleSets>
+
+</assembly>
\ No newline at end of file
Property changes on: trunk/build/assembly/client-jar.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/build/assembly/embedded/embedded-client-jar.xml
===================================================================
--- trunk/build/assembly/embedded/embedded-client-jar.xml 2009-07-01 19:04:52 UTC (rev
1092)
+++ trunk/build/assembly/embedded/embedded-client-jar.xml 2009-07-02 19:57:16 UTC (rev
1093)
@@ -1,35 +0,0 @@
-<!--This script builds a JAR for the Embedded Server Installation -->
-<assembly>
-
- <id>client</id>
-
- <formats>
- <format>jar</format>
- </formats>
-
- <includeBaseDirectory>false</includeBaseDirectory>
- <baseDirectory>teiid-embedded-client</baseDirectory>
-
- <moduleSets>
- <moduleSet>
- <includeSubModules>true</includeSubModules>
-
- <includes>
- <include>org.jboss.teiid:teiid-client</include>
- <include>org.jboss.teiid:teiid-client-jdbc</include>
- <include>org.jboss.teiid:teiid-common-core</include>
- </includes>
-
- <binaries>
- <includeDependencies>false</includeDependencies>
- <unpack>true</unpack>
- <outputDirectory></outputDirectory>
- <includes>
- <include>:jar:*</include>
- </includes>
- </binaries>
-
- </moduleSet>
- </moduleSets>
-
-</assembly>
\ No newline at end of file
Added: trunk/build/kit-adminshell/COPYRIGHT.txt
===================================================================
--- trunk/build/kit-adminshell/COPYRIGHT.txt (rev 0)
+++ trunk/build/kit-adminshell/COPYRIGHT.txt 2009-07-02 19:57:16 UTC (rev 1093)
@@ -0,0 +1,4 @@
+Portions Copyright (C) 2008-2009 Red Hat, Inc.
+Portions Copyright (C) 2000-2007 MetaMatrix, Inc.
+Portions Copyright (c) 2000, 2003, 2008 IBM Corporation and others.
+Portions Copyright (c) 1997-2000 Sun Microsystems, Inc.
\ No newline at end of file
Property changes on: trunk/build/kit-adminshell/COPYRIGHT.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/kit-adminshell/LICENSE-lgpl-2.1.txt
===================================================================
--- trunk/build/kit-adminshell/LICENSE-lgpl-2.1.txt (rev 0)
+++ trunk/build/kit-adminshell/LICENSE-lgpl-2.1.txt 2009-07-02 19:57:16 UTC (rev 1093)
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Property changes on: trunk/build/kit-adminshell/LICENSE-lgpl-2.1.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/kit-adminshell/adminshell.bat
===================================================================
--- trunk/build/kit-adminshell/adminshell.bat (rev 0)
+++ trunk/build/kit-adminshell/adminshell.bat 2009-07-02 19:57:16 UTC (rev 1093)
@@ -0,0 +1,78 @@
+@ECHO OFF
+@setlocal
+
+@REM JBoss, Home of Professional Open Source.
+@REM Copyright (C) 2008 Red Hat, Inc.
+@REM Licensed to Red Hat, Inc. under one or more contributor
+@REM license agreements. See the copyright.txt file in the
+@REM distribution for a full listing of individual contributors.
+@REM
+@REM This library is free software; you can redistribute it and/or
+@REM modify it under the terms of the GNU Lesser General Public
+@REM License as published by the Free Software Foundation; either
+@REM version 2.1 of the License, or (at your option) any later version.
+@REM
+@REM This library is distributed in the hope that it will be useful,
+@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+@REM Lesser General Public License for more details.
+@REM
+@REM You should have received a copy of the GNU Lesser General Public
+@REM License along with this library; if not, write to the Free Software
+@REM Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+@REM 02110-1301 USA.
+
+@REM This assumes it's run from its installation directory. It is also assumed there
is a java
+@REM executable defined along the PATH
+
+@if not "%ECHO%" == "" echo %ECHO%
+@if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+ set "DIRNAME=%~dp0%"
+) else (
+ set DIRNAME=.\
+)
+
+pushd %DIRNAME%..
+if "x%TEIID_HOME%" == "x" (
+ set "TEIID_HOME=%CD%"
+)
+popd
+
+set DIRNAME=
+
+if "x%JAVA_HOME%" == "x" (
+ set JAVA=java
+ echo JAVA_HOME is not set. Unexpected results may occur.
+ echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
+) else (
+ set "JAVA=%JAVA_HOME%\bin\java"
+ if exist "%JAVA_HOME%\lib\tools.jar" (
+ set "JAVAC_JAR=%JAVA_HOME%\lib\tools.jar"
+ )
+)
+
+set TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\lib\*;
+
+rem JVM memory allocation pool parameters. Modify as appropriate.
+set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -XX:MaxPermSize=256m
+
+echo ===============================================================================
+echo.
+echo Teiid AdminShell Bootstrap Environment
+echo.
+echo TEIID_HOME: %TEIID_HOME%
+echo.
+echo JAVA: %JAVA%
+echo.
+echo JAVA_OPTS: %JAVA_OPTS%
+echo.
+echo CLASSPATH: %TEIID_CLASSPATH%
+echo.
+echo ===============================================================================
+echo.
+
+"%JAVA%" %JAVA_OPTS% ^
+ -classpath "%TEIID_CLASSPATH%" ^
+ org.teiid.AdminShell %*
Property changes on: trunk/build/kit-adminshell/adminshell.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/build/kit-adminshell/adminshell.sh
===================================================================
--- trunk/build/kit-adminshell/adminshell.sh (rev 0)
+++ trunk/build/kit-adminshell/adminshell.sh 2009-07-02 19:57:16 UTC (rev 1093)
@@ -0,0 +1,78 @@
+#!/bin/sh
+#
+# JBoss, Home of Professional Open Source.
+# Copyright (C) 2008 Red Hat, Inc.
+# Licensed to Red Hat, Inc. under one or more contributor
+# license agreements. See the copyright.txt file in the
+# distribution for a full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+
+DIRNAME=`dirname $0`
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false;
+linux=false;
+case "`uname`" in
+ CYGWIN*)
+ cygwin=true
+ ;;
+
+ Linux)
+ linux=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$TEIID_HOME" ] &&
+ TEIID_HOME=`cygpath --unix "$TEIID_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Setup TEIID_HOME
+if [ "x$TEIID_HOME" = "x" ]; then
+ # get the full path (without any relative bits)
+ TEIID_HOME=`cd $DIRNAME; pwd`
+fi
+export TEIID_HOME
+
+# Setup the JVM
+if [ "x$JAVA" = "x" ]; then
+ if [ "x$JAVA_HOME" != "x" ]; then
+ JAVA="$JAVA_HOME/bin/java"
+ else
+ JAVA="java"
+ fi
+fi
+
+TEIID_CLASSPATH="$TEIID_HOME/lib/patches/*:$TEIID_HOME/lib/*"
+
+
+# Print the env settings
+echo
"========================================================================="
+echo ""
+echo " Teiid AdminSehll Bootstrap Environment"
+echo ""
+echo " TEIID_HOME = $TEIID_HOME"
+echo " CLASSPATH = $TEIID_CLASSPATH"
+echo " JAVA = $JAVA"
+echo ""
+echo
"========================================================================="
+echo ""
+
+$JAVA -cp $TEIID_CLASSPATH -Xmx256m org.teiid.AdminShell $*
\ No newline at end of file
Property changes on: trunk/build/kit-adminshell/adminshell.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/build/kit-adminshell/connection.properties
===================================================================
--- trunk/build/kit-adminshell/connection.properties (rev 0)
+++ trunk/build/kit-adminshell/connection.properties 2009-07-02 19:57:16 UTC (rev 1093)
@@ -0,0 +1,6 @@
+server.host=localhost
+server.port=31000
+server.username=admin
+server.password=teiid
+#server.optional-url=(optional)
+vdb.name=admin
Property changes on: trunk/build/kit-adminshell/connection.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/build/kit-embedded/bin/run.bat
===================================================================
--- trunk/build/kit-embedded/bin/run.bat 2009-07-01 19:04:52 UTC (rev 1092)
+++ trunk/build/kit-embedded/bin/run.bat 2009-07-02 19:57:16 UTC (rev 1093)
@@ -64,7 +64,7 @@
:RESTART
"%JAVA%" %JAVA_OPTS% ^
- -classpath "%JBOSS_CLASSPATH%" ^
+ -classpath "%TEIID_CLASSPATH%" ^
-server ^
org.teiid.Server %TEIID_HOME%\deploy.properties %*
Modified: trunk/build/kit-embedded/bin/run.sh
===================================================================
--- trunk/build/kit-embedded/bin/run.sh 2009-07-01 19:04:52 UTC (rev 1092)
+++ trunk/build/kit-embedded/bin/run.sh 2009-07-02 19:57:16 UTC (rev 1093)
@@ -6,7 +6,6 @@
### ====================================================================== ###
DIRNAME=`dirname $0`
-PROGNAME=`basename $0`
# OS specific support (must be 'true' or 'false').
cygwin=false;
@@ -26,7 +25,7 @@
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=$JMX_PORT
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false"
# JPDA options. Uncomment and modify as appropriate to enable remote debugging.
-# JAVA_OPTS=$JAVA_OPTS -Xdebug
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
+# JAVA_OPTS="$JAVA_OPTS -Xdebug
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
# Force IPv4 on Linux systems since IPv6 doesn't work correctly with jdk5 and lower
if [ "$linux" = "true" ]; then
Modified:
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -44,8 +44,6 @@
ServerConnection createConnection(Properties connectionProperties) throws
CommunicationException, ConnectionException;
- public Admin getAdminAPI(Properties connectionProperties) throws AdminException;
-
/**
* Shutdown the connection factory, including the DQP and all its existing
connections
*/
Deleted:
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionListener.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionListener.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionListener.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.common.comm.api;
-
-import com.metamatrix.common.comm.api.ServerConnection;
-
-
-/**
- * An implementor of this interface, when registered with the ServerConnection will
- * receive notifications about the connection life cycle events.
- */
-public interface ServerConnectionListener {
- /**
- * A connection has been added to DQP
- * @param connection The client connection instance, never null
- */
- void connectionAdded(ServerConnection connection);
-
- /**
- * A connection has been removed for DQP
- * @param connection The client connection instance, never null
- */
- void connectionRemoved(ServerConnection connection);
-
-}
Modified:
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -293,11 +293,6 @@
this.maxCachedInstances = maxCachedInstances;
}
- @Override
- public Admin getAdminAPI(Properties connectionProperties) throws AdminException {
- ServerAdminFactory factory = ServerAdminFactory.getInstance();
- return factory.createAdmin(connectionProperties);
- }
@Override
public void shutdown(boolean restart) {
Modified: trunk/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2009-07-01 19:04:52 UTC (rev
1092)
+++ trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2009-07-02 19:57:16 UTC (rev
1093)
@@ -31,10 +31,4 @@
* @since 4.3
*/
public interface Admin extends ConfigurationAdmin, MonitoringAdmin, RuntimeStateAdmin,
SecurityAdmin {
- /**
- * Closes connection.
- * @since 4.3
- */
- @RolesAllowed(value=AdminRoles.RoleName.ANONYMOUS)
- void close();
}
Modified:
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServiceRegistry.java
===================================================================
---
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServiceRegistry.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServiceRegistry.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -34,13 +34,18 @@
import com.metamatrix.common.xa.XATransactionException;
import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.dqp.client.ClientSideDQP;
+import com.metamatrix.platform.security.api.ILogon;
public class TestSocketServiceRegistry extends TestCase {
+ interface Foo{
+ void somemethod();
+ }
+
public void testExceptionConversionNoException() throws Exception {
+
+ Method m = Foo.class.getMethod("somemethod", new Class[] {});
- Method m = Admin.class.getMethod("close", new Class[] {});
-
Throwable t = ExceptionUtil.convertException(m, new MetaMatrixComponentException());
assertTrue(t instanceof MetaMatrixRuntimeException);
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java 2009-07-01
19:04:52 UTC (rev 1092)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -463,7 +463,7 @@
try {
info.setProperty(DQPEmbeddedProperties.BOOTURL, url.toExternalForm());
ServerConnection conn = connectionFactory.createConnection(info);
- return new MMConnection(conn, info, url.toExternalForm(), connectionFactory);
+ return new MMConnection(conn, info, url.toExternalForm());
} catch (CommunicationException e) {
throw MMSQLException.create(e);
} catch (ConnectionException e) {
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java 2009-07-01
19:04:52 UTC (rev 1092)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -123,9 +123,6 @@
private ClientSideDQP dqp;
protected ServerConnection serverConn;
- private Admin admin;
- ServerConnectionFactory connFactory = null;
-
/**
* <p>MMConnection constructor, tring to establish connection to metamatrix
with
* the given URL and properties.</p>
@@ -133,11 +130,10 @@
* @param info contains properies needed to establish a MetaMatrix connection.
* @throws SQLException if the driver cannot establish connection to metamatrix.
*/
- public MMConnection(ServerConnection serverConn, Properties info, String url,
ServerConnectionFactory connFactory) {
+ public MMConnection(ServerConnection serverConn, Properties info, String url) {
this.serverConn = serverConn;
this.url = url;
this.dqp = serverConn.getService(ClientSideDQP.class);
- this.connFactory = connFactory;
// set default properties if not overridden
String overrideProp = info.getProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP);
@@ -244,14 +240,7 @@
* @since 4.3
*/
public synchronized Admin getAdminAPI() throws SQLException {
- try {
- if (admin == null) {
- admin = connFactory.getAdminAPI(this.propInfo);
- }
- } catch(AdminException e) {
- throw MMSQLException.create(e);
- }
- return admin;
+ return this.serverConn.getService(Admin.class);
}
/**
@@ -318,11 +307,6 @@
// set the status of the connection to closed
closed = true;
}
-
- if (admin != null) {
- admin.close();
- }
-
}
/**
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDriver.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDriver.java 2009-07-01 19:04:52
UTC (rev 1092)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDriver.java 2009-07-02 19:57:16
UTC (rev 1093)
@@ -143,7 +143,7 @@
ServerConnection serverConn =
SocketServerConnectionFactory.getInstance().createConnection(info);
// construct a MMConnection object.
- MMConnection connection = new MMConnection(serverConn, info, url,
SocketServerConnectionFactory.getInstance());
+ MMConnection connection = new MMConnection(serverConn, info, url);
return connection;
}
Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidDriver.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidDriver.java 2009-07-01 19:04:52
UTC (rev 1092)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidDriver.java 2009-07-02 19:57:16
UTC (rev 1093)
@@ -147,7 +147,7 @@
ServerConnection serverConn =
SocketServerConnectionFactory.getInstance().createConnection(info);
// construct a MMConnection object.
- MMConnection connection = new MMConnection(serverConn, info, url,
SocketServerConnectionFactory.getInstance());
+ MMConnection connection = new MMConnection(serverConn, info, url);
return connection;
}
Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java
===================================================================
--- trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java 2009-07-01
19:04:52 UTC (rev 1092)
+++ trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -60,7 +60,7 @@
productInfo.setProperty(ProductInfoConstants.VIRTUAL_DB, STD_DATABASE_NAME);
productInfo.setProperty(ProductInfoConstants.VDB_VERSION, STD_DATABASE_VERSION);
stub(mock.getLogonResult()).toReturn(new LogonResult(new SessionToken(new
MetaMatrixSessionID(1), "metamatrixadmin"), productInfo, "fake"));
//$NON-NLS-1$
- return new MMConnection(mock, props, serverUrl,
mock(ServerConnectionFactory.class));
+ return new MMConnection(mock, props, serverUrl);
}
public void testGetMetaData() throws Exception {
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java
===================================================================
---
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -243,8 +243,8 @@
com.metamatrix.common.queue.WorkerPoolStats stats =
(com.metamatrix.common.queue.WorkerPoolStats)src;
return Util.convertStats(stats, stats.getQueueName());
}
- else if (src != null && src instanceof ServerConnection) {
- ServerConnection conn = (ServerConnection)src;
+ else if (src != null && src instanceof DQPWorkContext) {
+ DQPWorkContext conn = (DQPWorkContext)src;
return convertConnection(conn);
}
else if (src != null && src instanceof
com.metamatrix.common.config.api.ExtensionModule) {
@@ -273,10 +273,14 @@
return module;
}
- private Session convertConnection(ServerConnection src) {
- MMSession session = new MMSession(new String[]
{src.getLogonResult().getSessionID().toString()});
-
session.setVDBName(src.getLogonResult().getProductInfo(ProductInfoConstants.VIRTUAL_DB));
-
session.setVDBVersion(src.getLogonResult().getProductInfo(ProductInfoConstants.VDB_VERSION));
+ private Session convertConnection(DQPWorkContext src) {
+ MMSession session = new MMSession(new String[] {src.getSessionId().toString()});
+ session.setVDBName(src.getVdbName());
+ session.setVDBVersion(src.getVdbVersion());
+ session.setApplicationName(src.getAppName());
+ session.setIPAddress(src.getClientAddress());
+ session.setHostName(src.getClientHostname());
+ session.setUserName(src.getUserName());
return session;
}
@@ -404,7 +408,7 @@
if (bindings != null && !bindings.isEmpty()) {
List names = new ArrayList();
for (int i=0; i<bindings.size();i++) {
- names.add(vdb.getConnectorBindingByName((String)bindings.get(i)));
+
names.add(convertToAdminObject(vdb.getConnectorBindingByName((String)bindings.get(i)),
parent));
}
model.setConnectorBindingNames(names);
}
@@ -441,12 +445,11 @@
* @return
* @since 4.3
*/
- ServerConnection getClientConnection(String identifier) {
- Collection<ServerConnection> connections =
getConfigurationService().getClientConnections();
- for (Iterator i = connections.iterator(); i.hasNext();) {
- ServerConnection clientConnection = (ServerConnection)i.next();
- if
(clientConnection.getLogonResult().getSessionID().toString().equals(identifier)) {
- return clientConnection;
+ DQPWorkContext getClientConnection(String identifier) {
+ Collection<DQPWorkContext> connections =
getConfigurationService().getClientConnections();
+ for (DQPWorkContext context:connections) {
+ if (context.getSessionId().toString().equals(identifier)) {
+ return context;
}
}
return null;
@@ -457,7 +460,7 @@
* @return
* @throws AdminException
*/
- Set<ServerConnection> getClientConnections() throws AdminException{
+ Set<DQPWorkContext> getClientConnections() {
return getConfigurationService().getClientConnections();
}
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
===================================================================
---
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -22,8 +22,6 @@
package com.metamatrix.dqp.embedded.admin;
-import static org.teiid.dqp.internal.process.Util.convertStats;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -43,20 +41,15 @@
import org.teiid.adminapi.ProcessObject;
import org.teiid.adminapi.SystemObject;
import org.teiid.adminapi.Transaction;
+import org.teiid.dqp.internal.process.DQPWorkContext;
import com.metamatrix.admin.objects.MMAdminObject;
-import com.metamatrix.admin.objects.MMProcess;
-import com.metamatrix.admin.objects.MMQueueWorkerPool;
import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.common.comm.api.ServerConnection;
import com.metamatrix.common.config.api.ComponentType;
-import com.metamatrix.common.queue.WorkerPoolStats;
import com.metamatrix.common.vdb.api.VDBArchive;
import com.metamatrix.dqp.embedded.DQPEmbeddedPlugin;
import com.metamatrix.dqp.service.TransactionService;
import com.metamatrix.jdbc.EmbeddedConnectionFactoryImpl;
-import com.metamatrix.platform.vm.controller.ProcessStatistics;
-import com.metamatrix.platform.vm.controller.SocketListenerStats;
import com.metamatrix.server.serverapi.RequestInfo;
@@ -252,16 +245,7 @@
if (identifier == null || !identifier.matches(NUMBER_REGEX)) {
throw new
AdminProcessingException(DQPEmbeddedPlugin.Util.getString("Admin.Invalid_identifier"));
//$NON-NLS-1$
}
-
- ArrayList goodConections = new ArrayList();
- Set<ServerConnection> connections = getClientConnections();
- for (Iterator i = connections.iterator(); i.hasNext();) {
- ServerConnection connection = (ServerConnection)i.next();
- if (connection.isOpen()) {
- goodConections.add(connection);
- }
- }
- return matchedCollection(identifier,
(List)convertToAdminObjects(goodConections));
+ return matchedCollection(identifier,
(List)convertToAdminObjects(getClientConnections()));
}
/**
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPRuntimeStateAdminImpl.java
===================================================================
---
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPRuntimeStateAdminImpl.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPRuntimeStateAdminImpl.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -38,6 +38,7 @@
import org.teiid.adminapi.EmbeddedLogger;
import org.teiid.adminapi.Request;
import org.teiid.adminapi.RuntimeStateAdmin;
+import org.teiid.dqp.internal.process.DQPWorkContext;
import com.metamatrix.admin.objects.MMRequest;
import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -208,28 +209,23 @@
public void terminateSession(String identifier)
throws AdminException {
- Set<ServerConnection> connections = getClientConnections();
- ArrayList matchedConnections = new ArrayList();
+ Set<DQPWorkContext> connections = getClientConnections();
+ ArrayList<DQPWorkContext> matchedConnections = new
ArrayList<DQPWorkContext>();
- for (ServerConnection clientConnection:connections) {
- String id = clientConnection.getLogonResult().getSessionID().toString();
+ for (DQPWorkContext clientConnection:connections) {
+ String id = clientConnection.getSessionId().toString();
if (matches(identifier, id)) {
matchedConnections.add(clientConnection);
}
}
// Double iteration because to avoid concurrent modification of underlying map.
- for (Iterator i = matchedConnections.iterator(); i.hasNext();) {
- ServerConnection clientConnection = (ServerConnection)i.next();
-
+ for (DQPWorkContext clientConnection: matchedConnections) {
try {
- this.manager.getDQP().terminateConnection(clientConnection.getLogonResult().getSessionID().toString());
+ this.manager.getDQP().terminateConnection(clientConnection.getSessionId().toString());
} catch (MetaMatrixComponentException e) {
throw new AdminComponentException(e);
}
-
- // Shutdown the connection
- clientConnection.shutdown();
}
}
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPSecurityAdminImpl.java
===================================================================
---
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPSecurityAdminImpl.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPSecurityAdminImpl.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -98,7 +98,7 @@
* @see
com.metamatrix.admin.api.server.ServerSecurityAdmin#getGroupsForUser(java.lang.String,
boolean)
* @since 4.3
*/
- public Collection getGroupsForUser(String userIdentifier) throws AdminException {
+ public Collection<Group> getGroupsForUser(String userIdentifier) throws
AdminException {
if (userIdentifier == null) {
throwProcessingException("AdminImpl.requiredparameter", new
Object[] {}); //$NON-NLS-1$
}
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
===================================================================
---
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -38,6 +38,8 @@
import java.util.Set;
import java.util.StringTokenizer;
+import org.teiid.dqp.internal.process.DQPWorkContext;
+
import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -45,8 +47,6 @@
import com.metamatrix.common.application.ApplicationEnvironment;
import com.metamatrix.common.application.exception.ApplicationInitializationException;
import com.metamatrix.common.application.exception.ApplicationLifecycleException;
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.api.ServerConnectionListener;
import com.metamatrix.common.config.api.ComponentType;
import com.metamatrix.common.config.api.ComponentTypeID;
import com.metamatrix.common.config.api.ConfigurationModelContainer;
@@ -74,9 +74,9 @@
import com.metamatrix.dqp.embedded.configuration.VDBConfigurationWriter;
import com.metamatrix.dqp.service.ConfigurationService;
import com.metamatrix.dqp.service.ConnectorBindingLifeCycleListener;
+import com.metamatrix.dqp.service.ServerConnectionListener;
import com.metamatrix.dqp.service.VDBLifeCycleListener;
import com.metamatrix.dqp.util.LogConstants;
-import com.metamatrix.platform.util.ProductInfoConstants;
import com.metamatrix.query.function.FunctionLibraryManager;
import com.metamatrix.query.function.UDFSource;
import com.metamatrix.vdb.runtime.BasicModelInfo;
@@ -113,7 +113,7 @@
private ArrayList<VDBLifeCycleListener> vdbLifeCycleListeners = new
ArrayList<VDBLifeCycleListener>();
private ArrayList<ConnectorBindingLifeCycleListener>
connectorBindingLifeCycleListeners = new
ArrayList<ConnectorBindingLifeCycleListener>();
private UDFSource udfSource;
- private HashSet<ServerConnection> clientConnections = new
HashSet<ServerConnection>();
+ private HashSet<DQPWorkContext> clientConnections = new
HashSet<DQPWorkContext>();
private AbstractClassLoaderManager classLoaderManager = new
AbstractClassLoaderManager(Thread.currentThread().getContextClassLoader(), true, true) {
@@ -1239,15 +1239,13 @@
/**
* A Client Connection to DQP has been added
*/
- public void connectionAdded(ServerConnection connection) {
+ public void connectionAdded(DQPWorkContext connection) {
// Add to parent's collection
clientConnections.add(connection);
- String vdbName =
connection.getLogonResult().getProductInfo(ProductInfoConstants.VIRTUAL_DB);
- String vdbVersion =
connection.getLogonResult().getProductInfo(ProductInfoConstants.VDB_VERSION);
- String key = vdbId(vdbName, vdbVersion);
+ String key = vdbId(connection.getVdbName(), connection.getVdbVersion());
-
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.connectionAdded", new
Object[] {vdbName, vdbVersion, connection.getLogonResult().getSessionID()});
//$NON-NLS-1$
+
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.connectionAdded", new
Object[] {connection.getVdbName(), connection.getVdbVersion(),
connection.getSessionId()}); //$NON-NLS-1$
Integer useCount = inuseVDBs.get(key);
if (useCount == null) {
@@ -1261,15 +1259,13 @@
/**
* A Client Connection to DQP has been removed
*/
- public void connectionRemoved(ServerConnection connection) {
+ public void connectionRemoved(DQPWorkContext connection) {
// remove from the collection
clientConnections.remove(connection);
- String vdbName =
connection.getLogonResult().getProductInfo(ProductInfoConstants.VIRTUAL_DB);
- String vdbVersion =
connection.getLogonResult().getProductInfo(ProductInfoConstants.VDB_VERSION);
- String key = vdbId(vdbName, vdbVersion);
+ String key = vdbId(connection.getVdbName(), connection.getVdbVersion());
-
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.connectionRemoved", new
Object[] {vdbName, vdbVersion, connection.getLogonResult().getSessionID()});
//$NON-NLS-1$
+
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.connectionRemoved", new
Object[] {connection.getVdbName(), connection.getVdbVersion(),
connection.getSessionId()}); //$NON-NLS-1$
Integer useCount = inuseVDBs.get(key);
if (useCount == null) {
@@ -1279,7 +1275,7 @@
// after decrementing if use count comes to zero we can
// see if there are any VDBs to delete
if ((useCount.intValue()-1) == 0) {
- runVDBCleanUp(vdbName, vdbVersion);
+ runVDBCleanUp(connection.getVdbName(),
connection.getVdbVersion());
inuseVDBs.remove(key);
}
else {
@@ -1288,15 +1284,12 @@
}
}
}
-
};
}
- /**
- * @see com.metamatrix.dqp.service.ConfigurationService#getClientConnections()
- */
- public Set<ServerConnection> getClientConnections() {
- return new HashSet<ServerConnection>(clientConnections);
+ @Override
+ public Set<DQPWorkContext> getClientConnections() {
+ return new HashSet<DQPWorkContext>(clientConnections);
}
/**
Modified:
trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java
===================================================================
---
trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -55,7 +55,6 @@
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.comm.api.ServerConnection;
import com.metamatrix.common.comm.api.ServerConnectionFactory;
-import com.metamatrix.common.comm.api.ServerConnectionListener;
import com.metamatrix.common.comm.exception.CommunicationException;
import com.metamatrix.common.comm.exception.ConnectionException;
import com.metamatrix.common.log.LogManager;
@@ -76,6 +75,7 @@
import com.metamatrix.dqp.service.AuthorizationService;
import com.metamatrix.dqp.service.ConfigurationService;
import com.metamatrix.dqp.service.DQPServiceNames;
+import com.metamatrix.dqp.service.ServerConnectionListener;
import com.metamatrix.dqp.util.LogConstants;
import com.metamatrix.platform.security.api.ILogon;
import com.metamatrix.platform.security.api.service.SessionServiceInterface;
@@ -96,35 +96,15 @@
private ClientServiceRegistry clientServices;
private String workspaceDirectory;
private boolean init = false;
- private ConnectionListenerList listenerList = new ConnectionListenerList();
private SocketTransport socketTransport;
private JMXUtil jmxServer;
private boolean restart = false;
- private final class ConnectionListenerList extends
ArrayList<ServerConnectionListener> implements ServerConnectionListener{
-
- @Override
- public void connectionAdded(ServerConnection connection) {
- for (ServerConnectionListener l: this) {
- l.connectionAdded(connection);
- }
- }
-
- @Override
- public void connectionRemoved(ServerConnection connection) {
- for (ServerConnectionListener l: this) {
- l.connectionRemoved(connection);
- }
- }
- }
-
@Override
public ServerConnection createConnection(Properties connectionProperties) throws
CommunicationException, ConnectionException {
try {
-
initialize(connectionProperties);
- return new LocalServerConnection(connectionProperties, this.clientServices,
listenerList);
-
+ return new LocalServerConnection(connectionProperties, this.clientServices);
} catch (ApplicationInitializationException e) {
throw new ConnectionException(e.getCause());
}
@@ -177,7 +157,8 @@
// make the configuration service listen for the connection life-cycle events
// used during VDB delete
ConfigurationService configService =
(ConfigurationService)findService(DQPServiceNames.CONFIGURATION_SERVICE);
-
+
+ //in new class loader - all of these should be created lazily and held locally
this.clientServices = createClientServices(configService);
// start socket transport
@@ -186,9 +167,6 @@
this.socketTransport = new SocketTransport(props, this.clientServices,
(SessionServiceInterface)findService(DQPServiceNames.SESSION_SERVICE));
this.socketTransport.start();
}
-
- //in new class loader - all of these should be created lazily and held locally
- listenerList.add(configService.getConnectionListener());
this.shutdownThread = new ShutdownWork();
Runtime.getRuntime().addShutdownHook(this.shutdownThread);
@@ -202,14 +180,10 @@
ClientServiceRegistry services = new ClientServiceRegistry();
SessionServiceInterface sessionService =
(SessionServiceInterface)this.dqp.getEnvironment().findService(DQPServiceNames.SESSION_SERVICE);
- services.registerClientService(ILogon.class, new LogonImpl(sessionService,
configService.getClusterName()), com.metamatrix.common.util.LogConstants.CTX_SERVER);
+ services.registerClientService(ILogon.class, new LogonImpl(sessionService,
configService.getClusterName(), configService.getConnectionListener()),
com.metamatrix.common.util.LogConstants.CTX_SERVER);
- try {
- Admin roleCheckedServerAdmin = wrapAdminService(Admin.class, getAdminAPI(null));
- services.registerClientService(Admin.class, roleCheckedServerAdmin,
com.metamatrix.common.util.LogConstants.CTX_ADMIN);
- } catch (AdminException e) {
- // ignore; exception is not thrown in this case.
- }
+ Admin roleCheckedServerAdmin = wrapAdminService(Admin.class, getAdminAPI());
+ services.registerClientService(Admin.class, roleCheckedServerAdmin,
com.metamatrix.common.util.LogConstants.CTX_ADMIN);
services.registerClientService(ClientSideDQP.class, this.dqp,
LogConstants.CTX_QUERY_SERVICE);
@@ -391,8 +365,7 @@
}
}
- @Override
- public Admin getAdminAPI(Properties connectionProperties) throws AdminException {
+ private Admin getAdminAPI() {
InvocationHandler handler = new MixinProxy(new Object[] {
new DQPConfigAdminImpl(this),
Modified:
trunk/embedded/src/main/java/com/metamatrix/platform/security/authorization/service/AuthorizationServiceImpl.java
===================================================================
---
trunk/embedded/src/main/java/com/metamatrix/platform/security/authorization/service/AuthorizationServiceImpl.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/embedded/src/main/java/com/metamatrix/platform/security/authorization/service/AuthorizationServiceImpl.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -100,6 +100,7 @@
protected MembershipServiceInterface membershipService;
protected VDBService vdbService;
protected LRUCache<VDBKey, Collection<AuthorizationPolicy>> policyCache =
new LRUCache<VDBKey, Collection<AuthorizationPolicy>>();
+ private Collection<AuthorizationPolicy> adminPolicies;
// Permission factory is reusable and threadsafe
private static final BasicAuthorizationPermissionFactory PERMISSION_FACTORY = new
BasicAuthorizationPermissionFactory();
@@ -420,6 +421,9 @@
this.policyCache.put(key, policies);
}
}
+ else {
+ // update admin roles.
+ }
}
/**
@@ -542,6 +546,11 @@
public void setMembershipService(MembershipServiceInterface membershipService) {
this.membershipService = membershipService;
}
+
+// @Inject
+// public void setAdminPolicies(Collection<AuthorizationPolicy> adminPolicies)
{
+// this.adminPolicies = adminPolicies;
+// }
public void setUseEntitlements(boolean useEntitlements) {
this.useEntitlements = useEntitlements;
Modified: trunk/embedded/src/main/java/org/teiid/transport/LocalServerConnection.java
===================================================================
--- trunk/embedded/src/main/java/org/teiid/transport/LocalServerConnection.java 2009-07-01
19:04:52 UTC (rev 1092)
+++ trunk/embedded/src/main/java/org/teiid/transport/LocalServerConnection.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -36,7 +36,6 @@
import com.metamatrix.common.api.MMURL;
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.api.ServerConnectionListener;
import com.metamatrix.common.comm.exception.CommunicationException;
import com.metamatrix.common.comm.exception.ConnectionException;
import com.metamatrix.common.comm.platform.CommPlatformPlugin;
@@ -51,12 +50,11 @@
private final LogonResult result;
private boolean shutdown;
private DQPWorkContext workContext;
- private ServerConnectionListener listener;
private ClassLoader classLoader;
ClientServiceRegistry clientServices;
- public LocalServerConnection(Properties connectionProperties, ClientServiceRegistry
clientServices, ServerConnectionListener listener) throws CommunicationException,
ConnectionException{
+ public LocalServerConnection(Properties connectionProperties, ClientServiceRegistry
clientServices) throws CommunicationException, ConnectionException{
this.clientServices = clientServices;
@@ -66,12 +64,6 @@
this.result = authenticate(connectionProperties);
- this.listener = listener;
-
- if (this.listener != null) {
- this.listener.connectionAdded(this);
- }
-
this.classLoader = Thread.currentThread().getContextClassLoader();
}
@@ -124,9 +116,6 @@
if (shutdown) {
return;
}
- if (this.listener != null) {
- this.listener.connectionRemoved(this);
- }
this.shutdown = true;
}
Modified: trunk/embedded/src/main/java/org/teiid/transport/LogonImpl.java
===================================================================
--- trunk/embedded/src/main/java/org/teiid/transport/LogonImpl.java 2009-07-01 19:04:52
UTC (rev 1092)
+++ trunk/embedded/src/main/java/org/teiid/transport/LogonImpl.java 2009-07-02 19:57:16
UTC (rev 1093)
@@ -41,6 +41,7 @@
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.util.LogConstants;
import com.metamatrix.dqp.client.ResultsFuture;
+import com.metamatrix.dqp.service.ServerConnectionListener;
import com.metamatrix.jdbc.api.ConnectionProperties;
import com.metamatrix.platform.PlatformPlugin;
import com.metamatrix.platform.security.api.Credentials;
@@ -56,10 +57,12 @@
private SessionServiceInterface service;
private String clusterName;
+ private ServerConnectionListener connListener;
- public LogonImpl(SessionServiceInterface service, String clusterName) {
+ public LogonImpl(SessionServiceInterface service, String clusterName,
ServerConnectionListener connListener) {
this.service = service;
this.clusterName = clusterName;
+ this.connListener = connListener;
}
public LogonResult logon(Properties connProps) throws LogonException,
@@ -82,13 +85,10 @@
Object payload = connProps.get(MMURL.CONNECTION.CLIENT_TOKEN_PROP);
try {
- MetaMatrixSessionInfo sessionInfo = service.createSession(user,
- credential, (Serializable) payload, applicationName,
- connProps);
- // logon
+ MetaMatrixSessionInfo sessionInfo = service.createSession(user,credential,
(Serializable) payload, applicationName, connProps);
MetaMatrixSessionID sessionID = updateDQPContext(sessionInfo);
- LogManager.logDetail(LogConstants.CTX_SESSION, new Object[] {
- "Logon successful for \"", user, "\" - created SessionID
\"", "" + sessionID, "\"" }); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ this.connListener.connectionAdded(DQPWorkContext.getWorkContext());
+ LogManager.logDetail(LogConstants.CTX_SESSION, new Object[] {"Logon successful
for \"", user, "\" - created SessionID \"", "" +
sessionID, "\"" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
return new LogonResult(sessionInfo.getSessionToken(), sessionInfo.getProductInfo(),
clusterName);
} catch (MetaMatrixAuthenticationException e) {
throw new LogonException(e, e.getMessage());
@@ -150,6 +150,7 @@
public ResultsFuture<?> logoff() throws InvalidSessionException,
MetaMatrixComponentException {
try {
this.service.closeSession(DQPWorkContext.getWorkContext().getSessionId());
+ this.connListener.connectionRemoved(DQPWorkContext.getWorkContext());
} catch (SessionServiceException e) {
throw new MetaMatrixComponentException(e);
}
Modified: trunk/embedded/src/test/java/org/teiid/transport/TestCommSockets.java
===================================================================
--- trunk/embedded/src/test/java/org/teiid/transport/TestCommSockets.java 2009-07-01
19:04:52 UTC (rev 1092)
+++ trunk/embedded/src/test/java/org/teiid/transport/TestCommSockets.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -49,6 +49,7 @@
import com.metamatrix.common.comm.platform.socket.client.SocketServerConnectionFactory;
import com.metamatrix.common.comm.platform.socket.client.UrlServerDiscovery;
import com.metamatrix.common.util.crypto.NullCryptor;
+import com.metamatrix.dqp.service.ServerConnectionListener;
import com.metamatrix.platform.security.api.ILogon;
import com.metamatrix.platform.security.api.LogonResult;
import com.metamatrix.platform.security.api.service.SessionServiceInterface;
@@ -73,7 +74,7 @@
@Test public void testFailedConnect() throws Exception {
ClientServiceRegistry csr = new ClientServiceRegistry();
SessionServiceInterface sessionService = mock(SessionServiceInterface.class);
- csr.registerClientService(ILogon.class, new LogonImpl(sessionService,
"fakeCluster"), "foo"); //$NON-NLS-1$ //$NON-NLS-2$
+ csr.registerClientService(ILogon.class, new LogonImpl(sessionService,
"fakeCluster", mock(ServerConnectionListener.class)), "foo");
//$NON-NLS-1$ //$NON-NLS-2$
listener = new SocketListener(addr.getPort(), addr.getAddress().getHostAddress(),
csr, 1024, 1024, 1, null, true, sessionService);
@@ -144,7 +145,7 @@
if (listener == null) {
SessionServiceInterface sessionService = mock(SessionServiceInterface.class);
ClientServiceRegistry csr = new ClientServiceRegistry();
- csr.registerClientService(ILogon.class, new LogonImpl(sessionService,
"fakeCluster") { //$NON-NLS-1$
+ csr.registerClientService(ILogon.class, new LogonImpl(sessionService,
"fakeCluster", mock(ServerConnectionListener.class)) { //$NON-NLS-1$
@Override
public LogonResult logon(Properties connProps)
throws LogonException, ComponentNotFoundException {
Modified: trunk/embedded/src/test/java/org/teiid/transport/TestLogonImpl.java
===================================================================
--- trunk/embedded/src/test/java/org/teiid/transport/TestLogonImpl.java 2009-07-01
19:04:52 UTC (rev 1092)
+++ trunk/embedded/src/test/java/org/teiid/transport/TestLogonImpl.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -23,14 +23,18 @@
package org.teiid.transport;
+import static org.mockito.Mockito.mock;
+
import java.util.Properties;
import junit.framework.TestCase;
import org.mockito.Mockito;
+import org.teiid.dqp.internal.process.DQPWorkContext;
import com.metamatrix.api.exception.security.LogonException;
import com.metamatrix.common.api.MMURL;
+import com.metamatrix.dqp.service.ServerConnectionListener;
import com.metamatrix.platform.security.api.LogonResult;
import com.metamatrix.platform.security.api.MetaMatrixSessionID;
import com.metamatrix.platform.security.api.MetaMatrixSessionInfo;
@@ -55,16 +59,22 @@
Mockito.stub(ssi.createSession(userName, null, null, applicationName,
p)).toReturn(resultInfo);
- LogonImpl impl = new LogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
+ ServerConnectionListener listener = mock(ServerConnectionListener.class);
+ LogonImpl impl = new LogonImpl(ssi, "fakeCluster", listener); //$NON-NLS-1$
LogonResult result = impl.logon(p);
assertEquals(userName, result.getUserName());
assertEquals(new MetaMatrixSessionID(1), result.getSessionID());
+ Mockito.verify(listener,
Mockito.times(1)).connectionAdded((DQPWorkContext)Mockito.anyObject());
+ Mockito.verify(listener,
Mockito.times(0)).connectionRemoved((DQPWorkContext)Mockito.anyObject());
+
+ impl.logoff();
+ Mockito.verify(listener,
Mockito.times(1)).connectionRemoved((DQPWorkContext)Mockito.anyObject());
}
public void testCredentials() throws Exception {
SessionServiceInterface ssi = Mockito.mock(SessionServiceInterface.class);
- LogonImpl impl = new LogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
+ LogonImpl impl = new LogonImpl(ssi, "fakeCluster",
mock(ServerConnectionListener.class)); //$NON-NLS-1$
Properties p = new Properties();
p.put(MMURL.CONNECTION.CLIENT_TOKEN_PROP, new Object());
//invalid credentials
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/ConfigurationService.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/dqp/service/ConfigurationService.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/engine/src/main/java/com/metamatrix/dqp/service/ConfigurationService.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -28,11 +28,11 @@
import java.util.Properties;
import java.util.Set;
+import org.teiid.dqp.internal.process.DQPWorkContext;
+
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.application.ApplicationService;
import com.metamatrix.common.application.ClassLoaderManager;
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.api.ServerConnectionListener;
import com.metamatrix.common.config.api.ComponentType;
import com.metamatrix.common.config.api.ConfigurationModelContainer;
import com.metamatrix.common.config.api.ConnectorBinding;
@@ -371,7 +371,7 @@
* This returns the active client connections that have been made to the DQP
* @return list of connections which are currently available;never null
*/
- public Set<ServerConnection> getClientConnections();
+ public Set<DQPWorkContext> getClientConnections();
/**
* Gets the processor batch size
Copied:
trunk/engine/src/main/java/com/metamatrix/dqp/service/ServerConnectionListener.java (from
rev 1089,
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionListener.java)
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/ServerConnectionListener.java
(rev 0)
+++
trunk/engine/src/main/java/com/metamatrix/dqp/service/ServerConnectionListener.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.dqp.service;
+
+import org.teiid.dqp.internal.process.DQPWorkContext;
+
+
+
+/**
+ * An implementor of this interface, when registered with the ServerConnection will
+ * receive notifications about the connection life cycle events.
+ */
+public interface ServerConnectionListener {
+ /**
+ * A connection has been added to DQP
+ * @param connection The client connection instance, never null
+ */
+ void connectionAdded(DQPWorkContext context);
+
+ /**
+ * A connection has been removed for DQP
+ * @param connection The client connection instance, never null
+ */
+ void connectionRemoved(DQPWorkContext context);
+
+}
Property changes on:
trunk/engine/src/main/java/com/metamatrix/dqp/service/ServerConnectionListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-07-01 19:04:52 UTC (rev 1092)
+++ trunk/pom.xml 2009-07-02 19:57:16 UTC (rev 1093)
@@ -80,13 +80,16 @@
<configuration>
<descriptors>
<descriptor>build/assembly/src.xml</descriptor>
- <!-- <descriptor>build/assembly/bin.xml</descriptor>-->
- <descriptor>build/assembly/embedded/embedded-client-jar.xml</descriptor>
+ <descriptor>build/assembly/client-jar.xml</descriptor>
<descriptor>build/assembly/embedded/embedded-dependencies.xml</descriptor>
<descriptor>build/assembly/embedded/embedded-dist.xml</descriptor>
<descriptor>build/assembly/cdk/cdk-dependencies.xml</descriptor>
<descriptor>build/assembly/cdk/cdk-dist.xml</descriptor>
+
<descriptor>build/assembly/adminshell/adminshell-dependencies.xml</descriptor>
+
<descriptor>build/assembly/adminshell/adminshell-dist.xml</descriptor>
+ <!--
<descriptor>documentation/assembly/docs.xml</descriptor>
+ -->
</descriptors>
<outputDirectory>target/distribution</outputDirectory>
<workDirectory>target/assembly/work</workDirectory>
Modified:
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java 2009-07-01
19:04:52 UTC (rev 1092)
+++
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java 2009-07-02
19:57:16 UTC (rev 1093)
@@ -243,7 +243,7 @@
* @throws ConfigurationException
*/
private void registerILogonAPI() throws ConfigurationException, ServiceException {
- this.clientServices.registerClientService(ILogon.class, new
LogonImpl(PlatformProxyHelper.getSessionServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL),
CurrentConfiguration.getInstance().getClusterName()), LogCommonConstants.CTX_LOGON);
+ this.clientServices.registerClientService(ILogon.class, new
LogonImpl(PlatformProxyHelper.getSessionServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL),
CurrentConfiguration.getInstance().getClusterName(), null),
LogCommonConstants.CTX_LOGON);
}
/**