teiid SVN: r729 - in trunk: client/src/main/java/com/metamatrix/admin/objects and 6 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-08 07:50:41 -0400 (Wed, 08 Apr 2009)
New Revision: 729
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/objects/Session.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMSession.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionTableModel.java
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
trunk/server/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.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/admin/server/TestServerMonitoringAdminImpl.java
trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java
Log:
TEIID-475 fully removing product references
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/objects/Session.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/objects/Session.java 2009-04-08 00:05:32 UTC (rev 728)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/objects/Session.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -126,15 +126,7 @@
*/
public String getApplicationName();
-
/**
- * Get the Product Name
- *
- * @return String of the Product Name
- */
- public String getProductName();
-
- /**
* Get the unique MetaMatrix session
* within a given MetaMatrix System
*
Modified: trunk/client/src/main/java/com/metamatrix/admin/objects/MMSession.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMSession.java 2009-04-08 00:05:32 UTC (rev 728)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMSession.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -38,7 +38,6 @@
private String sessionID;
private String vdbName = ""; //$NON-NLS-1$
private String vdbVersion = ""; //$NON-NLS-1$
- private String productName = ""; //$NON-NLS-1$
private String ipAddress = ""; //$NON-NLS-1$
private String hostName = ""; //$NON-NLS-1$
private long lastPingTime;
@@ -70,7 +69,6 @@
result.append(AdminPlugin.Util.getString("MMSession.ID")).append(sessionID); //$NON-NLS-1$
result.append(AdminPlugin.Util.getString("MMSession.VDB_Name")).append(vdbName); //$NON-NLS-1$
result.append(AdminPlugin.Util.getString("MMSession.VDB_Version")).append(vdbVersion); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.Product")).append(productName); //$NON-NLS-1$
result.append(AdminPlugin.Util.getString("MMSession.Last_Ping_Time")).append(getLastPingTimeString()); //$NON-NLS-1$
result.append(AdminPlugin.Util.getString("MMSession.State")).append(getStateAsString()); //$NON-NLS-1$
result.append(AdminPlugin.Util.getString("MMSession.IPAddress")).append(ipAddress); //$NON-NLS-1$
@@ -163,27 +161,7 @@
this.applicationName = name;
}
-
-
/**
- * Get the Product Names
- *
- * @return String of the Product Names
- */
- public String getProductName() {
- return productName;
- }
-
- /**
- * Set the Product Names
- * @param name
- */
- public void setProductName(String name) {
- this.productName = name;
- }
-
-
- /**
* Get the unique MetaMatrix session
* within a given MetaMatrix System
*
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-08 00:05:32 UTC (rev 728)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -396,8 +396,6 @@
data[i][SessionTableModel.VDB_VERSION_COLUMN_NUM] = vdbVersStr;
String sessionState = ACTIVE_TEXT;
data[i][SessionTableModel.STATE_COLUMN_NUM] = sessionState;
- data[i][SessionTableModel.PRODUCT_COLUMN_NUM]= u.getProductName();
-
}
return data;
}
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionTableModel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionTableModel.java 2009-04-08 00:05:32 UTC (rev 728)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionTableModel.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -38,9 +38,8 @@
public static final int LOGGED_IN_COLUMN_NUM = 3;
public static final int VDB_NAME_COLUMN_NUM = 4;
public static final int VDB_VERSION_COLUMN_NUM = 5;
- public static final int PRODUCT_COLUMN_NUM = 6;
- public static final int LAST_PING_TIME = 7;
- public static final int STATE_COLUMN_NUM = 8;
+ public static final int LAST_PING_TIME = 6;
+ public static final int STATE_COLUMN_NUM = 7;
//Note-- positions must match USER_NAME_COLUMN_NUM, etc., below.
public final static String LOGGED_IN_AT = ConsolePlugin.Util.getString("SessionTableModel.Logged_In_At_1"); //$NON-NLS-1$
@@ -52,7 +51,6 @@
LOGGED_IN_AT,
ConsolePlugin.Util.getString("SessionTableModel.VDB_Name_5"), //$NON-NLS-1$
ConsolePlugin.Util.getString("SessionTableModel.VDB_Ver._6"), //$NON-NLS-1$
- ConsolePlugin.Util.getString("SessionTableModel.Product_7"), //$NON-NLS-1$
ConsolePlugin.Util.getString("SessionTableModel.Last_Ping_Time_8"), //$NON-NLS-1$
ConsolePlugin.Util.getString("SessionTableModel.State_9") }; //$NON-NLS-1$
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-08 00:05:32 UTC (rev 728)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -911,7 +911,6 @@
session.setLastUpdated(new Date(info.getTimeCreated()));
session.setVDBName(vdbName);
session.setVDBVersion(vdbVersionString);
- session.setProductName(info.getProductName());
session.setLastPingTime(info.getLastPingTime());
session.setSessionState(MetaMatrixSessionState.ACTIVE);
session.setIPAddress(info.getClientIp());
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java 2009-04-08 00:05:32 UTC (rev 728)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -37,7 +37,6 @@
private long lastPingTime;
private long timeCreated;
private String applicationName;
- private String product;
private Properties productInfo;
private String clientIp;
private String clientHostname;
@@ -47,11 +46,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, Properties productInfo, String product, String clientIp, String clientHostname){
+ public MetaMatrixSessionInfo(MetaMatrixSessionID sessionID, String userName, long timeCreated, String applicationName, Properties productInfo, String clientIp, String clientHostname){
this.timeCreated = timeCreated;
this.lastPingTime = timeCreated;
this.applicationName = applicationName;
- this.product = product;
this.sessionToken = new SessionToken(sessionID, userName);
this.productInfo = productInfo;
this.clientIp = clientIp;
@@ -93,10 +91,6 @@
this.lastPingTime = lastPingTime;
}
- public String getProductName() {
- return this.product;
- }
-
public SessionToken getSessionToken(){
return this.sessionToken;
}
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-08 00:05:32 UTC (rev 728)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -198,14 +198,11 @@
String authenticatedUserName = authenticatedToken.getUserName();
- String productName = "Platform"; //$NON-NLS-1$
-
//
// Validate VDB and version if logging on to server product...
//
String vdbName = properties.getProperty(ProductInfoConstants.VIRTUAL_DB);
if (vdbName != null) {
- productName = "Integration Server"; //$NON-NLS-1$
String vdbVersion = properties.getProperty(ProductInfoConstants.VDB_VERSION);
VirtualDatabaseID vdbID = null;
try {
@@ -240,9 +237,8 @@
creationTime,
applicationName,
productInfo,
- productName,
properties.getProperty(MMURL.CONNECTION.CLIENT_IP_ADDRESS),
- properties.getProperty(MMURL.CONNECTION.CLIENT_HOSTNAME));
+ properties.getProperty(MMURL.CONNECTION.CLIENT_HOSTNAME));
newSession.setTrustedToken(trustedToken);
this.sessionCache.put(newSession.getSessionID(), newSession);
return newSession;
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-08 00:05:32 UTC (rev 728)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -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", productInfo1, "product1", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- null, null); //$NON-NLS-1$
+ MetaMatrixSessionInfo info1 = new MetaMatrixSessionInfo(id1, "user1", 1, "app1", productInfo1, null, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ 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", productInfo2, "product2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- null, null); //$NON-NLS-1$
+ MetaMatrixSessionInfo info2 = new MetaMatrixSessionInfo(id2, "user2", 2, "app2", productInfo2, null, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ null); //$NON-NLS-1$
sessions.add(info2);
return sessions;
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java 2009-04-08 00:05:32 UTC (rev 728)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -473,10 +473,6 @@
assertEquals("vdb1", session.getVDBName()); //$NON-NLS-1$
assertEquals("1", session.getVDBVersion()); //$NON-NLS-1$
assertEquals("app1", session.getApplicationName()); //$NON-NLS-1$
- assertEquals("product1", session.getProductName()); //$NON-NLS-1$
-
-
-
results = admin.getSessions("1"); //$NON-NLS-1$
assertEquals(1, results.size());
}
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-08 00:05:32 UTC (rev 728)
+++ trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java 2009-04-08 11:50:41 UTC (rev 729)
@@ -51,7 +51,7 @@
MetaMatrixSessionInfo resultInfo = new MetaMatrixSessionInfo(
new MetaMatrixSessionID(1), userName, 0, applicationName, new Properties(),
- "product", null, null); //$NON-NLS-1$ //$NON-NLS-2$
+ null, null); //$NON-NLS-1$ //$NON-NLS-2$
Mockito.stub(ssi.createSession(userName, null, null, applicationName,
p)).toReturn(resultInfo);
15 years, 8 months
teiid SVN: r728 - in trunk: client/src/main/java/com/metamatrix/common/comm/platform/client and 12 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-07 20:05:32 -0400 (Tue, 07 Apr 2009)
New Revision: 728
Removed:
trunk/common-core/src/main/java/com/metamatrix/common/util/MetaMatrixProductNames.java
trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionTerminationHandler.java
Modified:
trunk/client/src/main/java/com/metamatrix/common/api/MMURL.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationModelContainerAdapter.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperUtil.java
trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/ConfigurationTreeCellRenderer.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.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/main/java/com/metamatrix/server/util/DataServerSessionTerminationHandler.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-475 removing the use of mmproductnames and product as a part of the logon protocol.
Modified: trunk/client/src/main/java/com/metamatrix/common/api/MMURL.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/api/MMURL.java 2009-04-07 21:45:42 UTC (rev 727)
+++ trunk/client/src/main/java/com/metamatrix/common/api/MMURL.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -50,7 +50,6 @@
}
public static interface CONNECTION {
- public static final String PRODUCT_NAME = "productName"; //$NON-NLS-1$
public static final String CLIENT_IP_ADDRESS = "clientIpAddress"; //$NON-NLS-1$
public static final String CLIENT_HOSTNAME = "clientHostName"; //$NON-NLS-1$
/**
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java 2009-04-07 21:45:42 UTC (rev 727)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -41,7 +41,6 @@
import com.metamatrix.common.comm.exception.ConnectionException;
import com.metamatrix.common.comm.platform.CommPlatformPlugin;
import com.metamatrix.common.comm.platform.socket.client.SocketServerConnectionFactory;
-import com.metamatrix.common.util.MetaMatrixProductNames;
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.core.MetaMatrixRuntimeException;
@@ -216,7 +215,8 @@
public ServerAdmin createAdmin(Properties p)
throws AdminComponentException, AdminException {
p = PropertiesUtils.clone(p);
- p.setProperty(MMURL.CONNECTION.PRODUCT_NAME, MetaMatrixProductNames.Platform.PRODUCT_NAME);
+ p.remove(MMURL.JDBC.VDB_NAME);
+ p.remove(MMURL.JDBC.VDB_VERSION);
p.setProperty(MMURL.CONNECTION.AUTO_FAILOVER, Boolean.TRUE.toString());
ServerAdmin serverAdmin = (ServerAdmin)Proxy.newProxyInstance(Thread.currentThread()
.getContextClassLoader(), new Class[] { ServerAdmin.class }, new ReconnectingProxy(p));
Deleted: trunk/common-core/src/main/java/com/metamatrix/common/util/MetaMatrixProductNames.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/util/MetaMatrixProductNames.java 2009-04-07 21:45:42 UTC (rev 727)
+++ trunk/common-core/src/main/java/com/metamatrix/common/util/MetaMatrixProductNames.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -1,147 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.common.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.metamatrix.core.util.MetaMatrixProductVersion;
-
-/**
- * <p>
- * This class records the official names of the various MetaMatrix products
- * and subsystems (each product has one or more subsystem). This class
- * is composed of embedded inner classes which reflect the embedding of
- * subsystems within a product. Note that this class presents the known
- * product names; a MetaMatrix system may not necessarily have all products
- * installed and available for administration.
- * </p><p>
- * This class also records the String classname of each Admin API
- * Facade Impl subsystem (which is needed by the Admin API
- * and is not intended for client use). Use {@link com.metamatrix.platform.admin.api.AdminAPIConnection}
- * to dynamically retrieve the list of installed products and subsystems.
- * </p>
- */
-public final class MetaMatrixProductNames extends MetaMatrixProductVersion {
-
- private static Map productsToSubsystems;
-
- public static class Platform {
- public static final String PRODUCT_NAME = PLATFORM_TYPE_NAME;
- public static class SubSystemNames {
- public static final String CONFIGURATION = "Configuration"; //$NON-NLS-1$
- public static final String RUNTIME_STATE = "Runtime State"; //$NON-NLS-1$
- public static final String MEMBERSHIP = "Membership"; //$NON-NLS-1$
- public static final String SESSION = "Session"; //$NON-NLS-1$
- public static final String AUTHORIZATION = "Authorization"; //$NON-NLS-1$
- public static final String EXTENSION_SOURCE = "Extension Source"; //$NON-NLS-1$
- }
- }
-
- public static class MetaMatrixServer {
- public static final String PRODUCT_NAME = METAMATRIX_SERVER_TYPE_NAME;
- public static class SubSystemNames {
- public static final String QUERY = "Query"; //$NON-NLS-1$
- public static final String TRANSACTION = "Transaction"; //$NON-NLS-1$
- public static final String CONNECTOR = "Connector"; //$NON-NLS-1$
- public static final String RUNTIME_METADATA = "Runtime MetaData"; //$NON-NLS-1$
- }
- }
-
- public static class ConnectorProduct {
- public static final String PRODUCT_NAME = CONNECTOR_PRODUCT_TYPE_NAME;
- public static final String JDBC = "Connector/JDBC"; //$NON-NLS-1$
- public static final String TEXT = "Connector/Text"; //$NON-NLS-1$
- public static final String LIBRADOS = "Connector/Librados"; //$NON-NLS-1$
- public static final String CUSTOM = "Connector/Custom"; //$NON-NLS-1$
- public static final String XML = "Connector/XML"; //$NON-NLS-1$
- public static final String DATASOURCES = "Sources"; //$NON-NLS-1$
- }
-
- /**
- * Returns the product names defined by this class as a Collection of
- * Strings.
- * @return Collection of String product names
- */
- public static Collection getProductNames(){
- if (productsToSubsystems == null){
- initializeMap();
- }
- return productsToSubsystems.keySet();
- }
-
- /**
- * Returns the subsystem names for a product as a Collection of
- * Strings.
- * @param productName name of product for which subsystem names are sought
- * @return Collection of String subsystem names for the product, or null
- * if the productName is invalid
- */
- public static Collection getProductSubsystemNames(final String productName){
- if (productsToSubsystems == null){
- initializeMap();
- }
- return (Collection)productsToSubsystems.get(productName);
- }
-
- /**
- * private Constructor, this class should never be instantiated
- */
- private MetaMatrixProductNames(){
- }
-
- /**
- * This Map maps a String product name to a List
- * of String subsystem names
- */
- private static void initializeMap(){
- productsToSubsystems = new HashMap();
-
- //platform
- int subsystemCount = 6;
- ArrayList aList = new ArrayList(subsystemCount);
- aList.add(Platform.SubSystemNames.CONFIGURATION);
- aList.add(Platform.SubSystemNames.RUNTIME_STATE);
- aList.add(Platform.SubSystemNames.MEMBERSHIP);
- aList.add(Platform.SubSystemNames.SESSION);
- aList.add(Platform.SubSystemNames.AUTHORIZATION);
- aList.add(Platform.SubSystemNames.EXTENSION_SOURCE);
- productsToSubsystems.put(Platform.PRODUCT_NAME, aList);
-
- //MM server
- subsystemCount = 4;
- aList = new ArrayList(subsystemCount);
- aList.add(MetaMatrixServer.SubSystemNames.CONNECTOR);
- aList.add(MetaMatrixServer.SubSystemNames.QUERY);
- aList.add(MetaMatrixServer.SubSystemNames.RUNTIME_METADATA);
- aList.add(MetaMatrixServer.SubSystemNames.TRANSACTION);
- productsToSubsystems.put(MetaMatrixServer.PRODUCT_NAME, aList);
-
- productsToSubsystems.put(ConnectorProduct.PRODUCT_NAME, Collections.EMPTY_LIST);
- }
-
-}
-
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationModelContainerAdapter.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationModelContainerAdapter.java 2009-04-07 21:45:42 UTC (rev 727)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationModelContainerAdapter.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -37,8 +37,8 @@
import com.metamatrix.common.config.util.ConfigObjectsNotResolvableException;
import com.metamatrix.common.config.util.ConfigurationPropertyNames;
import com.metamatrix.common.config.xml.XMLConfigurationImportExportUtility;
+import com.metamatrix.common.util.ApplicationInfo;
import com.metamatrix.common.util.ErrorMessageKeys;
-import com.metamatrix.common.util.MetaMatrixProductNames;
public class ConfigurationModelContainerAdapter {
@@ -118,7 +118,7 @@
Properties props = new Properties();
props.put(ConfigurationPropertyNames.APPLICATION_CREATED_BY, "Configuration Import_Export Utility"); //$NON-NLS-1$
- props.put(ConfigurationPropertyNames.APPLICATION_VERSION_CREATED_BY, MetaMatrixProductNames.VERSION_NUMBER);
+ props.put(ConfigurationPropertyNames.APPLICATION_VERSION_CREATED_BY, ApplicationInfo.getInstance().getMajorReleaseNumber());
props.put(ConfigurationPropertyNames.USER_CREATED_BY, principalName);
io.exportConfiguration(out, model.getAllObjects(), props);
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperUtil.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperUtil.java 2009-04-07 21:45:42 UTC (rev 727)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelperUtil.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -30,7 +30,7 @@
import com.metamatrix.common.config.util.ConfigurationPropertyNames;
import com.metamatrix.common.config.util.InvalidConfigurationElementException;
-import com.metamatrix.common.util.MetaMatrixProductNames;
+import com.metamatrix.common.util.ApplicationInfo;
import com.metamatrix.core.util.DateUtil;
@@ -131,7 +131,7 @@
defaultProperties.putAll(props);
}
defaultProperties.setProperty(ConfigurationPropertyNames.CONFIGURATION_VERSION, ConfigurationPropertyNames.MM_CONFIG_4_2_VERSION);
- defaultProperties.setProperty(ConfigurationPropertyNames.METAMATRIX_SYSTEM_VERSION, MetaMatrixProductNames.VERSION_NUMBER);
+ defaultProperties.setProperty(ConfigurationPropertyNames.METAMATRIX_SYSTEM_VERSION, ApplicationInfo.getInstance().getMajorReleaseNumber());
defaultProperties.setProperty(ConfigurationPropertyNames.TIME, DateUtil.getCurrentDateAsString());
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-07 21:45:42 UTC (rev 727)
+++ trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -39,7 +39,6 @@
import com.metamatrix.common.comm.exception.ConnectionException;
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.models.ModelManager;
import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.core.util.HashCodeUtil;
@@ -248,7 +247,6 @@
properties.setProperty(MMURL.CONNECTION.USER_NAME, user);
properties.setProperty(MMURL.CONNECTION.PASSWORD, new String(password));
properties.setProperty(MMURL.CONNECTION.APP_NAME, applicationName);
- properties.setProperty(MMURL.CONNECTION.PRODUCT_NAME, MetaMatrixProductNames.Platform.PRODUCT_NAME);
properties.setProperty(MMURL.CONNECTION.SERVER_URL, mmurl.getAppServerURL());
connection = SocketServerConnectionFactory.getInstance().createConnection(properties);
ModelManager.clearServices(this);
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/ConfigurationTreeCellRenderer.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/ConfigurationTreeCellRenderer.java 2009-04-07 21:45:42 UTC (rev 727)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/ConfigurationTreeCellRenderer.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -34,7 +34,6 @@
import com.metamatrix.common.config.api.ProductType;
import com.metamatrix.common.config.api.ServiceComponentDefn;
import com.metamatrix.common.config.api.VMComponentDefn;
-import com.metamatrix.common.util.MetaMatrixProductNames;
import com.metamatrix.console.connections.ConnectionInfo;
import com.metamatrix.console.models.ConfigurationManager;
import com.metamatrix.console.models.ModelManager;
@@ -131,17 +130,7 @@
} else if (userObj instanceof ConfigurationTreeModel.HostWrapper) {
setIcon(HOST_ICON);
} else if (userObj instanceof ProductType) {
- ProductType product = (ProductType)userObj;
- if (product.getName().equals(
- MetaMatrixProductNames.Platform.PRODUCT_NAME)) {
- setIcon(PLATFORM_ICON);
- } else if (product.getName().equals(
- MetaMatrixProductNames.MetaMatrixServer.PRODUCT_NAME)) {
- setIcon(METAMATRIX_SERVER_ICON);
- } else if (product.getName().equals(
- MetaMatrixProductNames.ConnectorProduct.PRODUCT_NAME)) {
- setIcon(CONNECTOR_ICON);
- }
+ setIcon(METAMATRIX_SERVER_ICON);
} else if (userObj instanceof DeployedComponent) {
setIcon(SERVICE_ICON);
}
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-07 21:45:42 UTC (rev 727)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -72,7 +72,6 @@
String user = connProps.getProperty(MMURL.CONNECTION.USER_NAME);
// password may be null if using trustedToken to log on
String password = connProps.getProperty(MMURL.CONNECTION.PASSWORD);
- String productName = connProps.getProperty(MMURL.CONNECTION.PRODUCT_NAME);
Credentials credential = null;
if (password != null) {
credential = new Credentials(password.toCharArray());
@@ -87,7 +86,7 @@
try {
MetaMatrixSessionInfo sessionInfo = service.createSession(user,
credential, (Serializable) payload, applicationName,
- productName, connProps);
+ connProps);
// logon
MetaMatrixSessionID sessionID = updateDQPContext(sessionInfo);
LogManager.logDetail(LogSecurityConstants.CTX_SESSION, new Object[] {
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-07 21:45:42 UTC (rev 727)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionServiceInterface.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -64,7 +64,6 @@
Credentials credentials,
Serializable trustedToken,
String applicationName,
- String productName,
Properties properties)
throws MetaMatrixAuthenticationException, SessionServiceException;
Deleted: trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionTerminationHandler.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionTerminationHandler.java 2009-04-07 21:45:42 UTC (rev 727)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionTerminationHandler.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -1,40 +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.security.api.service;
-
-import com.metamatrix.platform.security.api.SessionToken;
-
-/**
- *
- */
-public interface SessionTerminationHandler {
-
- void cleanup(SessionToken token) throws Exception;
- String getProductName();
-
-}
-
-
-
-
-
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-07 21:45:42 UTC (rev 727)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -26,10 +26,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
import java.util.Properties;
import java.util.Timer;
import java.util.TimerTask;
@@ -50,10 +46,8 @@
import com.metamatrix.common.id.dbid.DBIDController;
import com.metamatrix.common.id.dbid.DBIDGenerator;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.common.util.MetaMatrixProductNames;
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.core.util.ArgCheck;
-import com.metamatrix.core.util.StringUtil;
import com.metamatrix.dqp.ResourceFinder;
import com.metamatrix.metadata.runtime.RuntimeMetadataCatalog;
import com.metamatrix.metadata.runtime.api.VirtualDatabaseID;
@@ -67,7 +61,6 @@
import com.metamatrix.platform.security.api.MetaMatrixSessionInfo;
import com.metamatrix.platform.security.api.service.MembershipServiceInterface;
import com.metamatrix.platform.security.api.service.SessionServiceInterface;
-import com.metamatrix.platform.security.api.service.SessionTerminationHandler;
import com.metamatrix.platform.security.membership.service.AuthenticationToken;
import com.metamatrix.platform.security.util.LogSecurityConstants;
import com.metamatrix.platform.service.api.exception.ServiceException;
@@ -77,6 +70,7 @@
import com.metamatrix.platform.util.LogMessageKeys;
import com.metamatrix.platform.util.PlatformProxyHelper;
import com.metamatrix.platform.util.ProductInfoConstants;
+import com.metamatrix.server.util.DataServerSessionTerminationHandler;
/**
* This class serves as the primary implementation of the Session Service.
@@ -88,7 +82,6 @@
* Comma delimited string containing a list of SessionTerminationHandlers to be called when a session
* is terminated.
*/
- private static final String SESSION_TERMINATION_HANDLERS = "security.session.terminationHandlers"; //$NON-NLS-1$
private static final String MAX_ACTIVE_SESSIONS = "metamatrix.session.max.connections"; //$NON-NLS-1$
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$
@@ -100,8 +93,7 @@
private long sessionMaxLimit;
private long sessionTimeLimit;
- // Product name -> ServiceTerminationHandler
- private Map<String, SessionTerminationHandler> terminationHandlerMap = new HashMap<String, SessionTerminationHandler>();
+ private DataServerSessionTerminationHandler queryTerminationHandler = new DataServerSessionTerminationHandler();
private Timer sessionMonitor;
private DBIDController idGenerator = DBIDGenerator.getInstance();
@@ -115,13 +107,6 @@
*/
protected void initService(Properties env) throws Exception {
this.membershipService = PlatformProxyHelper.getMembershipServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL);
-
- // Instantiate SessionTerminationHandlers
- String handlerString = env.getProperty(SESSION_TERMINATION_HANDLERS);
- if (handlerString != null && handlerString.trim().length() > 0) {
- List handlers = StringUtil.split(handlerString, ","); //$NON-NLS-1$
- initTerminationHandlers(handlers);
- }
CacheFactory cf = ResourceFinder.getCacheFactory();
this.sessionCache = cf.get(Cache.Type.SESSION, new CacheConfiguration(Policy.LRU, 24*60*60, 5000));
@@ -156,22 +141,6 @@
}
}
- private void initTerminationHandlers(List handlers) {
-
- Iterator iter = handlers.iterator();
- while (iter.hasNext()) {
- String handler = (String)iter.next();
- try {
- SessionTerminationHandler sth = (SessionTerminationHandler)Thread.currentThread().getContextClassLoader().loadClass(handler).newInstance();
- terminationHandlerMap.put(sth.getProductName(), sth);
- } catch (ClassNotFoundException e) {
- LogManager.logWarning(LogSecurityConstants.CTX_SESSION,e,PlatformPlugin.Util.getString(LogMessageKeys.SEC_SESSION_0002, new Object[] {handler}));
- } catch (Exception e) {
- throw new ServiceException(e, ErrorMessageKeys.SEC_SESSION_0003,PlatformPlugin.Util.getString(ErrorMessageKeys.SEC_SESSION_0003, handler));
- }
- }
- }
-
/**
* Close the service to new work if applicable. After this method is called the service should no longer accept new work to
* perform but should continue to process any outstanding work. This method is called by die().
@@ -202,22 +171,19 @@
if (info == null) {
throw new InvalidSessionException(ErrorMessageKeys.SEC_SESSION_0027, PlatformPlugin.Util.getString(ErrorMessageKeys.SEC_SESSION_0027, sessionID));
}
- SessionTerminationHandler handler = terminationHandlerMap.get(info.getProductName());
- if (handler != null) {
+ if (info.getProductInfo(ProductInfoConstants.VIRTUAL_DB) != null) {
try {
- handler.cleanup(info.getSessionToken());
+ queryTerminationHandler.cleanup(info.getSessionToken());
} catch (Exception e) {
- LogManager.logWarning(LogSecurityConstants.CTX_SESSION,e,PlatformPlugin.Util.getString(LogMessageKeys.SEC_SESSION_0028, new Object[] {handler.getProductName()}));
+ LogManager.logWarning(LogSecurityConstants.CTX_SESSION,e,PlatformPlugin.Util.getString(LogMessageKeys.SEC_SESSION_0028, DataServerSessionTerminationHandler.class.getName()));
}
- } else {
- LogManager.logDetail(LogSecurityConstants.CTX_SESSION,PlatformPlugin.Util.getString(LogMessageKeys.SEC_SESSION_0024, new Object[] {info.getProductName()}));
- }
+ }
}
@Override
public MetaMatrixSessionInfo createSession(String userName,
Credentials credentials, Serializable trustedToken,
- String applicationName, String productName, Properties properties)
+ String applicationName, Properties properties)
throws MetaMatrixAuthenticationException, SessionServiceException {
ArgCheck.isNotNull(applicationName);
ArgCheck.isNotNull(properties);
@@ -232,12 +198,15 @@
String authenticatedUserName = authenticatedToken.getUserName();
+ String productName = "Platform"; //$NON-NLS-1$
+
//
// Validate VDB and version if logging on to server product...
//
- if (productName == null || productName.equals(MetaMatrixProductNames.MetaMatrixServer.PRODUCT_NAME)) {
- String vdbName = (String)properties.get(ProductInfoConstants.VIRTUAL_DB);
- String vdbVersion = (String)properties.get(ProductInfoConstants.VDB_VERSION);
+ String vdbName = properties.getProperty(ProductInfoConstants.VIRTUAL_DB);
+ if (vdbName != null) {
+ productName = "Integration Server"; //$NON-NLS-1$
+ String vdbVersion = properties.getProperty(ProductInfoConstants.VDB_VERSION);
VirtualDatabaseID vdbID = null;
try {
vdbID = RuntimeMetadataCatalog.getInstance().getActiveVirtualDatabaseID(vdbName, vdbVersion);
Modified: trunk/server/src/main/java/com/metamatrix/server/util/DataServerSessionTerminationHandler.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/util/DataServerSessionTerminationHandler.java 2009-04-07 21:45:42 UTC (rev 727)
+++ trunk/server/src/main/java/com/metamatrix/server/util/DataServerSessionTerminationHandler.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -24,10 +24,8 @@
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.util.LogCommonConstants;
-import com.metamatrix.common.util.MetaMatrixProductNames;
import com.metamatrix.metadata.runtime.RuntimeVDBDeleteUtility;
import com.metamatrix.platform.security.api.SessionToken;
-import com.metamatrix.platform.security.api.service.SessionTerminationHandler;
import com.metamatrix.platform.service.api.exception.ServiceException;
import com.metamatrix.platform.util.PlatformProxyHelper;
import com.metamatrix.server.ServerPlugin;
@@ -37,16 +35,10 @@
* SessionTerminationHandler implementation that cleans up all resources associated
* with a Session on the MetaMatrix server.
*/
-public class DataServerSessionTerminationHandler implements SessionTerminationHandler {
+public class DataServerSessionTerminationHandler {
- public static final String PRODUCT_NAME = MetaMatrixProductNames.MetaMatrixServer.PRODUCT_NAME;
-
private QueryServiceInterface queryServiceProxy;
- public String getProductName() {
- return PRODUCT_NAME;
- }
-
public void cleanup(SessionToken token) throws Exception {
// Cancel all queries and clean up cursors with queryService
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-07 21:45:42 UTC (rev 727)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -57,7 +57,7 @@
public MetaMatrixSessionInfo createSession(String userName,
Credentials credentials, Serializable trustedToken,
- String applicationName, String productName, Properties properties)
+ String applicationName, Properties properties)
throws MetaMatrixAuthenticationException, SessionServiceException {
return null;
}
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-07 21:45:42 UTC (rev 727)
+++ trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -48,14 +48,13 @@
Properties p = new Properties();
p.setProperty(MMURL.CONNECTION.USER_NAME, userName);
p.setProperty(MMURL.CONNECTION.APP_NAME, applicationName);
- p.setProperty(MMURL.CONNECTION.PRODUCT_NAME, productName);
MetaMatrixSessionInfo resultInfo = new MetaMatrixSessionInfo(
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);
+ p)).toReturn(resultInfo);
LogonImpl impl = new LogonImpl(ssi, "fakeCluster");
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-07 21:45:42 UTC (rev 727)
+++ trunk/server/src/test/java/com/metamatrix/platform/security/session/service/TestSessionServiceImpl.java 2009-04-08 00:05:32 UTC (rev 728)
@@ -32,7 +32,7 @@
}
- MetaMatrixSessionInfo info = ssi.createSession("steve", null, null, "foo", "test", new Properties()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ MetaMatrixSessionInfo info = ssi.createSession("steve", null, null, "foo", new Properties()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
id1 = info.getSessionID();
ssi.validateSession(id1);
15 years, 8 months
teiid SVN: r727 - trunk/engine/src/main/java/com/metamatrix/server/serverapi.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-07 17:45:42 -0400 (Tue, 07 Apr 2009)
New Revision: 727
Modified:
trunk/engine/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java
Log:
reapplying changes
Modified: trunk/engine/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java 2009-04-07 17:15:19 UTC (rev 726)
+++ trunk/engine/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java 2009-04-07 21:45:42 UTC (rev 727)
@@ -68,6 +68,10 @@
public SessionToken getSessionToken() {
return this.token;
}
+
+ public String getUserName() {
+ return this.token.getUsername();
+ }
/**
* Get time that the request was created by the user.
15 years, 8 months
teiid SVN: r726 - trunk/server/src/main/java/com/metamatrix/platform/security/membership/spi/ldap.
by teiid-commits@lists.jboss.org
Author: li.liang
Date: 2009-04-07 13:15:19 -0400 (Tue, 07 Apr 2009)
New Revision: 726
Modified:
trunk/server/src/main/java/com/metamatrix/platform/security/membership/spi/ldap/LDAPMembershipDomain.java
Log:
JIRA TEIID 471 - Map user name with blank password to blank user name.
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/membership/spi/ldap/LDAPMembershipDomain.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/membership/spi/ldap/LDAPMembershipDomain.java 2009-04-07 14:29:16 UTC (rev 725)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/membership/spi/ldap/LDAPMembershipDomain.java 2009-04-07 17:15:19 UTC (rev 726)
@@ -24,6 +24,7 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
@@ -318,6 +319,10 @@
}
}
}
+
+ if(credential.getCredentialsAsCharArray().length == 0){
+ username = "";//$NON-NLS-1$
+ }
return new SuccessfulAuthenticationToken(trustedPayload, username);
}
@@ -357,6 +362,10 @@
LogManager.logTrace(LogSecurityConstants.CTX_MEMBERSHIP, new Object[] {domainName, "getGroupNamesForUser", username}); //$NON-NLS-1$
+ if(username.length() == 0){
+ return Collections.EMPTY_SET;
+ }
+
UserEntry ue = getUserEntry(username, true);
return ue.getGroups();
15 years, 8 months
teiid SVN: r725 - trunk.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-07 10:29:16 -0400 (Tue, 07 Apr 2009)
New Revision: 725
Removed:
trunk/trunk/
Log:
rolling back commit 723 which created trunk under trunk by mistake.
15 years, 8 months
teiid SVN: r724 - trunk/trunk.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-04-07 10:29:01 -0400 (Tue, 07 Apr 2009)
New Revision: 724
Removed:
trunk/trunk/teiid-client/
Log:
rolling back commit 723 which created trunk under trunk by mistake.
15 years, 8 months
teiid SVN: r721 - in trunk: client/src/main/java/com/metamatrix/platform/security/api and 13 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-06 16:21:13 -0400 (Mon, 06 Apr 2009)
New Revision: 721
Added:
trunk/engine/src/main/java/com/metamatrix/server/
trunk/engine/src/main/java/com/metamatrix/server/serverapi/
Removed:
trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixPrincipalNames.java
trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/MembershipAdminAPI.java
trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/MembershipAdminAPIImpl.java
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerSecurityAdmin.java
trunk/console/src/main/java/com/metamatrix/console/models/GroupsManager.java
trunk/console/src/main/java/com/metamatrix/console/models/ModelManager.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/ProvidersMain.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/SummaryMain.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/users/GroupsTabMainPanel.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/users/NewGroupsWizardSelectionPanel.java
trunk/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java
trunk/server/src/main/java/com/metamatrix/admin/server/ServerSecurityAdminImpl.java
trunk/server/src/main/java/com/metamatrix/platform/security/api/service/MembershipServiceInterface.java
trunk/server/src/main/java/com/metamatrix/platform/security/membership/service/MembershipServiceImpl.java
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
trunk/server/src/main/resources/com/metamatrix/admin/util/methodroles.properties
Log:
TEIID-469 removing membershipadminapi.
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerSecurityAdmin.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerSecurityAdmin.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerSecurityAdmin.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -22,7 +22,9 @@
package com.metamatrix.admin.api.server;
+import java.io.Serializable;
import java.util.Collection;
+import java.util.List;
import com.metamatrix.admin.api.core.CoreSecurityAdmin;
import com.metamatrix.admin.api.exception.AdminException;
@@ -55,7 +57,7 @@
* if there's a system error.
* @since 4.3
*/
- Collection getRolesForGroup(String groupIdentifier) throws AdminException;
+ Collection<Role> getRolesForGroup(String groupIdentifier) throws AdminException;
/**
* Get the Collection of administrative role names possessed by the given user, if any.
@@ -64,12 +66,12 @@
* The unique identifier for the user. This is generally a user name. A user is a {@link Principal} and a
* Principal name is considered to be unique throughout the MetaMatrix system across all Membership domains.
* The {@link AdminObject#WILDCARD WILDCARD} cannot be used here.
- * @return The Collection of <code>String</code> role names.
+ * @return The Collection of {@link Role}s
* @throws AdminException
* if there's a system error.
* @since 4.3
*/
- Collection getRolesForUser(String userIdentifier) throws AdminException;
+ Collection<Role> getRolesForUser(String userIdentifier) throws AdminException;
/**
* Get the group memberships for the given user.
@@ -83,7 +85,7 @@
* if there's a system error.
* @since 4.3
*/
- Collection getGroupsForUser(String userIdentifier) throws AdminException;
+ Collection<Group> getGroupsForUser(String userIdentifier) throws AdminException;
/**
@@ -94,12 +96,12 @@
* a Principal name is considered to be unique throughout the MetaMatrix system across all Membership domains. <br>
* Note that by supplying the {@link AdminObject#WILDCARD WILDCARD} identifier, all all users in the system will
* retrieved.</br>
- * @return The Collection of users.
+ * @return The Collection of groups.
* @throws AdminException
* if there's a system error.
* @since 4.3
*/
- Collection getGroups(String groupIdentifier) throws AdminException;
+ Collection<Group> getGroups(String groupIdentifier) throws AdminException;
/**
* Assign to the given {@link Group} the given Administrative Role.
@@ -142,11 +144,42 @@
throws AdminException;
/**
- * Export the data roles defined for the given vdb fromthe current system
+ * Export the data roles defined for the given vdb from the current system
* @param vdbName - Name of the vdb
* @param vdbVersion - version of the vdb
* @return - char[] stream containing the XML contents of the roles.
* @throws AdminException
*/
char[] exportDataRoles(String vdbName, String vdbVersion) throws AdminException;
+
+ /**
+ * Authenticate a user with the specified user name and credentials
+ * for use with the specified application. The application name may also
+ * be used by the Membership Service to determine the appropriate authentication
+ * mechanism.
+ * @param username the user name that is to be authenticated
+ * @param credential
+ * @param trustePayload
+ * @param applicationName the name of the application for which the user
+ * is authenticating
+ * @return true if the authentication is successful
+ * @throws AdminException
+ */
+ boolean authenticateUser(String username, char[] credentials, Serializable trustePayload, String applicationName) throws AdminException;
+
+ /**
+ * Returns the active authorization provider domain names, in authentication order.
+ * @return List<String>
+ * @throws AdminException
+ */
+ List<String> getDomainNames( ) throws AdminException;
+
+ /**
+ * Return the {@link Group}s for a given domain. The domain name must be an specified
+ * exactly. See {@link #getActiveDomainNames()} for possible domain names.
+ * @param domainName
+ * @return
+ * @throws AdminException
+ */
+ Collection<Group> getGroupsForDomain(String domainName) throws AdminException;
}
Deleted: trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixPrincipalNames.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixPrincipalNames.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixPrincipalNames.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -1,95 +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.security.api;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Set;
-import java.util.HashSet;
-
-/**
- * This class wraps two Collections of <code>String</code> names -
- * the first is a <code>Collection</code> of names of MetaMatrix
- * user principals, the other is a <code>Collection</code> of group
- * principal names. These principal names can then be used, by a client,
- * to retrieve a {@link MetaMatrixPrincipal} object from the server.
- */
-public class MetaMatrixPrincipalNames implements Serializable {
-
- private Set groupNames;
- private Set userNames;
-
- /**
- * The constructor takes two Sets of names - one of group names, one of
- * user names. These two sets should never be null (they can be empty),
- * but there are no checks against null sets currently.
- */
- public MetaMatrixPrincipalNames(Set groupPrincipalNames, Set userPrincipalNames){
- if ( groupPrincipalNames == null ) {
- groupNames = new HashSet();
- }
- if ( userPrincipalNames == null ) {
- userNames = new HashSet();
- }
- this.groupNames = groupPrincipalNames;
- this.userNames = userPrincipalNames;
- }
-
- /**
- * Returns the names of all group principals contained in this
- * object
- * @return currently returns a <code>Set</code> of <code>String</code>
- * names, representing group principals. However, note that this
- * implementation may change.
- */
- public Collection getGroupPrincipalNames(){
- return this.groupNames;
- }
-
- /**
- * Returns the names of all user principals contained in this
- * object
- * @return currently returns a <code>Set</code> of <code>String</code>
- * names, representing user principals. However, note that this
- * implementation may change.
- */
- public Collection getUserPrincipalNames(){
- return this.userNames;
- }
-
- /**
- * Displays the group and user names
- */
- public String toString(){
- StringBuffer buffer = new StringBuffer();
- buffer.append("MetaMatrixPrincipalNames: {group names: "); //$NON-NLS-1$
- buffer.append(groupNames);
- buffer.append(" }, {user names: "); //$NON-NLS-1$
- buffer.append(userNames);
- buffer.append(" }"); //$NON-NLS-1$
- return buffer.toString();
- }
-}
-
-
-
Deleted: trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/MembershipAdminAPI.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/MembershipAdminAPI.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/MembershipAdminAPI.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -1,63 +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.admin.api;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
-import com.metamatrix.admin.api.exception.security.MetaMatrixSecurityException;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.AuthorizationException;
-import com.metamatrix.api.exception.security.MembershipServiceException;
-import com.metamatrix.common.util.MultipleRequestConfirmation;
-import com.metamatrix.platform.security.api.Credentials;
-import com.metamatrix.platform.security.api.MetaMatrixPrincipal;
-
-public interface MembershipAdminAPI extends SubSystemAdminAPI {
-
- List getDomainNames( )
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException, MetaMatrixSecurityException;
-
- Set getGroupsForDomain(String domainName)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException, MetaMatrixSecurityException;
-
- MetaMatrixPrincipal getUserPrincipal(String principalName)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException, MetaMatrixSecurityException;
-
- MultipleRequestConfirmation getUserPrincipals(Collection userNames)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException, MetaMatrixSecurityException;
-
- Collection getGroupPrincipalNames()
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException, MetaMatrixSecurityException;
-
- MultipleRequestConfirmation getGroupPrincipals(Collection groupNames)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException, MetaMatrixSecurityException;
-
- boolean authenticateUser(String username, Credentials credential, Serializable trustePayload, String applicationName)
- throws MetaMatrixComponentException, MembershipServiceException;
-
-}
-
Modified: trunk/console/src/main/java/com/metamatrix/console/models/GroupsManager.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/models/GroupsManager.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/console/src/main/java/com/metamatrix/console/models/GroupsManager.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -30,9 +30,9 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import com.metamatrix.admin.api.exception.security.MetaMatrixSecurityException;
+import com.metamatrix.admin.api.objects.Group;
import com.metamatrix.api.exception.ComponentNotFoundException;
import com.metamatrix.api.exception.security.AuthorizationException;
import com.metamatrix.console.connections.ConnectionInfo;
@@ -268,94 +268,24 @@
}
}
- public Collection /*<String>*/ getAllGroupNames()
- throws ExternalException, AuthorizationException,
- ComponentNotFoundException {
- /*try {
- MetaMatrixPrincipalNames enterprisePrincipals =
- ModelManager.getMembershipAPI(getConnection())
- .getReadonlyPrincipalNames();
- Collection groups = enterprisePrincipals.getGroupPrincipalNames();
- MetaMatrixPrincipalNames metaMatrixPrincipals =
- ModelManager.getMembershipAPI(getConnection())
- .getEditablePrincipalNames();
- Collection metaMatrixGroups = metaMatrixPrincipals
- .getGroupPrincipalNames();
- groups.addAll(metaMatrixGroups);
- return groups;
- } catch (AuthorizationException e) {
- throw(e);
- } catch (ComponentNotFoundException e) {
- throw(e);
- } catch (Exception e) {
- throw new ExternalException(e);
- }*/
- return Collections.EMPTY_LIST;
- }
-
- public List /*<String>*/ getDomainNames()
- throws ExternalException, AuthorizationException,
- ComponentNotFoundException {
- List domainNames = Collections.EMPTY_LIST;
+ public List<String> getDomainNames() {
+ List<String> domainNames = Collections.emptyList();
try {
- domainNames = ModelManager.getMembershipAPI(getConnection()).getDomainNames();
+ domainNames = getConnection().getServerAdmin().getDomainNames();
} catch (Exception e) {
return domainNames;
}
return domainNames;
}
- public void setDomainOrder(List domainNames)
- throws ExternalException, AuthorizationException,
- ComponentNotFoundException {
- try {
- //ModelManager.getMembershipAPI(getConnection()).setDomainOrder(domainNames);
- } catch (Exception e) {
- }
- }
-
- public void setEnableSecurity(boolean enabled)
- throws ExternalException, AuthorizationException,
- ComponentNotFoundException {
- try {
- //ModelManager.getMembershipAPI(getConnection()).setEnableSecurity(enabled);
- } catch (Exception e) {
- }
- }
-
- public void setAdminUsername(String username)
- throws ExternalException, AuthorizationException,
- ComponentNotFoundException {
- try {
- //ModelManager.getMembershipAPI(getConnection()).setAdminUsername(username);
- } catch (Exception e) {
- }
- }
-
- public void setAdminPassword(String password)
- throws ExternalException, AuthorizationException,
- ComponentNotFoundException {
- try {
- //ModelManager.getMembershipAPI(getConnection()).setAdminPassword(password);
- } catch (Exception e) {
- }
- }
-
- public Collection getGroupsForDomain (String theDomain) {
- Set groupNames = null;
+ public Collection<Group> getGroupsForDomain (String theDomain) {
try {
-
- groupNames = ModelManager.getMembershipAPI(getConnection()).getGroupsForDomain(theDomain);
-
+ return getConnection().getServerAdmin().getGroupsForDomain(theDomain);
} catch (Exception e) {
- return Collections.EMPTY_SET;
+
}
-
- if(groupNames!=null) {
- return groupNames;
- }
- return Collections.EMPTY_SET;
+ return Collections.emptyList();
}
public Map getMetaMatrixPropNamesForGroups() {
Modified: trunk/console/src/main/java/com/metamatrix/console/models/ModelManager.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/models/ModelManager.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/console/src/main/java/com/metamatrix/console/models/ModelManager.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -40,7 +40,6 @@
import com.metamatrix.platform.admin.api.AuthorizationAdminAPI;
import com.metamatrix.platform.admin.api.ConfigurationAdminAPI;
import com.metamatrix.platform.admin.api.ExtensionSourceAdminAPI;
-import com.metamatrix.platform.admin.api.MembershipAdminAPI;
import com.metamatrix.platform.admin.api.RuntimeStateAdminAPI;
import com.metamatrix.platform.admin.api.SubSystemAdminAPI;
import com.metamatrix.platform.security.api.MetaMatrixPrincipalName;
@@ -320,11 +319,6 @@
return (ConfigurationAdminAPI) getSubSystemAdminAPI(ConfigurationAdminAPI.class, conn);
}
- public static MembershipAdminAPI getMembershipAPI(ConnectionInfo conn) {
-
- return (MembershipAdminAPI) getSubSystemAdminAPI(MembershipAdminAPI.class, conn);
- }
-
public static RuntimeStateAdminAPI getRuntimeStateAPI(ConnectionInfo conn) {
return (RuntimeStateAdminAPI) getSubSystemAdminAPI(RuntimeStateAdminAPI.class, conn);
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/ProvidersMain.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/ProvidersMain.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/ProvidersMain.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -55,8 +55,6 @@
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableModel;
-import com.metamatrix.api.exception.ComponentNotFoundException;
-import com.metamatrix.api.exception.security.AuthorizationException;
import com.metamatrix.common.config.ResourceNames;
import com.metamatrix.common.config.api.AuthenticationProvider;
import com.metamatrix.common.config.api.Configuration;
@@ -396,9 +394,6 @@
private void setAuthenticationOrder(List authOrder) {
try {
- // Sets the order on the MembershipService
- getGroupsManager().setDomainOrder(authOrder);
-
// Updates the next startup configuration
updateConfiguration(authOrder);
} catch (Exception e) {
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/SummaryMain.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/SummaryMain.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/SummaryMain.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -56,8 +56,6 @@
import com.metamatrix.console.util.StaticUtilities;
import com.metamatrix.core.util.StringUtil;
import com.metamatrix.platform.admin.api.AuthorizationAdminAPI;
-import com.metamatrix.platform.admin.api.MembershipAdminAPI;
-import com.metamatrix.platform.security.api.Credentials;
import com.metamatrix.toolbox.ui.widget.ButtonWidget;
import com.metamatrix.toolbox.ui.widget.CheckBox;
import com.metamatrix.toolbox.ui.widget.DialogPanel;
@@ -466,9 +464,8 @@
return;
}
- final MembershipAdminAPI membershipAPI = ModelManager.getMembershipAPI(this.connection );
try {
- if(! membershipAPI.authenticateUser(this.connection.getUser(), new Credentials(currentPass), null, null) ) {
+ if(! this.getConnection().getServerAdmin().authenticateUser(this.connection.getUser(), currentPass, null, null) ) {
String title = ConsolePlugin.Util.getString("SummaryMain.authErrorDialog.title"); //$NON-NLS-1$
String msg = ConsolePlugin.Util.getString("SummaryMain.authErrorDialog.msg"); //$NON-NLS-1$
StaticUtilities.displayModalDialogWithOK(title, msg);
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/users/GroupsTabMainPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/users/GroupsTabMainPanel.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/users/GroupsTabMainPanel.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -48,7 +48,6 @@
import com.metamatrix.console.util.ExceptionUtility;
import com.metamatrix.console.util.ExternalException;
import com.metamatrix.console.util.LogContexts;
-import com.metamatrix.toolbox.ui.widget.ButtonWidget;
import com.metamatrix.toolbox.ui.widget.Splitter;
/**
@@ -65,7 +64,6 @@
private GroupsManager manager;
private RolesList rolesList;
- private ButtonWidget addButton;
private JPanel rightPanel = new JPanel();
private GroupTabSelectionHandler selectionHandler;
private boolean canViewPrincipalInfo;
@@ -125,11 +123,6 @@
return showingRolesList;
}
- public void setAddUser(boolean enableAddUser){
- if (addButton != null)
- addButton.setEnabled(enableAddUser);
- }
-
public String getTitle() {
//Unused-- needed by WorkspacePanel
return "";
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/users/NewGroupsWizardSelectionPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/users/NewGroupsWizardSelectionPanel.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/users/NewGroupsWizardSelectionPanel.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -48,14 +48,12 @@
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
-import com.metamatrix.api.exception.ComponentNotFoundException;
-import com.metamatrix.api.exception.security.AuthorizationException;
+import com.metamatrix.admin.api.objects.Group;
import com.metamatrix.console.models.GroupsManager;
import com.metamatrix.console.ui.util.BasicWizardSubpanelContainer;
import com.metamatrix.console.ui.util.NoMinTextFieldWidget;
import com.metamatrix.console.ui.util.WizardInterface;
import com.metamatrix.console.ui.util.property.TypeConstants;
-import com.metamatrix.console.util.ExternalException;
import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.platform.security.api.MetaMatrixPrincipal;
import com.metamatrix.platform.security.api.MetaMatrixPrincipalName;
@@ -254,13 +252,12 @@
// --------------------------------------------
String selectedDomain = (String)cbxDomainSelection.getSelectedItem();
- Collection allDomainGroups = getGroupsManager().getGroupsForDomain(selectedDomain);
+ Collection<Group> allDomainGroups = getGroupsManager().getGroupsForDomain(selectedDomain);
// Remove any that are in the supplied 'remove' list
this.currentDomainGroups = new ArrayList(allDomainGroups.size());
- Iterator iter = allDomainGroups.iterator();
- while(iter.hasNext()) {
- String currentGroup = (String)iter.next()+"@"+selectedDomain;
+ for (Group group : allDomainGroups) {
+ String currentGroup = group.getIdentifier();
if(this.listToRemoveFromAvailable != null && !this.listToRemoveFromAvailable.contains(currentGroup)) {
this.currentDomainGroups.add(currentGroup);
}
Copied: trunk/engine/src/main/java/com/metamatrix/server/serverapi (from rev 713, trunk/client/src/main/java/com/metamatrix/server/serverapi)
Property changes on: trunk/engine/src/main/java/com/metamatrix/server/serverapi
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -22,13 +22,16 @@
package com.metamatrix.admin.server;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import java.util.Properties;
import com.metamatrix.admin.api.exception.AdminException;
import com.metamatrix.admin.api.objects.AdminOptions;
import com.metamatrix.admin.api.objects.ConnectorBinding;
+import com.metamatrix.admin.api.objects.Group;
import com.metamatrix.admin.api.objects.LogConfiguration;
import com.metamatrix.admin.api.objects.ScriptsContainer;
import com.metamatrix.admin.api.objects.SystemObject;
@@ -949,4 +952,21 @@
return getConfigurationAdmin().getClusterKey();
}
+ @Override
+ public boolean authenticateUser(String username, char[] credentials,
+ Serializable trustePayload, String applicationName)
+ throws AdminException {
+ return getSecurityAdmin().authenticateUser(username, credentials, trustePayload, applicationName);
+ }
+
+ @Override
+ public List<String> getDomainNames() throws AdminException {
+ return getSecurityAdmin().getDomainNames();
+ }
+
+ @Override
+ public Collection<Group> getGroupsForDomain(String domainName)
+ throws AdminException {
+ return getSecurityAdmin().getGroupsForDomain(domainName);
+ }
}
\ No newline at end of file
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerSecurityAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerSecurityAdminImpl.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerSecurityAdminImpl.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -22,9 +22,11 @@
package com.metamatrix.admin.server;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import com.metamatrix.admin.api.exception.AdminComponentException;
@@ -34,6 +36,7 @@
import com.metamatrix.admin.api.exception.security.MetaMatrixSecurityException;
import com.metamatrix.admin.api.objects.AdminObject;
import com.metamatrix.admin.api.objects.AdminOptions;
+import com.metamatrix.admin.api.objects.Group;
import com.metamatrix.admin.api.objects.Principal;
import com.metamatrix.admin.api.server.AdminRoles;
import com.metamatrix.admin.api.server.ServerSecurityAdmin;
@@ -41,11 +44,13 @@
import com.metamatrix.admin.objects.MMRole;
import com.metamatrix.api.exception.security.AuthorizationException;
import com.metamatrix.api.exception.security.AuthorizationMgmtException;
+import com.metamatrix.api.exception.security.MembershipServiceException;
import com.metamatrix.common.actions.ModificationActionQueue;
import com.metamatrix.platform.registry.ClusteredRegistryState;
import com.metamatrix.platform.security.api.AuthorizationObjectEditor;
import com.metamatrix.platform.security.api.AuthorizationPolicy;
import com.metamatrix.platform.security.api.AuthorizationPolicyID;
+import com.metamatrix.platform.security.api.Credentials;
import com.metamatrix.platform.security.api.MetaMatrixPrincipalName;
import com.metamatrix.platform.security.api.SessionToken;
import com.metamatrix.platform.security.util.RolePermissionFactory;
@@ -126,6 +131,14 @@
executeAuthorizationActions(aoe);
}
+ public boolean authenticateUser(String username, char[] credentials, Serializable trustePayload, String applicationName) throws AdminException {
+ try {
+ return getMembershipServiceProxy().authenticateUser(username, new Credentials(credentials), trustePayload, applicationName).isAuthenticated();
+ } catch (MembershipServiceException e) {
+ throw new AdminComponentException(e);
+ }
+ }
+
/**
* Execute the actions requeted of the <code>MembershipObjectEditor</code> or throw
* an exception if unable for any reason.
@@ -209,12 +222,12 @@
* @see com.metamatrix.admin.api.server.ServerSecurityAdmin#getGroups(java.lang.String)
* @since 4.3
*/
- public Collection getGroups(String groupIdentifier) throws AdminException {
+ public Collection<Group> getGroups(String groupIdentifier) throws AdminException {
if (groupIdentifier == null) {
throwProcessingException("AdminImpl.requiredparameter", new Object[] {}); //$NON-NLS-1$
}
- Collection groups = new ArrayList();
+ Collection<Group> groups = new ArrayList<Group>();
Collection allGroups = null;
// Add all groups from internal membership domain
try {
@@ -292,9 +305,6 @@
return super.importDataRoles(vdbName, vdbVersion, xmlContents, options);
}
-
-
-
/**
* @see com.metamatrix.admin.api.server.ServerSecurityAdmin#exportDataRoles(java.lang.String, java.lang.String)
*/
@@ -310,4 +320,31 @@
}
return super.exportDataRoles(vdbName, vdbVersion);
}
+
+ @Override
+ public List<String> getDomainNames() throws AdminException {
+ try {
+ return this.getMembershipServiceProxy().getDomainNames();
+ } catch (MembershipServiceException e) {
+ throw new AdminComponentException(e);
+ }
+ }
+
+ @Override
+ public Collection<Group> getGroupsForDomain(String domainName)
+ throws AdminException {
+ if (domainName == null) {
+ throwProcessingException("AdminImpl.requiredparameter", new Object[] {}); //$NON-NLS-1$
+ }
+ try {
+ Collection<String> groupNames = this.getMembershipServiceProxy().getGroupsForDomain(domainName);
+ List<Group> result = new ArrayList<Group>(groupNames.size());
+ for (String groupName : groupNames) {
+ result.add(new MMGroup(new String[] {groupName}));
+ }
+ return result;
+ } catch (MembershipServiceException e) {
+ throw new AdminComponentException(e);
+ }
+ }
}
\ No newline at end of file
Deleted: trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/MembershipAdminAPIImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/MembershipAdminAPIImpl.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/MembershipAdminAPIImpl.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -1,194 +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.admin.apiimpl;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
-import com.metamatrix.admin.api.exception.security.MetaMatrixSecurityException;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.AuthorizationException;
-import com.metamatrix.api.exception.security.InvalidUserException;
-import com.metamatrix.api.exception.security.MembershipServiceException;
-import com.metamatrix.common.util.MultipleRequestConfirmation;
-import com.metamatrix.platform.admin.api.MembershipAdminAPI;
-import com.metamatrix.platform.security.api.Credentials;
-import com.metamatrix.platform.security.api.MetaMatrixPrincipal;
-import com.metamatrix.platform.security.api.MetaMatrixPrincipalName;
-import com.metamatrix.platform.security.api.service.MembershipServiceInterface;
-import com.metamatrix.platform.util.PlatformProxyHelper;
-
-public class MembershipAdminAPIImpl extends SubSystemAdminAPIImpl implements MembershipAdminAPI {
-
- // Auth svc proxy
- private MembershipServiceInterface membAdmin;
- private static MembershipAdminAPI membershipAdminAPI;
-
- /**
- * ctor
- */
- private MembershipAdminAPIImpl() throws MetaMatrixComponentException {
-
- membAdmin = PlatformProxyHelper.getMembershipServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL);
- }
-
- public synchronized static MembershipAdminAPI getInstance() throws MetaMatrixComponentException {
- if (membershipAdminAPI == null) {
- membershipAdminAPI = new MembershipAdminAPIImpl();
- }
- return membershipAdminAPI;
- }
-
- public synchronized List getDomainNames( ) throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException,
- MetaMatrixSecurityException {
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
-
- // Any administrator may call this read-only method - no need to validate role
- return membAdmin.getDomainNames();
- }
-
- public synchronized Set getGroupsForDomain(String domainName) throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException,
- MetaMatrixSecurityException {
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return membAdmin.getGroupsForDomain(domainName);
- }
-
- /**
- * Authenticate the given user / credentials as a valid system user using the given payload and application name
- * @param username - user to authenticate
- * @param credential - credentials to use when validating user
- * @param trustedpayload - payload to use when validating user
- * @param applicationName - applicationName to use when validating user
- * @return Will return either a SuccessfulAuthenticationToken or an UnsuccessfulAuthenticationToken
- * @see com.metamatrix.platform.admin.api.MembershipAdminAPI#authenticateUser(java.lang.String, com.metamatrix.platform.security.api.Credentials, java.io.Serializable, java.lang.String)
- *
- */
- public boolean authenticateUser(String username, Credentials credential, Serializable trustePayload, String applicationName) throws MetaMatrixComponentException, MembershipServiceException {
- return membAdmin.authenticateUser(username, credential, trustePayload, applicationName).isAuthenticated();
- }
-
- public synchronized MetaMatrixPrincipal getUserPrincipal(String principalName) throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException,
- MetaMatrixSecurityException {
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return membAdmin.getPrincipal(new MetaMatrixPrincipalName(principalName, MetaMatrixPrincipal.TYPE_USER));
- }
-
- public synchronized MultipleRequestConfirmation getUserPrincipals(Collection userNames) throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException,
- MetaMatrixSecurityException {
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
-
- MultipleRequestConfirmation result = new MultipleRequestConfirmation();
- Collection principals = new HashSet(userNames.size());
-
- Iterator iter = userNames.iterator();
- String userName = null;
- MetaMatrixPrincipal principal = null;
- while (iter.hasNext()) {
- userName = (String)iter.next();
- try {
- principal = membAdmin.getPrincipal(new MetaMatrixPrincipalName(userName, MetaMatrixPrincipal.TYPE_USER));
- principals.add(principal);
- } catch (InvalidUserException e) {
- result.addFailure(userName, e);
- } catch (MetaMatrixSecurityException e) {
- result.addFailure(userName, e);
- }
- }
- result.setResult(principals);
- return result;
- }
-
- /**
- * Add the given set of principals to the given role.
- *
- * @param principals
- * Set of <code>MetaMatrixPrincipalName</code>s to which to add.
- * @param roleName
- * The name of the role to which to add the principals.
- * @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 MultipleRequestConfirmation getGroupPrincipals(Collection groupNames) throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException,
- MetaMatrixSecurityException {
- // Validate caller's session
- // SessionToken token =
- AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
-
- MultipleRequestConfirmation result = new MultipleRequestConfirmation();
- Collection principals = new HashSet(groupNames.size());
-
- Iterator iter = groupNames.iterator();
- String groupName = null;
- MetaMatrixPrincipal principal = null;
- while (iter.hasNext()) {
- groupName = (String)iter.next();
- try {
- principal = membAdmin.getPrincipal(new MetaMatrixPrincipalName(groupName, MetaMatrixPrincipal.TYPE_GROUP));
- principals.add(principal);
- } catch (InvalidUserException e) {
- result.addFailure(groupName, e);
- } catch (MetaMatrixSecurityException e) {
- result.addFailure(groupName, e);
- }
- }
- result.setResult(principals);
- return result;
- }
-
- public synchronized Collection getGroupPrincipalNames() throws AuthorizationException,
- InvalidSessionException,
- MetaMatrixComponentException,
- MetaMatrixSecurityException {
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
- return membAdmin.getGroupNames();
- }
-}
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/api/service/MembershipServiceInterface.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/api/service/MembershipServiceInterface.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/api/service/MembershipServiceInterface.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -68,6 +68,8 @@
public static final String DOMAIN_PROPERTIES = "propertiesFile"; //$NON-NLS-1$
+ public static final String AT = "@"; //$NON-NLS-1$
+
/**
* Authenticate a user with the specified username and credential
* for use with the specified application. The application name may also
@@ -100,17 +102,17 @@
*
* The username should be fully qualified
*/
- Set getGroupsForUser(String username)
+ Set<String> getGroupsForUser(String username)
throws MembershipServiceException, InvalidPrincipalException;
/**
* Obtain the collection of group names.
*/
- Set getGroupNames() throws MembershipServiceException;
+ Set<String> getGroupNames() throws MembershipServiceException;
- List getDomainNames() throws MembershipServiceException;
+ List<String> getDomainNames() throws MembershipServiceException;
- Set getGroupsForDomain(String domainName) throws MembershipServiceException;
+ Set<String> getGroupsForDomain(String domainName) throws MembershipServiceException;
boolean isSuperUser(String username) throws MembershipServiceException;
Modified: trunk/server/src/main/java/com/metamatrix/platform/security/membership/service/MembershipServiceImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/membership/service/MembershipServiceImpl.java 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/membership/service/MembershipServiceImpl.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -78,9 +78,7 @@
*/
public class MembershipServiceImpl extends AbstractService implements MembershipServiceInterface {
- private static final String AT = "@"; //$NON-NLS-1$
-
- static class MembershipDomainHolder {
+ static class MembershipDomainHolder {
private MembershipDomain membershipDomain;
private String domainName;
@@ -338,7 +336,7 @@
if (auth.getDomainName() != null) {
domain = auth.getDomainName();
}
- return new SuccessfulAuthenticationToken(auth.getPayload(), baseUsername + AT + domain);
+ return new SuccessfulAuthenticationToken(auth.getPayload(), baseUsername + MembershipServiceInterface.AT + domain);
}
String msg = PlatformPlugin.Util.getString("MembershipServiceImpl.Null_authentication", entry.getDomainName(), username ); //$NON-NLS-1$
LogManager.logError(LogSecurityConstants.CTX_MEMBERSHIP, msg);
@@ -378,7 +376,7 @@
}
//strip the escape character from the remaining ats
- return result.replaceAll("\\\\"+AT, AT); //$NON-NLS-1$
+ return result.replaceAll("\\\\"+MembershipServiceInterface.AT, MembershipServiceInterface.AT); //$NON-NLS-1$
}
static String escapeName(String name) {
@@ -386,7 +384,7 @@
return name;
}
- return name.replaceAll(AT, "\\\\"+AT); //$NON-NLS-1$
+ return name.replaceAll(MembershipServiceInterface.AT, "\\\\"+MembershipServiceInterface.AT); //$NON-NLS-1$
}
static String getDomainName(String username) {
@@ -405,7 +403,7 @@
static int getQualifierIndex(String username) {
int index = username.length();
- while ((index = username.lastIndexOf(AT, --index)) != -1) {
+ while ((index = username.lastIndexOf(MembershipServiceInterface.AT, --index)) != -1) {
if (index > 0 && username.charAt(index - 1) != '\\') {
return index;
}
@@ -515,14 +513,14 @@
throw new InvalidPrincipalException(PlatformPlugin.Util.getString("MembershipServiceImpl.principal_does_not_exist", name, domain.getDomainName())); //$NON-NLS-1$
}
- private Set getDomainSpecificGroups(Set groups, String domainName) {
+ private Set<String> getDomainSpecificGroups(Set<String> groups, String domainName) {
if (groups == null) {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
- Set results = new HashSet();
+ Set<String> results = new HashSet<String>();
- for (Iterator i = groups.iterator(); i.hasNext();) {
- results.add(escapeName((String)i.next()) + AT + domainName);
+ for (Iterator<String> i = groups.iterator(); i.hasNext();) {
+ results.add(escapeName(i.next()) + MembershipServiceInterface.AT + domainName);
}
return results;
}
@@ -600,7 +598,7 @@
return names;
}
- public Set getGroupsForDomain(String domainName) throws MembershipServiceException {
+ public Set<String> getGroupsForDomain(String domainName) throws MembershipServiceException {
LogManager.logTrace(LogSecurityConstants.CTX_MEMBERSHIP, new Object[] {"getGroupsForDomain", domainName}); //$NON-NLS-1$
@@ -614,10 +612,10 @@
}
}
if(dHolder==null) {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
try {
- return dHolder.getMembershipDomain().getGroupNames();
+ return getDomainSpecificGroups(dHolder.getMembershipDomain().getGroupNames(), domainName);
} catch (Throwable e) {
String msg = PlatformPlugin.Util.getString("MembershipServiceImpl.source_exception", dHolder.getDomainName()); //$NON-NLS-1$
LogManager.logError(LogSecurityConstants.CTX_MEMBERSHIP, e, msg);
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-06 17:38:05 UTC (rev 720)
+++ trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java 2009-04-06 20:21:13 UTC (rev 721)
@@ -83,13 +83,11 @@
import com.metamatrix.platform.admin.api.AuthorizationAdminAPI;
import com.metamatrix.platform.admin.api.ConfigurationAdminAPI;
import com.metamatrix.platform.admin.api.ExtensionSourceAdminAPI;
-import com.metamatrix.platform.admin.api.MembershipAdminAPI;
import com.metamatrix.platform.admin.api.RuntimeStateAdminAPI;
import com.metamatrix.platform.admin.apiimpl.AdminHelper;
import com.metamatrix.platform.admin.apiimpl.AuthorizationAdminAPIImpl;
import com.metamatrix.platform.admin.apiimpl.ConfigurationAdminAPIImpl;
import com.metamatrix.platform.admin.apiimpl.ExtensionSourceAdminAPIImpl;
-import com.metamatrix.platform.admin.apiimpl.MembershipAdminAPIImpl;
import com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPIImpl;
import com.metamatrix.platform.config.api.service.ConfigurationServiceInterface;
import com.metamatrix.platform.config.event.ConfigurationChangeEvent;
@@ -210,7 +208,6 @@
private void registerSubSystemAdminAPIs(HostManagement hostManagement) throws MetaMatrixComponentException {
this.clientServices.registerClientService(ConfigurationAdminAPI.class, ConfigurationAdminAPIImpl.getInstance(this.registry), PlatformAdminConstants.CTX_CONFIGURATION_ADMIN_API);
this.clientServices.registerClientService(RuntimeStateAdminAPI.class, RuntimeStateAdminAPIImpl.getInstance(this.registry, hostManagement), PlatformAdminConstants.CTX_RUNTIME_STATE_ADMIN_API);
- this.clientServices.registerClientService(MembershipAdminAPI.class, MembershipAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
this.clientServices.registerClientService(AuthorizationAdminAPI.class, AuthorizationAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_AUTHORIZATION_ADMIN_API);
this.clientServices.registerClientService(ExtensionSourceAdminAPI.class, ExtensionSourceAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
this.clientServices.registerClientService(RuntimeMetadataAdminAPI.class, RuntimeMetadataAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_RUNTIME_METADATA_ADMIN_API);
Modified: trunk/server/src/main/resources/com/metamatrix/admin/util/methodroles.properties
===================================================================
--- trunk/server/src/main/resources/com/metamatrix/admin/util/methodroles.properties 2009-04-06 17:38:05 UTC (rev 720)
+++ trunk/server/src/main/resources/com/metamatrix/admin/util/methodroles.properties 2009-04-06 20:21:13 UTC (rev 721)
@@ -129,10 +129,13 @@
addUser=Admin.SystemAdmin
assignRoleToGroup=Admin.SystemAdmin
assignRoleToUser=Admin.SystemAdmin
+authenticateUser=Anonymous
exportDataRoles=Admin.SystemAdmin
exportPrincipals=Admin.SystemAdmin
getChildrenOfGroup=Admin.SystemAdmin
+getDomainNames=Admin.SystemAdmin
getGroups=Admin.SystemAdmin
+getGroupsForDomain=Admin.SystemAdmin
getGroupsForUser=Admin.SystemAdmin
getParentsOfGroup=Admin.SystemAdmin
getRolesForGroup=Admin.SystemAdmin
15 years, 8 months
teiid SVN: r720 - in trunk: client/src/main/java/com/metamatrix/admin/api/objects and 9 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-04-06 13:38:05 -0400 (Mon, 06 Apr 2009)
New Revision: 720
Removed:
trunk/client/src/main/java/com/metamatrix/admin/api/objects/SourceRequest.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMSourceRequest.java
trunk/common-internal/src/main/java/com/metamatrix/server/admin/api/QueryAdminAPI.java
trunk/server/src/main/java/com/metamatrix/server/admin/apiimpl/QueryAdminAPIImpl.java
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java
trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreRuntimeStateAdmin.java
trunk/client/src/main/java/com/metamatrix/admin/api/objects/Request.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMAdminObject.java
trunk/client/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java
trunk/console/src/main/java/com/metamatrix/console/models/ModelManager.java
trunk/console/src/main/java/com/metamatrix/console/models/QueryManager.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryPanel.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryRequestPanel.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryTableModel.java
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java
Log:
TEIID-468 removed QueryAdminApi
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -33,7 +33,6 @@
import com.metamatrix.admin.api.objects.QueueWorkerPool;
import com.metamatrix.admin.api.objects.Request;
import com.metamatrix.admin.api.objects.Session;
-import com.metamatrix.admin.api.objects.SourceRequest;
import com.metamatrix.admin.api.objects.SystemObject;
import com.metamatrix.admin.api.objects.VDB;
@@ -195,7 +194,7 @@
* @since 4.3
*/
- Collection getRequests(String identifier) throws AdminException;
+ Collection<Request> getRequests(String identifier) throws AdminException;
/**
* Get the Source Request that correspond to the specified identifier pattern
@@ -206,14 +205,12 @@
* that begin with given number, or all the requests for particular session etc.
* <li><code>"number<{@link AdminObject#DELIMITER_CHAR}>number<{@link AdminObject#DELIMITER_CHAR}>number"</code> - for a single source request in the system
* </ul>
- * @return Collection of {@link SourceRequest}
+ * @return Collection of {@link Request}
* @throws AdminException if there's a system error.
* @since 4.3
*/
- Collection getSourceRequests(String identifier) throws AdminException;
+ Collection<Request> getSourceRequests(String identifier) throws AdminException;
-
-
/**
* Get all of the available Configuration Properties for the specified AdminObject, and details about them.
* @param identifier
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreRuntimeStateAdmin.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreRuntimeStateAdmin.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreRuntimeStateAdmin.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -78,7 +78,7 @@
/**
* Terminate the Session
*
- * @param identifier Session Idenitfier {@link com.metamatrix.admin.api.objects.Session}.
+ * @param identifier Session Identifier {@link com.metamatrix.admin.api.objects.Session}.
* No wild cards currently supported, must be explicit
* @throws AdminException if there's a system error.
* @since 4.3
@@ -88,7 +88,7 @@
/**
* Cancel Request
*
- * @param identifier The request identifer defined by {@link com.metamatrix.admin.api.objects.Request}
+ * @param identifier The request identifier defined by {@link com.metamatrix.admin.api.objects.Request}
* No wild cards currently supported, must be explicit
* @throws AdminException if there's a system error.
* @since 4.3
@@ -98,7 +98,7 @@
/**
* Cancel Source Request
*
- * @param identifier The request identifer defined by {@link com.metamatrix.admin.api.objects.Request}
+ * @param identifier The request identifier defined by {@link com.metamatrix.admin.api.objects.Request}
* No wild cards currently supported, must be explicit
* @throws AdminException if there's a system error.
* @since 4.3
@@ -108,8 +108,8 @@
/**
* Change the status of a Deployed VDB
*
- * @param name Name of the Virtial Database
- * @param version Version of the Virtial Database
+ * @param name Name of the Virtual Database
+ * @param version Version of the Virtual Database
* @param status Active, InActive, Delete
* @throws AdminException if there's a system error.
* @since 4.3
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/objects/Request.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/objects/Request.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/objects/Request.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -26,13 +26,13 @@
/**
- * when user submits a SQL command to the system for processing, usally that represents
- * a single request to a MetaMatrix system. A single request might have one or more source
+ * When a user submits a SQL command to the system for processing, usually that represents
+ * a single request. A single request might have one or more source
* requests (the requests that are being processed on the physical data sources) as part
* of original request.
*
- * <p>A request is identified by a numbers separted by "." (dots). Usally in they are arranged
- * in pattern [session].[request] or [session].[request].[source request] </p>
+ * <p>A request is identified by a numbers separated by "." (dots). usually in they are arranged
+ * in the pattern [session].[request] or [session].[request].[source request] </p>
* @since 4.3
*/
public interface Request extends AdminObject {
Deleted: trunk/client/src/main/java/com/metamatrix/admin/api/objects/SourceRequest.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/objects/SourceRequest.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/objects/SourceRequest.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -1,32 +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.admin.api.objects;
-
-
-/**
- * @since 4.3
- * @see com.metamatrix.admin.api.objects.Request
- */
-public interface SourceRequest extends Request {
-
-}
Modified: trunk/client/src/main/java/com/metamatrix/admin/objects/MMAdminObject.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMAdminObject.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMAdminObject.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -115,7 +115,6 @@
objectTypeMap.put(com.metamatrix.admin.api.objects.Resource.class.getName(), new Integer(OBJECT_TYPE_RESOURCE));
objectTypeMap.put(com.metamatrix.admin.api.objects.Role.class.getName(), new Integer(OBJECT_TYPE_ROLE));
objectTypeMap.put(com.metamatrix.admin.api.objects.Session.class.getName(), new Integer(OBJECT_TYPE_SESSION));
- objectTypeMap.put(com.metamatrix.admin.api.objects.SourceRequest.class.getName(), new Integer(OBJECT_TYPE_SOURCE_REQUEST));
objectTypeMap.put(com.metamatrix.admin.api.objects.SystemObject.class.getName(), new Integer(OBJECT_TYPE_SYSTEM_OBJECT));
objectTypeMap.put(com.metamatrix.admin.api.objects.User.class.getName(), new Integer(OBJECT_TYPE_USER));
objectTypeMap.put(com.metamatrix.admin.api.objects.VDB.class.getName(), new Integer(OBJECT_TYPE_VDB));
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMSourceRequest.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMSourceRequest.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMSourceRequest.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -1,76 +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.admin.objects;
-
-import com.metamatrix.admin.AdminPlugin;
-import com.metamatrix.admin.api.objects.SourceRequest;
-
-/**
- * Dataholder for information about SourceRequests.
- */
-public class MMSourceRequest extends MMRequest implements SourceRequest {
-
-
-
- /**
- * Construct a new MMSourceRequest
- * @param identifierParts
- * @since 4.3
- */
- public MMSourceRequest(String[] identifierParts) {
- super(identifierParts);
- }
-
-
-
- /**
- * @return Returns whether this is a Source Request.
- * @since 4.3
- */
- public boolean isSource() {
- return true;
- }
-
-
-
- /**
- * @see java.lang.Object#toString()
- * @return String for display purposes
- */
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMSourceRequest.MMSourceRequest")).append(getIdentifier()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMRequest.requestID")).append(getRequestID()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMRequest.userName")).append(userName); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMRequest.sessionID")).append(sessionID); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMRequest.created")).append(getCreatedString()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMRequest.processing")).append(getProcessingDateString()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMRequest.transactionID")).append(transactionID); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMRequest.command")).append(sqlCommand); //$NON-NLS-1$
- return result.toString();
- }
-
-
-
-
-}
Modified: trunk/client/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/client/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -152,11 +152,14 @@
@Override
public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
if (!(obj instanceof RequestInfo)) {
return false;
}
RequestInfo value = (RequestInfo)obj;
- if (connectorBindingUUID == null) {
+ if (connectorBindingUUID == null || value.getConnectorBindingUUID() == null) {
return requestID.equals(value.getRequestID());
}
return requestID.equals(value.getRequestID()) && connectorBindingUUID.equals(value.getConnectorBindingUUID()) && nodeID == value.nodeID;
Deleted: trunk/common-internal/src/main/java/com/metamatrix/server/admin/api/QueryAdminAPI.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/server/admin/api/QueryAdminAPI.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/common-internal/src/main/java/com/metamatrix/server/admin/api/QueryAdminAPI.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -1,113 +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.server.admin.api;
-
-import java.util.*;
-
-import com.metamatrix.platform.admin.api.SubSystemAdminAPI;
-import com.metamatrix.platform.security.api.MetaMatrixSessionID;
-
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.AuthorizationException;
-import com.metamatrix.api.exception.server.InvalidRequestIDException;
-import com.metamatrix.dqp.message.RequestID;
-
-public interface QueryAdminAPI extends SubSystemAdminAPI {
-
- /**
- * Return all queries that are in the system.
- *
- * @return a collection of <code>Request</code> objects.
- * @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 occurs in communicating with a component.
- */
- Collection getAllRequests()
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
- * Return all queries that are currently being processed for the user session.
- *
- * @param userSessionID the primary identifier for the user account.
- * @return a collection of <code>Request</code> objects.
- * @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 occurs in communicating with a component.
- */
- Collection getRequestsForSession(MetaMatrixSessionID userSessionID)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException;
-
-
- /**
- * Cancel a single query.
- *
- * @param requestID the identifier of the query to be cancelled.
- * @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 InvalidRequestIDException if the <code>Request</code> specified by the ID does not exist.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- void cancelRequest(RequestID requestID)
- throws AuthorizationException, InvalidSessionException, InvalidRequestIDException, MetaMatrixComponentException;
-
- /**
- * Cancel multiple queries for the user session.
- *
- * @param userSessionID the primary identifier for the user account.
- * @param requestIDs the collection of identifiers of the queries to be cancelled.
- * @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 InvalidRequestIDException if the <code>Request</code> specified by the ID does not exist.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- //void cancelRequests(MetaMatrixSessionID userSessionID, Collection requestIDs)
- //throws AuthorizationException, InvalidSessionException, InvalidRequestIDException, MetaMatrixComponentException;
-
- /**
- * Cancel all queries for the user session.
- *
- * @param userSessionID the primary identifier for the user account.
- * @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 occurs in communicating with a component.
- */
- void cancelRequests(MetaMatrixSessionID userSessionID)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException;
-
- /**
- * Cancel an atomic query for the user session.
- *
- * @param callerSessionID ID of the caller's current session.
- * @param requestID the identifier of the query to be cancelled.
- * @param nodeID identifies the node in the query to cancel.
- * @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 InvalidRequestIDException if the <code>Request</code> specified by the ID does not exist.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- void cancelRequest(RequestID requestID, int nodeID)
- throws AuthorizationException, InvalidSessionException, InvalidRequestIDException, MetaMatrixComponentException;
-
-}
-
Modified: trunk/console/src/main/java/com/metamatrix/console/models/ModelManager.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/models/ModelManager.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/console/src/main/java/com/metamatrix/console/models/ModelManager.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -44,7 +44,6 @@
import com.metamatrix.platform.admin.api.RuntimeStateAdminAPI;
import com.metamatrix.platform.admin.api.SubSystemAdminAPI;
import com.metamatrix.platform.security.api.MetaMatrixPrincipalName;
-import com.metamatrix.server.admin.api.QueryAdminAPI;
import com.metamatrix.server.admin.api.RuntimeMetadataAdminAPI;
import com.metamatrix.server.admin.api.TransactionAdminAPI;
@@ -331,11 +330,6 @@
return (RuntimeStateAdminAPI) getSubSystemAdminAPI(RuntimeStateAdminAPI.class, conn);
}
- public static QueryAdminAPI getQueryAPI(ConnectionInfo conn) {
-
- return (QueryAdminAPI) getSubSystemAdminAPI(QueryAdminAPI.class, conn);
- }
-
public static RuntimeMetadataAdminAPI getRuntimeMetadataAPI(ConnectionInfo conn) {
return (RuntimeMetadataAdminAPI) getSubSystemAdminAPI(RuntimeMetadataAdminAPI.class, conn);
Modified: trunk/console/src/main/java/com/metamatrix/console/models/QueryManager.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/models/QueryManager.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/console/src/main/java/com/metamatrix/console/models/QueryManager.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -25,27 +25,21 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
+import java.util.Set;
import javax.swing.Action;
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
-import com.metamatrix.api.exception.ComponentNotFoundException;
-import com.metamatrix.api.exception.security.AuthorizationException;
-import com.metamatrix.api.exception.server.InvalidRequestIDException;
+import com.metamatrix.admin.api.objects.AdminObject;
+import com.metamatrix.admin.api.objects.Request;
import com.metamatrix.console.connections.ConnectionInfo;
import com.metamatrix.console.ui.ViewManager;
import com.metamatrix.console.util.AutoRefresher;
import com.metamatrix.console.util.ExternalException;
-import com.metamatrix.console.util.InvalidRequestException;
import com.metamatrix.platform.security.api.MetaMatrixSessionID;
-import com.metamatrix.server.admin.api.QueryAdminAPI;
-import com.metamatrix.server.serverapi.RequestInfo;
public class QueryManager extends TimedManager implements ManagerListener{
- private HashSet queryRequests;
+ private Collection<Request> queryRequests = new HashSet<Request>();
private MetaMatrixSessionID currentToken = null;
private Action refreshAction;
private AutoRefresher ar;
@@ -57,16 +51,11 @@
public void init() {
super.init();
super.setRefreshRate(5);
- setQueryRequests(new HashSet());
setIsStale(true);
ModelManager.getSessionManager(getConnection()).addManagerListener(this);
super.setIsAutoRefreshEnabled(false);
}
- private QueryAdminAPI getQueryAdminAPI() {
- return ModelManager.getQueryAPI(getConnection());
- }
-
/**
* The QueryManager listens for changes to the SessionManager. If, for
*example, a session is terminated, the QueryManager needs to know so
@@ -78,44 +67,30 @@
}
}
- public void cancelQueryRequests(Collection selected)
- throws ExternalException, AuthorizationException,
- InvalidRequestException, ComponentNotFoundException {
+ public void cancelQueryRequests(Collection<Request> selected)
+ throws ExternalException {
try {
ViewManager.startBusy();
- Iterator iterator = selected.iterator();
- RequestInfo q;
// determine which request are a global query cancellation
// versus just an atomic query.
// If a global request and an atomic request for the same
// query is select, then the global request will be submitted.
- List queries = new ArrayList(selected.size());
- while (iterator.hasNext()){
- q = (RequestInfo)iterator.next();
- if (!q.isAtomicQuery()) {
- queries.add(q);
+ Set<String> queries = new HashSet<String>();
+ for (Request q : selected) {
+ if (!q.isSource()) {
+ queries.add(q.getIdentifier());
}
}
- iterator = selected.iterator();
- while (iterator.hasNext()){
- q = (RequestInfo)iterator.next();
+ for (Request q : selected) {
try{
- if (q.isAtomicQuery()) {
- if (!queries.contains(q)) {
- getQueryAdminAPI().cancelRequest(q.getRequestID(), q.getNodeID());
+ if (q.isSource()) {
+ if (!queries.contains(q.getSessionID() + '.' + q.getRequestID())) {
+ getConnection().getServerAdmin().cancelSourceRequest(q.getIdentifier());
}
} else {
- getQueryAdminAPI().cancelRequest(q.getRequestID());
+ getConnection().getServerAdmin().cancelRequest(q.getIdentifier());
}
- } catch (AuthorizationException e) {
- throw e;
- } catch (ComponentNotFoundException e) {
- throw e;
- } catch (InvalidRequestIDException e) {
- throw new InvalidRequestException(e);
- } catch (InvalidSessionException e) {
- throw new InvalidRequestException(e);
} catch (Exception e) {
throw new ExternalException(e);
}
@@ -127,32 +102,10 @@
}
- public void cancelAllQueryRequests(MetaMatrixSessionID token)
- throws ComponentNotFoundException, InvalidRequestException,
- AuthorizationException, ExternalException {
- try{
- ViewManager.startBusy();
- try{
- getQueryAdminAPI().cancelRequests(token);
- } catch (ComponentNotFoundException e) {
- throw e;
- } catch (InvalidSessionException e) {
- throw new InvalidRequestException(e);
- } catch (AuthorizationException e) {
- throw e;
- } catch (Exception e) {
- throw new ExternalException(e);
- }
- refresh();
- } finally {
- ViewManager.endBusy();
- }
- }
-
- public Collection getAllRequests()
- throws AuthorizationException, ExternalException {
+ public Collection<Request> getAllRequests()
+ throws ExternalException {
loadRealData();
- return (Collection) getQueryRequests().clone();
+ return new ArrayList<Request>(getQueryRequests());
}
public void setAutoRefresher(AutoRefresher autoRefresher){
@@ -160,26 +113,19 @@
}
private void loadRealData()
- throws ExternalException, AuthorizationException {
+ throws ExternalException {
boolean autoRefresh = (ar!=null && ar.isAutoRefreshEnabled());
if (getIsStale() || autoRefresh || currentToken != null){
try{
currentToken = null;
ViewManager.startBusy(); //ADJUSTS STATUS BAR
//THIS COULD FAIL SILENTLY
- Collection col;
try {
- col = getQueryAdminAPI().getAllRequests();
- } catch (AuthorizationException e) {
- throw e;
+ this.queryRequests = new ArrayList<Request>(this.getConnection().getServerAdmin().getRequests(AdminObject.WILDCARD));
+ this.queryRequests.addAll(this.getConnection().getServerAdmin().getSourceRequests(AdminObject.WILDCARD));
} catch (Exception e) {
throw new ExternalException(e);
}
-
- if (col!= null)
- setQueryRequests(new HashSet(col));
- else
- setQueryRequests(new HashSet(0));
setIsStale(false);
super.startTimer();
} finally {
@@ -190,14 +136,10 @@
//GETTERS-SETTERS
- private HashSet getQueryRequests(){
+ private Collection<Request> getQueryRequests(){
return queryRequests;
}
- private void setQueryRequests(HashSet set){
- queryRequests = set;
- }
-
//OVERRIDING superclass implementation of refresh()
public void refresh(){
super.refresh();
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryPanel.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryPanel.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -40,8 +40,7 @@
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
-import com.metamatrix.common.config.api.ConnectorBinding;
-import com.metamatrix.common.log.LogManager;
+import com.metamatrix.admin.api.objects.Request;
import com.metamatrix.console.ConsolePlugin;
import com.metamatrix.console.connections.ConnectionInfo;
import com.metamatrix.console.models.ConnectorManager;
@@ -59,11 +58,9 @@
import com.metamatrix.console.util.AutoRefreshable;
import com.metamatrix.console.util.AutoRefresher;
import com.metamatrix.console.util.ExceptionUtility;
-import com.metamatrix.console.util.LogContexts;
import com.metamatrix.console.util.StaticProperties;
import com.metamatrix.console.util.StaticUtilities;
import com.metamatrix.core.util.StringUtil;
-import com.metamatrix.server.serverapi.RequestInfo;
import com.metamatrix.toolbox.ui.widget.LabelWidget;
import com.metamatrix.toolbox.ui.widget.Splitter;
import com.metamatrix.toolbox.ui.widget.TextFieldWidget;
@@ -176,7 +173,7 @@
add(splitter);
this.connectorMgr = ModelManager.getConnectorManager(this.connection);
- queryPanel = new QueryRequestPanel(this, connectorMgr);
+ queryPanel = new QueryRequestPanel(this);
splitter.setTopComponent(queryPanel);
@@ -299,35 +296,25 @@
* Main interface to this panel - supply a Request to be displayed. String.valueOf(request.getRequestID().getID())
* @param request Request to be displayed String.valueOf(request.getSessionToken().getSessionID())
*/
- public void displayQuery(RequestInfo request) {
+ public void displayQuery(Request request) {
if (request != null) {
txfRequestId.setText(String.valueOf(request.getRequestID()));
- String sessionIDStr = request.getSessionId();
+ String sessionIDStr = request.getSessionID();
txfSessionId.setText(sessionIDStr);
- Date date = request.getProcessingTimestamp();
+ Date date = request.getProcessingDate();
txfSubmitted.setText((date == null) ? StringUtil.Constants.EMPTY_STRING :
FORMATTER.format(date));
- String transId = request.getTransactionId();
+ String transId = request.getTransactionID();
txfTransactionId.setText((transId == null) ? StringUtil.Constants.EMPTY_STRING : transId);
String userStr = request.getUserName();
txfUser.setText(userStr);
-
- String bindingUUID = request.getConnectorBindingUUID();
- String bindingName = StringUtil.Constants.EMPTY_STRING;
- if ((bindingUUID != null) && (bindingUUID.trim().length() > 0)) {
- try {
- ConnectorBinding cb = connectorMgr.getConnectorBindingByUUID(bindingUUID);
- if (cb != null) {
- bindingName = cb.getName();
- }
- } catch (Exception ex) {
- LogManager.logError(LogContexts.QUERIES, ex,
- "Error retrieving connector binding for UUID " + bindingUUID); //$NON-NLS-1$
- }
+ if (request.isSource() && request.getConnectorBindingName() != null) {
+ txfConnectorBinding.setText(request.getConnectorBindingName());
+ } else {
+ txfConnectorBinding.setText(StringUtil.Constants.EMPTY_STRING);
}
- txfConnectorBinding.setText(bindingName);
- String command = request.getCommand();
+ String command = request.getSqlCommand();
StringBuffer sql = new StringBuffer();
sql.append(command.toString());
txaCommand.setText(sql.toString());
@@ -376,7 +363,7 @@
final String selectedRequestID = txfRequestId.getText();
try {
StaticUtilities.startWait(ConsoleMainFrame.getInstance());
- final Collection allQueries = getQueryManager().getAllRequests();
+ final Collection<Request> allQueries = getQueryManager().getAllRequests();
//refresh in the Swing thread
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryRequestPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryRequestPanel.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryRequestPanel.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -43,10 +43,9 @@
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
-import com.metamatrix.common.config.api.ConnectorBinding;
+import com.metamatrix.admin.api.objects.Request;
import com.metamatrix.console.ConsolePlugin;
import com.metamatrix.console.connections.ConnectionInfo;
-import com.metamatrix.console.models.ConnectorManager;
import com.metamatrix.console.models.ModelManager;
import com.metamatrix.console.security.UserCapabilities;
import com.metamatrix.console.ui.layout.BasePanel;
@@ -56,8 +55,6 @@
import com.metamatrix.console.ui.util.property.PropertyProvider;
import com.metamatrix.console.util.ExternalException;
import com.metamatrix.console.util.StaticUtilities;
-import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.server.serverapi.RequestInfo;
import com.metamatrix.toolbox.ui.widget.DialogPanel;
import com.metamatrix.toolbox.ui.widget.DialogWindow;
import com.metamatrix.toolbox.ui.widget.LabelWidget;
@@ -77,12 +74,11 @@
///////////////////////////////////////////////////////////////////////////
private QueryPanel caller;
- private ConnectorManager connectorManager;
private ConnectionInfo connection = null;
private TableWidget queryTable;
private QueryTableModel tableModel;
- private HashMap /*<requestID display string to RequestInfo>*/ requestsMap = new HashMap();
+ private HashMap<String, Request> requestsMap = new HashMap<String, Request>();
private CancelQueryRequestsAction actionCancel = null;
private Vector actionsVec;
@@ -91,10 +87,9 @@
// CONSTRUCTORS
///////////////////////////////////////////////////////////////////////////
- public QueryRequestPanel(QueryPanel cllr, ConnectorManager connMgr) {
+ public QueryRequestPanel(QueryPanel cllr) {
super();
caller = cllr;
- this.connectorManager = connMgr;
connection = caller.getConnection();
createComponent();
@@ -149,7 +144,7 @@
String requestIDStr = (String)tableModel.getValueAt(
queryTable.convertRowIndexToModel(selectionRow),
tableModel.getRequestIdColumn());
- RequestInfo req = (RequestInfo) requestsMap.get(requestIDStr);
+ Request req = requestsMap.get(requestIDStr);
caller.displayQuery(req);
} else {
// either 0 or more queries selected
@@ -218,7 +213,7 @@
* @param newQueryRequests new Request collection that this
* panel should populate its view with.
*/
- public void updateView(Collection /*<Request>*/ newQueryRequests,
+ public void updateView(Collection<Request> newQueryRequests,
String selectedRequestID) {
StaticUtilities.startWait(this);
updateTheView(newQueryRequests);
@@ -252,25 +247,21 @@
queryTable.getTableHeader().setName("QueryTable.header"); //$NON-NLS-1$
}
- private void updateTheView(Collection /*<RequestInfo>*/ newRequests) {
+ private void updateTheView(Collection<Request> newRequests) {
ColumnSortInfo[] tableColumnSortInfo = ColumnSortInfo.getTableColumnSortInfo(this.queryTable);
Vector outerVec = new Vector(newRequests.size());
- Iterator iterator = newRequests.iterator();
- HashMap tempRequestsMap = new HashMap();
+ HashMap<String, Request> tempRequestsMap = new HashMap<String, Request>();
// Populate the table data.
- RequestInfo q;
- while (iterator.hasNext()) {
- q = (RequestInfo) iterator.next();
+ for (Request q : newRequests) {
Object[] rowData = new Object[QueryTableModel.NUM_COLUMNS];
- String requestStr = getRequestInfoDisplayString(q);
+ String requestStr = q.getIdentifier();
rowData[QueryTableModel.REQUEST_ID_COL] = requestStr;
tempRequestsMap.put(requestStr, q);
rowData[QueryTableModel.USER_COL] = q.getUserName();
- rowData[QueryTableModel.SESSION_ID_COL] = q.getSessionId();
- rowData[QueryTableModel.CONNECTOR_BINDING_COL] =
- getConnectorBindingForUUID(q.getConnectorBindingUUID());
+ rowData[QueryTableModel.SESSION_ID_COL] = q.getSessionID();
+ rowData[QueryTableModel.CONNECTOR_BINDING_COL] = q.getConnectorBindingName();
Vector innerVec = StaticUtilities.arrayToVector(rowData);
outerVec.add(innerVec);
}
@@ -290,35 +281,6 @@
ColumnSortInfo.setColumnSortOrder(tableColumnSortInfo, this.queryTable);
}
-
-
-
-
- private String getRequestInfoDisplayString(RequestInfo q) {
- RequestID id = q.getRequestID();
- boolean isAtomicQuery = q.isAtomicQuery();
- String requestStr;
- if (isAtomicQuery) {
- requestStr = id.toString() + '.' + q.getNodeID();
- } else {
- requestStr = id.toString();
- }
- return requestStr;
- }
-
- private String getConnectorBindingForUUID(String connectorBindingUUID) {
- ConnectorBinding cb = null;
- String name = null;
- try {
- cb = connectorManager.getConnectorBindingByUUID(connectorBindingUUID);
- } catch (Exception ex) {
- }
- if (cb != null) {
- name = cb.getFullName();
- }
- return name;
- }
-
/**
* Assemble a Collection of Requests that were previously
*selected, before an update - do this by getting each index that
@@ -326,14 +288,14 @@
*to get each Query ID from the table model, and using each ID to
*get an actual Request from the Query Manager
*/
- public Collection /*<RequestInfo>*/ getCurrentSelections() {
+ public Collection<Request> getCurrentSelections() {
int[] selectedRows = queryTable.getSelectedRows();
- Collection queries = new ArrayList(selectedRows.length);
+ Collection<Request> queries = new ArrayList<Request>(selectedRows.length);
for (int i = 0; i < selectedRows.length; i++) {
String requestIDStr = (String) tableModel.getValueAt(
queryTable.convertRowIndexToModel(selectedRows[i]),
tableModel.getRequestIdColumn());
- RequestInfo ri = (RequestInfo)requestsMap.get(requestIDStr);
+ Request ri = requestsMap.get(requestIDStr);
queries.add(ri);
}
return queries;
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryTableModel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryTableModel.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/queries/QueryTableModel.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -70,6 +70,16 @@
}
return col;
}
+
+ public int getSessionIdColumn() {
+ int col = -1;
+ for (int i = 0; i < colOrder.length; i++) {
+ if (colOrder[i] == SESSION_ID_COL) {
+ col = i;
+ }
+ }
+ return col;
+ }
public void setRows(Vector data) {
removeRows();
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-06 15:32:15 UTC (rev 719)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -46,7 +46,6 @@
import com.metamatrix.admin.api.exception.AdminProcessingException;
import com.metamatrix.admin.api.objects.AdminObject;
import com.metamatrix.admin.api.objects.Model;
-import com.metamatrix.admin.api.objects.Request;
import com.metamatrix.admin.api.objects.Resource;
import com.metamatrix.admin.api.objects.Session;
import com.metamatrix.admin.api.objects.SystemObject;
@@ -63,7 +62,6 @@
import com.metamatrix.admin.objects.MMRequest;
import com.metamatrix.admin.objects.MMResource;
import com.metamatrix.admin.objects.MMSession;
-import com.metamatrix.admin.objects.MMSourceRequest;
import com.metamatrix.admin.objects.MMSystem;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.security.SessionServiceException;
@@ -753,7 +751,6 @@
/**
* Get monitoring information about requests.
- * @see com.metamatrix.admin.api.server.ServerMonitoringAdmin#getRequests(java.lang.String)
* @param identifier Identifier of a session or request to get information for.
* For example "sessionID" or "sessionID.requestID".
* <p>If identifier is "*", this method returns information about all requests in the system.
@@ -787,25 +784,24 @@
results = new ArrayList(requests.size());
for (Iterator iter = requests.iterator(); iter.hasNext();) {
RequestInfo info = (RequestInfo)iter.next();
-
- String[] identifierParts = new String[2];
- identifierParts[0] = info.getRequestID().getConnectionID();
+ if (source ^ info.isAtomicQuery()) {
+ continue;
+ }
+ String[] identifierParts = null;
MMRequest request;
- boolean correctType;
- if (source) {
- identifierParts[1] = info.getRequestID().getExecutionID() + Request.DELIMITER + info.getNodeID();
- request = new MMSourceRequest(identifierParts);
-
- correctType = info.isAtomicQuery();
+ if (info.isAtomicQuery()) {
+ identifierParts = new String[3];
+ identifierParts[2] = String.valueOf(info.getNodeID());
} else {
- identifierParts[1] = Long.toString(info.getRequestID().getExecutionID());
- request = new MMRequest(identifierParts);
-
- correctType = (! info.isAtomicQuery());
+ identifierParts = new String[2];
}
+ identifierParts[0] = info.getRequestID().getConnectionID();
+ identifierParts[1] = Long.toString(info.getRequestID().getExecutionID());
+
+ request = new MMRequest(identifierParts);
- if (correctType && identifierMatches(identifier, identifierParts)) {
+ if (identifierMatches(identifier, identifierParts)) {
Object bindingName = uuidToBindingNameMap.get(info.getConnectorBindingUUID());
request.setConnectorBindingName(bindingName!=null?(String)bindingName:null);
request.setCreated(info.getSubmittedTimestamp());
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-06 15:32:15 UTC (rev 719)
+++ trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -113,10 +113,8 @@
import com.metamatrix.platform.vm.api.controller.ProcessManagement;
import com.metamatrix.server.HostManagement;
import com.metamatrix.server.ResourceFinder;
-import com.metamatrix.server.admin.api.QueryAdminAPI;
import com.metamatrix.server.admin.api.RuntimeMetadataAdminAPI;
import com.metamatrix.server.admin.api.TransactionAdminAPI;
-import com.metamatrix.server.admin.apiimpl.QueryAdminAPIImpl;
import com.metamatrix.server.admin.apiimpl.RuntimeMetadataAdminAPIImpl;
import com.metamatrix.server.admin.apiimpl.TransactionAdminAPIImpl;
import com.metamatrix.server.util.ServerPropertyNames;
@@ -215,7 +213,6 @@
this.clientServices.registerClientService(MembershipAdminAPI.class, MembershipAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
this.clientServices.registerClientService(AuthorizationAdminAPI.class, AuthorizationAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_AUTHORIZATION_ADMIN_API);
this.clientServices.registerClientService(ExtensionSourceAdminAPI.class, ExtensionSourceAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
- this.clientServices.registerClientService(QueryAdminAPI.class, QueryAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
this.clientServices.registerClientService(RuntimeMetadataAdminAPI.class, RuntimeMetadataAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_RUNTIME_METADATA_ADMIN_API);
this.clientServices.registerClientService(TransactionAdminAPI.class, TransactionAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
}
Deleted: trunk/server/src/main/java/com/metamatrix/server/admin/apiimpl/QueryAdminAPIImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/admin/apiimpl/QueryAdminAPIImpl.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/server/src/main/java/com/metamatrix/server/admin/apiimpl/QueryAdminAPIImpl.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -1,170 +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.server.admin.apiimpl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
-import com.metamatrix.admin.api.server.AdminRoles;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.AuthorizationException;
-import com.metamatrix.api.exception.server.InvalidRequestIDException;
-import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.platform.admin.apiimpl.AdminAPIHelper;
-import com.metamatrix.platform.admin.apiimpl.SubSystemAdminAPIImpl;
-import com.metamatrix.platform.security.api.MetaMatrixSessionID;
-import com.metamatrix.platform.security.api.SessionToken;
-import com.metamatrix.platform.util.PlatformProxyHelper;
-import com.metamatrix.server.admin.api.QueryAdminAPI;
-import com.metamatrix.server.query.service.QueryServiceInterface;
-
-public class QueryAdminAPIImpl extends SubSystemAdminAPIImpl implements QueryAdminAPI {
-
- private QueryServiceInterface queryAdmin;
- private static QueryAdminAPI queryAdminAPI;
- /**
- * ctor
- */
- private QueryAdminAPIImpl() throws MetaMatrixComponentException {
-
- queryAdmin = PlatformProxyHelper.getQueryServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL);
- }
-
- public static synchronized QueryAdminAPI getInstance() throws MetaMatrixComponentException {
- if (queryAdminAPI == null) {
- queryAdminAPI = new QueryAdminAPIImpl();
- }
- return queryAdminAPI;
- }
-
- /**
- * Return all queries that are in the system.
- *
- * @param callerSessionID ID of the caller's current session.
- * @return a collection of <code>Request</code> objects.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- public synchronized Collection getAllRequests()
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
-
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
- // Any administrator may call this read-only method - no need to validate role
-
- List requests = new ArrayList();
- requests.addAll(queryAdmin.getAllQueries());
- return requests;
- }
-
- /**
- * Return all queries that are currently being processed for the user session.
- *
- * @param callerSessionID ID of the caller's current session.
- * @param userSessionID the primary identifier for the user account.
- * @return a collection of <code>Request</code> objects.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- public synchronized Collection getRequestsForSession(MetaMatrixSessionID userSessionID)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
-
- // Validate caller's session
- AdminAPIHelper.validateSession(getSessionID());
- // Validate user's session
- SessionToken userToken = AdminAPIHelper.validateSession(userSessionID);
-
- // Any administrator may call this read-only method - no need to validate role
-
- List requests = new ArrayList();
- requests.addAll(queryAdmin.getQueriesForSession(userToken));
- return requests;
- }
-
-
- /**
- * Cancel a single query for the user session.
- *
- * @param callerSessionID ID of the caller's current session.
- * @param requestID the identifier of the query to be cancelled.
- * @throws InvalidRequestIDException if the <code>Request</code> specified by the ID does not exist.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- public synchronized void cancelRequest(RequestID requestID)
- throws AuthorizationException, InvalidSessionException, InvalidRequestIDException, MetaMatrixComponentException {
-
- // Validate caller's session
- SessionToken callerToken = AdminAPIHelper.validateSession(getSessionID());
- // Validate caller's role
- AdminAPIHelper.checkForRequiredRole(callerToken, AdminRoles.RoleName.ADMIN_PRODUCT, "QueryAdminAPIImpl.cancelRequest(" + requestID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- queryAdmin.cancelQuery(requestID, true);
- }
-
- /**
- * Cancel an atomic query for the user session.
- *
- * @param callerSessionID ID of the caller's current session.
- * @param requestID the identifier of the query that is running.
- * @param nodeid identifies the atomic query to be cancelled.
- *
- * @throws InvalidRequestIDException if the <code>Request</code> specified by the ID does not exist.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- public synchronized void cancelRequest(RequestID requestID, int nodeID)
- throws AuthorizationException, InvalidSessionException, InvalidRequestIDException, MetaMatrixComponentException {
-
- // Validate caller's session
- SessionToken callerToken = AdminAPIHelper.validateSession(getSessionID());
- // Validate caller's role
- AdminAPIHelper.checkForRequiredRole(callerToken, AdminRoles.RoleName.ADMIN_PRODUCT, "QueryAdminAPIImpl.cancelRequest(" + requestID + ", " + nodeID + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- queryAdmin.cancelQuery(requestID, nodeID);
- }
-
-
- /**
- * Cancel all queries for the user session.
- *
- * @param callerSessionID ID of the caller's current session.
- * @param userSessionID the primary identifier for the user account.
- * @throws MetaMatrixComponentException if an error occurs in communicating with a component.
- */
- public synchronized void cancelRequests(MetaMatrixSessionID userSessionID)
- throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
-
- // Validate caller's session
- SessionToken callerToken = AdminAPIHelper.validateSession(getSessionID());
- // Validate caller's role
- AdminAPIHelper.checkForRequiredRole(callerToken, AdminRoles.RoleName.ADMIN_PRODUCT, "QueryAdminAPIImpl.cancelRequests(" + userSessionID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- // Validate user's session
- SessionToken userToken = AdminAPIHelper.validateSession(userSessionID);
-
- try {
- queryAdmin.cancelQueries(userToken, true);
- } catch (InvalidRequestIDException e) {
- throw new MetaMatrixComponentException(e, e.getMessage());
- }
- }
-
-
-}
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java 2009-04-06 15:32:15 UTC (rev 719)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java 2009-04-06 17:38:05 UTC (rev 720)
@@ -33,6 +33,7 @@
import com.metamatrix.admin.api.exception.AdminException;
import com.metamatrix.admin.api.objects.AdminObject;
import com.metamatrix.admin.api.objects.ConnectorBinding;
+import com.metamatrix.admin.api.objects.Request;
import com.metamatrix.admin.api.objects.Session;
import com.metamatrix.admin.objects.MMConnectorBinding;
import com.metamatrix.admin.objects.MMConnectorType;
@@ -44,7 +45,6 @@
import com.metamatrix.admin.objects.MMRequest;
import com.metamatrix.admin.objects.MMResource;
import com.metamatrix.admin.objects.MMSession;
-import com.metamatrix.admin.objects.MMSourceRequest;
import com.metamatrix.admin.objects.MMSystem;
import com.metamatrix.common.config.api.SharedResource;
import com.metamatrix.platform.registry.ClusteredRegistryState;
@@ -437,10 +437,11 @@
Collection results = admin.getSourceRequests(AdminObject.WILDCARD);
assertEquals(2, results.size());
- MMSourceRequest request = (MMSourceRequest) results.iterator().next();
+ Request request = (Request) results.iterator().next();
assertEquals(REQUEST_1_1_1, request.getIdentifier());
assertEquals("1", request.getSessionID()); //$NON-NLS-1$
- assertEquals(REQUEST_1_1, request.getRequestID());
+ assertEquals("1", request.getRequestID()); //$NON-NLS-1$
+ assertEquals("1", request.getNodeID()); //$NON-NLS-1$
assertEquals("connectorBinding1", request.getConnectorBindingName()); //$NON-NLS-1$
assertEquals("user1", request.getUserName()); //$NON-NLS-1$
15 years, 8 months