[teiid-commits] teiid SVN: r1979 - in trunk: client/src/main/java/com/metamatrix/dqp/client and 10 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Mar 19 14:04:08 EDT 2010


Author: shawkins
Date: 2010-03-19 14:04:06 -0400 (Fri, 19 Mar 2010)
New Revision: 1979

Added:
   trunk/engine/src/main/java/org/teiid/adminapi/
   trunk/engine/src/main/java/org/teiid/adminapi/impl/
   trunk/engine/src/main/java/org/teiid/adminapi/impl/DQPManagement.java
   trunk/engine/src/test/java/org/teiid/adminapi/
   trunk/engine/src/test/java/org/teiid/adminapi/impl/
Removed:
   trunk/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java
   trunk/client/src/main/java/org/teiid/adminapi/impl/
   trunk/client/src/test/java/org/teiid/adminapi/impl/
Modified:
   trunk/client/pom.xml
   trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
   trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
   trunk/metadata/pom.xml
Log:
moving adminapi impl to the client

Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/pom.xml	2010-03-19 18:04:06 UTC (rev 1979)
@@ -22,10 +22,5 @@
       <artifactId>teiid-common-core</artifactId>
       <type>test-jar</type>
     </dependency> 
-    <dependency>
-        <groupId>org.jboss.man</groupId>
-        <artifactId>jboss-managed</artifactId>
-        <scope>provided</scope>
-    </dependency>     
   </dependencies>
 </project>
\ No newline at end of file

Deleted: trunk/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java	2010-03-19 18:04:06 UTC (rev 1979)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package com.metamatrix.dqp.client;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.teiid.adminapi.AdminException;
-import org.teiid.adminapi.impl.RequestMetadata;
-import org.teiid.adminapi.impl.SessionMetadata;
-import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
-
-
-public interface DQPManagement {
-    List<RequestMetadata> getRequestsForSession(long sessionId) ;
-    List<RequestMetadata> getRequests();
-    WorkerPoolStatisticsMetadata getWorkManagerStatistics(String identifier);
-    void terminateSession(long terminateeId);
-    boolean cancelRequest(long sessionId, long requestId) throws AdminException;
-    Collection<String> getCacheTypes();
-    void clearCache(String cacheType);
-    Collection<SessionMetadata> getActiveSessions() throws AdminException;
-    int getActiveSessionsCount() throws AdminException;
-    Collection<org.teiid.adminapi.Transaction> getTransactions();
-    void terminateTransaction(String xid) throws AdminException ;
-}

Modified: trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java	2010-03-19 18:04:06 UTC (rev 1979)
@@ -19,10 +19,8 @@
 import org.jboss.metatype.api.values.CollectionValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
 import org.jboss.metatype.api.values.MetaValueFactory;
-import org.teiid.adminapi.impl.RequestMetadata;
-import org.teiid.adminapi.impl.RequestMetadataMapper;
-import org.teiid.adminapi.impl.SessionMetadata;
-import org.teiid.adminapi.impl.SessionMetadataMapper;
+import org.teiid.adminapi.Request;
+import org.teiid.adminapi.Session;
 import org.teiid.rhq.comm.ExecutedResult;
 import org.teiid.rhq.plugin.util.PluginConstants;
 import org.teiid.rhq.plugin.util.ProfileServiceUtil;
@@ -76,7 +74,7 @@
 						.equals(PluginConstants.ComponentType.Platform.Metrics.LONG_RUNNING_QUERIES)) {
 					Integer longRunningQueryLimit = (Integer) valueMap
 							.get(PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT);
-					Collection<RequestMetadata> longRunningQueries = getLongRunningQueries(longRunningQueryLimit);
+					Collection<Request> longRunningQueries = getLongRunningQueries(longRunningQueryLimit);
 					resultObject = new Double(longRunningQueries.size());
 				}
 			}
