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);