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$