@@ -106,7 +104,7 @@
 						.equals(PluginConstants.ComponentType.VDB.Metrics.LONG_RUNNING_QUERIES)) {
 					Integer longRunningQueryLimit = (Integer) valueMap
 							.get(PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT);
-					Collection<RequestMetadata> longRunningQueries = getLongRunningQueries(longRunningQueryLimit);
+					Collection<Request> longRunningQueries = getLongRunningQueries(longRunningQueryLimit);
 					resultObject = new Double(longRunningQueries.size());
 				}
 			}
@@ -136,8 +134,8 @@
 
 	private void executePlatformOperation(ExecutedResult operationResult,
 			final String operationName, final Map<String, Object> valueMap) {
-		Collection<RequestMetadata> resultObject = new ArrayList<RequestMetadata>();
-		Collection<SessionMetadata> activeSessionsCollection = new ArrayList<SessionMetadata>();
+		Collection<Request> resultObject = new ArrayList<Request>();
+		Collection<Session> activeSessionsCollection = new ArrayList<Session>();
 
 		if (operationName.equals(Platform.Operations.GET_LONGRUNNINGQUERIES)) {
 			Integer longRunningValue = (Integer) valueMap
@@ -185,8 +183,8 @@
 
 	private void executeVdbOperation(ExecutedResult operationResult,
 			final String operationName, final Map<String, Object> valueMap) {
-		Collection<RequestMetadata> resultObject = new ArrayList<RequestMetadata>();
-		Collection<SessionMetadata> activeSessionsCollection = new ArrayList<SessionMetadata>();
+		Collection<Request> resultObject = new ArrayList<Request>();
+		Collection<Session> activeSessionsCollection = new ArrayList<Session>();
 
 		if (operationName.equals(VDB.Operations.GET_PROPERTIES)) {
 			List<String> fieldNameList = operationResult.getFieldNameList();
@@ -347,7 +345,7 @@
 		Integer count = new Integer(0);
 
 		MetaValue requests = null;
-		Collection<RequestMetadata> requestsCollection = new ArrayList<RequestMetadata>();
+		Collection<Request> requestsCollection = new ArrayList<Request>();
 
 		requests = getRequests();
 
@@ -362,17 +360,17 @@
 
 	private Integer getSessionCount() {
 
-		Collection<SessionMetadata> activeSessionsCollection = new ArrayList<SessionMetadata>();
+		Collection<Session> activeSessionsCollection = new ArrayList<Session>();
 		MetaValue sessionMetaValue = getSessions();
 		getSessionCollectionValue(sessionMetaValue, activeSessionsCollection);
 		return activeSessionsCollection.size();
 	}
 
-	protected Collection<RequestMetadata> getLongRunningQueries(
+	protected Collection<Request> getLongRunningQueries(
 			int longRunningValue) {
 
 		MetaValue requestsCollection = null;
-		Collection<RequestMetadata> list = new ArrayList<RequestMetadata>();
+		Collection<Request> list = new ArrayList<Request>();
 
 		double longRunningQueryTimeDouble = new Double(longRunningValue);
 
@@ -380,9 +378,9 @@
 
 		getRequestCollectionValue(requestsCollection, list);
 
-		Iterator<RequestMetadata> requestsIter = list.iterator();
+		Iterator<Request> requestsIter = list.iterator();
 		while (requestsIter.hasNext()) {
-			RequestMetadata request = requestsIter.next();
+			Request request = requestsIter.next();
 			long startTime = request.getStartTime();
 			// Get msec from each, and subtract.
 			long runningTime = Calendar.getInstance().getTimeInMillis()
@@ -397,16 +395,14 @@
 	}
 
 	public static <T> void getRequestCollectionValue(MetaValue pValue,
-			Collection<RequestMetadata> list) {
+			Collection<Request> list) {
 		MetaType metaType = pValue.getMetaType();
 		if (metaType.isCollection()) {
 			for (MetaValue value : ((CollectionValueSupport) pValue)
 					.getElements()) {
 				if (value.getMetaType().isComposite()) {
-					RequestMetadataMapper requestMapper = new RequestMetadataMapper();
-					RequestMetadata requestMetaData = requestMapper
-							.unwrapMetaValue(value);
-					list.add(requestMetaData);
+					Request Request = (Request)MetaValueFactory.getInstance().unwrap(value);
+					list.add(Request);
 				} else {
 					throw new IllegalStateException(pValue
 							+ " is not a Composite type");
@@ -416,16 +412,14 @@
 	}
 
 	public static <T> void getSessionCollectionValue(MetaValue pValue,
-			Collection<SessionMetadata> list) {
+			Collection<Session> list) {
 		MetaType metaType = pValue.getMetaType();
 		if (metaType.isCollection()) {
 			for (MetaValue value : ((CollectionValueSupport) pValue)
 					.getElements()) {
 				if (value.getMetaType().isComposite()) {
-					SessionMetadataMapper sessionMapper = new SessionMetadataMapper();
-					SessionMetadata sessionMetaData = sessionMapper
-							.unwrapMetaValue(value);
-					list.add(sessionMetaData);
+					Session Session = (Session)MetaValueFactory.getInstance().unwrap(value);
+					list.add(Session);
 				} else {
 					throw new IllegalStateException(pValue
 							+ " is not a Composite type");

Copied: trunk/engine/src/main/java/org/teiid/adminapi/impl (from rev 1976, trunk/client/src/main/java/org/teiid/adminapi/impl)

Copied: trunk/engine/src/main/java/org/teiid/adminapi/impl/DQPManagement.java (from rev 1976, trunk/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java)
===================================================================
--- trunk/engine/src/main/java/org/teiid/adminapi/impl/DQPManagement.java	                        (rev 0)
+++ trunk/engine/src/main/java/org/teiid/adminapi/impl/DQPManagement.java	2010-03-19 18:04:06 UTC (rev 1979)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.adminapi.impl;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.teiid.adminapi.AdminException;
+
+
+public interface DQPManagement {
+    List<RequestMetadata> getRequestsForSession(long sessionId) ;
+    List<RequestMetadata> getRequests();
+    WorkerPoolStatisticsMetadata getWorkManagerStatistics(String identifier);
+    void terminateSession(long terminateeId);
+    boolean cancelRequest(long sessionId, long requestId) throws AdminException;
+    Collection<String> getCacheTypes();
+    void clearCache(String cacheType);
+    Collection<SessionMetadata> getActiveSessions() throws AdminException;
+    int getActiveSessionsCount() throws AdminException;
+    Collection<org.teiid.adminapi.Transaction> getTransactions();
+    void terminateTransaction(String xid) throws AdminException ;
+}

Copied: trunk/engine/src/test/java/org/teiid/adminapi/impl (from rev 1976, trunk/client/src/test/java/org/teiid/adminapi/impl)

Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2010-03-19 18:04:06 UTC (rev 1979)
@@ -45,6 +45,7 @@
 import org.teiid.adminapi.Admin;
 import org.teiid.adminapi.AdminComponentException;
 import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.impl.DQPManagement;
 import org.teiid.adminapi.impl.RequestMetadata;
 import org.teiid.adminapi.impl.SessionMetadata;
 import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
@@ -73,7 +74,6 @@
 import com.metamatrix.core.MetaMatrixRuntimeException;
 import com.metamatrix.core.log.MessageLevel;
 import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.client.DQPManagement;
 import com.metamatrix.dqp.service.BufferService;
 import com.metamatrix.dqp.service.SessionService;
 import com.metamatrix.dqp.service.TransactionService;

Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/metadata/pom.xml	2010-03-19 18:04:06 UTC (rev 1979)
@@ -52,17 +52,18 @@
       <artifactId>connector-api</artifactId>
       <scope>provided</scope>
     </dependency>
+    
     <dependency>
         <groupId>org.jboss</groupId>
         <artifactId>jboss-vfs</artifactId>
         <scope>provided</scope>
-    </dependency> 
-    
-    <dependency>
-        <groupId>org.jboss.man</groupId>
-        <artifactId>jboss-managed</artifactId>
-        <scope>test</scope>
-    </dependency>     
+    </dependency>
+
+	<dependency>
+		<groupId>org.jboss.man</groupId>
+		<artifactId>jboss-managed</artifactId>
+	</dependency>
+  
   </dependencies>
   
 </project>
\ No newline at end of file



More information about the teiid-commits mailing list