teiid SVN: r709 - trunk/hibernate-dialect.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-03 16:36:53 -0400 (Fri, 03 Apr 2009)
New Revision: 709
Modified:
trunk/hibernate-dialect/
Log:
ignoring eclipse metadata
Property changes on: trunk/hibernate-dialect
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
15 years, 11 months
teiid SVN: r708 - in trunk: hibernate-dialect and 7 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-03 16:35:45 -0400 (Fri, 03 Apr 2009)
New Revision: 708
Added:
trunk/hibernate-dialect/
trunk/hibernate-dialect/pom.xml
trunk/hibernate-dialect/src/
trunk/hibernate-dialect/src/main/
trunk/hibernate-dialect/src/main/java/
trunk/hibernate-dialect/src/main/java/org/
trunk/hibernate-dialect/src/main/java/org/teiid/
trunk/hibernate-dialect/src/main/java/org/teiid/dialect/
trunk/hibernate-dialect/src/main/java/org/teiid/dialect/TeiidDialect.java
trunk/hibernate-dialect/src/main/resources/
trunk/hibernate-dialect/src/test/
trunk/hibernate-dialect/src/test/java/
trunk/hibernate-dialect/src/test/resources/
Modified:
trunk/pom.xml
Log:
TEIID-416 adding the dialect based upon the MetaMatrix 5.5.3 dialect.
Added: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml (rev 0)
+++ trunk/hibernate-dialect/pom.xml 2009-04-03 20:35:45 UTC (rev 708)
@@ -0,0 +1,20 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>6.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-hibernate-dialect</artifactId>
+ <name>Hibernate Dialect</name>
+ <version>6.1.0-SNAPSHOT</version>
+ <description>Teiid Hibernate Dialect</description>
+ <dependencies>
+ <dependency>
+ <groupId>hibernate</groupId>
+ <artifactId>hibernate3</artifactId>
+ <version>3.2.3.GA</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Property changes on: trunk/hibernate-dialect/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/hibernate-dialect/src/main/java/org/teiid/dialect/TeiidDialect.java
===================================================================
--- trunk/hibernate-dialect/src/main/java/org/teiid/dialect/TeiidDialect.java (rev 0)
+++ trunk/hibernate-dialect/src/main/java/org/teiid/dialect/TeiidDialect.java 2009-04-03 20:35:45 UTC (rev 708)
@@ -0,0 +1,248 @@
+/*
+ * 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.dialect;
+
+import java.sql.CallableStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.hibernate.Hibernate;
+import org.hibernate.LockMode;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.dialect.function.NoArgSQLFunction;
+import org.hibernate.dialect.function.StandardSQLFunction;
+import org.hibernate.dialect.function.VarArgsSQLFunction;
+
+public class TeiidDialect extends Dialect {
+
+ public TeiidDialect() {
+ // Register types
+ registerColumnType(Types.CHAR, "char"); //$NON-NLS-1$
+ registerColumnType(Types.VARCHAR, "string"); //$NON-NLS-1$
+
+ registerColumnType(Types.BIT, "boolean"); //$NON-NLS-1$
+ registerColumnType(Types.TINYINT, "byte"); //$NON-NLS-1$
+ registerColumnType(Types.SMALLINT, "short"); //$NON-NLS-1$
+ registerColumnType(Types.INTEGER, "integer"); //$NON-NLS-1$
+ registerColumnType(Types.BIGINT, "long"); //$NON-NLS-1$
+
+ registerColumnType(Types.REAL, "float"); //$NON-NLS-1$
+ registerColumnType(Types.FLOAT, "float"); //$NON-NLS-1$
+ registerColumnType(Types.DOUBLE, "double"); //$NON-NLS-1$
+ registerColumnType(Types.NUMERIC, "bigdecimal"); //$NON-NLS-1$
+
+ registerColumnType(Types.DATE, "date"); //$NON-NLS-1$
+ registerColumnType(Types.TIME, "time"); //$NON-NLS-1$
+ registerColumnType(Types.TIMESTAMP, "timestamp"); //$NON-NLS-1$
+
+ registerColumnType(Types.BLOB, "blob"); //$NON-NLS-1$
+ registerColumnType(Types.VARBINARY, "blob"); //$NON-NLS-1$
+ registerColumnType(Types.CLOB, "clob"); //$NON-NLS-1$
+ registerColumnType(Types.JAVA_OBJECT, "object"); //$NON-NLS-1$
+
+ registerFunction("acos", new StandardSQLFunction("acos", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("asin", new StandardSQLFunction("asin", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("atan", new StandardSQLFunction("atan", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("atan2", new StandardSQLFunction("atan2", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("ceil", new StandardSQLFunction("ceiling")); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("cos", new StandardSQLFunction("cos", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("cot", new StandardSQLFunction("cot", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("degrees", new StandardSQLFunction("degrees", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("exp", new StandardSQLFunction("exp", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("floor", new StandardSQLFunction("floor")); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("formatbigdecimal", new StandardSQLFunction("formatbigdecimal", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("formatbiginteger", new StandardSQLFunction("formatbiginteger", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("formatdouble", new StandardSQLFunction("formatdouble", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("formatfloat", new StandardSQLFunction("formatfloat", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("formatinteger", new StandardSQLFunction("formatinteger", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("formatlong", new StandardSQLFunction("formatlong", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("log", new StandardSQLFunction("log", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("mod", new StandardSQLFunction("mod")); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("parsebigdecimal", new StandardSQLFunction("parsebigdecimal", Hibernate.BIG_DECIMAL)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("parsebiginteger", new StandardSQLFunction("parsebiginteger", Hibernate.BIG_INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("parsedouble", new StandardSQLFunction("parsedouble", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("parsefloat", new StandardSQLFunction("parsefloat", Hibernate.FLOAT)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("parseinteger", new StandardSQLFunction("parseinteger", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("parselong", new StandardSQLFunction("parselong", Hibernate.LONG)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("pi", new StandardSQLFunction("pi", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("power", new StandardSQLFunction("power", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("radians", new StandardSQLFunction("radians", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("round", new StandardSQLFunction("round")); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("sign", new StandardSQLFunction("sign", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("sin", new StandardSQLFunction("sin", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("tan", new StandardSQLFunction("tan", Hibernate.DOUBLE)); //$NON-NLS-1$ //$NON-NLS-2$
+
+ registerFunction("ascii", new StandardSQLFunction("ascii", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("chr", new StandardSQLFunction("chr", Hibernate.CHARACTER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("char", new StandardSQLFunction("char", Hibernate.CHARACTER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("concat", new VarArgsSQLFunction(Hibernate.STRING, "", "||", "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ registerFunction("initcap", new StandardSQLFunction("initcap", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("insert", new StandardSQLFunction("insert", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("lcase", new StandardSQLFunction("lcase", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("left", new StandardSQLFunction("left", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("locate", new StandardSQLFunction("locate", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("lpad", new StandardSQLFunction("lpad", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("ltrim", new StandardSQLFunction("ltrim", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("repeat", new StandardSQLFunction("repeat", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("replace", new StandardSQLFunction("replace", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("right", new StandardSQLFunction("right", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("rpad", new StandardSQLFunction("rpad", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("rtrim", new StandardSQLFunction("rtrim", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("substring", new StandardSQLFunction("substring", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("translate", new StandardSQLFunction("translate", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("ucase", new StandardSQLFunction("ucase", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+
+ registerFunction("curdate", new NoArgSQLFunction("curdate", Hibernate.DATE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("curtime", new NoArgSQLFunction("curtime", Hibernate.TIME)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("now", new NoArgSQLFunction("now", Hibernate.TIMESTAMP)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("dayname", new StandardSQLFunction("dayname", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("dayofmonth", new StandardSQLFunction("dayofmonth", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("dayofweek", new StandardSQLFunction("dayofweek", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("dayofyear", new StandardSQLFunction("dayofyear", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("formatdate", new StandardSQLFunction("formatdate", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("formattime", new StandardSQLFunction("formattime", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("formattimestamp", new StandardSQLFunction("formattimestamp", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("hour", new StandardSQLFunction("hour", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("minute", new StandardSQLFunction("minute", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("monthname", new StandardSQLFunction("monthname", Hibernate.STRING)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("parsedate", new StandardSQLFunction("parsedate", Hibernate.DATE)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("parsetime", new StandardSQLFunction("parsetime", Hibernate.TIME)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("parsetimestamp", new StandardSQLFunction("parsetimestamp", Hibernate.TIMESTAMP)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("second", new StandardSQLFunction("second", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("timestampcreate", new StandardSQLFunction("timestampcreate", Hibernate.TIMESTAMP)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("timestampAdd", new StandardSQLFunction("timestampAdd")); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("timestampDiff", new StandardSQLFunction("timestampDiff", Hibernate.LONG)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("week", new StandardSQLFunction("week", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("year", new StandardSQLFunction("year", Hibernate.INTEGER)); //$NON-NLS-1$ //$NON-NLS-2$
+ registerFunction("modifytimezone", new StandardSQLFunction("modifytimezone", Hibernate.TIMESTAMP)); //$NON-NLS-1$ //$NON-NLS-2$
+
+ registerFunction("convert", new StandardSQLFunction("convert")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public boolean dropConstraints() {
+ return false;
+ }
+
+ public boolean hasAlterTable() {
+ return false;
+ }
+
+ public boolean supportsColumnCheck() {
+ return false;
+ }
+
+ public boolean supportsCascadeDelete() {
+ return false;
+ }
+
+ public String getCurrentTimestampSQLFunctionName() {
+ return "now"; //$NON-NLS-1$
+ }
+
+ public boolean isCurrentTimestampSelectStringCallable() {
+ return false;
+ }
+
+ public boolean supportsCurrentTimestampSelection() {
+ return true;
+ }
+
+ public boolean supportsLimit() {
+ return true;
+ }
+
+ public boolean supportsOuterJoinForUpdate() {
+ return false;
+ }
+
+ public boolean supportsTableCheck() {
+ return false;
+ }
+
+ public boolean supportsUnionAll() {
+ return true;
+ }
+
+ public boolean supportsUnique() {
+ return false;
+ }
+
+ public String toBooleanValueString(boolean arg0) {
+ if (arg0) {
+ return "{b'true'}"; //$NON-NLS-1$
+ }
+ return "{b'false'}"; //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.hibernate.dialect.Dialect#getLimitString(java.lang.String, boolean)
+ */
+ public String getLimitString(String querySelect,
+ boolean hasOffset) {
+ return new StringBuffer(querySelect.length() + 20).append(querySelect).append(hasOffset ? " limit ?, ?" : " limit ?") //$NON-NLS-1$ //$NON-NLS-2$
+ .toString();
+ }
+
+ /**
+ * @see org.hibernate.dialect.Dialect#getResultSet(java.sql.CallableStatement)
+ */
+ public ResultSet getResultSet(CallableStatement ps) throws SQLException {
+ boolean isResultSet = ps.execute();
+ while (!isResultSet && ps.getUpdateCount() != -1) {
+ isResultSet = ps.getMoreResults();
+ }
+ ResultSet rs = ps.getResultSet();
+ return rs;
+ }
+
+ /**
+ * @see org.hibernate.dialect.Dialect#registerResultSetOutParameter(java.sql.CallableStatement, int)
+ */
+ public int registerResultSetOutParameter(CallableStatement statement,
+ int col) throws SQLException {
+ return col;
+ }
+
+ public String getForUpdateNowaitString() {
+ return ""; //$NON-NLS-1$
+ }
+
+ public String getForUpdateNowaitString(String aliases) {
+ return ""; //$NON-NLS-1$
+ }
+
+ public String getForUpdateString() {
+ return ""; //$NON-NLS-1$
+ }
+
+ public String getForUpdateString(LockMode lockMode) {
+ return ""; //$NON-NLS-1$
+ }
+
+ public String getForUpdateString(String aliases) {
+ return ""; //$NON-NLS-1$
+ }
+
+}
+
Property changes on: trunk/hibernate-dialect/src/main/java/org/teiid/dialect/TeiidDialect.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-04-03 20:34:01 UTC (rev 707)
+++ trunk/pom.xml 2009-04-03 20:35:45 UTC (rev 708)
@@ -462,6 +462,7 @@
<module>connector-metadata</module>
<module>cache-jbosscache</module>
<module>server-installer</module>
+ <module>hibernate-dialect</module>
</modules>
<distributionManagement>
<repository>
15 years, 11 months
teiid SVN: r707 - trunk/engine/src/main/java/com/metamatrix/cache.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-03 16:34:01 -0400 (Fri, 03 Apr 2009)
New Revision: 707
Modified:
trunk/engine/src/main/java/com/metamatrix/cache/Cache.java
Log:
removing federate name
Modified: trunk/engine/src/main/java/com/metamatrix/cache/Cache.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/cache/Cache.java 2009-04-03 19:51:39 UTC (rev 706)
+++ trunk/engine/src/main/java/com/metamatrix/cache/Cache.java 2009-04-03 20:34:01 UTC (rev 707)
@@ -28,7 +28,7 @@
/**
- * Federate abstraction over cache providers
+ * Abstraction over cache providers
*/
public interface Cache<K, V> {
15 years, 11 months
teiid SVN: r706 - trunk/client/src/test/java/com/metamatrix/common/comm.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-03 15:51:39 -0400 (Fri, 03 Apr 2009)
New Revision: 706
Removed:
trunk/client/src/test/java/com/metamatrix/common/comm/exception/
Log:
TEIID-458, TEIID-454, TEIID-445 changing back to using a separate pool for socket work, removing the retry logic from console relogons and properly display queue information
15 years, 11 months
teiid SVN: r705 - in trunk: client/src/main/java/com/metamatrix/common/comm/platform/socket/client and 14 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-03 15:51:36 -0400 (Fri, 03 Apr 2009)
New Revision: 705
Modified:
trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/AdminApiServerDiscovery.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServerDiscovery.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java
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/SocketServerInstance.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java
trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java
trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestAdminApiServerDiscovery.java
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java
trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java
trunk/embedded/src/main/java/com/metamatrix/jdbc/transport/LocalServerConnection.java
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketClientInstance.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java
trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionServiceInterface.java
trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java
trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java
trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java
trunk/server/src/test/java/com/metamatrix/platform/security/session/service/TestSessionServiceImpl.java
Log:
TEIID-458, TEIID-454, TEIID-445 changing back to using a separate pool for socket work, removing the retry logic from console relogons and properly display queue information
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -25,6 +25,8 @@
import com.metamatrix.platform.security.api.LogonResult;
public interface ServerConnection {
+
+ public static final int PING_INTERVAL = 120000;
<T> T getService(Class<T> iface);
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/AdminApiServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/AdminApiServerDiscovery.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/AdminApiServerDiscovery.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -24,7 +24,10 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import com.metamatrix.admin.api.exception.AdminException;
@@ -36,7 +39,6 @@
/**
* Will discover hosts based upon an anon admin api call.
- * TODO: perform active polling
*/
public class AdminApiServerDiscovery extends UrlServerDiscovery {
@@ -46,62 +48,56 @@
*/
public static final String USE_URL_HOST = "AdminApiServerDiscovery.useUrlHost"; //$NON-NLS-1$
- private volatile List<HostInfo> knownHosts;
+ public static final int DISCOVERY_TIMEOUT = 120000;
- private volatile boolean discoveredHosts;
- private volatile boolean authenticated;
+ static class ClusterInfo {
+ volatile long lastDiscoveryTime;
+ volatile List<HostInfo> knownHosts = new ArrayList<HostInfo>();
+ }
- private HostInfo lastHostInfo;
- private SocketServerInstance lastServerInstance;
+ private static Map<String, ClusterInfo> clusterInfo = Collections.synchronizedMap(new HashMap<String, ClusterInfo>());
private boolean useUrlHost;
@Override
- public List<HostInfo> getKnownHosts() {
- if (!discoveredHosts) {
- return super.getKnownHosts();
- }
- return knownHosts;
- }
-
- @Override
public void init(MMURL url, Properties p) {
super.init(url, p);
+ //TODO: this could be on a per cluster basis
useUrlHost = Boolean.valueOf(p.getProperty(USE_URL_HOST)).booleanValue();
}
-
+
@Override
- public synchronized void connectionSuccessful(HostInfo info, SocketServerInstance instance) {
- super.connectionSuccessful(info, instance);
- this.lastHostInfo = info;
- this.lastServerInstance = instance;
- discoverHosts();
- }
-
- private synchronized void discoverHosts() {
- if (discoveredHosts || !authenticated) {
- return;
+ public List<HostInfo> getKnownHosts(LogonResult result,
+ SocketServerInstance instance) {
+ if (result == null) {
+ return super.getKnownHosts(result, instance);
}
- ServerAdmin serverAdmin = lastServerInstance.getService(ServerAdmin.class);
- try {
- Collection<ProcessObject> processes = serverAdmin.getProcesses("*");
- this.knownHosts = new ArrayList<HostInfo>(processes.size());
- for (ProcessObject processObject : processes) {
- if (!processObject.isEnabled()) {
- continue;
+ ClusterInfo info = clusterInfo.get(result.getClusterName());
+ if (info == null) {
+ info = new ClusterInfo();
+ }
+ synchronized (info) {
+ if (instance != null
+ && (info.lastDiscoveryTime < System.currentTimeMillis() - DISCOVERY_TIMEOUT || info.knownHosts.isEmpty())) {
+ ServerAdmin serverAdmin = instance.getService(ServerAdmin.class);
+ try {
+ Collection<ProcessObject> processes = serverAdmin.getProcesses("*");
+ info.knownHosts.clear();
+ for (ProcessObject processObject : processes) {
+ if (!processObject.isEnabled() || !processObject.isRunning()) {
+ continue;
+ }
+ info.knownHosts.add(new HostInfo(useUrlHost?instance.getHostInfo().getHostName():processObject.getInetAddress().getHostName(), processObject.getPort()));
+ }
+ info.lastDiscoveryTime = System.currentTimeMillis();
+ } catch (AdminException e) {
+ //ignore - will get an update on the next successful connection
}
- this.knownHosts.add(new HostInfo(useUrlHost?lastHostInfo.getHostName():processObject.getInetAddress().getHostName(), processObject.getPort()));
}
- discoveredHosts = true;
- } catch (AdminException e) {
- //ignore - will get an update on the next successful connection
+ if (info.knownHosts.size() == 0) {
+ return super.getKnownHosts(result, instance);
+ }
+ return new ArrayList<HostInfo>(info.knownHosts);
}
}
-
- @Override
- public boolean setLogonResult(LogonResult result) {
- this.authenticated = true;
- discoverHosts();
- return this.discoveredHosts;
- }
}
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServerDiscovery.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServerDiscovery.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -31,27 +31,39 @@
/**
* Customizable ServerDiscovery interface
- *
- * TODO: add knowledge of the cluster/ServerConnection in the getKnownHosts calls
*/
public interface ServerDiscovery {
+ /**
+ * Initialize the {@link ServerDiscovery}
+ * @param url
+ * @param p
+ */
void init(MMURL url, Properties p);
- List<HostInfo> getKnownHosts();
+ /**
+ * Get the currently known hosts.
+ * @param result, the current {@link LogonResult} - may be null if unauthenticated
+ * @param instance, the currently connected instance - may be null if not connected
+ * @return
+ */
+ List<HostInfo> getKnownHosts(LogonResult result, SocketServerInstance instance);
- void connectionSuccessful(HostInfo info, SocketServerInstance instance);
+ /**
+ * Indicates that a connection was made successfully to the given host.
+ * @param info
+ */
+ void connectionSuccessful(HostInfo info);
+ /**
+ * Indicates that a connection could not be made to the given host.
+ * @param info
+ */
void markInstanceAsBad(HostInfo info);
- void shutdown();
-
/**
- * Sets the {@link LogonResult} after authentication. The {@link LogonResult} will contain information
- * such as the cluster name that can be used for more efficient discovery.
- * @param result
- * @return <code>true</code> if the connection should select another instance after logon.
+ * Shutdown this {@link ServerDiscovery}
*/
- boolean setLogonResult(LogonResult result);
-
+ void shutdown();
+
}
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -94,8 +94,27 @@
authenticate();
this.pingTimer = pingTimer;
- if (this.pingTimer != null && logonResult.getPingInterval() > 0) {
- schedulePing();
+ schedulePing();
+ }
+
+ private void schedulePing() {
+ if (this.pingTimer != null) {
+ this.pingTimer.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ try {
+ if (isOpen()) {
+ logon.ping();
+ return;
+ }
+ } catch (InvalidSessionException e) {
+ shutdown();
+ } catch (MetaMatrixComponentException e) {
+ shutdown();
+ }
+ this.cancel();
+ }
+ }, PING_INTERVAL, PING_INTERVAL);
}
}
@@ -113,9 +132,9 @@
if (this.serverInstance.isOpen()) {
return this.serverInstance;
}
- closeServerInstance();
}
- List<HostInfo> hostKeys = new ArrayList<HostInfo>(this.serverDiscovery.getKnownHosts());
+ List<HostInfo> hostKeys = new ArrayList<HostInfo>(this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance));
+ closeServerInstance();
List<HostInfo> hostCopy = new ArrayList<HostInfo>(hostKeys);
int knownHosts = hostKeys.size();
while (hostKeys.size() > 0) {
@@ -128,7 +147,7 @@
ILogon newLogon = instance.getService(ILogon.class);
newLogon.assertIdentity(logonResult.getSessionID());
}
- this.serverDiscovery.connectionSuccessful(hostInfo, instance);
+ this.serverDiscovery.connectionSuccessful(hostInfo);
this.serverInstance = instance;
return this.serverInstance;
} catch (IOException e) {
@@ -158,7 +177,8 @@
// Log on to server
try {
this.logonResult = logon.logon(connProps);
- if (this.serverDiscovery.setLogonResult(this.logonResult)) {
+ if (this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance).size() > 1) {
+ //if there are multiple instances, allow for load-balancing
closeServerInstance();
}
return;
@@ -174,25 +194,6 @@
}
}
- private void schedulePing() {
- this.pingTimer.schedule(new TimerTask() {
-
- @Override
- public void run() {
- try {
- if (isOpen()) {
- logon.ping();
- schedulePing();
- }
- } catch (InvalidSessionException e) {
- shutdown();
- } catch (MetaMatrixComponentException e) {
- shutdown();
- }
-
- }}, logonResult.getPingInterval());
- }
-
class ServerConnectionInvocationHandler implements InvocationHandler {
private Class<?> targetClass;
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-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -38,11 +38,10 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.api.HostInfo;
import com.metamatrix.common.api.MMURL;
import com.metamatrix.common.comm.api.ServerConnectionFactory;
@@ -67,7 +66,8 @@
private static final String URL = "URL"; //$NON-NLS-1$
private static SocketServerConnectionFactory INSTANCE;
-
+ private static Logger log = Logger.getLogger("org.teiid.client.sockets"); //$NON-NLS-1$
+
private final class ShutdownHandler implements InvocationHandler {
private final CachedInstance key;
@@ -200,11 +200,8 @@
Future<?> success = logon.ping();
success.get(this.channelFactory.getSoTimeout(), TimeUnit.MICROSECONDS);
valid = true;
- } catch (MetaMatrixComponentException e) {
- } catch (InvalidSessionException e) {
- } catch (InterruptedException e) {
- } catch (ExecutionException e) {
- } catch (TimeoutException e) {
+ } catch (Exception e) {
+ log.log(Level.FINE, "Error performing ping, will select another instance", e); //$NON-NLS-1$
}
if (valid) {
return instance.proxy;
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstance.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstance.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstance.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -24,6 +24,7 @@
import java.net.SocketAddress;
+import com.metamatrix.common.api.HostInfo;
import com.metamatrix.common.util.crypto.Cryptor;
public interface SocketServerInstance {
@@ -34,6 +35,8 @@
SocketAddress getRemoteAddress();
+ HostInfo getHostInfo();
+
boolean isOpen();
Cryptor getCryptor();
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -106,6 +106,11 @@
}
@Override
+ public HostInfo getHostInfo() {
+ return this.hostInfo;
+ }
+
+ @Override
public SocketAddress getRemoteAddress() {
return this.socketChannel.getRemoteAddress();
}
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -44,7 +44,8 @@
}
@Override
- public List<HostInfo> getKnownHosts() {
+ public List<HostInfo> getKnownHosts(LogonResult result,
+ SocketServerInstance instance) {
return url.getHostInfo();
}
@@ -52,10 +53,9 @@
public void init(MMURL url, Properties p) {
this.url = url;
}
-
+
@Override
- public void connectionSuccessful(HostInfo info,
- SocketServerInstance instance) {
+ public void connectionSuccessful(HostInfo info) {
}
@@ -63,13 +63,8 @@
public void markInstanceAsBad(HostInfo info) {
}
-
+
@Override
- public boolean setLogonResult(LogonResult result) {
- return false;
- }
-
- @Override
public void shutdown() {
}
Modified: trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -40,7 +40,6 @@
private TimeZone timeZone = TimeZone.getDefault();
private final Properties productInfo;
private String userName;
- private long pingInterval;
private String clusterName;
public LogonResult() {
@@ -48,11 +47,10 @@
}
public LogonResult(MetaMatrixSessionID sessionID,
- String userName, Properties productInfo, long pingInterval, String clusterName) {
+ String userName, Properties productInfo, String clusterName) {
this.sessionID = sessionID;
this.userName = userName;
this.productInfo = productInfo;
- this.pingInterval = pingInterval;
this.clusterName = clusterName;
}
@@ -77,10 +75,6 @@
return userName;
}
- public long getPingInterval() {
- return pingInterval;
- }
-
public String getClusterName() {
return clusterName;
}
Modified: trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -36,9 +36,7 @@
private SessionToken sessionToken; // immutable
private long lastPingTime;
private long timeCreated;
- private long timeStateChanged;
private String applicationName;
- private int state;
private String product;
private Properties productInfo;
private String clientIp;
@@ -49,11 +47,10 @@
* Master constructor, allows a MetaMatrixSessionInfo to be created with
* any state and any timestamps.
*/
- public MetaMatrixSessionInfo(MetaMatrixSessionID sessionID, String userName, long timeCreated, String applicationName, int state, String clusterName, Properties productInfo, String product, String clientIp, String clientHostname){
+ public MetaMatrixSessionInfo(MetaMatrixSessionID sessionID, String userName, long timeCreated, String applicationName, Properties productInfo, String product, String clientIp, String clientHostname){
this.timeCreated = timeCreated;
this.lastPingTime = timeCreated;
this.applicationName = applicationName;
- this.state = state;
this.product = product;
this.sessionToken = new SessionToken(sessionID, userName);
this.productInfo = productInfo;
@@ -100,18 +97,10 @@
return this.product;
}
- public boolean isOpen() {
- return (this.state == MetaMatrixSessionState.ACTIVE);
- }
-
public SessionToken getSessionToken(){
return this.sessionToken;
}
- public int getState(){
- return this.state;
- }
-
/**
* Return a cloned instance of this object.
* @return the object that is the clone of this instance.
@@ -135,12 +124,8 @@
s.append(", "); //$NON-NLS-1$
s.append("application:"); //$NON-NLS-1$
s.append(this.applicationName);
- s.append(", state:"); //$NON-NLS-1$
- s.append(this.state);
s.append(", created:"); //$NON-NLS-1$
s.append(this.timeCreated);
- s.append(", state changed:"); //$NON-NLS-1$
- s.append(this.timeStateChanged);
s.append(", last pinged server:"); //$NON-NLS-1$
s.append(this.lastPingTime);
s.append("]"); //$NON-NLS-1$
Modified: trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestAdminApiServerDiscovery.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestAdminApiServerDiscovery.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestAdminApiServerDiscovery.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -22,6 +22,7 @@
package com.metamatrix.common.comm.platform.socket.client;
+import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@@ -42,33 +43,36 @@
AdminApiServerDiscovery discovery = new AdminApiServerDiscovery();
Properties p = new Properties();
p.setProperty(AdminApiServerDiscovery.USE_URL_HOST, Boolean.TRUE.toString());
- MMURL mmurl = new MMURL("foo", 1, false);
+ MMURL mmurl = new MMURL("foo", 1, false); //$NON-NLS-1$
discovery.init(mmurl, p);
-
+ HostInfo knownHost = mmurl.getHostInfo().get(0);
//we will start off using the url host
- assertEquals(1, discovery.getKnownHosts().size());
+ assertEquals(1, discovery.getKnownHosts(null, null).size());
SocketServerInstance instance = Mockito.mock(SocketServerInstance.class);
ServerAdmin serverAdmin = Mockito.mock(ServerAdmin.class);
List<ProcessObject> processes = new ArrayList<ProcessObject>();
ProcessObject p1 = Mockito.mock(ProcessObject.class);
- Mockito.stub(p1.isEnabled()).toReturn(false);
Mockito.stub(p1.getPort()).toReturn(5);
processes.add(p1);
ProcessObject p2 = Mockito.mock(ProcessObject.class);
Mockito.stub(p2.isEnabled()).toReturn(true);
+ Mockito.stub(p2.isRunning()).toReturn(true);
Mockito.stub(p2.getPort()).toReturn(6);
+ Mockito.stub(p2.getInetAddress()).toReturn(InetAddress.getByName("0.0.0.0")); //$NON-NLS-1$
processes.add(p2);
+ Mockito.stub(serverAdmin.getProcesses("*")).toReturn(processes); //$NON-NLS-1$
+ Mockito.stub(instance.getService(ServerAdmin.class)).toReturn(serverAdmin);
+ Mockito.stub(instance.getHostInfo()).toReturn(knownHost);
- Mockito.stub(serverAdmin.getProcesses("*")).toReturn(processes);
- Mockito.stub(instance.getService(ServerAdmin.class)).toReturn(serverAdmin);
- discovery.connectionSuccessful(discovery.getKnownHosts().get(0), instance);
- discovery.setLogonResult(new LogonResult());
- List<HostInfo> knownHosts = discovery.getKnownHosts();
+ discovery.connectionSuccessful(knownHost);
+ List<HostInfo> knownHosts = discovery.getKnownHosts(new LogonResult(), instance);
+
assertEquals(1, knownHosts.size());
HostInfo h = knownHosts.get(0);
- assertEquals("foo", h.getHostName());
+ //the returned host should have the url name, but the process port
+ assertEquals("foo", h.getHostName()); //$NON-NLS-1$
assertEquals(6, h.getPortNumber());
}
Modified: trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -78,7 +78,7 @@
Properties connectionProperties)
throws LogonException,
MetaMatrixComponentException {
- return new LogonResult(new MetaMatrixSessionID(1), "fooUser", new Properties(), 1, "fake"); //$NON-NLS-1$ //$NON-NLS-2$
+ return new LogonResult(new MetaMatrixSessionID(1), "fooUser", new Properties(), "fake"); //$NON-NLS-1$ //$NON-NLS-2$
}
@Override
Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java
===================================================================
--- trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -45,10 +45,9 @@
public TestMMConnection(String name) {
super(name);
- System.setProperty("metamatrix.config.none", "true");
}
- public static MMServerConnection getMMConnection() throws SQLException {
+ public static MMServerConnection getMMConnection() {
ServerConnection mock = mock(ServerConnection.class);
stub(mock.getService(ClientSideDQP.class)).toReturn(mock(ClientSideDQP.class));
Properties props = new Properties();
@@ -58,7 +57,7 @@
Properties productInfo = new Properties();
productInfo.setProperty(ProductInfoConstants.VIRTUAL_DB, STD_DATABASE_NAME);
productInfo.setProperty(ProductInfoConstants.VDB_VERSION, STD_DATABASE_VERSION);
- stub(mock.getLogonResult()).toReturn(new LogonResult(new MetaMatrixSessionID(1), "metamatrixadmin", productInfo, 1, "fake")); //$NON-NLS-1$
+ stub(mock.getLogonResult()).toReturn(new LogonResult(new MetaMatrixSessionID(1), "metamatrixadmin", productInfo, "fake")); //$NON-NLS-1$
return new MMServerConnection(mock, props, serverUrl);
}
Modified: trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -44,43 +44,7 @@
/** An error code. */
private String code;
- /** Construct a default instance of this class. */
- public MultipleException() {
- super();
- }
-
/**
- * Construct an instance with the error message specified.
- *
- * @param message The error message
- */
- public MultipleException( String message ) {
- super( message );
- }
-
- /**
- * Construct an instance with an error code and message specified.
- *
- * @param message The error message
- * @param code The error code
- */
- public MultipleException( String code, String message ) {
- super( message );
- setCode( code );
- }
-
- /**
- * Construct an instance with the set of exceptions specified.
- *
- * @param throwables the set of exceptions that is to comprise
- * this exception
- */
- public MultipleException( Collection throwables ) {
- super();
- setExceptions(throwables);
- }
-
- /**
* Construct an instance with the set of exceptions and error message
* specified.
*
@@ -89,8 +53,7 @@
* @param message The error message
*/
public MultipleException( Collection throwables, String message ) {
- super( message );
- setExceptions(throwables);
+ this( throwables, null, message );
}
/**
@@ -102,9 +65,9 @@
* @param message The error message
* @param code The error code
*/
- public MultipleException( Collection throwables, String code, String message ) {
+ public MultipleException( Collection<Throwable> throwables, String code, String message ) {
super( message );
- setExceptions(throwables);
+ this.throwablesList = Collections.unmodifiableList(new ArrayList<Throwable>(throwables));
setCode( code );
}
@@ -132,15 +95,6 @@
return this.throwablesList;
}
- /**
- * Set the exceptions that comprise this exception.
- * @param throwables the set of exceptions that is to comprise
- * this exception
- */
- public void setExceptions( Collection throwables ){
- this.throwablesList = new ArrayList(throwables);
- }
-
@Override
public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException {
this.code = (String)in.readObject();
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -42,6 +42,7 @@
private QueueStatisticsRefreshRequestHandler controller;
private ProcessStatistics vmStatistics;
private ProcessVMStatisticsPanel processPanel;
+ private SingleQueueStatisticsPanel queuePanel;
private SocketVMStatisticsPanel socketPanel;
private AbstractButton closeButton;
@@ -83,10 +84,13 @@
JPanel statsPanel = new JPanel(statsLayout);
processPanel = new ProcessVMStatisticsPanel(vmStatistics.name);
processPanel.populate(vmStatistics);
+ queuePanel = new SingleQueueStatisticsPanel("Socket Worker");
+ queuePanel.populate(vmStatistics.processPoolStats);
socketPanel = new SocketVMStatisticsPanel();
socketPanel.populate(vmStatistics);
statsPanel.add(processPanel);
+ statsPanel.add(queuePanel);
statsPanel.add(socketPanel);
this.add(statsPanel);
@@ -100,6 +104,9 @@
statsLayout.setConstraints(processPanel, new GridBagConstraints(0, 0, 1, 1,
1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(4, 4, 4, 4), 0, 0));
+ statsLayout.setConstraints(queuePanel, new GridBagConstraints(0, 1, 1, 1,
+ 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+ new Insets(4, 4, 4, 4), 0, 0));
statsLayout.setConstraints(socketPanel, new GridBagConstraints(0, 2, 1, 1,
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(4, 4, 4, 4), 0, 0));
@@ -116,6 +123,7 @@
public void repopulate(ProcessStatistics vmStat) {
vmStatistics = vmStat;
processPanel.populate(vmStatistics);
+ queuePanel.populate(vmStatistics.processPoolStats);
socketPanel.populate(vmStatistics);
}
@@ -166,8 +174,6 @@
"Message Packets Written",
"Num. Sockets",
"Highest Num. Sockets",
- "Current Thread Count",
- "Highest Thread Count",
};
@@ -192,8 +198,6 @@
textFieldWidgets[1].setText(Long.toString(listenerStats.objectsWritten));
textFieldWidgets[2].setText(Integer.toString(listenerStats.sockets));
textFieldWidgets[3].setText(Integer.toString(listenerStats.maxSockets));
- textFieldWidgets[4].setText(Integer.toString(vmStats.processPoolStats.getActiveThreads()));
- textFieldWidgets[5].setText(Integer.toString(vmStats.processPoolStats.getHighestActiveThreads()));
}
}
\ No newline at end of file
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -76,7 +76,6 @@
import com.metamatrix.console.util.StaticUtilities;
import com.metamatrix.platform.security.api.MetaMatrixSessionID;
import com.metamatrix.platform.security.api.MetaMatrixSessionInfo;
-import com.metamatrix.platform.security.api.MetaMatrixSessionState;
import com.metamatrix.platform.util.ProductInfoConstants;
import com.metamatrix.toolbox.ui.widget.TableWidget;
import com.metamatrix.toolbox.ui.widget.table.EnhancedTableColumn;
@@ -400,23 +399,7 @@
}
data[i][SessionTableModel.VDB_VERSION_COLUMN_NUM] = vdbVersStr;
- String sessionState;
- switch (u.getState()){
- case MetaMatrixSessionState.EXPIRED:
- sessionState = EXPIRED_TEXT;
- break;
- case MetaMatrixSessionState.ACTIVE:
- sessionState = ACTIVE_TEXT;
- break;
- case MetaMatrixSessionState.CLOSED:
- sessionState = CLOSED_TEXT;
- break;
- case MetaMatrixSessionState.TERMINATED:
- sessionState = TERMINATED_TEXT;
- break;
- default:
- sessionState = DEFAULT_TEXT;
- }
+ String sessionState = ACTIVE_TEXT;
data[i][SessionTableModel.STATE_COLUMN_NUM] = sessionState;
data[i][SessionTableModel.PRODUCT_COLUMN_NUM]= u.getProductName();
Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/transport/LocalServerConnection.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/transport/LocalServerConnection.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/transport/LocalServerConnection.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -49,7 +49,7 @@
private ServerConnectionListener listener;
public LocalServerConnection(MetaMatrixSessionID sessionId, Properties connectionProperties, ClientSideDQP dqp, ServerConnectionListener listener) {
- result = new LogonResult(sessionId, connectionProperties.getProperty(MMURL.CONNECTION.USER_NAME), connectionProperties, -1, "local"); //$NON-NLS-1$
+ result = new LogonResult(sessionId, connectionProperties.getProperty(MMURL.CONNECTION.USER_NAME), connectionProperties, "local"); //$NON-NLS-1$
//Initialize the workContext
workContext = new DQPWorkContext();
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -92,6 +92,7 @@
import com.metamatrix.platform.registry.ClusteredRegistryState;
import com.metamatrix.platform.registry.ServiceRegistryBinding;
import com.metamatrix.platform.security.api.MetaMatrixSessionInfo;
+import com.metamatrix.platform.security.api.MetaMatrixSessionState;
import com.metamatrix.platform.security.api.SessionToken;
import com.metamatrix.platform.service.api.exception.ServiceException;
import com.metamatrix.platform.util.ProductInfoConstants;
@@ -920,7 +921,7 @@
session.setVDBVersion(vdbVersionString);
session.setProductName(info.getProductName());
session.setLastPingTime(info.getLastPingTime());
- session.setSessionState(info.getState());
+ session.setSessionState(MetaMatrixSessionState.ACTIVE);
session.setIPAddress(info.getClientIp());
session.setHostName(info.getClientHostname());
results.add(session);
Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -91,7 +91,7 @@
MetaMatrixSessionID sessionID = updateDQPContext(sessionInfo);
LogManager.logDetail(LogSecurityConstants.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(sessionID, sessionInfo.getUserName(), sessionInfo.getProductInfo(), service.getPingInterval(), clusterName);
+ return new LogonResult(sessionID, sessionInfo.getUserName(), sessionInfo.getProductInfo(), clusterName);
} catch (MetaMatrixAuthenticationException e) {
throw new LogonException(e, e.getMessage());
} catch (ServiceException e) {
Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -40,12 +40,10 @@
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.comm.api.Message;
-import com.metamatrix.common.comm.platform.socket.SocketVMController;
import com.metamatrix.common.comm.platform.socket.client.ServiceInvocationStruct;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.util.crypto.CryptoException;
import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.core.util.ReflectionHelper;
import com.metamatrix.dqp.client.ResultsFuture;
import com.metamatrix.platform.PlatformPlugin;
Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketClientInstance.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketClientInstance.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketClientInstance.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -37,6 +37,7 @@
import com.metamatrix.common.comm.platform.socket.ObjectChannel;
import com.metamatrix.common.comm.platform.socket.SocketVMController;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.queue.WorkerPool;
import com.metamatrix.common.util.crypto.CryptoException;
import com.metamatrix.common.util.crypto.Cryptor;
import com.metamatrix.common.util.crypto.DhKeyGenerator;
@@ -55,6 +56,7 @@
public class SocketClientInstance implements ChannelListener, ClientInstance {
private final ObjectChannel objectSocket;
+ private final WorkerPool workerPool;
private final ClientServiceRegistry server;
private Cryptor cryptor;
private boolean usingEncryption;
@@ -62,8 +64,9 @@
private DQPWorkContext workContext = new DQPWorkContext();
private SessionServiceInterface sessionService;
- public SocketClientInstance(ObjectChannel objectSocket, ClientServiceRegistry server, boolean isClientEncryptionEnabled, SessionServiceInterface sessionService) {
+ public SocketClientInstance(ObjectChannel objectSocket, WorkerPool workerPool, ClientServiceRegistry server, boolean isClientEncryptionEnabled, SessionServiceInterface sessionService) {
this.objectSocket = objectSocket;
+ this.workerPool = workerPool;
this.server = server;
this.usingEncryption = isClientEncryptionEnabled;
this.sessionService = sessionService;
@@ -143,7 +146,7 @@
if (LogManager.isMessageToBeRecorded(SocketVMController.SOCKET_CONTEXT, MessageLevel.DETAIL)) {
LogManager.logDetail(SocketVMController.SOCKET_CONTEXT, "processing message:" + packet); //$NON-NLS-1$
}
- new ServerWorkItem(this, packet.getMessageKey(), packet, this.server, this.sessionService).run();
+ workerPool.execute(new ServerWorkItem(this, packet.getMessageKey(), packet, this.server, this.sessionService));
}
public void shutdown() throws CommunicationException {
Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -25,6 +25,7 @@
import java.net.InetSocketAddress;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLEngine;
@@ -58,7 +59,7 @@
private boolean isClientEncryptionEnabled;
private SessionServiceInterface sessionService;
private WorkerPool workerPool;
- private ExecutorService bossService;
+ private ExecutorService nettyPool;
/**
*
@@ -81,12 +82,12 @@
this.server = server;
this.workerPool = WorkerPoolFactory.newWorkerPool("SocketWorker", maxWorkers, 120000); //$NON-NLS-1$
- this.bossService = Executors.newCachedThreadPool();
+ this.nettyPool = Executors.newCachedThreadPool();
if (LogManager.isMessageToBeRecorded(SocketVMController.SOCKET_CONTEXT, MessageLevel.DETAIL)) {
LogManager.logDetail(SocketVMController.SOCKET_CONTEXT, "server = " + this.server + "binding to port:" + port); //$NON-NLS-1$ //$NON-NLS-2$
}
- ChannelFactory factory = new NioServerSocketChannelFactory(bossService, workerPool, maxWorkers);
+ ChannelFactory factory = new NioServerSocketChannelFactory(nettyPool, nettyPool, Math.min(Runtime.getRuntime().availableProcessors(), maxWorkers));
ServerBootstrap bootstrap = new ServerBootstrap(factory);
this.channelHandler = new SSLAwareChannelHandler(this, engine, Thread.currentThread().getContextClassLoader());
@@ -117,7 +118,7 @@
public void stop() {
this.serverChanel.close();
this.workerPool.shutdownNow();
- this.bossService.shutdownNow();
+ this.nettyPool.shutdownNow();
}
public SocketListenerStats getStats() {
@@ -130,7 +131,7 @@
}
public ChannelListener createChannelListener(ObjectChannel channel) {
- return new SocketClientInstance(channel, this.server, this.isClientEncryptionEnabled, this.sessionService);
+ return new SocketClientInstance(channel, this.workerPool, this.server, this.isClientEncryptionEnabled, this.sessionService);
}
}
\ No newline at end of file
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionServiceInterface.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionServiceInterface.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionServiceInterface.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -55,7 +55,7 @@
* </p>
*/
public interface SessionServiceInterface extends ServiceInterface {
- public static String NAME = "SessionService";
+ public static String NAME = "SessionService"; //$NON-NLS-1$
/**
* Create a session for the given user authenticating against the given <code>Credentials</code>.
@@ -154,5 +154,4 @@
*/
public void pingServer(MetaMatrixSessionID sessionID) throws InvalidSessionException;
- public long getPingInterval();
}
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -44,6 +44,7 @@
import com.metamatrix.cache.CacheFactory;
import com.metamatrix.cache.CacheConfiguration.Policy;
import com.metamatrix.common.api.MMURL;
+import com.metamatrix.common.comm.api.ServerConnection;
import com.metamatrix.common.config.CurrentConfiguration;
import com.metamatrix.common.config.api.Configuration;
import com.metamatrix.common.log.LogManager;
@@ -62,7 +63,6 @@
import com.metamatrix.platform.security.api.MetaMatrixPrincipalName;
import com.metamatrix.platform.security.api.MetaMatrixSessionID;
import com.metamatrix.platform.security.api.MetaMatrixSessionInfo;
-import com.metamatrix.platform.security.api.MetaMatrixSessionState;
import com.metamatrix.platform.security.api.service.MembershipServiceInterface;
import com.metamatrix.platform.security.api.service.SessionServiceInterface;
import com.metamatrix.platform.security.api.service.SessionTerminationHandler;
@@ -91,13 +91,10 @@
private static final String SESSION_TIME_LIMIT = "metamatrix.session.time.limit"; //$NON-NLS-1$
public static final String SESSION_MONITOR_ACTIVITY_INTERVAL = "metamatrix.session.sessionMonitor.ActivityInterval"; //$NON-NLS-1$
- private static long CLIENT_PING_INTERVAL = 600000;
-
private MembershipServiceInterface membershipService;
private Cache<MetaMatrixSessionID, MetaMatrixSessionInfo> sessionCache;
private long sessionMaxLimit;
private long sessionTimeLimit;
- private String clusterName;
// Product name -> ServiceTerminationHandler
private Map<String, SessionTerminationHandler> terminationHandlerMap = new HashMap<String, SessionTerminationHandler>();
@@ -128,21 +125,20 @@
Properties nextProperties = config.getProperties();
this.sessionMaxLimit = PropertiesUtils.getIntProperty(nextProperties, MAX_ACTIVE_SESSIONS, 0);
this.sessionTimeLimit = PropertiesUtils.getIntProperty(nextProperties, SESSION_TIME_LIMIT, 0) * 60000;
- this.clusterName = CurrentConfiguration.getInstance().getClusterName();
this.sessionMonitor = new Timer("SessionMonitor", true); //$NON-NLS-1$
this.sessionMonitor.schedule(new TimerTask() {
@Override
public void run() {
monitorSessions();
}
- }, this.sessionTimeLimit > 0 ? this.sessionTimeLimit : CLIENT_PING_INTERVAL * 4, CLIENT_PING_INTERVAL);
+ }, 0, ServerConnection.PING_INTERVAL * 5);
}
private void monitorSessions() {
long currentTime = System.currentTimeMillis();
for (MetaMatrixSessionInfo info : sessionCache.values()) {
try {
- if (currentTime - info.getLastPingTime() > CLIENT_PING_INTERVAL * 4) {
+ if (currentTime - info.getLastPingTime() > ServerConnection.PING_INTERVAL * 5) {
LogManager.logInfo(LogSecurityConstants.CTX_SESSION, PlatformPlugin.Util.getString( "SessionServiceImpl.keepaliveFailed", info.getSessionID())); //$NON-NLS-1$
closeSession(info.getSessionID());
} else if (sessionTimeLimit > 0 && currentTime - info.getTimeCreated() > sessionTimeLimit) {
@@ -269,11 +265,9 @@
authenticatedUserName,
creationTime,
applicationName,
- MetaMatrixSessionState.ACTIVE,
- clusterName,
- productInfo,
- productName,
- properties.getProperty(MMURL.CONNECTION.CLIENT_IP_ADDRESS),
+ productInfo,
+ productName,
+ properties.getProperty(MMURL.CONNECTION.CLIENT_IP_ADDRESS),
properties.getProperty(MMURL.CONNECTION.CLIENT_HOSTNAME));
newSession.setTrustedToken(trustedToken);
if (this.sessionCache.put(newSession.getSessionID(), newSession) != null) {
@@ -348,11 +342,6 @@
}
@Override
- public long getPingInterval() {
- return CLIENT_PING_INTERVAL;
- }
-
- @Override
public MetaMatrixPrincipal getPrincipal(MetaMatrixSessionID sessionID)
throws InvalidSessionException, SessionServiceException {
@@ -430,8 +419,4 @@
this.sessionCache = sessionCache;
}
- void setClusterName(String clusterName) {
- this.clusterName = clusterName;
- }
-
}
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -91,8 +91,8 @@
Properties productInfo1 = new Properties();
productInfo1.put(ProductInfoConstants.VIRTUAL_DB, "vdb1"); //$NON-NLS-1$
productInfo1.put(ProductInfoConstants.VDB_VERSION, "1");//$NON-NLS-1$
- MetaMatrixSessionInfo info1 = new MetaMatrixSessionInfo(id1, "user1", 1, "app1", 1, "cluster1", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- productInfo1, "product1", null, null); //$NON-NLS-1$
+ MetaMatrixSessionInfo info1 = new MetaMatrixSessionInfo(id1, "user1", 1, "app1", productInfo1, "product1", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ null, null); //$NON-NLS-1$
sessions.add(info1);
@@ -100,8 +100,8 @@
Properties productInfo2 = new Properties();
productInfo2.put(ProductInfoConstants.VIRTUAL_DB, "vdb2"); //$NON-NLS-1$
productInfo2.put(ProductInfoConstants.VDB_VERSION, "2"); //$NON-NLS-1$
- MetaMatrixSessionInfo info2 = new MetaMatrixSessionInfo(id2, "user2", 2, "app2", 2, "cluster2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- productInfo2, "product2", null, null); //$NON-NLS-1$
+ MetaMatrixSessionInfo info2 = new MetaMatrixSessionInfo(id2, "user2", 2, "app2", productInfo2, "product2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ null, null); //$NON-NLS-1$
sessions.add(info2);
return sessions;
Modified: trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -51,8 +51,8 @@
p.setProperty(MMURL.CONNECTION.PRODUCT_NAME, productName);
MetaMatrixSessionInfo resultInfo = new MetaMatrixSessionInfo(
- new MetaMatrixSessionID(1), userName, 0, applicationName, 0,
- "bar", new Properties(), "product", null, null); //$NON-NLS-1$ //$NON-NLS-2$
+ new MetaMatrixSessionID(1), userName, 0, applicationName, new Properties(),
+ "product", null, null); //$NON-NLS-1$ //$NON-NLS-2$
Mockito.stub(ssi.createSession(userName, null, null, applicationName,
productName, p)).toReturn(resultInfo);
Modified: trunk/server/src/test/java/com/metamatrix/platform/security/session/service/TestSessionServiceImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/security/session/service/TestSessionServiceImpl.java 2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/test/java/com/metamatrix/platform/security/session/service/TestSessionServiceImpl.java 2009-04-03 19:51:36 UTC (rev 705)
@@ -17,7 +17,6 @@
public void testValidateSession() throws Exception {
SessionServiceImpl ssi = new SessionServiceImpl();
- ssi.setClusterName("test"); //$NON-NLS-1$
ssi.setSessionCache(new FakeCache<MetaMatrixSessionID, MetaMatrixSessionInfo>());
MembershipServiceInterface msi = Mockito.mock(MembershipServiceInterface.class);
Mockito.stub(msi.authenticateUser("steve", null, null, "foo")).toReturn(new SuccessfulAuthenticationToken(null, "steve@somedomain")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
15 years, 11 months
teiid SVN: r704 - in trunk/server/src/main/java/com/metamatrix: platform/registry and 3 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-03 15:47:52 -0400 (Fri, 03 Apr 2009)
New Revision: 704
Modified:
trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java
trunk/server/src/main/java/com/metamatrix/platform/registry/ClusteredRegistryState.java
trunk/server/src/main/java/com/metamatrix/platform/registry/RegistryListener.java
trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
trunk/server/src/main/java/com/metamatrix/server/HostController.java
Log:
TEIID-459 fixing misc shutdown issues.
Modified: trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java 2009-04-03 19:43:55 UTC (rev 703)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java 2009-04-03 19:47:52 UTC (rev 704)
@@ -117,8 +117,6 @@
protected void closeService() throws Exception {
String instanceName = this.getInstanceName().toString();
LogManager.logDetail(CONTEXT, instanceName + ": closing"); //$NON-NLS-1$
-// this.serviceIsClosed = true;
- I18nLogManager.logInfo(CONTEXT, LogMessageKeys.CONFIG_0003, new Object[]{ instanceName});
}
/**
Modified: trunk/server/src/main/java/com/metamatrix/platform/registry/ClusteredRegistryState.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/registry/ClusteredRegistryState.java 2009-04-03 19:43:55 UTC (rev 703)
+++ trunk/server/src/main/java/com/metamatrix/platform/registry/ClusteredRegistryState.java 2009-04-03 19:47:52 UTC (rev 704)
@@ -24,8 +24,9 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -46,7 +47,7 @@
private static final String NAME = "Name"; //$NON-NLS-1$
Cache cache;
- private List<RegistryListener> listeners = Collections.synchronizedList(new ArrayList<RegistryListener>());
+ private Queue<RegistryListener> listeners = new ConcurrentLinkedQueue<RegistryListener>();
@Inject
public ClusteredRegistryState(CacheFactory cacheFactory) {
@@ -320,6 +321,9 @@
public void shutdown() {
this.cache.removeListener();
+ for(RegistryListener l:this.listeners) {
+ l.registryShutdown();
+ }
this.listeners.clear();
}
}
Modified: trunk/server/src/main/java/com/metamatrix/platform/registry/RegistryListener.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/registry/RegistryListener.java 2009-04-03 19:43:55 UTC (rev 703)
+++ trunk/server/src/main/java/com/metamatrix/platform/registry/RegistryListener.java 2009-04-03 19:47:52 UTC (rev 704)
@@ -24,4 +24,5 @@
public interface RegistryListener {
void registryChanged();
+ void registryShutdown();
}
Modified: trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java 2009-04-03 19:43:55 UTC (rev 703)
+++ trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java 2009-04-03 19:47:52 UTC (rev 704)
@@ -36,6 +36,7 @@
import com.metamatrix.common.queue.WorkerPoolFactory;
import com.metamatrix.platform.registry.ClusteredRegistryState;
import com.metamatrix.platform.registry.RegistryListener;
+import com.metamatrix.platform.registry.ServiceRegistryBinding;
import com.metamatrix.platform.service.ServiceMessages;
import com.metamatrix.platform.service.ServicePlugin;
import com.metamatrix.platform.service.api.ServiceInterface;
@@ -49,7 +50,7 @@
public class ProxyManager implements RegistryListener{
// Map of all SelectionPolicies.
- private Map<ServiceSelectionPolicyKey, ServiceSelectionPolicy> policyRegistry = new HashMap();
+ private Map<ServiceSelectionPolicyKey, ServiceSelectionPolicy> policyRegistry = new HashMap<ServiceSelectionPolicyKey, ServiceSelectionPolicy>();
/**
* Thread that updates the service instances of the service selection policies
@@ -71,7 +72,12 @@
this.registry.addListener(this);
}
+ @Override
+ public void registryShutdown() {
+ this.updatePool.shutdownNow();
+ }
+ @Override
public void registryChanged() {
updatePool.execute(new Runnable() {public void run() { doUpdate(); } });
}
@@ -214,8 +220,8 @@
* @param serviceType The type of the service of interest.
*/
private void setServiceInstances(ServiceSelectionPolicy policy, String serviceType) {
- List localServiceBindings = this.registry.getActiveServiceBindings(this.hostName, this.processName, serviceType);
- List serviceBindings = this.registry.getActiveServiceBindings(null, null, serviceType);
+ List<ServiceRegistryBinding> localServiceBindings = this.registry.getActiveServiceBindings(this.hostName, this.processName, serviceType);
+ List<ServiceRegistryBinding> serviceBindings = this.registry.getActiveServiceBindings(null, null, serviceType);
serviceBindings.removeAll(localServiceBindings);
policy.updateServices(localServiceBindings, serviceBindings);
}
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-04-03 19:43:55 UTC (rev 703)
+++ trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java 2009-04-03 19:47:52 UTC (rev 704)
@@ -31,6 +31,7 @@
import java.util.EventObject;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -201,8 +202,6 @@
this.registerSubSystemAdminAPIs(hostManagement);
manageCommonExtensionClassloader();
-
- addShutdownHook();
}
@@ -245,18 +244,6 @@
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);
}
-
- private void addShutdownHook() {
- Runtime.getRuntime().addShutdownHook(new Thread() {
- public void run() {
- try {
- shutdown(false);
- } catch (Exception e) {
- // ignore
- }
- }
- });
- }
/**
* Lazily get Current Configuration
@@ -796,25 +783,25 @@
*/
private void stopServices(boolean now, boolean shutdown) throws MultipleException {
- MultipleException multipleException = new MultipleException();
-
List<ServiceRegistryBinding> bindings = this.registry.getServiceBindings(host.getFullName(), this.processName);
+ List<ServiceException> exceptions = new LinkedList<ServiceException>();
+
for (ServiceRegistryBinding binding:bindings) {
try {
stopService(binding, now, shutdown);
} catch (ServiceException se) {
- multipleException.getExceptions().add(se);
+ exceptions.add(se);
}
}
- int numExceptions = multipleException.getExceptions().size();
+ int numExceptions = exceptions.size();
if (numExceptions == 1) {
//if there is one ServiceException, throw it
- throw (ServiceException) multipleException.getExceptions().get(0);
+ throw exceptions.get(0);
} else if (numExceptions > 1) {
//if there are many, throw the MultipleException containing all of them
- throw multipleException;
+ throw new MultipleException(exceptions, "Multiple errors stopping services"); //$NON-NLS-1$
}
}
Modified: trunk/server/src/main/java/com/metamatrix/server/HostController.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/HostController.java 2009-04-03 19:43:55 UTC (rev 703)
+++ trunk/server/src/main/java/com/metamatrix/server/HostController.java 2009-04-03 19:47:52 UTC (rev 704)
@@ -118,6 +118,7 @@
}
}
};
+ monitorThread.setDaemon(true);
monitorThread.start();
}
15 years, 11 months
teiid SVN: r703 - trunk/console/src/main/java/com/metamatrix/console/connections.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-03 15:43:55 -0400 (Fri, 03 Apr 2009)
New Revision: 703
Modified:
trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java
Log:
TEIID-397 removing retry logic and adding a better message for failing credentials.
Modified: trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java 2009-04-03 17:37:49 UTC (rev 702)
+++ trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java 2009-04-03 19:43:55 UTC (rev 703)
@@ -42,7 +42,6 @@
import com.metamatrix.common.comm.platform.client.ServerAdminFactory;
import com.metamatrix.common.comm.platform.socket.client.SocketServerConnectionFactory;
import com.metamatrix.common.util.MetaMatrixProductNames;
-import com.metamatrix.console.ConsolePlugin;
import com.metamatrix.console.models.ModelManager;
import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.core.util.HashCodeUtil;
@@ -61,60 +60,6 @@
private MMURL mmurl;
private ServerAdmin serverAdmin;
- // DEFAULT Initial delay before trying to connect
- private static final long INIT_RETRY_DELAY_DEFAULT_VAL = 1000*10;
- // DEFAULT number of milliseconds to wait between retries
- private static final long MAX_RETRY_DELAY_DEFAULT_VAL = 1000;
- // DEFAULT number of times the login should retry before giving up
- private static final int MAX_RETRY_DEFAULT_VAL = 240;
-
- // Initial delay before trying to connect
- private static long INIT_RETRY_DELAY_VAL = INIT_RETRY_DELAY_DEFAULT_VAL;
- // The number of milliseconds to wait between retries
- private static long MAX_RETRY_DELAY_VAL = MAX_RETRY_DELAY_DEFAULT_VAL;
- // The number of times the login should retry before giving up
- private static int MAX_RETRY_VAL = MAX_RETRY_DEFAULT_VAL;
-
-
- static {
- // Initial delay before trying to connect
- long initRetryMS = -1;
- try {
- String initialRetryDelay = ConsolePlugin.Util.getString("ConnectionInfo.initialRetryDelayMS"); //$NON-NLS-1$
- initRetryMS = Long.parseLong(initialRetryDelay);
- } catch (NumberFormatException err) {
- err.printStackTrace();
- }
- if(initRetryMS>0) {
- INIT_RETRY_DELAY_VAL = initRetryMS;
- }
-
- // The number of milliseconds to wait between retries
- long retryDelayMS = -1;
- try {
- String retryDelayStr = ConsolePlugin.Util.getString("ConnectionInfo.retryDelayMS"); //$NON-NLS-1$
- retryDelayMS = Long.parseLong(retryDelayStr);
- } catch (NumberFormatException err) {
- err.printStackTrace();
- }
- if(retryDelayMS>0) {
- MAX_RETRY_DELAY_VAL = retryDelayMS;
- }
-
- // The number of times the login should retry before giving up
- int maxRetrys = -1;
- try {
- String maxRetryStr = ConsolePlugin.Util.getString("ConnectionInfo.maxRetrys"); //$NON-NLS-1$
- maxRetrys = Integer.parseInt(maxRetryStr);
- } catch (NumberFormatException err) {
- err.printStackTrace();
- }
- if(maxRetrys>0) {
- MAX_RETRY_VAL = maxRetrys;
- }
-
- }
-
public ConnectionInfo(String serverURL,
String user,
char[] password,
@@ -225,7 +170,7 @@
}
try {
// Case 4793 - changed to true - network latency issues causing problems with reconnect
- connection = relogin(true);
+ connection = relogin();
return connection;
} catch (MetaMatrixComponentException e) {
@@ -320,54 +265,32 @@
return connection;
}
- private ServerConnection relogin(boolean sleepFirst) throws MetaMatrixComponentException {
+ public ServerConnection relogin() throws MetaMatrixComponentException {
- if (sleepFirst) {
- try {
- Thread.sleep(INIT_RETRY_DELAY_VAL);
- } catch (InterruptedException ie) { /* Try again. */
- }
- }
-
-
close();
-
Exception e = null;
connection = null;
- for (int i = 0; i < MAX_RETRY_VAL; i++) {
- // Retry MAX_RETRY_VAL times...
+ try {
+ connection = login();
+ boolean initSucceeded = ModelManager.init(this);
- try {
- connection = login();
- boolean initSucceeded = ModelManager.init(this);
-
- if (initSucceeded) {
- return connection;
- }
- } catch (Exception ex) {
- e = ex;
- }
-
- // I guess we do not need to sleep at all
- if (sleepFirst) {
- try {
- Thread.sleep(MAX_RETRY_DELAY_VAL);
- } catch (InterruptedException ie) { /* Try again. */
- }
- }
- }
+ if (initSucceeded) {
+ return connection;
+ }
+ } catch (Exception ex) {
+ e = ex;
+ }
// If we're here we've retried the maximum number of times
String msg = "Lost communication with Server."; //$NON-NLS-1$
+ if (e instanceof LogonException) {
+ msg = "Current credentials are no longer valid. This connection should be closed."; //$NON-NLS-1$
+ }
ComponentCommunicationException cce = new ComponentCommunicationException(e, msg);
throw cce;
}
+
- public ServerConnection relogin() throws MetaMatrixComponentException {
- return relogin(true);
- }
-
-
/**
* Close the underlying connection.
*
15 years, 11 months
teiid SVN: r702 - trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-03 13:37:49 -0400 (Fri, 03 Apr 2009)
New Revision: 702
Modified:
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecAntExecution.java
Log:
misc: creating a un-necessary temp directory and polluting the build directories
Modified: trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecAntExecution.java
===================================================================
--- trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecAntExecution.java 2009-04-03 12:36:49 UTC (rev 701)
+++ trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecAntExecution.java 2009-04-03 17:37:49 UTC (rev 702)
@@ -66,7 +66,6 @@
public class ExecAntExecution extends BasicExecution implements ResultSetExecution {
private static final Random random = new Random(System.currentTimeMillis());
- private static TempDirectory TEMPDIR = null;
private static String INSTALL_DIR = ".";//$NON-NLS-1$
@@ -91,21 +90,6 @@
private List exclusionList;
private IQuery query;
- static {
- String hosttempdir = ".";//$NON-NLS-1$
- try {
- Host host = CurrentConfiguration.getInstance().getDefaultHost();
- if ( host != null) {
- INSTALL_DIR = host.getProperty(CommonPropertyNames.INSTALLATION_DIRECTORY);
- hosttempdir = host.getTempDirectory();
- }
- TEMPDIR = new TempDirectory(hosttempdir,System.currentTimeMillis(), random.nextLong());
- } catch (Exception e) {
- TEMPDIR = new TempDirectory(System.currentTimeMillis(), random.nextLong());
- }
- TEMPDIR.create();
- }
-
public ExecAntExecution(IQuery query, ConnectorEnvironment env, RuntimeMetadata metadata, ConnectorLogger logger, List exclusionThese) {
this.env = env;
this.query = query;
@@ -254,8 +238,6 @@
public void close() throws ConnectorException {
// nothing to do
- TEMPDIR.remove();
-
exclusionList = null;
responses = null;
15 years, 11 months
teiid SVN: r701 - trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-03 08:36:49 -0400 (Fri, 03 Apr 2009)
New Revision: 701
Removed:
trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/RuntimeBaseConnector.java
Modified:
trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/MetaBaseConnector.java
Log:
removing unused interface
Modified: trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/MetaBaseConnector.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/MetaBaseConnector.java 2009-04-03 02:07:14 UTC (rev 700)
+++ trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/MetaBaseConnector.java 2009-04-03 12:36:49 UTC (rev 701)
@@ -24,10 +24,11 @@
import java.util.*;
+import com.metamatrix.common.connection.TransactionInterface;
import com.metamatrix.metadata.runtime.api.*;
import com.metamatrix.metadata.runtime.exception.*;
-public interface MetaBaseConnector extends RuntimeBaseConnector {
+public interface MetaBaseConnector extends TransactionInterface {
/**
* Set the <code>VirtualDatabase</code> status.
Deleted: trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/RuntimeBaseConnector.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/RuntimeBaseConnector.java 2009-04-03 02:07:14 UTC (rev 700)
+++ trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/RuntimeBaseConnector.java 2009-04-03 12:36:49 UTC (rev 701)
@@ -1,51 +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.metadata.runtime.spi;
-
-import com.metamatrix.common.connection.ManagedConnectionException;
-import com.metamatrix.common.connection.TransactionInterface;
-
-public interface RuntimeBaseConnector extends TransactionInterface {
-
- /**
- * Make all changes made during this transaction's lifetime
- * and release any data source locks currently held by the associated Connection.
- * A transaction can be committed or rolled back any number of times throughout its lifetime,
- * and throughout its lifetime the transaction is guaranteed to have the same connection.
- * @throws ManagedConnectionException if an error occurred within or during communication with the associated connection.
- */
- void commit() throws ManagedConnectionException;
-
- /**
- * Drops all changes made during this transaction's lifetime
- * and release any data source locks currently held by the associated Connection.
- * Once this method is executed, the transaction (after rolling back) becomes invalid, and the connection
- * referenced by this transaction is returned to the pool.
- * <p>
- * Calling this method on a read-only transaction is unneccessary (and discouraged, since
- * the implementation does nothing in that case anyway).
- * @throws ManagedConnectionException if an error occurred within or during communication with the associated connection.
- */
- void rollback() throws ManagedConnectionException;
-}
-
15 years, 11 months
teiid SVN: r700 - in trunk: common-internal/src/main/java/com/metamatrix/server/admin/api and 3 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-02 22:07:14 -0400 (Thu, 02 Apr 2009)
New Revision: 700
Removed:
trunk/server/src/main/java/com/metamatrix/platform/config/service/ActionHistory.java
Modified:
trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/AuthorizationAdminAPI.java
trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/ExtensionSourceAdminAPI.java
trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/RuntimeStateAdminAPI.java
trunk/common-internal/src/main/java/com/metamatrix/server/admin/api/RuntimeMetadataAdminAPI.java
trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/AuthorizationAdminAPIImpl.java
trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/ExtensionSourceAdminAPIImpl.java
trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIImpl.java
trunk/server/src/main/java/com/metamatrix/server/admin/apiimpl/RuntimeMetadataAdminAPIImpl.java
Log:
removing unused subsystem methods
Modified: trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/AuthorizationAdminAPI.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/AuthorizationAdminAPI.java 2009-04-03 01:38:21 UTC (rev 699)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/AuthorizationAdminAPI.java 2009-04-03 02:07:14 UTC (rev 700)
@@ -51,16 +51,6 @@
throws InvalidSessionException, AuthorizationException, MetaMatrixComponentException;
/**
- * Obtain the names of all of the realms known to the system.
- * @return the set of realm names
- * @throws InvalidSessionException if the <code>SessionToken</code> is not valid or is expired
- * @throws AuthorizationException if the caller is unable to perform this operation
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- Collection getRealmNames()
- throws InvalidSessionException, AuthorizationException, MetaMatrixComponentException;
-
- /**
* Obtain the names of all of the roles and their descriptions known to the system.
* @return a Map of role descriptions key by the role's name.
* @throws InvalidSessionException if the <code>SessionToken</code> is not valid or is expired
@@ -133,17 +123,6 @@
throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException;
/**
- * Remove the policy with the specified ID.
- * @param policyID the ID of the policy that is to be removed.
- * @throws InvalidSessionException if the <code>sessionToken</code> is not valid or is expired
- * @throws AuthorizationException if the caller is unable to perform this operation
- * @throws MetaMatrixComponentException if this service is unable to locate resources required
- * for this operation
- */
- void removePolicy(AuthorizationPolicyID policyID)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
* Locate the IDs of all of the policies that are accessible by the caller.
* @param caller the session token of the principal that is attempting to access the policies.
* @return the set of all policy IDs
@@ -156,30 +135,6 @@
throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException;
/**
- * Locate the IDs of all of the policies that apply to the specified principal and that are accessible by the caller.
- * @param principals the Set of UserGroupIDs and/or UserAccountIDs to whom the returned policies should apply to
- * (may not null, empty or invalid, all of which would result in an empty result)
- * @return the set of all policy IDs; never null but possibly empty
- * @throws InvalidSessionException if the <code>SessionToken</code> is not valid or is expired
- * @throws AuthorizationException if the caller is unable to perform this operation
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- Collection findPolicyIDs(Collection principals)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
- * Locate the policies that have the specified IDs. Any ID that is invalid is simply
- * ignored.
- * @param policyIDs the policy IDs for which the policies are to be obtained
- * @return the set of entitlements that correspond to those specified IDs that are valid
- * @throws InvalidSessionException if the <code>SessionToken</code> is not valid or is expired
- * @throws AuthorizationException if the caller is unable to perform this operation
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- Collection getPolicies(Collection policyIDs)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
* Return whether there is an existing policy with the specified ID.
* @param id the ID that is to be checked
* @return true if a policy with the specified ID exists
@@ -216,36 +171,7 @@
throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException;
/**
- * Remove given Principal from <emph>ALL</emph> <code>AuthorizationPolicies</code> to
- * which he belongs.
- * @param principal <code>MetaMatrixPrincipalName</code> which should be deleted.
- * @return true if at least one policy in which the principal had authorization
- * was found and deleted, false otherwise.
- * @throws AuthorizationException if admninistrator does not have the authority to preform the action.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- Boolean removePrincipalFromAllPolicies(MetaMatrixPrincipalName principal)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
* Returns a <code>Collection</code> of <code>AuthorizationPolicyID</code>s
- * that have <code>AuthorizationPermission</code>s in the given <code>AuthorizationRealm</code>.<br>
- * <strong>NOTE:</strong> It is the responsibility of the caller to determine
- * which of the <code>AuthorizationPolicy</code>'s <code>AuthorizationPermission</code>s
- * are actually in the given <code>AuthorizationRealm</code>. The <code>AuthorizationPolicy</code>
- * may span <code>AuthorizationRealm</code>s.
- * @param realm The realm in which to search for <code>AuthorizationPermission</code>s.
- * @return The collection of <code>AuthorizationPolicyID</code>s that have permissions
- * in the given realm - possibly empty but never null.
- * @throws AuthorizationException if admninistrator does not have the authority to preform the action.
- * @throws AuthorizationMgmtException if an error occurs in the Authorization store.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- Collection getPolicyIDsWithPermissionsInRealm(AuthorizationRealm realm)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
- * Returns a <code>Collection</code> of <code>AuthorizationPolicyID</code>s
* in the given <code>AuthorizationRealm</code>.
* <br>This method will only work for Data Access Authorizations because the realm
* is encoded in a Data Access policy name.
@@ -262,105 +188,5 @@
*/
Collection getPolicyIDsInRealm(AuthorizationRealm realm)
throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
- * Returns a <code>Collection</code> of <code>AuthorizationPolicyID</code>s
- * that have <code>AuthorizationPermissions</code> that exist in the given
- * <emph>partial</emph> <code>AuthorizationRealm</code>.<br>
- * The implementation is such that all <code>AuthorizationPolicyID</code>s
- * whose <code>AuthorizationRealm</code> <emph>starts with</emph> the given
- * <code>AuthorizationRealm</code> are returned.
- * @param realm The <emph>partial</emph> realm in which to search for
- * <code>AuthorizationPermission</code>s whose realm name <emph>starts with</emph>
- * the given realm.
- * @return The collection of <code>AuthorizationPolicyID</code>s that have permissions
- * in the given partial realm - possibly empty but never null.
- * @throws AuthorizationException if admninistrator does not have the authority to preform the action.
- * @throws AuthorizationMgmtException if an error occurs in the Authorization store.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- Collection getPolicyIDsInPartialRealm(AuthorizationRealm realm)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
- * Returns a <code>Collection</code> of <code>AuthorizationPolicyID</code>s
- * that have <code>AuthorizationPermissions</code> on the given resource that
- * exists in the given <code>AuthorizationRealm</code>.<br>
- * @param realm The realm in which to search for <code>AuthorizationPermission</code>s.
- * @param resourceName The resource for which to search for <code>AuthorizationPermission</code>s.
- * @return The collection of <code>AuthorizationPolicyID</code>s that have permissions
- * on the given resource - possibly empty but never null.
- * @throws AuthorizationException if admninistrator does not have the authority to preform the action.
- * @throws AuthorizationMgmtException if an error occurs in the Authorization store.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- Collection getPolicyIDsForResourceInRealm(AuthorizationRealm realm, String resourceName)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
- * Verify that caller is in the specified logical role.
- * @param caller The session token of the MetaMatrix principle involking an administrative method.
- * @return true if caller's session token is valid and he is a MetaMatrix administrator.
- * @throws AuthorizationMgmtException if this service has trouble connecting to services it uses.
- */
- boolean isCallerInRole( SessionToken caller, String roleName )
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
- * Returns a <code>List</code> of entitlements to the given fully qualified group name in the given realm.
- * <p>The list contains objects of type {@link com.metamatrix.platform.security.api.UserEntitlementInfo UserEntitlementInfo}
- * which will contain all user entitlement information for each group found. Each of these objects
- * will contain 1 or more objects of type {@link com.metamatrix.platform.security.api.GranteeEntitlementEntry GranteeEntitlementEntry}
- * which contain the <i>Grantee</i>'s name the entitlement <i>Grantor</i> or entity specifying the <i>Grantee</i>
- * is entitled and the <i>Allowed Actions</i> the <i>Grantee</i> is entitled to perform on the group.</p>
- * The attributes availible are:
- * <ol>
- * <li value=1>VDB Name</li>
- * <li>VDB Version</li>
- * <li>Group Name (fully qualified)</li>
- * <ul>
- * <li>Grantee Name; Grantor Name; Allowed Actions (A <code>String[]</code> of one or more of {CREATE, READ, UPDATE, DELETE})</li>
- * <li> ... </li>
- * </ul>
- * </ol>
- * @param realm The realm in which the element must live.
- * @param fullyQualifiedGroupName The resource for which to look up permissions.
- * @return The <code>List</code> of entitlements to the given element in the
- * given realm - May be empty but never null.
- * @throws AuthorizationException if admninistrator does not have the authority to preform the action.
- * @throws AuthorizationMgmtException if an error occurs in the Authorization store.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- List getGroupEntitlements(AuthorizationRealm realm, String fullyQualifiedGroupName)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
- * Returns a <code>List</code> of entitlements to the given element pattern in the given realm.
- * <p>The list contains objects of type {@link com.metamatrix.platform.security.api.UserEntitlementInfo UserEntitlementInfo}
- * which will contain all user entitlement information for each element found. Each of these objects
- * will contain 1 or more objects of type {@link com.metamatrix.platform.security.api.GranteeEntitlementEntry GranteeEntitlementEntry}
- * which contain the <i>Grantee</i>'s name the entitlement <i>Grantor</i> or entity specifying the <i>Grantee</i>
- * is entitled and the <i>Allowed Actions</i> the <i>Grantee</i> is entitled to perform on the element.</p>
- * The attributes availible are:
- * <ol>
- * <li value=1>VDB Name</li>
- * <li>VDB Version</li>
- * <li>Group Name (fully qualified)</li>
- * <li>Element Name (fully qualified)</li>
- * <ul>
- * <li>Grantee Name; Grantor Name; Allowed Actions (A <code>String[]</code> of one or more of {CREATE, READ, UPDATE, DELETE})</li>
- * <li> ... </li>
- * </ul>
- * </ol>
- * @param realm The realm in which the element must live.
- * @param elementNamePattern The resource for which to look up permissions. SQL '%' pattern matching may be used.
- * @return The <code>List</code> of entitlements to the given element in the
- * given realm - May be empty but never null.
- * @throws AuthorizationMgmtException if this service is unable to locate resources required
- * for this operation.
- * @throws ServiceStateException if the Authorization service is not taking requests.
- */
- List getElementEntitlements(AuthorizationRealm realm, String elementNamePattern)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException;
}
Modified: trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/ExtensionSourceAdminAPI.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/ExtensionSourceAdminAPI.java 2009-04-03 01:38:21 UTC (rev 699)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/ExtensionSourceAdminAPI.java 2009-04-03 02:07:14 UTC (rev 700)
@@ -130,22 +130,6 @@
throws InvalidSessionException, AuthorizationException, MetaMatrixComponentException;
/**
- * Returns List of ExtensionSourceDescriptor objects of indicated type,
- * in order of their search ordering
- * @param type one of the known types of extension file
- * @return List of ExtensionSourceDescriptor objects of indicated type,
- * in order of their search ordering
- * @throws InvalidSessionException if there is not a valid administrative session
- * @throws AuthorizationException if the administrator does not have privileges to use this method
- * @throws InvalidExtensionTypeException if the indicated type is not one
- * of the currently-supported extension source types
- * @throws MetaMatrixComponentException indicating a non-business-related
- * exception (such as a communication exception)
- */
- List getSourceDescriptors(String type)
- throws InvalidSessionException, AuthorizationException, InvalidExtensionModuleTypeException, MetaMatrixComponentException;
-
- /**
* Returns the ExtensionSourceDescriptor object for the extension
* source indicated by sourceName
* @param sourceName name (e.g. filename) of extension source
Modified: trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/RuntimeStateAdminAPI.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/RuntimeStateAdminAPI.java 2009-04-03 01:38:21 UTC (rev 699)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/RuntimeStateAdminAPI.java 2009-04-03 02:07:14 UTC (rev 700)
@@ -58,40 +58,6 @@
MetaMatrixComponentException;
/**
- * Return all services running in mm system.
- *
- * @param callerSessionID
- * ID of the caller's current session.
- * @return List of ServiceIDs.
- * @throws AuthorizationException
- * if caller is not authorized to perform this method.
- * @throws InvalidSessionException
- * if the <code>callerSessionID</code> is not valid or is expired.
- * @throws MetaMatrixComponentException
- * if an error occurred in communicating with a component.
- */
- List getServices() throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException;
-
- /**
- * Return all hosts running in mm system.
- *
- * @param callerSessionID
- * ID of the caller's current session.
- * @return List of String Host names..
- * @throws AuthorizationException
- * if caller is not authorized to perform this method.
- * @throws InvalidSessionException
- * if the <code>callerSessionID</code> is not valid or is expired.
- * @throws MetaMatrixComponentException
- * if an error occurred in communicating with a component.
- */
- List getHosts() throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException;
-
- /**
* Stop service once work is complete.
*
* @param callerSessionID
@@ -383,24 +349,6 @@
MetaMatrixComponentException;
/**
- * Sets the <code>LogConfiguration</code> on the <code>LogManager</code> running in the given VM.
- *
- * @param logConfig
- * The log configuration with which to affect the log properties.
- * @param vmID
- * The ID of the VM for which to set log configuration used to affect the configuration database.
- * @throws AuthorizationException
- * if caller is not authorized to perform this method.
- * @throws InvalidSessionException
- * if the <code>callerSessionID</code> is not valid or is expired.
- * @throws MetaMatrixComponentException
- * if an error occurred in communicating with a component.
- */
- void setLoggingConfiguration(LogConfiguration logConfig, String hostName, String processName) throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException;
-
- /**
* Return Collection of QueueStats for service.
*
* @param serviceID
Modified: trunk/common-internal/src/main/java/com/metamatrix/server/admin/api/RuntimeMetadataAdminAPI.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/server/admin/api/RuntimeMetadataAdminAPI.java 2009-04-03 01:38:21 UTC (rev 699)
+++ trunk/common-internal/src/main/java/com/metamatrix/server/admin/api/RuntimeMetadataAdminAPI.java 2009-04-03 02:07:14 UTC (rev 700)
@@ -96,19 +96,6 @@
throws AuthorizationException, InvalidSessionException, VirtualDatabaseException, MetaMatrixComponentException;
/**
- * Get connector binding names for a given virtual database.
- *
- * @param vdbID ID of the VirtualDatabase.
- * @return Map of ModelIDs and String connector binding names.
- * @throws AuthorizationException if caller is not authorized to perform this method.
- * @throws InvalidSessionException if the <code>callerSessionID</code> is not valid or is expired.
- * @throws VirtualDatabaseException if an error occurs while setting the state.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- Map getConnectorBindingNames(VirtualDatabaseID vdbID)
- throws AuthorizationException, InvalidSessionException, VirtualDatabaseException, MetaMatrixComponentException;
-
- /**
* Given a routing ID, find all VDBs whose models use the connector binding.
*
* @param routingID ID of the connector binding.
@@ -269,21 +256,6 @@
// throws AuthorizationException, InvalidSessionException, VirtualDatabaseException, MetaMatrixComponentException;
/**
- * Get the visibility levels for models in a given virtual database.
- *
- * @param vdbID ID of the VirtualDatabase.
- * @return Map of ModelIDs and Short visibility levels.
- * Visibility levels are defined in MetadataConstants.VISIBILITY_TYPES.
- * @throws AuthorizationException if caller is not authorized to perform this method.
- * @throws InvalidSessionException if the <code>callerSessionID</code> is not valid or is expired.
- * @throws VirtualDatabaseException if an error occurs while setting the state.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- public Map getModelVisibilityLevels(VirtualDatabaseID vdbID)
- throws AuthorizationException, InvalidSessionException, VirtualDatabaseException, MetaMatrixComponentException;
-
-
- /**
* Call to obtain the VDB Definition that can be used
* for importing or exporting.
*
Modified: trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/AuthorizationAdminAPIImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/AuthorizationAdminAPIImpl.java 2009-04-03 01:38:21 UTC (rev 699)
+++ trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/AuthorizationAdminAPIImpl.java 2009-04-03 02:07:14 UTC (rev 700)
@@ -90,21 +90,6 @@
return new AuthorizationObjectEditor(true);
}
- /**
- * Obtain the names of all of the realms known to the system.
- * @return the set of realm names
- * @throws InvalidSessionException if the <code>SessionToken</code> is not valid or is expired
- * @throws AuthorizationException if the caller is unable to perform this operation
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- public synchronized Collection getRealmNames()
- throws InvalidSessionException, AuthorizationException, MetaMatrixComponentException {
- // Validate caller's session
- SessionToken token = AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return authAdmin.getRealmNames(token);
- }
-
public synchronized Map getRoleDescriptions()
throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
// Validate caller's session
@@ -162,32 +147,6 @@
}
/**
- * Add the given principal to the given roles.
- * @param principal The <code>MetaMatrixPrincipalName</code> to add
- * @param roleNames The <code>Collection</code> of <code>String</code> role names of which to add the principal.
- * @throws InvalidSessionException if the administrative session is invalid
- * @throws AuthorizationException if admninistrator does not have the authority to perform the requested operation.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- public synchronized void addPrincipalToRoles(MetaMatrixPrincipalName principal, Collection roleNames)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- SessionToken token = AdminAPIHelper.validateSession(getSessionID());
- // Validate caller's role
- AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_SYSTEM, "AuthorizationAdminAPIImpl.addPrincipalToRoles(" + principal + ", " + roleNames + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- AuthorizationObjectEditor editor = new AuthorizationObjectEditor();
- Iterator roleItr = roleNames.iterator();
- while (roleItr.hasNext()) {
- String roleName = (String) roleItr.next();
- AuthorizationPolicy role = authAdmin.getPolicy(token,new AuthorizationPolicyID(roleName, null, RolePermissionFactory.getRealm()));
- role = editor.addPrincipal(role, principal);
- }
- ModificationActionQueue queue = editor.getDestination();
- authAdmin.executeTransaction(token, queue.popActions());
- }
-
- /**
* Remove the given set of principals from the given role.
* @param principals Set of <code>MetaMatrixPrincipalName</code>s to remove.
* @param roleName The name of the role from which to remove the principals.
@@ -212,28 +171,6 @@
}
/**
- * Remove the policy with the specified ID.
- * @param policyID the ID of the policy that is to be removed.
- * @throws InvalidSessionException if the <code>sessionToken</code> is not valid or is expired
- * @throws AuthorizationException if the caller is unable to perform this operation
- * @throws MetaMatrixComponentException if this service is unable to locate resources required
- * for this operation
- */
- public synchronized void removePolicy(AuthorizationPolicyID policyID)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- SessionToken token = AdminAPIHelper.validateSession(getSessionID());
- // Validate caller's role
- AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_SYSTEM, "AuthorizationAdminAPIImpl.removePolicy(" + policyID +")"); //$NON-NLS-1$ //$NON-NLS-2$
-
- AuthorizationObjectEditor aoe = new AuthorizationObjectEditor(true);
- aoe.remove(policyID);
- ModificationActionQueue queue = aoe.getDestination();
-
- authAdmin.executeTransaction(token, queue.popActions());
- }
-
- /**
* Get all policyIDs in the system except those that we want to filter from the console.
*/
public synchronized Collection findAllPolicyIDs()
@@ -259,22 +196,6 @@
return filteredPolicyIDs;
}
- public synchronized Collection findPolicyIDs(Collection principals)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- SessionToken token = AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return authAdmin.findPolicyIDs(token, principals);
- }
-
- public synchronized Collection getPolicies(Collection policyIDs)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- SessionToken token = AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return authAdmin.getPolicies(token, policyIDs);
- }
-
public synchronized Boolean containsPolicy(AuthorizationPolicyID policyID)
throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
// Validate caller's session
@@ -300,39 +221,8 @@
return authAdmin.executeTransaction(token, actions);
}
- public synchronized Boolean removePrincipalFromAllPolicies(MetaMatrixPrincipalName principal)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- SessionToken token = AdminAPIHelper.validateSession(getSessionID());
- // Validate caller's role
- AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_SYSTEM, "AuthorizationAdminAPIImpl.removePrincipalFromAllPolicies(" + principal +")"); //$NON-NLS-1$ //$NON-NLS-2$
- return new Boolean(authAdmin.removePrincipalFromAllPolicies(token, principal));
- }
-
/**
* Returns a <code>Collection</code> of <code>AuthorizationPolicyID</code>s
- * that have <code>AuthorizationPermission</code>s in the given <code>AuthorizationRealm</code>.<br>
- * <strong>NOTE:</strong> It is the responsibility of the caller to determine
- * which of the <code>AuthorizationPolicy</code>'s <code>AuthorizationPermission</code>s
- * are actually in the given <code>AuthorizationRealm</code>. The <code>AuthorizationPolicy</code>
- * may span <code>AuthorizationRealm</code>s.
- * @param realm The realm in which to search for <code>AuthorizationPermission</code>s.
- * @return The collection of <code>AuthorizationPolicyID</code>s that have permissions
- * in the given realm - possibly empty but never null.
- * @throws AuthorizationException if admninistrator does not have the authority to preform the action.
- * @throws AuthorizationMgmtException if an error occurs in the Authorization store.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- public synchronized Collection getPolicyIDsWithPermissionsInRealm(AuthorizationRealm realm)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- SessionToken token = AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return authAdmin.getPolicyIDsWithPermissionsInRealm(token, realm);
- }
-
- /**
- * Returns a <code>Collection</code> of <code>AuthorizationPolicyID</code>s
* in the given <code>AuthorizationRealm</code>.
* <br>This method will only work for Data Access Authorizations because the realm
* is encoded in a Data Access policy name.
@@ -356,64 +246,6 @@
}
/**
- * Returns a <code>Collection</code> of <code>AuthorizationPolicyID</code>s
- * that have <code>AuthorizationPermissions</code> that exist in the given
- * <emph>partial</emph> <code>AuthorizationRealm</code>.<br>
- * The implementation is such that all <code>AuthorizationPolicyID</code>s
- * whose <code>AuthorizationRealm</code> <emph>starts with</emph> the given
- * <code>AuthorizationRealm</code> are returned.
- * @param realm The <emph>partial</emph> realm in which to search for
- * <code>AuthorizationPermission</code>s whose realm name <emph>starts with</emph>
- * the given realm.
- * @return The collection of <code>AuthorizationPolicyID</code>s that have permissions
- * in the given partial realm - possibly empty but never null.
- * @throws AuthorizationException if admninistrator does not have the authority to preform the action.
- * @throws AuthorizationMgmtException if an error occurs in the Authorization store.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- public synchronized Collection getPolicyIDsInPartialRealm(AuthorizationRealm realm)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- SessionToken token = AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return authAdmin.getPolicyIDsInPartialRealm(token, realm);
- }
-
- /**
- * Returns a <code>Collection</code> of <code>AuthorizationPolicyID</code>s
- * that have <code>AuthorizationPermissions</code> on the given resource that
- * exists in the given <code>AuthorizationRealm</code>.<br>
- * @param realm The realm in which to search for <code>AuthorizationPermission</code>s.
- * @param resourceName The resource for which to search for <code>AuthorizationPermission</code>s.
- * @return The collection of <code>AuthorizationPolicyID</code>s that have permissions
- * on the given resource - possibly empty but never null.
- * @throws AuthorizationException if admninistrator does not have the authority to preform the action.
- * @throws AuthorizationMgmtException if an error occurs in the Authorization store.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- public synchronized Collection getPolicyIDsForResourceInRealm(AuthorizationRealm realm, String resourceName)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- SessionToken token = AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return authAdmin.getPolicIDsForResourceInRealm(token, realm, resourceName);
- }
-
- /**
- * Verify that caller is in the specified logical role.
- * @param caller The session token of the MetaMatrix principle involking an administrative method.
- * @return true if caller's session token is valid and he is a MetaMatrix administrator.
- * @throws AuthorizationMgmtException if this service has trouble connecting to services it uses.
- */
- public synchronized boolean isCallerInRole(SessionToken caller, String roleName)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- AdminAPIHelper.validateSession(caller.getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return authAdmin.isCallerInRole(caller, roleName);
- }
-
- /**
* Return true is given username is a super user
* @param username - The user to verify as super user
* @return true if given user is a super user
@@ -423,72 +255,5 @@
final MembershipServiceInterface membershipService = PlatformProxyHelper.getMembershipServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL);
return membershipService.isSuperUser(username);
}
-
- /**
- * Returns a <code>List</code> of entitlements to the given fully qualified group name in the given realm.
- * <p>The list contains objects of type {@link com.metamatrix.platform.security.api.UserEntitlementInfo UserEntitlementInfo}
- * which will contain all user entitlement information for each group found. Each of these objects
- * will contain 1 or more objects of type {@link com.metamatrix.platform.security.api.GranteeEntitlementEntry GranteeEntitlementEntry}
- * which contain the <i>Grantee</i>'s name the entitlement <i>Grantor</i> or entity specifying the <i>Grantee</i>
- * is entitled and the <i>Allowed Actions</i> the <i>Grantee</i> is entitled to perform on the group.</p>
- * The attributes availible are:
- * <ol>
- * <li value=1>VDB Name</li>
- * <li>VDB Version</li>
- * <li>Group Name (fully qualified)</li>
- * <ul>
- * <li>Grantee Name; Grantor Name; Allowed Actions (A <code>String[]</code> of one or more of {CREATE, READ, UPDATE, DELETE})</li>
- * <li> ... </li>
- * </ul>
- * </ol>
- * @param realm The realm in which the element must live.
- * @param fullyQualifiedGroupName The resource for which to look up permissions.
- * @return The <code>List</code> of entitlements to the given element in the
- * given realm - May be empty but never null.
- * @throws AuthorizationException if admninistrator does not have the authority to preform the action.
- * @throws AuthorizationMgmtException if an error occurs in the Authorization store.
- * @throws MetaMatrixComponentException if this service has trouble communicating.
- */
- public synchronized List getGroupEntitlements(AuthorizationRealm realm, String fullyQualifiedGroupName)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
-// SessionToken token =
- AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return authAdmin.getGroupEntitlements(realm, fullyQualifiedGroupName);
- }
-
- /**
- * Returns a <code>List</code> of entitlements to the given element pattern in the given realm.
- * <p>The list contains objects of type {@link com.metamatrix.platform.security.api.UserEntitlementInfo UserEntitlementInfo}
- * which will contain all user entitlement information for each element found. Each of these objects
- * will contain 1 or more objects of type {@link com.metamatrix.platform.security.api.GranteeEntitlementEntry GranteeEntitlementEntry}
- * which contain the <i>Grantee</i>'s name the entitlement <i>Grantor</i> or entity specifying the <i>Grantee</i>
- * is entitled and the <i>Allowed Actions</i> the <i>Grantee</i> is entitled to perform on the element.</p>
- * The attributes availible are:
- * <ol>
- * <li value=1>VDB Name</li>
- * <li>VDB Version</li>
- * <li>Group Name (fully qualified)</li>
- * <li>Element Name (fully qualified)</li>
- * <ul>
- * <li>Grantee Name; Grantor Name; Allowed Actions (A <code>String[]</code> of one or more of {CREATE, READ, UPDATE, DELETE})</li>
- * <li> ... </li>
- * </ul>
- * </ol>
- * @param realm The realm in which the element must live.
- * @param elementNamePattern The resource for which to look up permissions. SQL '%' pattern matching may be used.
- * @return The <code>List</code> of entitlements to the given element in the
- * given realm - May be empty but never null.
- * @throws AuthorizationMgmtException if this service is unable to locate resources required
- * for this operation.
- */
- public synchronized List getElementEntitlements(AuthorizationRealm realm, String elementNamePattern)
- throws AuthorizationException, AuthorizationMgmtException, InvalidSessionException, MetaMatrixComponentException {
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return authAdmin.getElementEntitlements(realm, elementNamePattern);
- }
}
Modified: trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/ExtensionSourceAdminAPIImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/ExtensionSourceAdminAPIImpl.java 2009-04-03 01:38:21 UTC (rev 699)
+++ trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/ExtensionSourceAdminAPIImpl.java 2009-04-03 02:07:14 UTC (rev 700)
@@ -168,26 +168,6 @@
}
/**
- * Returns List of ExtensionSourceDescriptor objects of indicated type,
- * in order of their search ordering
- * @param type one of the known types of extension file
- * @return List of ExtensionSourceDescriptor objects of indicated type,
- * in order of their search ordering
- * @throws InvalidSessionException if there is not a valid administrative session
- * @throws AuthorizationException if the administrator does not have privileges to use this method
- * @throws InvalidExtensionTypeException if the indicated type is not one
- * of the currently-supported extension source types
- * @throws MetaMatrixComponentException indicating a non-business-related
- * exception (such as a communication exception)
- */
- public synchronized List getSourceDescriptors(String type)
- throws InvalidSessionException, AuthorizationException, InvalidExtensionModuleTypeException, MetaMatrixComponentException{
-// SessionToken token =
- AdminAPIHelper.validateSession(getSessionID());
- return getExtensionSourceManager().getSourceDescriptors(type);
- }
-
- /**
* Returns the ExtensionSourceDescriptor object for the extension
* source indicated by sourceName
* @param sourceName name (e.g. filename) of extension source
Modified: trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIImpl.java 2009-04-03 01:38:21 UTC (rev 699)
+++ trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIImpl.java 2009-04-03 02:07:14 UTC (rev 700)
@@ -73,9 +73,6 @@
public class RuntimeStateAdminAPIImpl extends SubSystemAdminAPIImpl implements RuntimeStateAdminAPI {
- // Config svc proxy
- private ConfigurationServiceInterface configAdmin;
-
protected Set listeners = new HashSet();
private RuntimeStateAdminAPIHelper helper;
@@ -93,7 +90,6 @@
*/
private RuntimeStateAdminAPIImpl(ClusteredRegistryState registry, HostManagement hostManagement) throws MetaMatrixComponentException {
this.registry = registry;
- configAdmin = PlatformProxyHelper.getConfigurationServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL);
helper = RuntimeStateAdminAPIHelper.getInstance(registry, hostManagement);
}
@@ -150,27 +146,6 @@
/**
- * Return all hosts running in mm system.
- *
- * @return List of HostRegistryBindings.
- * @throws AuthorizationException
- * if caller is not authorized to perform this method.
- * @throws InvalidSessionException
- * if the <code>callerSessionID</code> is not valid or is expired.
- * @throws MetaMatrixComponentException
- * if an error occurred in communicating with a component.
- */
- public synchronized List<String> getHosts() throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException {
-
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
-
- return helper.getHosts();
- }
-
- /**
* Stop service once work is complete.
*
* @param serviceID
Deleted: trunk/server/src/main/java/com/metamatrix/platform/config/service/ActionHistory.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/service/ActionHistory.java 2009-04-03 01:38:21 UTC (rev 699)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/service/ActionHistory.java 2009-04-03 02:07:14 UTC (rev 700)
@@ -1,124 +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.platform.config.service;
-
-import java.util.*;
-
-import com.metamatrix.platform.PlatformPlugin;
-import com.metamatrix.platform.util.ErrorMessageKeys;
-
-/**
- * This class maintains a history of actions. The "maximum size" of
- * the history can be specified. However, when the history is pruned,
- * it is done so in whole transactions.
- *
- */
-public class ActionHistory {
-
- public static final int DEFAULT_ACTION_COUNT_LIMIT = 100;
-
- private LinkedList actions = new LinkedList();
- private LinkedList actionCountInTransactions = new LinkedList();
- private int actionCountLimit = DEFAULT_ACTION_COUNT_LIMIT;
-
- public ActionHistory() {
- }
-
- public synchronized void addActionsForTransaction( List newActions ) {
- if ( newActions == null || newActions.isEmpty() ) {
- return;
- }
-
- // Add the actions to the history ...
- Iterator iter = newActions.iterator();
- while ( iter.hasNext() ) {
- this.actions.addFirst( iter.next() );
- }
- this.actionCountInTransactions.addFirst( new Integer(newActions.size()) );
-
- // Prune the history if required ...
- this.pruneIfRequired();
- }
-
- public synchronized int getHistorySize() {
- return this.actions.size();
- }
-
- public synchronized List getHistory() {
- return this.actions;
- }
-
- public synchronized List pop( int count ) {
- List result = new LinkedList();
- if ( count > 0 ) {
- int actualCount = count;
- if ( actualCount > this.actions.size() ) {
- actualCount = this.actions.size();
- }
- for ( int i=0; i!=actualCount; ++i ) {
- result.add( this.actions.removeFirst() );
- }
- }
- return result;
- }
-
- public int getHistoryLimit() {
- return this.actionCountLimit;
- }
-
- public synchronized void clearHistory() {
- this.actions.clear();
- this.actionCountInTransactions.clear();
- }
-
- public synchronized void setHistoryLimit( int newLimit ) {
- if ( newLimit < 0 ) {
- throw new IllegalArgumentException(PlatformPlugin.Util.getString(ErrorMessageKeys.CONFIG_0037));
- }
- this.actionCountLimit = newLimit;
- this.pruneIfRequired();
- }
-
- protected void pruneIfRequired() {
- int newSize = this.actions.size();
-
- // If the new size is greater than the limit, check whether the history
- // should be shrunk ...
- if ( newSize > actionCountLimit ) {
- // Get the number of actions in the earliest transaction.
- Integer countInEarliestTransaction = (Integer) actionCountInTransactions.getLast();
-
- // Remove all of the actions in the transaction ONLY IF the history
- // would we still be greater than the limit ...
- int numberToBeRemoved = countInEarliestTransaction.intValue();
- if ( newSize - numberToBeRemoved > actionCountLimit ) {
- for ( int i=0; i!= numberToBeRemoved; ++i ) {
- this.actions.removeLast();
- }
- actionCountInTransactions.removeLast();
- }
- }
- }
-
-}
-
Modified: trunk/server/src/main/java/com/metamatrix/server/admin/apiimpl/RuntimeMetadataAdminAPIImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/admin/apiimpl/RuntimeMetadataAdminAPIImpl.java 2009-04-03 01:38:21 UTC (rev 699)
+++ trunk/server/src/main/java/com/metamatrix/server/admin/apiimpl/RuntimeMetadataAdminAPIImpl.java 2009-04-03 02:07:14 UTC (rev 700)
@@ -256,43 +256,6 @@
}
/**
- * Get connector binding names for a given virtual database.
- *
- * @param vdbID ID of the VirtualDatabase.
- * @return Map of ModelIDs and String connector binding names.
- * @throws AuthorizationException if caller is not authorized to perform this method.
- * @throws InvalidSessionException if the <code>callerSessionID</code> is not valid or is expired.
- * @throws VirtualDatabaseException if an error occurs while setting the state.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- public synchronized Map getConnectorBindingNames(VirtualDatabaseID vdbID)
- throws AuthorizationException, InvalidSessionException, VirtualDatabaseException, MetaMatrixComponentException {
-
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
-
- Collection models = RuntimeMetadataCatalog.getInstance().getModels(vdbID);
- Map modelIDsCBNames = new HashMap();
- Iterator iter = models.iterator();
- while (iter.hasNext()) {
- Model model = (Model) iter.next();
- List cbNames = model.getConnectorBindingNames();
- for (Iterator mit=cbNames.iterator(); mit.hasNext();) {
- String cbName = (String) mit.next();
- modelIDsCBNames.put(model.getID(), cbName);
-
- }
-
- // Filter connector bindings that we don't want to see in Console
-// if (!HIDDEN_CONNECTORS.contains(cbName)) {
-// }
- }
-
- return modelIDsCBNames;
- }
-
- /**
* Given a routing ID, find all VDBs whose models use the connector binding.
* @param callerSessionID The caller's session ID.
* @param routingID ID of the connector binding.
15 years, 11 months