[teiid-commits] teiid SVN: r1904 - in trunk/client: src/main/java/com/metamatrix/admin and 27 other directories.
teiid-commits at lists.jboss.org
teiid-commits at lists.jboss.org
Thu Mar 4 13:25:25 EST 2010
Author: shawkins
Date: 2010-03-04 13:25:21 -0500 (Thu, 04 Mar 2010)
New Revision: 1904
Added:
trunk/client/src/main/java/com/metamatrix/dqp/client/ClientSideDQP.java
trunk/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java
trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/client/src/main/java/org/teiid/adminapi/ConnectionPoolStatistics.java
trunk/client/src/main/java/org/teiid/adminapi/Logger.java
trunk/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java
trunk/client/src/main/java/org/teiid/adminapi/WorkerPoolStatistics.java
trunk/client/src/main/java/org/teiid/adminapi/impl/
trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionPoolStatisticsMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/DataRoleMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetadataMapper.java
trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ReferenceMappingMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java
trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java
trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java
trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadata.java
trunk/client/src/main/java/org/teiid/transport/
trunk/client/src/main/java/org/teiid/transport/ClientServiceRegistry.java
trunk/client/src/main/java/org/teiid/transport/LocalServerConnection.java
trunk/client/src/main/resources/vdb-deployer.xsd
Removed:
trunk/client/src/main/java/com/metamatrix/admin/RolesAllowed.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectionPool.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorBinding.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorType.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMExtensionModule.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMGroup.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMModel.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMPropertyDefinition.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMQueueWorkerPool.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMRequest.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMRole.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMSession.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMVDB.java
trunk/client/src/main/java/com/metamatrix/admin/objects/TransactionImpl.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java
trunk/client/src/main/java/com/metamatrix/dqp/client/ClientSideDQP.java
trunk/client/src/main/java/com/metamatrix/dqp/message/RequestID.java
trunk/client/src/main/java/com/metamatrix/jdbc/api/ConnectionProperties.java
trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionID.java
trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionPoolStatisticsMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/DataRoleMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetadataMapper.java
trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ReferenceMappingMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java
trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java
trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java
trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadata.java
trunk/client/src/main/java/org/teiid/transport/ClientServiceRegistry.java
trunk/client/src/main/java/org/teiid/transport/LocalServerConnection.java
trunk/client/src/test/java/com/metamatrix/admin/api/objects/
trunk/client/src/test/java/com/metamatrix/common/comm/platform/client/
trunk/client/src/test/java/org/
Modified:
trunk/client/pom.xml
trunk/client/src/main/java/com/metamatrix/admin/objects/MMProcess.java
trunk/client/src/main/java/com/metamatrix/common/api/MMURL.java
trunk/client/src/main/java/com/metamatrix/common/batch/BatchSerializer.java
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/Handshake.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServiceInvocationStruct.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
trunk/client/src/main/java/com/metamatrix/common/xa/MMXid.java
trunk/client/src/main/java/com/metamatrix/dqp/client/MetadataResult.java
trunk/client/src/main/java/com/metamatrix/dqp/client/ResultsFuture.java
trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
trunk/client/src/main/java/com/metamatrix/dqp/message/RequestMessage.java
trunk/client/src/main/java/com/metamatrix/dqp/message/ResultsMessage.java
trunk/client/src/main/java/com/metamatrix/platform/security/api/ILogon.java
trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java
trunk/client/src/main/java/com/metamatrix/platform/security/api/SessionToken.java
trunk/client/src/main/java/org/teiid/adminapi/Admin.java
trunk/client/src/main/java/org/teiid/adminapi/AdminObject.java
trunk/client/src/main/java/org/teiid/adminapi/AdminRoles.java
trunk/client/src/main/java/org/teiid/adminapi/ConnectorBinding.java
trunk/client/src/main/java/org/teiid/adminapi/Model.java
trunk/client/src/main/java/org/teiid/adminapi/ProcessObject.java
trunk/client/src/main/java/org/teiid/adminapi/PropertyDefinition.java
trunk/client/src/main/java/org/teiid/adminapi/Request.java
trunk/client/src/main/java/org/teiid/adminapi/Session.java
trunk/client/src/main/java/org/teiid/adminapi/Transaction.java
trunk/client/src/main/java/org/teiid/adminapi/VDB.java
trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties
trunk/client/src/main/resources/com/metamatrix/common/comm/i18n.properties
trunk/client/src/main/resources/com/metamatrix/common/comm/platform/i18n.properties
trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java
trunk/client/src/test/java/com/metamatrix/common/xa/TestMMXid.java
trunk/client/src/test/java/com/metamatrix/dqp/message/TestRequestMessage.java
Log:
TEIID-833 committing JCA merge
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/pom.xml 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,5 +22,10 @@
<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/admin/RolesAllowed.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/RolesAllowed.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/RolesAllowed.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,36 +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;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
- at Documented
- at Retention(value=RetentionPolicy.RUNTIME)
- at Target(value={ElementType.TYPE,ElementType.METHOD})
-public @interface RolesAllowed {
- String[] value();
-}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectionPool.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectionPool.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectionPool.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,115 +0,0 @@
-package com.metamatrix.admin.objects;
-
-import org.teiid.adminapi.ConnectionPool;
-
-public class MMConnectionPool implements ConnectionPool {
-
- /**
- * @since 6.1
- */
- private static final long serialVersionUID = -2341549955193216875L;
-
- private boolean xa;
- /**
- * Number of connections currently in use by a client
- */
- private int connectionInUse;
- /**
- * Number of connections waiting for use by a client
- */
- private int connectionsWaiting;
- /**
- * Total number of connections currently in the pool
- */
- private int totalConnections;
-
- /**
- * Total number of connections that have been destroyed since the inception of the pool
- */
- private long connectionsDestroyed;
- /**
- * Total number of connections that have been created since the inception of the pool
- */
- private long connectionsCreated;
-
- private String connectorBindingIdentifier;
-
- public boolean isXAPoolType() {
- return xa;
- }
-
- public void setXa(boolean xa) {
- this.xa = xa;
- }
-
- @Override
- public String getConnectorBindingIdentifier() {
- return connectorBindingIdentifier;
- }
-
- public void setConnectorBindingIdentifier(String connectorBindingIdentifier) {
- this.connectorBindingIdentifier = connectorBindingIdentifier;
- }
-
- public int getConnectionsInuse() {
- return this.connectionInUse;
- }
-
- public int getConnectionsWaiting() {
- return this.connectionsWaiting;
- }
-
- public long getConnectionsCreated() {
- return this.connectionsCreated;
- }
-
- public long getConnectionsDestroyed() {
- return this.connectionsDestroyed;
- }
-
- public int getTotalConnections() {
- return this.totalConnections;
- }
-
- public void setConnectionsInUse(int inUseConnections) {
- this.connectionInUse = inUseConnections;
- }
-
- public void setConnectionsWaiting(int waitingConnections) {
- this.connectionsWaiting = waitingConnections;
- }
-
- public void setTotalConnections(int totalConnections) {
- this.totalConnections = totalConnections;
- }
-
- public void setConnectionsDestroyed(long connectionsDestroyed) {
- this.connectionsDestroyed = connectionsDestroyed;
- }
-
- public void setConnectionsCreated(long connectionsCreated) {
- this.connectionsCreated = connectionsCreated;
- }
-
-
- @Override
- /**
- * Get string for display purposes
- * @see java.lang.Object#toString()
- * @since 6.1
- */
- public String toString() {
- StringBuffer str = new StringBuffer();
-
- str.append(this.connectorBindingIdentifier + " ConnectionPoolStats:\n"); //$NON-NLS-1$
- str.append("\tisXAPoolType = " + isXAPoolType()); //$NON-NLS-1$
- str.append("\ttotalConnections = " + this.totalConnections); //$NON-NLS-1$
- str.append("\tinUseConnections = " + this.connectionInUse); //$NON-NLS-1$
- str.append("\twaitingConnections = " + connectionsWaiting); //$NON-NLS-1$
- str.append("\tconnectionsCreated = " + connectionsCreated); //$NON-NLS-1$
- str.append("\tconnectionsDestroyed = " + connectionsDestroyed); //$NON-NLS-1$
- return str.toString();
- }
-
-
-}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorBinding.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorBinding.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorBinding.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,231 +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 java.util.Date;
-
-import org.teiid.adminapi.ConnectorBinding;
-
-import com.metamatrix.admin.AdminPlugin;
-
-
-/**
- * A Connector Binding is a Connector Type with properties that have been
- * bond to a Connector.
- *
- * May are may not be assigned to a VDB
- */
-public class MMConnectorBinding extends MMAdminObject implements ConnectorBinding {
-
- private static final long serialVersionUID = 6919562861762280546L;
- private String routingUUID = ""; //$NON-NLS-1$
- private String description = ""; //$NON-NLS-1$
- private String connectorTypeName = ""; //$NON-NLS-1$
- private int currentState;
- private Date stateChangedTime;
- private long serviceID = -1;
-
-
- /**
- * Constructor.
- * @param identifierParts
- * @since 4.3
- */
- public MMConnectorBinding(String[] identifierParts) {
- super(identifierParts);
- }
-
-
-
-
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.MMConnectorBinding")).append(getIdentifier()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.Description")).append(description); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.Created")).append(getCreatedDate()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.Created_By")).append(getCreatedBy()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.Updated")).append(getLastChangedDate()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.Updated_By")).append(getLastChangedBy()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.State")).append(getState()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.State_Changed")).append(getStateChangedTime()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.IsRegistered")).append(isRegistered()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorBinding.Properties")).append(getPropertiesAsString()); //$NON-NLS-1$
- return result.toString();
- }
-
-
-
- /**
- * Returns the description
- * @return description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Set the description
- * @param description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
-
-
- /**
- * Returns the String globally unique routing UUID for this
- * Connector Binding
- * @return Returns the routingUUID.
- * @since 4.3
- */
- public String getRoutingUUID() {
- return this.routingUUID;
- }
-
- /**
- * @param routingUUID The routingUUID to set.
- * @since 4.3
- */
- public void setRoutingUUID(String routingUUID) {
- this.routingUUID = routingUUID;
- }
-
- /**
- * @return the current state of this connector binding.
- */
- public int getState() {
- return this.currentState;
- }
-
- /**
- * @return Returns the currentState as String.
- * @since 4.3
- */
- public String getStateAsString() {
- switch (currentState) {
- case STATE_OPEN:
- return AdminPlugin.Util.getString("MMConnectorBinding.open"); //$NON-NLS-1$
- case STATE_CLOSED:
- return AdminPlugin.Util.getString("MMConnectorBinding.closed"); //$NON-NLS-1$
- case STATE_FAILED:
- return AdminPlugin.Util.getString("MMConnectorBinding.failed"); //$NON-NLS-1$
- case STATE_INIT_FAILED:
- return AdminPlugin.Util.getString("MMConnectorBinding.initializationFailed"); //$NON-NLS-1$
- case STATE_NOT_INITIALIZED:
- return AdminPlugin.Util.getString("MMConnectorBinding.notInitialized"); //$NON-NLS-1$
- case STATE_NOT_REGISTERED:
- return AdminPlugin.Util.getString("MMConnectorBinding.notRegistered"); //$NON-NLS-1$
- case STATE_DATA_SOURCE_UNAVAILABLE:
- return AdminPlugin.Util.getString("MMConnectorBinding.dataSourceUnavailable"); //$NON-NLS-1$
- default:
- return AdminPlugin.Util.getString("MMConnectorBinding.unknown"); //$NON-NLS-1$
- }
- }
-
- /**
- * Set the state
- * @param state
- * @since 4.3
- */
- public void setState(int state) {
- this.currentState = state;
-
- //check on what states mean "registered"
- setRegistered(currentState==STATE_OPEN || currentState==STATE_FAILED || currentState==STATE_DATA_SOURCE_UNAVAILABLE);
- }
-
-
- /**
- * @return Returns time of last state change.
- * @since 4.3
- */
- public Date getStateChangedTime() {
- return stateChangedTime;
- }
-
- /**
- * Set the state changed time
- * @param stateChangedTime
- * @since 4.3
- */
- public void setStateChangedTime(Date stateChangedTime) {
- this.stateChangedTime = stateChangedTime;
- }
-
-
- /**
- * @return Returns the serviceID.
- * @since 4.3
- */
- public long getServiceID() {
- return this.serviceID;
- }
-
- /**
- * @param serviceID The serviceID to set.
- * @since 4.3
- */
- public void setServiceID(long serviceID) {
- this.serviceID = serviceID;
- }
-
-
- /**
- * @return Returns the processID.
- * @since 4.3
- */
- public String getProcessName() {
- return identifierParts[1];
- }
-
-
- /**
- * @return Returns the hostName.
- * @since 4.3
- */
- public String getHostName() {
- return identifierParts[0];
- }
-
-
- /**
- * @param connectorTypeName the identifier for a connector type
- * @since 4.3
- */
- public void setConnectorTypeName(String connectorTypeName) {
- this.connectorTypeName = connectorTypeName;
- }
-
- /**
- * @see org.teiid.adminapi.ConnectorBinding#getConnectorTypeName()
- * @since 4.3
- */
- public String getConnectorTypeName() {
- return this.connectorTypeName;
- }
-}
\ No newline at end of file
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorType.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorType.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorType.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,58 +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 org.teiid.adminapi.ConnectorType;
-
-import com.metamatrix.admin.AdminPlugin;
-
-/**
- * Dataholder for a connector type.
- */
-public class MMConnectorType extends MMAdminObject implements ConnectorType {
- private static final long serialVersionUID = -3029541826277765764L;
-
- /**
- * Constructor
- * @param identifierParts of the Conenctor Type
- */
- public MMConnectorType(String[] identifierParts) {
- super(identifierParts);
- }
-
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMConnectorType.MMConnectorType")).append(getIdentifier()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorType.Created")).append(getCreatedDate()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorType.Created_By")).append(getCreatedBy()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorType.Updated")).append(getLastChangedDate()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMConnectorType.Updated_By")).append(getLastChangedBy()); //$NON-NLS-1$
- return result.toString();
- }
-
-
-}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMExtensionModule.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMExtensionModule.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMExtensionModule.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,109 +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 org.teiid.adminapi.ExtensionModule;
-
-import com.metamatrix.admin.AdminPlugin;
-
-/**
- * A simple Extension Modules for the Admin API
- */
-public final class MMExtensionModule extends MMAdminObject implements ExtensionModule {
- private static final long serialVersionUID = -3250813293338474584L;
- private String description;
- private byte[] fileContents;
- private String moduleType;
-
-
-
- /**
- * Create a new MMExtensionModule
- * @param identifierParts
- * @since 4.3
- */
- public MMExtensionModule(String[] identifierParts) {
- super(identifierParts);
- }
-
-
-
- /**
- * @return description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * @param description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * @return byte array of file contents
- */
- public byte[] getFileContents() {
- return fileContents;
- }
-
- /**
- * @param contents
- */
- public void setFileContents(byte[] contents) {
- this.fileContents = contents;
- }
-
- /**
- * @return String of the Module Type for this Extension Module
- */
- public String getModuleType() {
- return moduleType;
- }
-
- /**
- * @param type
- */
- public void setModuleType(String type) {
- this.moduleType = type;
- }
-
-
-
- /**
- * @return a String of this object for display.
- */
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMExtensionModule.MMExtensionModule")).append(getIdentifier()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMExtensionModule.moduleType")).append(getModuleType()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMExtensionModule.description")).append(getDescription()); //$NON-NLS-1$
- return result.toString();
- }
-
-
-
-
-}
\ No newline at end of file
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMGroup.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMGroup.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMGroup.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.admin.objects;
-
-import org.teiid.adminapi.Group;
-
-
-/**
- * @since 4.3
- */
-public class MMGroup extends MMAdminObject implements Group {
- private static final long serialVersionUID = 1102507655851078982L;
-
- /**
- * @param groupName
- * @since 4.3
- */
- public MMGroup(String[] groupName) {
- super(groupName);
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("[Name=\""); //$NON-NLS-1$
- sb.append(this.getName());
- sb.append("\"]"); //$NON-NLS-1$
- return sb.toString();
- }
-
-}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMModel.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMModel.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMModel.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,191 +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 java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.adminapi.Model;
-
-import com.metamatrix.admin.AdminPlugin;
-
-/**
- */
-public class MMModel extends MMAdminObject implements Model {
-
- private static final long serialVersionUID = 3714234763056162230L;
- private List connectorBindingNames = new ArrayList();
- private String modelType = ""; //$NON-NLS-1$
- private String modelURI = ""; //$NON-NLS-1$
- private boolean isMaterialization = false;
- private boolean isPhysical = false;
- private boolean isVisible = false;
- private boolean supportsMultiSourceBindings = false;
-
-
-
- /**
- * Construct a new MMModel
- * @param identifierParts
- */
- public MMModel(String[] identifierParts) {
- super(identifierParts);
- }
-
-
- /**
- * @see java.lang.Object#toString()
- * @return String for display purposes
- */
- public String toString() {
-
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMModel.MMModel")).append(getIdentifier()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMModel.type")).append(getModelType()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMModel.physical")).append(isPhysical); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMModel.visible")).append(isVisible); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMModel.connector_bindings")).append(getConnectorBindingNames()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMModel.modelURI")).append(getModelURI()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMModel.properties")).append(getPropertiesAsString()); //$NON-NLS-1$
- return result.toString();
- }
-
- /**
- * @see org.teiid.adminapi.Model#getConnectorBindingNames()
- * @since 4.3
- */
- public List getConnectorBindingNames() {
- return connectorBindingNames;
- }
-
- /**
- * @see org.teiid.adminapi.Model#isPhysical()
- * @since 4.3
- */
- public boolean isPhysical() {
- return isPhysical;
- }
-
- /**
- * @see org.teiid.adminapi.Model#isVisible()
- * @since 4.3
- */
- public boolean isVisible() {
- return isVisible;
- }
-
- /**
- * @see org.teiid.adminapi.Model#getModelType()
- * @since 4.3
- */
- public String getModelType() {
- return modelType;
- }
-
- /**
- * @see org.teiid.adminapi.Model#getModelURI()
- * @since 4.3
- */
- public String getModelURI() {
- return modelURI;
- }
-
- /**
- * @see org.teiid.adminapi.Model#supportsMultiSourceBindings()
- * @since 4.3
- */
- public boolean supportsMultiSourceBindings() {
- return this.supportsMultiSourceBindings;
- }
-
- /**
- * @param bindings
- */
- public void setConnectorBindingNames(List bindings) {
- connectorBindingNames = bindings;
- }
-
- /**
- * @param supports
- * @since 4.3
- */
- public void setSupportsMultiSourceBindings(boolean supports) {
- this.supportsMultiSourceBindings = supports;
- }
-
-
-
- /**
- * @param isPhysical Whether this model is visible.
- * @since 4.3
- */
- public void setPhysical(boolean isPhysical) {
- this.isPhysical = isPhysical;
- }
-
-
- /**
- * @param isVisible Whether this model is visible.
- * @since 4.3
- */
- public void setVisible(boolean isVisible) {
- this.isVisible = isVisible;
- }
-
-
- /**
- * @param modelType The modelType to set.
- * @since 4.3
- */
- public void setModelType(String modelType) {
- this.modelType = modelType;
- }
-
-
- /**
- * @param modelURI The modelURI to set.
- * @since 4.3
- */
- public void setModelURI(String modelURI) {
- this.modelURI = modelURI;
- }
-
-
- /**
- * @return Returns whether the model is a materialization.
- * @since 4.3
- */
- public boolean isMaterialization() {
- return this.isMaterialization;
- }
-
-
- /**
- * @param isMaterialization whether the model is a materialization..
- * @since 4.3
- */
- public void setMaterialization(boolean isMaterialization) {
- this.isMaterialization = isMaterialization;
- }
-
-}
Modified: trunk/client/src/main/java/com/metamatrix/admin/objects/MMProcess.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMProcess.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMProcess.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -27,7 +27,7 @@
import org.teiid.adminapi.AdminObject;
import org.teiid.adminapi.ProcessObject;
-import org.teiid.adminapi.QueueWorkerPool;
+import org.teiid.adminapi.WorkerPoolStatistics;
import com.metamatrix.admin.AdminPlugin;
@@ -52,7 +52,7 @@
private long objectsWritten = 0;
private Date startTime;
- private QueueWorkerPool queueWorkerPool = null;
+ private WorkerPoolStatistics queueWorkerPool = null;
/**
@@ -296,14 +296,14 @@
* @return Returns the queueWorkerPool.
* @since 4.3
*/
- public QueueWorkerPool getQueueWorkerPool() {
+ public WorkerPoolStatistics getQueueWorkerPool() {
return this.queueWorkerPool;
}
/**
* @param queueWorkerPool The queueWorkerPool to set.
* @since 4.3
*/
- public void setQueueWorkerPool(QueueWorkerPool queueWorkerPool) {
+ public void setQueueWorkerPool(WorkerPoolStatistics queueWorkerPool) {
this.queueWorkerPool = queueWorkerPool;
}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMPropertyDefinition.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMPropertyDefinition.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMPropertyDefinition.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,296 +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 java.util.ArrayList;
-import java.util.Collection;
-
-import org.teiid.adminapi.PropertyDefinition;
-
-import com.metamatrix.admin.AdminPlugin;
-
-
-/**
- * @since 4.3
- */
-public class MMPropertyDefinition extends MMAdminObject implements PropertyDefinition {
- private static final long serialVersionUID = 6612838530524627205L;
- private String value = null;
- private Collection allowedValues = new ArrayList();
- private Object defaultValue = null;
- private String description = null;
- private String displayName = null;
- private String propertyType = "String"; //$NON-NLS-1$
- private String propertyTypeClassName = String.class.getName();
- private RestartType requiresRestart = RestartType.NONE;
- private boolean expert = false;
- private boolean masked = false;
- private boolean modifiable = true;
- private boolean required = false;
-
-
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.MMPropertyDefinition")).append(getIdentifier()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Display_name")).append(getDisplayName()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Description")).append(getDescription()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Value")).append(getValue()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Property_type")).append(getPropertyType()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Property_type_class_name")).append(getPropertyTypeClassName()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Default_value")).append(getDefaultValue()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Constrained_to_allow_values")).append(isConstrainedToAllowedValues()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Allowed_values")).append(getAllowedValues()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Required")).append(isRequired()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Expert")).append(isExpert()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Masked")).append(isMasked()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Modifiable")).append(isModifiable()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.RequiresRestart")).append(getRequiresRestart()); //$NON-NLS-1$
- return result.toString();
- }
-
-
-
-
- /**
- * Constructor.
- * @param identifierParts
- * @since 4.3
- */
- public MMPropertyDefinition(String[] identifierParts) {
- super(identifierParts);
- }
-
-
-
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getValue()
- * @since 4.3
- */
- public String getValue() {
- return value;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getAllowedValues()
- * @since 4.3
- */
- public Collection getAllowedValues() {
- return allowedValues;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getDefaultValue()
- * @since 4.3
- */
- public Object getDefaultValue() {
- return defaultValue;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getDescription()
- * @since 4.3
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getDisplayName()
- * @since 4.3
- */
- public String getDisplayName() {
- return displayName;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getPropertyType()
- * @since 4.3
- */
- public String getPropertyType() {
- return propertyType;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getPropertyTypeClassName()
- * @since 4.3
- */
- public String getPropertyTypeClassName() {
- return propertyTypeClassName;
- }
-
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getRequiresRestart()
- * @since 4.3
- */
- public RestartType getRequiresRestart() {
- return requiresRestart;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#isExpert()
- * @since 4.3
- */
- public boolean isExpert() {
- return expert;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#isMasked()
- * @since 4.3
- */
- public boolean isMasked() {
- return masked;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#isModifiable()
- * @since 4.3
- */
- public boolean isModifiable() {
- return modifiable;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#isRequired()
- * @since 4.3
- */
- public boolean isRequired() {
- return required;
- }
-
-
-
-
-
-
- /**
- * @param allowedValues The allowedValues to set.
- * @since 4.3
- */
- public void setAllowedValues(Collection allowedValues) {
- this.allowedValues = allowedValues;
- }
-
- /**
- * @param defaultValue The defaultValue to set.
- * @since 4.3
- */
- public void setDefaultValue(Object defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- /**
- * @param description The description to set.
- * @since 4.3
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
-
- /**
- * @param displayName The displayName to set.
- * @since 4.3
- */
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
-
-
- /**
- * @param expert The value of expert to set.
- * @since 4.3
- */
- public void setExpert(boolean expert) {
- this.expert = expert;
- }
-
- /**
- * @param masked The value of masked to set.
- * @since 4.3
- */
- public void setMasked(boolean masked) {
- this.masked = masked;
- }
- /**
- * @param modifiable The value of modifiable to set.
- * @since 4.3
- */
- public void setModifiable(boolean modifiable) {
- this.modifiable = modifiable;
- }
-
- /**
- * @param propertyTypeAsString The propertyTypeAsString to set.
- * @since 4.3
- */
- public void setPropertyType(String propertyTypeAsString) {
- this.propertyType = propertyTypeAsString;
- }
-
- /**
- * @param propertyTypeClassName The propertyTypeName to set.
- * @since 4.3
- */
- public void setPropertyTypeClassName(String propertyTypeClassName) {
- this.propertyTypeClassName = propertyTypeClassName;
- }
-
-
- /**
- * @param required The value of required to set.
- * @since 4.3
- */
- public void setRequired(boolean required) {
- this.required = required;
- }
-
- /**
- * @param requiresRestart The value of requiresRestart to set.
- * @since 4.3
- */
- public void setRequiresRestart(RestartType requiresRestart) {
- this.requiresRestart = requiresRestart;
- }
-
- /**
- * @param value The value to set.
- * @since 4.3
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- @Override
- public boolean isConstrainedToAllowedValues() {
- return allowedValues != null && !allowedValues.isEmpty();
- }
-
-
-}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMQueueWorkerPool.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMQueueWorkerPool.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMQueueWorkerPool.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,155 +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 org.teiid.adminapi.QueueWorkerPool;
-
-import com.metamatrix.admin.AdminPlugin;
-
-/**
- * Dataholder for all the statistics gathered about a worker pool.
- */
-public class MMQueueWorkerPool extends MMAdminObject implements QueueWorkerPool {
- private static final long serialVersionUID = 454595217325824487L;
- // Current state
- private int queued = 0;
- private int threads = 0;
-
- // Total counts, never reset
- private int highestThreads;
- private int highestQueued = 0;
- private long totalSubmitted = 0;
- private long totalCompleted = 0;
-
- /**
- * Construct a new MMQueueWorkerPool
- * @param identifierParts
- * @since 4.3
- */
- public MMQueueWorkerPool(String[] identifierParts) {
- super(identifierParts);
- }
-
- /**
- * Get string for display purposes
- * @see java.lang.Object#toString()
- * @since 4.3
- */
- public String toString() {
- StringBuffer str = new StringBuffer();
-
- str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.MMQueueWorkerPool") + getIdentifier()); //$NON-NLS-1$
- str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.queued") + queued); //$NON-NLS-1$
- str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.highestQueued") + highestQueued); //$NON-NLS-1$
- str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.totalSubmitted") + totalSubmitted); //$NON-NLS-1$
- str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.totalCompleted") + totalCompleted); //$NON-NLS-1$
- str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.threads") + threads); //$NON-NLS-1$
- str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.highestThreads") + highestThreads); //$NON-NLS-1$
-
- return str.toString();
- }
-
- /**
- * @return Returns the number of requests queued.
- * @since 4.3
- */
- public int getQueued() {
- return this.queued;
- }
- /**
- * @param queued The number of requests queued.
- * @since 4.3
- */
- public void setQueued(int queued) {
- this.queued = queued;
- }
- /**
- * @return Returns the number of threads.
- * @since 4.3
- */
- public int getThreads() {
- return this.threads;
- }
- /**
- * @param threads The number of threads to set.
- * @since 4.3
- */
- public void setThreads(int threads) {
- this.threads = threads;
- }
- /**
- * @return Returns the number of totalDequeues.
- * @since 4.3
- */
- public long getTotalDequeues() {
- return getTotalCompleted();
- }
- /**
- * @return Returns the number of totalEnqueues.
- * @since 4.3
- */
- public long getTotalEnqueues() {
- return getTotalSubmitted();
- }
- /**
- * @return Returns the totalHighwaterMark.
- * @since 4.3
- */
- public int getTotalHighwaterMark() {
- return getHighestQueued();
- }
-
- public int getHighestThreads() {
- return highestThreads;
- }
-
- public void setHighestThreads(int highestThreads) {
- this.highestThreads = highestThreads;
- }
-
- public int getHighestQueued() {
- return highestQueued;
- }
-
- public void setHighestQueued(int highestQueued) {
- this.highestQueued = highestQueued;
- }
-
- public long getTotalSubmitted() {
- return totalSubmitted;
- }
-
- public void setTotalSubmitted(long totalSubmitted) {
- this.totalSubmitted = totalSubmitted;
- }
-
- public void setTotalCompleted(long totalCompleted) {
- this.totalCompleted = totalCompleted;
- }
-
- public long getTotalCompleted() {
- return totalCompleted;
- }
-
-}
-
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMRequest.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMRequest.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMRequest.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,274 +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 java.util.Date;
-
-import org.teiid.adminapi.Request;
-
-import com.metamatrix.admin.AdminPlugin;
-import com.metamatrix.core.util.DateUtil;
-
-/**
- * Dataholder for information about Requests.
- */
-public class MMRequest extends MMAdminObject implements Request{
-
- private static final long serialVersionUID = -6271863624581160147L;
- String userName = ""; //$NON-NLS-1$;
- String sessionID;
- String requestID;
- Date created;
- Date processingDate;
- String transactionID = ""; //$NON-NLS-1$;
- String sqlCommand = ""; //$NON-NLS-1$;
- String connectorBindingName= ""; //$NON-NLS-1$;
- String nodeID=""; //$NON-NLS-1$
- boolean sourceRequest = false;
-
- /**
- * Construct a new MMRequest
- * @param identifierParts
- * @since 4.3
- */
- public MMRequest(String[] identifierParts) {
- super(identifierParts);
-
- this.sessionID = identifierParts[0];
- this.requestID = identifierParts[1];
- if (identifierParts.length >= 3) {
- this.nodeID = identifierParts[2];
- this.sourceRequest = true;
- }
- this.name = requestID;
- }
-
-
-
-
- /**
- * @return Date the request was created
- * @since 4.3
- */
- public Date getCreated() {
- return created;
- }
-
-
- /**
- * @return Date the request was created, as a String
- * @since 4.3
- */
- public String getCreatedString() {
- String result = ""; //$NON-NLS-1$;
- if( created != null ) {
- result = DateUtil.getDateAsString(created);
- }
- return result;
- }
-
-
-
- /**
- * Get the RequestID for a Request
- * @return RequestID
- */
- public String getRequestID() {
- return requestID;
- }
-
- /**
- * Get the SessionID for a Request
- *
- * @return long SessionID
- */
- public String getSessionID() {
- return sessionID;
- }
-
- /**
- * Get the SQL Command sent to the Server for a Request
- *
- * @return MetaMatrix SQL Command
- */
- public String getSqlCommand() {
- return sqlCommand;
- }
-
- /**
- * Get the Date processing began for the Request
- * @return Date processing began for the request
- */
- public Date getProcessingDate() {
- return processingDate;
- }
-
- /**
- * Get the Date processing began for the Request, as a String
- * @return Date processing began for the request
- */
- public String getProcessingDateString() {
- String result = ""; //$NON-NLS-1$;
- if (processingDate != null) {
- result = DateUtil.getDateAsString(processingDate);
- }
- return result;
- }
-
-
- /**
- * Get the TransactionID of the Request
- *
- * @return String of TransactionID if in a transaction
- */
- public String getTransactionID() {
- return transactionID;
- }
-
- /**
- * Get the UserName of the Request
- *
- * @return String username for the Request
- */
- public String getUserName() {
- return userName;
- }
-
-
-
-
-
- /**
- * @param created The date created.
- * @since 4.3
- */
- public void setCreated(Date created) {
- this.created = created;
- }
- /**
- * @param sessionID The sessionID to set.
- * @since 4.3
- */
- public void setSessionID(String sessionID) {
- this.sessionID = sessionID;
- }
- /**
- * @param sqlCommand The sqlCommand to set.
- * @since 4.3
- */
- public void setSqlCommand(String sqlCommand) {
- this.sqlCommand = sqlCommand;
- }
- /**
- * @param processingDate The date processing began.
- * @since 4.3
- */
- public void setProcessingDate(Date processingDate) {
- this.processingDate = processingDate;
- }
- /**
- * @param transactionID The transactionID to set.
- * @since 4.3
- */
- public void setTransactionID(String transactionID) {
- this.transactionID = transactionID;
- }
- /**
- * @param userName The userName to set.
- * @since 4.3
- */
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- /**
- * @return Returns the connectorBindingName.
- * @since 4.3
- */
- public String getConnectorBindingName() {
- return this.connectorBindingName;
- }
- /**
- * @param connectorBindingName The connectorBindingName to set.
- * @since 4.3
- */
- public void setConnectorBindingName(String connectorBindingName) {
- this.connectorBindingName = connectorBindingName;
- }
-
- /**
- * @return Returns whether this is a Source Request.
- * @since 4.3
- */
- public boolean isSource() {
- return sourceRequest;
- }
-
- /**
- * Set if the request is source request
- * @param value
- * @since 4.3
- */
- public void setSource(boolean value) {
- sourceRequest = value;
- }
-
- /**
- * If this is a source request then this represents the node id
- * @return Returns the nodeID.
- * @since 4.3
- */
- public String getNodeID() {
- return this.nodeID;
- }
-
- /**
- * If this is a source request then this represents the node id
- * @param nodeID The nodeID to set.
- * @since 4.3
- */
- public void setNodeID(String nodeID) {
- this.nodeID = nodeID;
- }
-
-
- /**
- * @see java.lang.Object#toString()
- * @return String for display purposes
- */
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMRequest.MMRequest")).append(getIdentifier()); //$NON-NLS-1$
- if (isSource()) {
- result.append(AdminPlugin.Util.getString("MMRequest.nodeID")).append(getNodeID()); //$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();
- }
-}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMRole.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMRole.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMRole.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,100 +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 java.util.Properties;
-
-import org.teiid.adminapi.Role;
-
-
-
-/**
- * @since 4.3
- */
-public class MMRole extends MMAdminObject implements Role {
-
- private static final long serialVersionUID = -768301010301417417L;
-
- /**
- * Ctor
- * @param identifier the role identifier should contain the whole
- * dotted notation in one field of the identifier so that the name
- * contains all components.
- * @since 4.3
- */
- public MMRole(String[] identifier) {
- super(identifier);
- }
-
- /**
- * Get the names of all administrative roles in the system.
- * @return the array of all role names suitable for adding to Principals.
- * @since 4.3
- */
- public static String[] getAvailableRoles() {
- return new String[] {Role.ADMIN_PRODUCT, Role.ADMIN_SYSTEM, Role.ADMIN_READONLY};
- }
-
- /**
- * @see org.teiid.adminapi.AdminObject#getIdentifier()
- * @since 4.3
- */
- public String getIdentifier() {
- return super.getIdentifier();
- }
-
- /**
- * @see org.teiid.adminapi.AdminObject#getName()
- * @since 4.3
- */
- public String getName() {
- // A Role name should not be broken into components
- // Role name should have have complete, dotted notation.
- return super.getIdentifier();
- }
-
- /**
- * @see org.teiid.adminapi.AdminObject#getProperties()
- * @since 4.3
- */
- public Properties getProperties() {
- return null;
- }
-
- /**
- * @see org.teiid.adminapi.AdminObject#getPropertyValue(java.lang.String)
- * @since 4.3
- */
- public String getPropertyValue(String name) {
- return null;
- }
-
- /**
- * @see com.metamatrix.admin.objects.MMAdminObject#toString()
- * @since 4.3
- */
- public String toString() {
- return super.getIdentifier();
- }
-
-}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMSession.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMSession.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMSession.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,273 +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 java.util.Date;
-
-import org.teiid.adminapi.Session;
-
-import com.metamatrix.admin.AdminPlugin;
-import com.metamatrix.core.util.DateUtil;
-
-/**
- * MetaMatrix Session
- *
- */
-public class MMSession extends MMAdminObject implements Session {
-
- private static final long serialVersionUID = 4939105946380675244L;
- private String userName = ""; //$NON-NLS-1$;
- private String applicationName = ""; //$NON-NLS-1$
- private String sessionID;
- private String vdbName = ""; //$NON-NLS-1$
- private String vdbVersion = ""; //$NON-NLS-1$
- private String ipAddress = ""; //$NON-NLS-1$
- private String hostName = ""; //$NON-NLS-1$
- private long lastPingTime;
- private int sessionState;
-
-
-
- /**
- * constructor
- * @param identifierParts
- */
- public MMSession(String[] identifierParts) {
- super(identifierParts);
- this.sessionID = getIdentifier();
- }
-
-
- /**
- * Convert a Session to a String
- *
- * @see java.lang.Object#toString()
- * @since 4.3
- */
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMSession.MMSession")).append(getIdentifier()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.User_Name")).append(userName); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.Application")).append(applicationName); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.ID")).append(sessionID); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.VDB_Name")).append(vdbName); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.VDB_Version")).append(vdbVersion); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.Last_Ping_Time")).append(getLastPingTimeString()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.State")).append(getStateAsString()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.IPAddress")).append(ipAddress); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMSession.HostName")).append(hostName); //$NON-NLS-1$
-
- return result.toString();
- }
-
- /**
- * Get the Last time Client has checked to see if the server is still available
- *
- * @return Date of the last ping to the server.
- */
- public Date getLastPingTime() {
- return new Date(lastPingTime);
- }
-
-
- /**
- * Get the Time the User logged into the System as a String
- *
- * @return String
- */
- public String getLastPingTimeString() {
- return DateUtil.getDateAsString(getLastPingTime());
- }
-
- /**
- * Set the Last time Client has checked to see if the server is still available
- * @param lastPingTime
- */
- public void setLastPingTime(long lastPingTime) {
- this.lastPingTime = lastPingTime;
- }
-
-
-
- /**
- * Get the SessionState
- *
- * @return String with the SessionState
- */
- public String getStateAsString() {
- String result = ""; //$NON-NLS-1$
- switch (sessionState) {
- case STATE_EXPIRED :
- result = EXPIRED_STATE_DESC;
- break;
- case STATE_ACTIVE :
- result = ACTIVE_STATE_DESC;
- break;
- case STATE_CLOSED :
- result = CLOSED_STATE_DESC;
- break;
- case STATE_TERMINATED :
- result = TERMINATED_STATE_DESC;
- break;
- case STATE_PASSIVATED :
- result = PASSIVATED_STATE_DESC;
- break;
- default :
- result = UNKNOWN_STATE_DESC;
- }
- return result;
- }
-
-
- /**
- * Set the SessionState
- * @param state
- */
- public void setSessionState(int state) {
- this.sessionState = state;
- }
-
- /**
- * Get the Application Name
- *
- * @return String of the Application Name
- */
- public String getApplicationName() {
- return applicationName;
- }
-
- /**
- * Set the ApplicationName
- * @param name
- */
- public void setApplicationName(String name) {
- this.applicationName = name;
- }
-
- /**
- * Get the unique MetaMatrix session
- * within a given MetaMatrix System
- *
- * @return Strings of the Session ID
- */
- public String getSessionID() {
- return sessionID;
- }
-
- /**
- * Get the State of the Session
- *
- * @return int of the Session's state
- */
- public int getState() {
- return sessionState;
- }
-
- /**
- * Get User Name for this Session
- *
- * @return String of UserName
- */
- public String getUserName() {
- return userName;
- }
-
- /**
- * Set User Name for this Session
- * @param userName
- */
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- /**
- * Get the VDB Name for this Session
- *
- * @return String name of the VDB
- */
- public String getVDBName() {
- return vdbName;
- }
-
- /**
- * Set VDBName for this Session
- * @param vdbName
- */
- public void setVDBName(String vdbName) {
- this.vdbName = vdbName;
- }
-
- /**
- * Get the VDB Version for this Session
- *
- * @return String name/number of the VDB Version
- */
- public String getVDBVersion() {
- return vdbVersion;
- }
-
- /**
- * Set VDBVersion for this Session
- * @param vdbVersion
- */
- public void setVDBVersion(String vdbVersion) {
- this.vdbVersion = vdbVersion;
- }
-
- /**
- * Set IPAddress for this Session
- * @param ipAddress
- */
- public void setIPAddress(String ipAddress) {
- this.ipAddress = ipAddress;
- }
-
-
- /**
- * Get the IPAddress for this Session
- * @return IPAddress
- */
- public String getIPAddress() {
- return this.ipAddress;
- }
-
- /**
- * Set information defined by the client at runtime
- * @param clientMachineName
- */
- public void setHostName(String clientMachineName) {
- this.hostName = clientMachineName;
- }
-
-
- /**
- * Get the host name of the machine the client is
- * accessing from
- * @return IPAddress
- */
- public String getHostName() {
- return this.hostName;
- }
-
-
-}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/MMVDB.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMVDB.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMVDB.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,289 +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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-
-import org.teiid.adminapi.VDB;
-
-import com.metamatrix.admin.AdminPlugin;
-import com.metamatrix.core.util.HashCodeUtil;
-
-/**
- * Dataholder object for information about a VDB (Virtual Database)
- */
-public final class MMVDB extends MMAdminObject implements VDB, Comparable {
-
- private static final long serialVersionUID = -3755957080991586389L;
- /**VDB is registered but incomplete*/
- public static final int STATUS_INCOMPLETE = 1;
- /**VDB is deployed but inactive*/
- public static final int STATUS_INACTIVE = 2;
- /**VDB is deployed and active*/
- public static final int STATUS_ACTIVE = 3;
- /**VDB has been deleted*/
- public static final int STATUS_DELETED = 4;
-
- final static String[] VDB_STATUS_NAMES = {"Incomplete", //$NON-NLS-1$
- "Inactive", //$NON-NLS-1$
- "Active", //$NON-NLS-1$
- "Deleted"}; //$NON-NLS-1$
-
-
-
- private Collection models = new ArrayList();
- private short status;
- private Date versionedDate;
- private String versionedBy;
- private long uid;
- private boolean hasMaterializedViews;
- private int cachedHashcode;
- private boolean hasWSDL;
-
-
-
- /**
- * VDBs are identified by name and version.
- * @param identifierParts the VDB name and version parts
- */
- public MMVDB(String[] identifierParts) {
- super(identifierParts);
- this.cachedHashcode = HashCodeUtil.hashCode(13, getIdentifier());
- }
-
- /**
- * @see java.lang.Object#toString()
- * @since 4.3
- */
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMVDB.MMVDB")).append(getIdentifier()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMVDB.status")).append(getState()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMVDB.versionedDate")).append(versionedDate); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMVDB.versionedBy")).append(versionedBy); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMVDB.properties")).append(getPropertiesAsString()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMVDB.models")).append(models); //$NON-NLS-1$
- return result.toString();
- }
-
- /**
- * Add an MMModel
- * @param mmModel
- * @since 4.3
- */
- public void addModel(MMModel mmModel) {
- models.add(mmModel);
- }
-
- /**
- * @return date the VDB was versioned
- */
- public Date getVersionedDate() {
- return versionedDate;
- }
-
- /**
- * @return user that versioned the VDB
- */
- public String getVersionedBy() {
- return versionedBy;
- }
-
- /**
- * @return Collection of MMModels
- */
- public Collection getModels() {
- return models;
- }
-
- /**
- * @return the status
- */
- public int getState() {
- return status;
- }
-
- /**
- * @return the status
- */
- public String getStateAsString() {
- return VDB_STATUS_NAMES[this.status - 1];
- }
-
- /**
- * Must be overridden since, unlike other admin objects, the
- * name component of a VDB is the first component of the
- * identifier. VDB version is the second component.
- * @see com.metamatrix.admin.objects.MMAdminObject#getName()
- * @return The Name of the VDB
- * @since 4.3
- */
- public String getName() {
- return identifierParts[0];
- }
-
- /**
- * @return the VDB version
- */
- public String getVDBVersion() {
- return identifierParts[1];
- }
-
-
- /**
- * @param bound The date the VDB was bound.
- * @since 4.3
- */
- public void setVersionedDate(Date bound) {
- this.versionedDate = bound;
- }
-
-
- /**
- * @param boundBy The user that bound the VDB.
- * @since 4.3
- */
- public void setVersionedBy(String boundBy) {
- this.versionedBy = boundBy;
- }
-
-
- /**
- * @param models Collection of MMModels to set.
- * @since 4.3
- */
- public void setModels(Collection models) {
- this.models = models;
- }
-
-
- /**
- * @param status The status to set.
- * @since 4.3
- */
- public void setStatus(short status) {
- this.status = status;
-
- //TODO: are these correct?
- setEnabled(status == STATUS_ACTIVE);
- setRegistered(status == STATUS_ACTIVE || status == STATUS_INACTIVE || status == STATUS_INCOMPLETE);
- }
-
-
- /**
- * @return Returns the uid.
- * @since 4.3
- */
- public long getUID() {
- return this.uid;
- }
-
-
- /**
- * @param uid The uid to set.
- * @since 4.3
- */
- public void setUID(long uid) {
- this.uid = uid;
- }
-
- /**
- * @see org.teiid.adminapi.VDB#hasMaterializedViews()
- * @since 4.3
- */
- public boolean hasMaterializedViews() {
- return hasMaterializedViews;
- }
-
-
- /**
- * @param hasMaterializedViews The hasMaterializedViews to set.
- * @since 4.3
- */
- public void setMaterializedViews(boolean hasMaterializedViews) {
- this.hasMaterializedViews = hasMaterializedViews;
- }
-
-
-
-
- /**
- * @return Returns the hasWSDL.
- * @since 5.5.3
- */
- public boolean hasWSDL() {
- return this.hasWSDL;
- }
-
-
- /**
- * @param hasWSDL The hasWSDL to set.
- * @since 5.5.3
- */
- public void setHasWSDL(boolean hasWSDL) {
- this.hasWSDL = hasWSDL;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- * @since 4.3
- */
- public boolean equals(Object obj) {
- if ( ! (obj instanceof MMVDB) ) {
- return false;
- }
-
- MMVDB other = (MMVDB)obj;
- if ( ! identifier.equals(other.identifier) ) {
- return false;
- }
-
- return true;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- * @since 4.3
- */
- public int hashCode() {
- return this.cachedHashcode;
- }
-
- /**
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- * @since 4.3
- */
- public int compareTo(Object obj) {
- if ( ! (obj instanceof MMVDB) ) {
- return -1;
- }
-
- MMVDB other = (MMVDB)obj;
- return identifier.compareTo(other.identifier);
- }
-
-
-
-}
Deleted: trunk/client/src/main/java/com/metamatrix/admin/objects/TransactionImpl.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/TransactionImpl.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/TransactionImpl.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,87 +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 javax.transaction.xa.Xid;
-
-import org.teiid.adminapi.Transaction;
-
-import com.metamatrix.admin.AdminPlugin;
-import com.metamatrix.common.xa.MMXid;
-
-public class TransactionImpl extends MMAdminObject implements Transaction {
-
- private static final long serialVersionUID = -8588785315218789068L;
- private String associatedSession;
- private String scope;
- private MMXid xid;
- private String status;
-
- public TransactionImpl(String ... id) {
- super(id);
- }
-
- public String getAssociatedSession() {
- return associatedSession;
- }
-
- public void setAssociatedSession(String associatedSession) {
- this.associatedSession = associatedSession;
- }
-
- public String getScope() {
- return scope;
- }
-
- public void setScope(String scope) {
- this.scope = scope;
- }
-
- public Xid getXid() {
- return xid;
- }
-
- public void setXid(MMXid xid) {
- this.xid = xid;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- @Override
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("TransactionImpl.identifier")).append(getIdentifier()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("TransactionImpl.associatedSession")).append(associatedSession); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("TransactionImpl.scope")).append(scope); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("TransactionImpl.status")).append(status); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("TransactionImpl.xid")).append(xid); //$NON-NLS-1$
- return result.toString();
- }
-
-}
Modified: trunk/client/src/main/java/com/metamatrix/common/api/MMURL.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/api/MMURL.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/api/MMURL.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -45,8 +45,6 @@
public static final String VDB_VERSION = "VirtualDatabaseVersion"; //$NON-NLS-1$
// constant for vdb version part of serverURL
public static final String VERSION = "version"; //$NON-NLS-1$
-
- public static final String CREDENTIALS = "credentials"; //$NON-NLS-1$
}
public static interface CONNECTION {
@@ -63,11 +61,6 @@
*/
public static final String DISCOVERY_STRATEGY = "discoveryStategy"; //$NON-NLS-1$
- /**
- * if "true" in the embedded mode if there is a active instance that instance will be shutdown.
- */
- public static final String SHUTDOWN = "shutdown"; //$NON-NLS-1$
-
public static final String SERVER_URL = "serverURL"; //$NON-NLS-1$
/**
* Non-secure MetaMatrix Protocol.
@@ -83,7 +76,8 @@
public static final String USER_NAME = "user"; //$NON-NLS-1$
// constant for password part of url
public static final String PASSWORD = "password"; //$NON-NLS-1$
- public static final String CLIENT_TOKEN_PROP = "clientToken"; //$NON-NLS-1$
+
+ public static final String ADMIN = "admin"; //$NON-NLS-1$
}
public static final String DOT_DELIMITER = "."; //$NON-NLS-1$
Modified: trunk/client/src/main/java/com/metamatrix/common/batch/BatchSerializer.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/batch/BatchSerializer.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/batch/BatchSerializer.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -45,24 +45,21 @@
private BatchSerializer() {} // Uninstantiable
- private static final Map serializers = new HashMap(18, 1.0f);
+ private static ColumnSerializer defaultSerializer = new ColumnSerializer();
+
+ private static final Map<String, ColumnSerializer> serializers = new HashMap<String, ColumnSerializer>();
static {
serializers.put(DataTypeManager.DefaultDataTypes.BIG_DECIMAL, new BigDecimalColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.BIG_INTEGER, new BigIntegerColumnSerializer());
- serializers.put(DataTypeManager.DefaultDataTypes.BLOB, new ObjectColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.BOOLEAN, new BooleanColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.BYTE, new ByteColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.CHAR, new CharColumnSerializer());
- serializers.put(DataTypeManager.DefaultDataTypes.CLOB, new ObjectColumnSerializer());
- serializers.put(DataTypeManager.DefaultDataTypes.XML, new ObjectColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.DATE, new DateColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.DOUBLE, new DoubleColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.FLOAT, new FloatColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.INTEGER, new IntColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.LONG, new LongColumnSerializer());
- serializers.put(DataTypeManager.DefaultDataTypes.OBJECT, new ObjectColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.SHORT, new ShortColumnSerializer());
- serializers.put(DataTypeManager.DefaultDataTypes.STRING, new StringColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.TIME, new TimeColumnSerializer());
serializers.put(DataTypeManager.DefaultDataTypes.TIMESTAMP, new TimestampColumnSerializer());
}
@@ -123,19 +120,10 @@
}
/**
- * An interface representing a stateless serializer of a batch column
- * @since 4.2
- */
- private static interface ColumnSerializer {
- void writeColumn(ObjectOutput out, int col, List[] results) throws IOException;
- void readColumn(ObjectInput in, int col, List[] batch, byte[] isNullNuffer) throws IOException, ClassNotFoundException;
- }
-
- /**
* An abstract serializer for native types
* @since 4.2
*/
- private static abstract class AbstractNativeColumnSerializer implements ColumnSerializer {
+ private static class ColumnSerializer {
public void writeColumn(ObjectOutput out, int col, List[] batch) throws IOException {
writeIsNullData(out, col, batch);
Object obj = null;
@@ -156,11 +144,15 @@
}
}
- protected abstract void writeObject(ObjectOutput out, Object obj) throws IOException;
- protected abstract Object readObject(ObjectInput in) throws IOException;
+ protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+ out.writeObject(obj);
+ }
+ protected Object readObject(ObjectInput in) throws IOException, ClassNotFoundException {
+ return in.readObject();
+ }
}
- private static class IntColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class IntColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
out.writeInt(((Integer)obj).intValue());
}
@@ -169,7 +161,7 @@
}
}
- private static class LongColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class LongColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
out.writeLong(((Long)obj).longValue());
}
@@ -178,7 +170,7 @@
}
}
- private static class FloatColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class FloatColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
out.writeFloat(((Float)obj).floatValue());
}
@@ -187,7 +179,7 @@
}
}
- private static class DoubleColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class DoubleColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
out.writeDouble(((Double)obj).doubleValue());
}
@@ -196,7 +188,7 @@
}
}
- private static class ShortColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class ShortColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
out.writeShort(((Short)obj).shortValue());
}
@@ -205,7 +197,7 @@
}
}
- private static class BooleanColumnSerializer implements ColumnSerializer {
+ private static class BooleanColumnSerializer extends ColumnSerializer {
/* This implementation compacts the isNull and boolean data for non-null values into a byte[]
* by using a 8 bit mask that is bit-shifted to mask each value.
*/
@@ -270,7 +262,7 @@
}
}
- private static class ByteColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class ByteColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
out.writeByte(((Byte)obj).byteValue());
}
@@ -279,7 +271,7 @@
}
}
- private static class CharColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class CharColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
out.writeChar(((Character)obj).charValue());
}
@@ -288,61 +280,8 @@
}
}
- private static class StringColumnSerializer extends AbstractNativeColumnSerializer {
- /*
- * This implementation writes single-byte chars until it reaches a non-ascii char in the string,
- * at which point it starts writing two-byte characters. This implementation never writes more
- * than two bytes per char.
- */
+ private static class BigIntegerColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
- String val = (String)obj;
- int length = val.length();
- out.writeInt(length);
- boolean writingShort = true;
- char c;
- for (int i = 0 ; i < length; i++) {
- if (writingShort) {
- /* charAt() simply gets the char out of the underlying array. The assumption is that this would be quicker
- * calling getChars() which makes a copy of the underlying char[].
- */
- c = val.charAt(i);
- if (c < 0x80) {
- out.write(c);
- } else {
- out.write(0x80);
- writingShort = false;
- out.writeChar(c);
- }
- } else {
- out.writeChar(val.charAt(i));
- }
- }
- }
- protected Object readObject(ObjectInput in) throws IOException {
- int b;
- boolean readingShort;
- int length = in.readInt();
- char[] chars = new char[length];
- readingShort = true;
- for (int i = 0; i < length; i++) {
- if (readingShort) {
- b = in.read();
- if (b == 0x80) {
- readingShort = false;
- chars[i] = in.readChar();
- } else {
- chars[i] = ((char)b);
- }
- } else {
- chars[i] = in.readChar();
- }
- }
- return new String(chars);
- }
- }
-
- private static class BigIntegerColumnSerializer extends AbstractNativeColumnSerializer {
- protected void writeObject(ObjectOutput out, Object obj) throws IOException {
BigInteger val = (BigInteger)obj;
byte[] bytes = val.toByteArray();
out.writeInt(bytes.length);
@@ -356,7 +295,7 @@
}
}
- private static class BigDecimalColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class BigDecimalColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
BigDecimal val = (BigDecimal)obj;
out.writeInt(val.scale());
@@ -374,7 +313,7 @@
}
}
- private static class DateColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class DateColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
out.writeLong(((java.sql.Date)obj).getTime());
}
@@ -383,7 +322,7 @@
}
}
- private static class TimeColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class TimeColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
out.writeLong(((Time)obj).getTime());
}
@@ -392,7 +331,7 @@
}
}
- private static class TimestampColumnSerializer extends AbstractNativeColumnSerializer {
+ private static class TimestampColumnSerializer extends ColumnSerializer {
protected void writeObject(ObjectOutput out, Object obj) throws IOException {
Timestamp ts = (Timestamp)obj;
out.writeLong(ts.getTime());
@@ -404,24 +343,12 @@
return ts;
}
}
-
- private static class ObjectColumnSerializer implements ColumnSerializer {
- public void writeColumn(ObjectOutput out, int col, List[] results) throws IOException {
- for (int i = 0; i < results.length; i++) {
- out.writeObject(results[i].get(col));
- }
- }
- public void readColumn(ObjectInput in, int col, List[] batch, byte[] isNull) throws IOException, ClassNotFoundException {
- for (int i = 0; i < batch.length; i++) {
- batch[i].set(col, in.readObject());
- }
- }
- }
-
private static ColumnSerializer getSerializer(String type) {
- ColumnSerializer cs = (ColumnSerializer)serializers.get((type == null) ? DataTypeManager.DefaultDataTypes.OBJECT : type);
- assert cs != null;
+ ColumnSerializer cs = serializers.get((type == null) ? DataTypeManager.DefaultDataTypes.OBJECT : type);
+ if (cs == null) {
+ return defaultSerializer;
+ }
return cs;
}
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -28,10 +28,11 @@
public interface ServerConnection {
public static final int PING_INTERVAL = 120000;
+ public static final String LOCAL_CONNECTION = "localConnection";
<T> T getService(Class<T> iface);
- void shutdown();
+ void close();
boolean isOpen();
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -26,12 +26,9 @@
import com.metamatrix.common.comm.exception.CommunicationException;
import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.core.MetaMatrixCoreException;
public interface ServerConnectionFactory {
- void initialize(Properties info) throws MetaMatrixCoreException;
-
/**
* Establish a connection to the server.
* @param connProps The properties used by the transport to find a connection. These
@@ -41,18 +38,5 @@
* @throws CommunicationException If an error occurs in connecting, typically due to
* problems with the connection properties (bad user name, bad password, bad host name, etc)
*/
- ServerConnection createConnection(Properties connectionProperties) throws CommunicationException, ConnectionException;
-
-
- /**
- * Shutdown the connection factory, including the DQP and all its existing connections
- */
- void shutdown(boolean restart);
-
- /**
- * Is the connection factory alive
- * @return true if alive; false otherwise.
- */
- boolean isAlive();
-
+ ServerConnection getConnection(Properties connectionProperties) throws CommunicationException, ConnectionException;
}
Deleted: 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 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,241 +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.comm.platform.client;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Properties;
-
-import org.teiid.adminapi.Admin;
-import org.teiid.adminapi.AdminComponentException;
-import org.teiid.adminapi.AdminException;
-import org.teiid.adminapi.AdminObject;
-
-import com.metamatrix.admin.AdminPlugin;
-import com.metamatrix.api.exception.security.LogonException;
-import com.metamatrix.client.ExceptionUtil;
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.api.ServerConnectionFactory;
-import com.metamatrix.common.comm.exception.CommunicationException;
-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.PropertiesUtils;
-import com.metamatrix.core.MetaMatrixRuntimeException;
-
-/**
- * Singleton factory for ServerAdmins.
- * @since 4.3
- */
-public class ServerAdminFactory {
-
- private static final int DEFAULT_BOUNCE_WAIT = 2000;
-
- private final class ReconnectingProxy implements InvocationHandler {
-
- private Admin target;
- private ServerConnection registry;
- private Properties p;
- private boolean closed;
-
- public ReconnectingProxy(Properties p) throws ConnectionException, CommunicationException {
- this.p = p;
- this.registry = serverConnectionFactory.createConnection(p);
- }
-
- private synchronized Admin getTarget() throws AdminComponentException, CommunicationException {
- if (closed) {
- throw new AdminComponentException(CommPlatformPlugin.Util.getString("ERR.014.001.0001")); //$NON-NLS-1$
- }
- if (target != null && registry.isOpen()) {
- return target;
- }
- try {
- registry = serverConnectionFactory.createConnection(p);
- } catch (ConnectionException e) {
- throw new AdminComponentException(e.getMessage());
- }
- target = registry.getService(Admin.class);
- return target;
- }
-
- //## JDBC4.0-begin ##
- @Override
- //## JDBC4.0-end ##
- public Object invoke(Object proxy, Method method, Object[] args)
- throws Throwable {
- if (method.getName().equals("close")) { //$NON-NLS-1$
- close();
- return null;
- }
- Throwable t = null;
- for (int i = 0; i < 3; i++) {
- try {
- return method.invoke(getTarget(), args);
- } catch (InvocationTargetException e) {
- if (ExceptionUtil.getExceptionOfType(e, CommunicationException.class) != null) {
- // communication exception occurred, lose the old connection and try again.
- this.target = null;
- if (method.getName().endsWith("restart")) { //$NON-NLS-1$
- bounceSystem(true);
- return null;
- }
- continue;
- }
- throw e.getTargetException();
- } catch (CommunicationException e) {
- t = e;
- }
- }
- throw t;
- }
-
- public synchronized void close() {
- if (closed) {
- return;
- }
- this.closed = true;
- if (registry != null) {
- registry.shutdown();
- }
- }
-
- public void bounceSystem(boolean waitUntilDone) {
- if (!waitUntilDone) {
- return;
- }
- //we'll wait 2 seconds for the server to come up
- try {
- Thread.sleep(bounceWait);
- } catch (InterruptedException e) {
- throw new MetaMatrixRuntimeException(e);
- }
-
- //we'll wait 30 seconds for the server to come back up
- for (int i = 0; i < 15; i++) {
- try {
- getTarget().getProcesses(AdminObject.WILDCARD);
- return;
- } catch (Exception e) {
- //reestablish a connection and retry
- try {
- Thread.sleep(bounceWait);
- } catch (InterruptedException ex) {
- throw new MetaMatrixRuntimeException(ex);
- }
- }
- }
- }
- }
-
- public static final String DEFAULT_APPLICATION_NAME = "Admin"; //$NON-NLS-1$
-
- /**Singleton instance*/
- private static ServerAdminFactory instance = new ServerAdminFactory(SocketServerConnectionFactory.getInstance(), DEFAULT_BOUNCE_WAIT);
-
- private ServerConnectionFactory serverConnectionFactory;
- private int bounceWait;
-
- ServerAdminFactory(ServerConnectionFactory connFactory, int bounceWait) {
- this.serverConnectionFactory = connFactory;
- this.bounceWait = bounceWait;
- }
-
- /**Get the singleton instance*/
- public static ServerAdminFactory getInstance() {
- return instance;
- }
-
-
- /**
- * Creates a ServerAdmin with the specified connection properties.
- * Uses the DEFAULT_APPLICATION_NAME as the application name.
- * @param userName
- * @param password
- * @param serverURL
- * @return
- * @throws LogonException
- * @throws AdminException
- * @throws CommunicationException
- * @throws LogonException
- * @since 4.3
- */
- public Admin createAdmin(String userName,
- char[] password,
- String serverURL) throws AdminException {
-
- return createAdmin(userName, password, serverURL, DEFAULT_APPLICATION_NAME);
-
- }
-
- /**
- * Creates a ServerAdmin with the specified connection properties.
- * @param userName
- * @param password
- * @param serverURL
- * @return
- * @throws LogonException
- * @throws AdminException
- * @throws CommunicationException
- * @throws LogonException
- * @since 4.3
- */
- public Admin createAdmin(String userName,
- char[] password,
- String serverURL,
- String applicationName) throws AdminException {
-
- if (userName == null || userName.trim().length() == 0) {
- throw new IllegalArgumentException(AdminPlugin.Util.getString("ERR.014.001.0099")); //$NON-NLS-1$
- }
-
- final Properties p = new Properties();
- p.setProperty(MMURL.CONNECTION.APP_NAME, applicationName);
- p.setProperty(MMURL.CONNECTION.USER_NAME, userName);
- if (password != null) {
- p.setProperty(MMURL.CONNECTION.PASSWORD, new String(password));
- }
- p.setProperty(MMURL.CONNECTION.SERVER_URL, serverURL);
- return createAdmin(p);
- }
-
- public Admin createAdmin(Properties p) throws AdminException {
- p = PropertiesUtils.clone(p);
- p.remove(MMURL.JDBC.VDB_NAME);
- p.remove(MMURL.JDBC.VDB_VERSION);
- p.setProperty(MMURL.CONNECTION.AUTO_FAILOVER, Boolean.TRUE.toString());
-
- try {
- Admin serverAdmin = (Admin)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { Admin.class }, new ReconnectingProxy(p));
- return serverAdmin;
- } catch (ConnectionException e) {
- throw new AdminComponentException(e.getMessage());
- } catch (CommunicationException e) {
- throw new AdminComponentException(e.getMessage());
- }
- }
-
-}
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/Handshake.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/Handshake.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/Handshake.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,14 +22,17 @@
package com.metamatrix.common.comm.platform.socket;
-import java.io.Serializable;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
import com.metamatrix.common.util.ApplicationInfo;
/**
* Represents the information needed in a socket connection handshake
*/
-public class Handshake implements Serializable {
+public class Handshake implements Externalizable {
private static final long serialVersionUID = 7839271224736355515L;
@@ -63,6 +66,18 @@
public void setPublicKey(byte[] key) {
this.publicKey = key;
}
-
+ @Override
+ public void readExternal(ObjectInput in) throws IOException,
+ ClassNotFoundException {
+ version = (String)in.readObject();
+ publicKey = (byte[])in.readObject();
+ }
+
+ @Override
+ public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeObject(version);
+ out.writeObject(publicKey);
+ }
+
}
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServiceInvocationStruct.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServiceInvocationStruct.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServiceInvocationStruct.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -31,6 +31,7 @@
import java.io.ObjectOutput;
import com.metamatrix.core.util.ArgCheck;
+import com.metamatrix.core.util.ExternalizeUtil;
public final class ServiceInvocationStruct implements Externalizable {
private static final long serialVersionUID = 1207674062670068350L;
@@ -43,7 +44,7 @@
}
public ServiceInvocationStruct(Object[] args, String methodName,
- Class targetClass) {
+ Class<?> targetClass) {
ArgCheck.isNotNull(methodName);
ArgCheck.isNotNull(targetClass);
this.args = args;
@@ -55,12 +56,12 @@
ClassNotFoundException {
this.targetClass = (String)in.readObject();
this.methodName = (String)in.readObject();
- this.args = (Object[])in.readObject();
+ this.args = ExternalizeUtil.readArray(in, Object.class);
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(targetClass);
out.writeObject(methodName);
- out.writeObject(args);
+ ExternalizeUtil.writeArray(out, args);
}
}
\ No newline at end of file
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -110,7 +110,7 @@
} catch (InvalidSessionException e) {
shutdown(false);
} catch (MetaMatrixComponentException e) {
- shutdown();
+ close();
}
this.cancel();
}
@@ -190,7 +190,7 @@
if (e.getCause() instanceof CommunicationException) {
throw (CommunicationException)e.getCause();
}
- throw new CommunicationException(e, CommPlatformPlugin.Util.getString("PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to_MetaMatrix")); //$NON-NLS-1$
+ throw new CommunicationException(e, CommPlatformPlugin.Util.getString("PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to")); //$NON-NLS-1$
}
}
@@ -244,7 +244,7 @@
public <T> T getService(Class<T> iface) {
return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new ServerConnectionInvocationHandler(iface));
}
- public synchronized void shutdown() {
+ public synchronized void close() {
shutdown(true);
}
private synchronized void shutdown(boolean logoff) {
@@ -318,5 +318,4 @@
public void setFailOver(boolean failOver) {
this.failOver = failOver;
}
-
}
\ No newline at end of file
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -179,7 +179,6 @@
}
- @Override
public void initialize(Properties info) {
PropertiesUtils.setBeanProperties(this, info, "org.teiid.sockets"); //$NON-NLS-1$
this.pingTimer = new Timer("SocketPing", true); //$NON-NLS-1$
@@ -237,13 +236,13 @@
/**
* @param connectionProperties will be updated with additional information before logon
*/
- public SocketServerConnection createConnection(Properties connectionProperties) throws CommunicationException, ConnectionException {
+ public SocketServerConnection getConnection(Properties connectionProperties) throws CommunicationException, ConnectionException {
updateConnectionProperties(connectionProperties);
MMURL url = new MMURL(connectionProperties.getProperty(MMURL.CONNECTION.SERVER_URL));
- String discoveryStrategyName = connectionProperties.getProperty(MMURL.CONNECTION.DISCOVERY_STRATEGY, AdminApiServerDiscovery.class.getName());
+ String discoveryStrategyName = connectionProperties.getProperty(MMURL.CONNECTION.DISCOVERY_STRATEGY, URL);
ServerDiscovery discovery;
@@ -288,16 +287,4 @@
this.maxCachedInstances = maxCachedInstances;
}
-
- @Override
- public void shutdown(boolean restart) {
- // only applies in the Embedded scenario.
- }
-
- @Override
- public boolean isAlive() {
- // only applies in the Embedded scenario.
- return false;
- }
-
}
Modified: trunk/client/src/main/java/com/metamatrix/common/xa/MMXid.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/xa/MMXid.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/common/xa/MMXid.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -28,7 +28,7 @@
import javax.transaction.xa.Xid;
/**
- * MetaMatrix implementation of Xid.
+ * Teiid implementation of Xid.
*/
public class MMXid implements Xid, Serializable {
private static final long serialVersionUID = -7078441828703404308L;
@@ -113,7 +113,7 @@
if (toString == null) {
StringBuffer sb = new StringBuffer();
- sb.append("MMXid global:"); //$NON-NLS-1$
+ sb.append("Teiid-Xid global:"); //$NON-NLS-1$
sb.append(getByteArrayString(globalTransactionId));
sb.append(" branch:"); //$NON-NLS-1$
sb.append(getByteArrayString(branchQualifier));
Deleted: trunk/client/src/main/java/com/metamatrix/dqp/client/ClientSideDQP.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/client/ClientSideDQP.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/dqp/client/ClientSideDQP.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,83 +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.List;
-
-import javax.transaction.xa.Xid;
-
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.MetaMatrixProcessingException;
-import com.metamatrix.api.exception.query.QueryMetadataException;
-import com.metamatrix.common.lob.LobChunk;
-import com.metamatrix.common.xa.MMXid;
-import com.metamatrix.common.xa.XATransactionException;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.ResultsMessage;
-
-public interface ClientSideDQP {
-
- ResultsFuture<ResultsMessage> executeRequest(long reqID, RequestMessage message) throws MetaMatrixProcessingException, MetaMatrixComponentException;
-
- ResultsFuture<ResultsMessage> processCursorRequest(long reqID, int batchFirst, int fetchSize) throws MetaMatrixProcessingException;
-
- ResultsFuture<?> closeRequest(long requestID) throws MetaMatrixProcessingException, MetaMatrixComponentException;
-
- void cancelRequest(long requestID) throws MetaMatrixProcessingException, MetaMatrixComponentException;
-
- ResultsFuture<?> closeLobChunkStream(int lobRequestId, long requestId, String streamId) throws MetaMatrixProcessingException, MetaMatrixComponentException;
-
- ResultsFuture<LobChunk> requestNextLobChunk(int lobRequestId, long requestId, String streamId) throws MetaMatrixProcessingException, MetaMatrixComponentException;
-
- List getXmlSchemas(String docName) throws MetaMatrixComponentException, QueryMetadataException;
-
- MetadataResult getMetadata(long requestID) throws MetaMatrixComponentException, MetaMatrixProcessingException;
-
- MetadataResult getMetadata(long requestID, String preparedSql, boolean allowDoubleQuotedVariable) throws MetaMatrixComponentException, MetaMatrixProcessingException;
-
- // local transaction
- void begin() throws XATransactionException;
-
- void commit() throws XATransactionException;
-
- void rollback() throws XATransactionException;
-
- // XA
- int prepare(MMXid xid) throws XATransactionException;
-
- void commit(MMXid xid, boolean onePhase) throws XATransactionException;
-
- void rollback(MMXid xid) throws XATransactionException;
-
- Xid[] recover(int flag) throws XATransactionException;
-
- void forget(MMXid xid) throws XATransactionException;
-
- void start(MMXid xid,
- int flags,
- int timeout) throws XATransactionException;
-
- void end(MMXid xid,
- int flags) throws XATransactionException;
-
-}
Copied: trunk/client/src/main/java/com/metamatrix/dqp/client/ClientSideDQP.java (from rev 1900, branches/JCA/client/src/main/java/com/metamatrix/dqp/client/ClientSideDQP.java)
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/client/ClientSideDQP.java (rev 0)
+++ trunk/client/src/main/java/com/metamatrix/dqp/client/ClientSideDQP.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,85 @@
+/*
+ * 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.List;
+
+import javax.transaction.xa.Xid;
+
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+import com.metamatrix.api.exception.MetaMatrixProcessingException;
+import com.metamatrix.api.exception.query.QueryMetadataException;
+import com.metamatrix.common.lob.LobChunk;
+import com.metamatrix.common.xa.MMXid;
+import com.metamatrix.common.xa.XATransactionException;
+import com.metamatrix.dqp.message.RequestMessage;
+import com.metamatrix.dqp.message.ResultsMessage;
+
+public interface ClientSideDQP {
+
+ ResultsFuture<ResultsMessage> executeRequest(long reqID, RequestMessage message) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+
+ ResultsFuture<ResultsMessage> processCursorRequest(long reqID, int batchFirst, int fetchSize) throws MetaMatrixProcessingException;
+
+ ResultsFuture<?> closeRequest(long requestID) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+
+ boolean cancelRequest(long requestID) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+
+ ResultsFuture<?> closeLobChunkStream(int lobRequestId, long requestId, String streamId) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+
+ ResultsFuture<LobChunk> requestNextLobChunk(int lobRequestId, long requestId, String streamId) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+
+ List<String> getXmlSchemas(String docName) throws MetaMatrixComponentException, QueryMetadataException;
+
+ MetadataResult getMetadata(long requestID) throws MetaMatrixComponentException, MetaMatrixProcessingException;
+
+ MetadataResult getMetadata(long requestID, String preparedSql, boolean allowDoubleQuotedVariable) throws MetaMatrixComponentException, MetaMatrixProcessingException;
+
+ // local transaction
+
+ ResultsFuture<?> begin() throws XATransactionException;
+
+ ResultsFuture<?> commit() throws XATransactionException;
+
+ ResultsFuture<?> rollback() throws XATransactionException;
+
+ // XA
+
+ ResultsFuture<?> start(MMXid xid,
+ int flags,
+ int timeout) throws XATransactionException;
+
+ ResultsFuture<?> end(MMXid xid,
+ int flags) throws XATransactionException;
+
+ ResultsFuture<Integer> prepare(MMXid xid) throws XATransactionException;
+
+ ResultsFuture<?> commit(MMXid xid, boolean onePhase) throws XATransactionException;
+
+ ResultsFuture<?> rollback(MMXid xid) throws XATransactionException;
+
+ ResultsFuture<?> forget(MMXid xid) throws XATransactionException;
+
+ ResultsFuture<Xid[]> recover(int flag) throws XATransactionException;
+
+}
Copied: trunk/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java (from rev 1900, branches/JCA/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java)
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java (rev 0)
+++ trunk/client/src/main/java/com/metamatrix/dqp/client/DQPManagement.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,45 @@
+/*
+ * 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/client/src/main/java/com/metamatrix/dqp/client/MetadataResult.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/client/MetadataResult.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/dqp/client/MetadataResult.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,10 +22,15 @@
package com.metamatrix.dqp.client;
-import java.io.Serializable;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
import java.util.Map;
-public class MetadataResult implements Serializable {
+import com.metamatrix.core.util.ExternalizeUtil;
+
+public class MetadataResult implements Externalizable {
private static final long serialVersionUID = -1520482281079030324L;
private Map[] columnMetadata;
private int parameterCount;
@@ -42,6 +47,17 @@
return parameterCount;
}
+ @Override
+ public void readExternal(ObjectInput in) throws IOException,
+ ClassNotFoundException {
+ columnMetadata = ExternalizeUtil.readArray(in, Map.class);
+ parameterCount = in.readInt();
+ }
+ @Override
+ public void writeExternal(ObjectOutput out) throws IOException {
+ ExternalizeUtil.writeArray(out, columnMetadata);
+ out.writeInt(parameterCount);
+ }
}
Modified: trunk/client/src/main/java/com/metamatrix/dqp/client/ResultsFuture.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/client/ResultsFuture.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/dqp/client/ResultsFuture.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -36,6 +36,12 @@
*/
public class ResultsFuture<T> implements Future<T> {
+ public static ResultsFuture<Void> NULL_FUTURE = new ResultsFuture<Void>();
+
+ static {
+ NULL_FUTURE.getResultsReceiver().receiveResults(null);
+ }
+
public interface CompletionListener<T> {
void onCompletion(ResultsFuture<T> future);
}
Modified: trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -67,7 +67,6 @@
public static final String BOOTURL = "bootURL"; //$NON-NLS-1$
public static final String ENABLE_SOCKETS = "sockets.enabled"; //$NON-NLS-1$
public static final String HOST_ADDRESS = "hostAddress"; //$NON-NLS-1$
- public static final String DQP_BOOTSTRAP_FILE = "bootstrapFile"; //$NON-NLS-1$
public static final String TEIID_HOME = "teiid.home"; //$NON-NLS-1$
public static final String TEIID_LOGDIR = "teiid.logdir"; //$NON-NLS-1$
Deleted: trunk/client/src/main/java/com/metamatrix/dqp/message/RequestID.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/message/RequestID.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/dqp/message/RequestID.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,167 +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.message;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-/**
- * <p>This class represents an identifier for a request. However, there are some
- * differences in what constitutes "uniqueness" for a given RequestID that
- * is based on context (where the id is used). The RequestID has 2 parts:
- * connectionID, and executionIDFor the purposes of the RequestID, the combined
- * representation is "connectionID.executionID" - this implies a scoping
- * for the name parts. The connectionID specifies a particular connection that
- * is making requests. Each connection generates a unique executionID for each
- * request execution, so the executionID is only unique in the context of a
- * connectionID. </p>
- *
- * <p>When this class is used between client and server, the connectionID is implied
- * and thus only the executionID part will be used. The server will qualify the
- * executionID with a connectionID when it reaches the server. </p>
- *
- * <p>RequestIDs are immutable so no setters exist. This allows hashcodes to be
- * pre-computed for faster comparison in equals.</p>
- */
-public class RequestID implements Externalizable {
-
- static final long serialVersionUID = -2888539138291776071L;
-
- public static final String NO_CONNECTION_STR = "C"; //$NON-NLS-1$
- private static final String SEPARATOR = "."; //$NON-NLS-1$
-
- // Basic state
- private String connectionID;
- private long executionID;
-
- // Derived state
- private String combinedID;
- private int hash;
-
- /**
- * Necessary for implementing Externalizable
- */
- public RequestID() {
- }
-
- /**
- * Create a RequestID using all of the ID parts.
- * @param connectionID Identifies a connection, may be null
- * @param executionID Identifies an execution, cannot be null
- */
- public RequestID(String connectionID, long executionID) {
- this.connectionID = connectionID;
- this.executionID = executionID;
-
- createCombinedID();
- computeHashCode();
- }
-
- /**
- * Create a RequestID for an execution where the connection is
- * not specified.
- * @param executionID Identifies an execution, cannot be null
- */
- public RequestID(long executionID) {
- this(null, executionID);
- }
-
-
- /**
- * Return connectionID, may be null if connection has not been specified.
- * @return Connection ID, may be null
- */
- public String getConnectionID() {
- return this.connectionID;
- }
-
- /**
- * Return executionID, which identifies a per-connection execution.
- * @return Execution ID
- */
- public long getExecutionID() {
- return this.executionID;
- }
-
- /**
- * Create a unique combined ID string from the RequestID parts.
- */
- private void createCombinedID() {
- StringBuffer combinedStr = new StringBuffer();
- if(this.connectionID != null) {
- combinedStr.append(this.connectionID);
- } else {
- combinedStr.append(NO_CONNECTION_STR);
- }
- combinedStr.append(SEPARATOR);
- combinedStr.append(this.executionID);
-
- this.combinedID = combinedStr.toString();
- }
-
- private void computeHashCode() {
- this.hash = combinedID.hashCode();
- }
-
- public int hashCode() {
- return this.hash;
- }
-
- public boolean equals(Object obj) {
- if(obj == this) {
- return true;
- } else if(obj == null || !(obj instanceof RequestID) || obj.hashCode() != this.hashCode()) {
- return false;
- } else {
- return this.toString().equals(obj.toString());
- }
- }
-
- /**
- * Return a combined string for the ID.
- */
- public String toString() {
- return this.combinedID;
- }
-
- /**
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- connectionID = (String)in.readObject();
- executionID = in.readLong();
-
- createCombinedID();
- computeHashCode();
- }
-
- /**
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeObject(connectionID);
- out.writeLong(executionID);
- }
-}
Modified: trunk/client/src/main/java/com/metamatrix/dqp/message/RequestMessage.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/message/RequestMessage.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/dqp/message/RequestMessage.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,58 +22,54 @@
package com.metamatrix.dqp.message;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
-import java.util.Date;
import java.util.List;
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.common.comm.CommonCommPlugin;
+import com.metamatrix.core.util.ExternalizeUtil;
import com.metamatrix.jdbc.api.ExecutionProperties;
/**
* Request Message, used by MMXStatement for submitting queries.
*/
-public class RequestMessage implements Serializable {
+public class RequestMessage implements Externalizable {
- static final long serialVersionUID = 2258063872049251854L;
-
public static final int DEFAULT_FETCH_SIZE = 2048;
+
+ public enum StatementType {
+ PREPARED, CALLABLE, STATEMENT
+ }
+
+ public enum ResultsMode {
+ RESULTSET, UPDATECOUNT, EITHER
+ }
private String[] commands;
private boolean isBatchedUpdate;
private int fetchSize = DEFAULT_FETCH_SIZE;
private int cursorType;
private boolean partialResultsFlag;
- private boolean isPreparedStatement;
- private boolean isCallableStatement;
- private boolean isPreparedBatchUpdate;
- private List parameterValues;
+ private StatementType statementType = StatementType.STATEMENT;
+ private List<?> parameterValues;
private boolean validationMode;
private String txnAutoWrapMode;
private String XMLFormat;
private String styleSheet;
- private Boolean requireResultSet;
-
- /**The time when the command was created by the client.*/
- private Date submittedTimestamp;
-
- /**The time when command begins processing on the server.*/
- private Date processingTimestamp;
-
+ private ResultsMode resultsMode = ResultsMode.EITHER;
//whether to use ResultSet cache if there is one
private boolean useResultSetCache;
-
// Treat the double quoted strings as variables in the command
private boolean ansiQuotedIdentifiers = true;
-
- private boolean showPlan = false;
-
+ private boolean showPlan;
private int rowLimit;
-
private Serializable executionPayload;
-
private long executionId;
public RequestMessage() {
@@ -110,34 +106,24 @@
* @return True if this request includes a prepared statement.
*/
public boolean isPreparedStatement() {
- return isPreparedStatement;
+ return this.statementType == StatementType.PREPARED;
}
/**
* @return True if this request includes a callable statement.
*/
public boolean isCallableStatement() {
- return isCallableStatement;
+ return this.statementType == StatementType.CALLABLE;
}
-
- /**
- * @param isPreparedStatement
- */
- public void setPreparedStatement(boolean isPreparedStatement) {
- this.isPreparedStatement = isPreparedStatement;
- }
-
- /**
- * @param isCallableStatement
- */
- public void setCallableStatement(boolean isCallableStatement) {
- this.isCallableStatement = isCallableStatement;
- }
-
- /**
+
+ public void setStatementType(StatementType statementType) {
+ this.statementType = statementType;
+ }
+
+ /**
* @return A list of parameter values. May be null.
*/
- public List getParameterValues() {
+ public List<?> getParameterValues() {
if (parameterValues == null) {
return Collections.EMPTY_LIST;
}
@@ -147,7 +133,7 @@
/**
* @param values
*/
- public void setParameterValues(List values) {
+ public void setParameterValues(List<?> values) {
parameterValues = values;
}
@@ -238,55 +224,6 @@
this.styleSheet = styleSheet;
}
- /**
- * Get time that the time when the command was created by the client.
- * @return timestamp in millis
- */
- public Date getSubmittedTimestamp() {
- return submittedTimestamp;
- }
-
- /**
- * Set time that the time when the command was created by the client.
- * NOTE: By default, this gets set to the current time by the constructor.
- * @param submittedTimestamp Time submitted to server.
- */
- public void setSubmittedTimestamp(Date submittedTimestamp) {
- this.submittedTimestamp = submittedTimestamp;
- }
-
- /**
- * Start the clock on submission start - this should be called when the request is originally created.
- */
- public void markSubmissionStart() {
- setSubmittedTimestamp(new Date());
- }
-
-
- /**
- * Get time that the request was assigned a unique ID by the server.
- * @return timestamp in millis
- */
- public Date getProcessingTimestamp() {
- return processingTimestamp;
- }
-
- /**
- * Set time that the request is submitted on the server.
- * @param processingTimestamp Time submitted to server.
- */
- public void setProcessingTimestamp(Date processingTimestamp) {
- this.processingTimestamp = processingTimestamp;
- }
-
- /**
- * Start the clock on processing times - this should be called when the query
- * hits the QueryService or SubscriptionService.
- */
- public void markProcessingStart() {
- setProcessingTimestamp(new Date());
- }
-
public boolean useResultSetCache() {
//not use caching when there is a txn
return useResultSetCache;
@@ -354,14 +291,6 @@
this.commands = batchedCommands;
}
- public boolean isPreparedBatchUpdate() {
- return isPreparedBatchUpdate;
- }
-
- public void setPreparedBatchUpdate(boolean isPreparedBatchUpdate) {
- this.isPreparedBatchUpdate = isPreparedBatchUpdate;
- }
-
public void setExecutionPayload(Serializable executionPayload) {
this.executionPayload = executionPayload;
}
@@ -377,7 +306,7 @@
public void setExecutionId(long executionId) {
this.executionId = executionId;
}
-
+
public void setBatchedUpdate(boolean isBatchedUpdate) {
this.isBatchedUpdate = isBatchedUpdate;
}
@@ -385,13 +314,58 @@
public boolean isBatchedUpdate() {
return isBatchedUpdate;
}
-
- public Boolean getRequireResultSet() {
- return requireResultSet;
+
+ public ResultsMode getResultsMode() {
+ return resultsMode;
}
- public void setRequireResultSet(Boolean requireResultSet) {
- this.requireResultSet = requireResultSet;
+ public void setResultsMode(ResultsMode resultsMode) {
+ this.resultsMode = resultsMode;
}
+ @Override
+ public void readExternal(ObjectInput in) throws IOException,
+ ClassNotFoundException {
+ this.commands = ExternalizeUtil.readStringArray(in);
+ this.isBatchedUpdate = in.readBoolean();
+ this.fetchSize = in.readInt();
+ this.cursorType = in.readInt();
+ this.partialResultsFlag = in.readBoolean();
+ this.statementType = StatementType.values()[in.readByte()];
+ this.parameterValues = ExternalizeUtil.readList(in);
+ this.validationMode = in.readBoolean();
+ this.txnAutoWrapMode = (String)in.readObject();
+ this.XMLFormat = (String)in.readObject();
+ this.styleSheet = (String)in.readObject();
+ this.resultsMode = ResultsMode.values()[in.readByte()];
+ this.useResultSetCache = in.readBoolean();
+ this.ansiQuotedIdentifiers = in.readBoolean();
+ this.showPlan = in.readBoolean();
+ this.rowLimit = in.readInt();
+ this.executionPayload = (Serializable)in.readObject();
+ this.executionId = in.readLong();
+ }
+
+ @Override
+ public void writeExternal(ObjectOutput out) throws IOException {
+ ExternalizeUtil.writeArray(out, commands);
+ out.writeBoolean(isBatchedUpdate);
+ out.writeInt(fetchSize);
+ out.writeInt(cursorType);
+ out.writeBoolean(partialResultsFlag);
+ out.writeByte(statementType.ordinal());
+ ExternalizeUtil.writeList(out, parameterValues);
+ out.writeBoolean(validationMode);
+ out.writeObject(txnAutoWrapMode);
+ out.writeObject(XMLFormat);
+ out.writeObject(styleSheet);
+ out.writeByte(resultsMode.ordinal());
+ out.writeBoolean(useResultSetCache);
+ out.writeBoolean(ansiQuotedIdentifiers);
+ out.writeBoolean(showPlan);
+ out.writeInt(rowLimit);
+ out.writeObject(executionPayload);
+ out.writeLong(executionId);
+ }
+
}
Modified: trunk/client/src/main/java/com/metamatrix/dqp/message/ResultsMessage.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/message/ResultsMessage.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/dqp/message/ResultsMessage.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -28,7 +28,6 @@
import java.io.ObjectOutput;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -69,12 +68,6 @@
/** The parameters of a Stored Procedure */
private List parameters;
- /** This object represents the time when command is submitted to the server. */
- private Date processingTimestamp;
-
- /** This object represents the time when results are produced on the server. */
- private Date completedTimestamp;
-
/** OPTION DEBUG log if OPTION DEBUG was used */
private String debugLog;
@@ -100,10 +93,6 @@
* @since 4.2
*/
public ResultsMessage(RequestMessage requestMsg){
- if(requestMsg != null){
- this.processingTimestamp = requestMsg.getProcessingTimestamp();
- this.completedTimestamp = new Date();
- }
this.results = new ArrayList[0];
}
@@ -236,13 +225,6 @@
parameters = list;
}
- public Date getProcessingTimestamp() {
- return this.processingTimestamp;
- }
-
- public Date getCompletedTimestamp() {
- return this.completedTimestamp;
- }
/**
* @param strings
*/
@@ -284,8 +266,6 @@
//Parameters
parameters = ExternalizeUtil.readList(in);
- processingTimestamp = (Date)in.readObject();
- completedTimestamp = (Date)in.readObject();
debugLog = (String)in.readObject();
annotations = (Collection)in.readObject();
isUpdateResult = in.readBoolean();
@@ -320,8 +300,6 @@
// Parameters
ExternalizeUtil.writeList(out, parameters);
- out.writeObject(processingTimestamp);
- out.writeObject(completedTimestamp);
out.writeObject(debugLog);
out.writeObject(annotations);
out.writeBoolean(isUpdateResult);
Deleted: trunk/client/src/main/java/com/metamatrix/jdbc/api/ConnectionProperties.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/jdbc/api/ConnectionProperties.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/jdbc/api/ConnectionProperties.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,80 +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.jdbc.api;
-
-import com.metamatrix.common.api.MMURL;
-
-
-/**
- * MetaMatrix-specific connection properties. These connection properties can
- * be set via the java.sql.DriverManager.getConnection(jdbcUrl, connectionProps)
- * method.
- *
- * WARNING: This class does not contain all possible properties.
- */
-public interface ConnectionProperties {
-
- // constant defined for connection properties indicating the value is a Serializable token
- // that may be used in the connector for this client's requests
-
- /**
- * Connection property name for trusted session payload.
- * The <i>optional</i> client token that will be passed directly through to connectors,
- * which may use it and/or pass it down to their underlying data source.
- * <p>
- * The form and type of the client payload object is up to the client but it <i>must</i>
- * implement the <code>Serializable</code> interface. MetaMatrix does nothing with this
- * object except to make it available for authentication/augmentation/replacement upon
- * authentication to the system and to connectors that may require it at the data source
- * level.</p>
- */
- public static final String PROP_CLIENT_SESSION_PAYLOAD = MMURL.CONNECTION.CLIENT_TOKEN_PROP;
-
- /**
- * <p>Data source credential sets. The credentials will be decoded and passed in a
- * CredentialMap object as the session payload. It is an error to use this property
- * in conjunction with {@link #PROP_CLIENT_SESSION_PAYLOAD} as the CredentialMap
- * is used as the payload. If a per-user connection factory is used with the
- * ConnectionPool in the Connector API, the CredentialMap can be used to obtain
- * per-system credentials and use per-user connection pooling. In particular, the
- * MetaMatrix JDBC Connectors have pre-built connection factories that can be
- * used with credentials for this purpose. </p>
- *
- * <p>Credentials take the following basic form: <code>credentials=(system=sys1,user=u1,password=p1/
- * system=sys2,user=u2,password=p2)</code>. Each set of system credentials <b>must</b>
- * contain a system property. The properties "user" and "password" are also well-known
- * property names used by the connection factory although any property name is allowed
- * and may be used by a connector to extract credentials.</>
- *
- * <p>Additionally, the credentials property allows an additional attribute before the
- * credentials list: <code>defaultToLogon</code> as follows: <code>credentials=defaultToLogon</code
- * or <code>credentials=defaultToLogon,(system=sys1,user=u1,password=p2)</code>. When this attribute
- * is used, the user's logon credentials are used as defaults when a connector asks for
- * credentials from the CredentialMap.
- * </p>
- */
- public static final String PROP_CREDENTIALS = MMURL.JDBC.CREDENTIALS;
-
- public static final String DEFAULT_TO_LOGON = "defaultToLogon"; //$NON-NLS-1$
-
-}
Modified: trunk/client/src/main/java/com/metamatrix/platform/security/api/ILogon.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/ILogon.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/ILogon.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -53,5 +53,4 @@
ResultsFuture<?> logoff() throws InvalidSessionException, MetaMatrixComponentException;
void assertIdentity(SessionToken sessionId) throws InvalidSessionException, MetaMatrixComponentException;
-
}
Modified: trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -23,7 +23,6 @@
package com.metamatrix.platform.security.api;
import java.io.Serializable;
-import java.util.Properties;
import java.util.TimeZone;
@@ -38,18 +37,19 @@
private static final long serialVersionUID = 4481443514871448269L;
private TimeZone timeZone = TimeZone.getDefault();
- private final Properties productInfo;
private String clusterName;
private SessionToken sessionToken;
+ private String vdbName;
+ private int vdbVersion;
public LogonResult() {
- this.productInfo = new Properties();
}
- public LogonResult(SessionToken token, Properties productInfo, String clusterName) {
- this.productInfo = productInfo;
+ public LogonResult(SessionToken token, String vdbName, int vdbVersion, String clusterName) {
this.clusterName = clusterName;
this.sessionToken = token;
+ this.vdbName = vdbName;
+ this.vdbVersion = vdbVersion;
}
/**
@@ -57,7 +57,7 @@
* @return
* @since 4.3
*/
- public MetaMatrixSessionID getSessionID() {
+ public long getSessionID() {
return this.sessionToken.getSessionID();
}
@@ -65,9 +65,6 @@
return timeZone;
}
- public String getProductInfo(String key) {
- return this.productInfo.getProperty(key);
- }
public String getUserName() {
return this.sessionToken.getUsername();
@@ -80,5 +77,13 @@
public SessionToken getSessionToken() {
return sessionToken;
}
+
+ public String getVdbName() {
+ return vdbName;
+ }
+
+ public int getVdbVersion() {
+ return vdbVersion;
+ }
}
Deleted: trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionID.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionID.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionID.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.platform.security.api;
-
-import java.io.Serializable;
-
-/**
- * This immutable class represents an identifier for a unique session.
- */
-public final class MetaMatrixSessionID implements
- Serializable {
-
- public final static long serialVersionUID = -7872739911360962975L;
-
- private long id;
-
- public MetaMatrixSessionID(long id) {
- this.id = id;
- }
-
- /**
- * Returns true if the specified object is semantically equal to this instance. Note: this method is consistent with
- * <code>compareTo()</code>.
- *
- * @param obj
- * the object that this instance is to be compared to.
- * @return whether the object is equal to this object.
- */
- public boolean equals(Object obj) {
- // Check if instances are identical ...
- if (this == obj) {
- return true;
- }
-
- // Check if object can be compared to this one
- // (this includes checking for null ) ...
- if (obj instanceof MetaMatrixSessionID) {
- MetaMatrixSessionID that = (MetaMatrixSessionID)obj;
- return this.id == that.id;
- }
-
- // Otherwise not comparable ...
- return false;
- }
-
- /**
- * Returns the hash code value for this object.
- *
- * @return a hash code value for this object.
- */
- public final int hashCode() {
- return (int)id;
- }
-
- /**
- * Returns a string representing the current state of the object.
- *
- * @return the string representation of this instance.
- */
- public final String toString() {
- return String.valueOf(id);
- }
-
-}
-
Modified: trunk/client/src/main/java/com/metamatrix/platform/security/api/SessionToken.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/SessionToken.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/SessionToken.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -33,12 +33,25 @@
* transit if sent to the client. Also it should only be sent to the client
* who creates the session.
*/
-public class SessionToken implements Serializable,
- Cloneable {
+public class SessionToken implements Serializable, Cloneable {
public final static long serialVersionUID = -2853708320435636107L;
+ private static ThreadLocal<SessionToken> CONTEXTS = new ThreadLocal<SessionToken>() {
+ protected SessionToken initialValue() {
+ return null;
+ }
+ };
+
+ public static SessionToken getSession() {
+ return CONTEXTS.get();
+ }
+
+ public static void setSession(SessionToken context) {
+ CONTEXTS.set(context);
+ }
+
/** The session ID */
- private MetaMatrixSessionID sessionID;
+ private long sessionID;
private String userName;
private UUID secret;
@@ -46,7 +59,7 @@
* Fake SessionToken representing a trusted user
*/
public SessionToken() {
- this.sessionID = new MetaMatrixSessionID(-1);
+ this.sessionID = -1L;
this.userName = "trusted"; //$NON-NLS-1$
this.secret = new UUID(1,1);
}
@@ -60,12 +73,12 @@
* @param userName
* (String) the userName for this session
* @throws IllegalArgumentException
- */
- public SessionToken(MetaMatrixSessionID id, String userName) {
+ */
+ public SessionToken(long id, String userName) {
this.sessionID = id;
this.userName = userName;
this.secret = UUID.randomUUID();
- }
+ }
public UUID getSecret() {
return secret;
@@ -76,20 +89,11 @@
*
* @return the session ID
*/
- public MetaMatrixSessionID getSessionID() {
+ public long getSessionID() {
return this.sessionID;
}
/**
- * Returns unique session identifier
- *
- * @return the session ID value
- */
- public String getSessionIDValue() {
- return this.sessionID.toString();
- }
-
- /**
* Get the principal name for this session's user.
*
* @return the user name
@@ -119,7 +123,7 @@
return false;
}
SessionToken that = (SessionToken) obj;
- return (this.sessionID.equals(that.sessionID))
+ return (this.sessionID == that.sessionID)
&& this.userName.equals(that.userName)
&& this.secret.equals(that.secret);
}
@@ -132,14 +136,14 @@
* @see Object#equals(Object)
*/
public int hashCode() {
- return this.sessionID.hashCode();
+ return new Long(this.sessionID).hashCode();
}
/**
* Returns a string representing the current state of the object.
*/
public String toString() {
- return "SessionToken[" + getUsername() + "," + getSessionIDValue() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return "SessionToken[" + getUsername() + "," + this.sessionID + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
/**
Modified: trunk/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,10 +22,359 @@
package org.teiid.adminapi;
-/**
- * Marker interface for all MetaMatrix administration - core.
- *
- * @since 4.3
- */
-public interface Admin extends ConfigurationAdmin, MonitoringAdmin, RuntimeStateAdmin, SecurityAdmin {
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Properties;
+import java.util.Set;
+
+public interface Admin {
+
+ public enum Cache {CODE_TABLE_CACHE,PREPARED_PLAN_CACHE, QUERY_SERVICE_RESULT_SET_CACHE, CONNECTOR_RESULT_SET_CACHE};
+
+ /**
+ * Assign a {@link ConnectorBinding} to a {@link VDB}'s Model
+ *
+ * @param connectorBindingName
+ * Name of the ConnectorBinding
+ * @param vdbName
+ * Name of the VDB
+ * @param vdbVersion
+ * Version of the VDB
+ * @param modelName
+ * Name of the Model to map Connector Binding
+ * @throws AdminException
+ * if there's a system error or if there's a user input error.
+ */
+ void assignBindingToModel(String vdbName,
+ int vdbVersion,
+ String modelName,
+ String connectorBindingName) throws AdminException;
+
+ void assignBindingsToModel(String vdbName,
+ int vdbVersion,
+ String modelName,
+ String[] connectorBindingName) throws AdminException;
+
+ /**
+ * Set/update the property for the Connector Binding identified by the given deployed name.
+ * @param deployedName
+ * @param propertyName
+ * @param propertyValue
+ * @throws AdminException
+ */
+ void setConnectorBindingProperty(String deployedName, String propertyName, String propertyValue) throws AdminException;
+
+ /**
+ * Add Connector Type, will import Connector Type from a file
+ *
+ * @param name of the Connector Type to add
+ * @param URL URL to RAR file
+ * @throws AdminException if there's a system error.
+ */
+ void addConnectorType(String name, URL rarURL) throws AdminException;
+
+ /**
+ * Delete Connector Type from Next Configuration
+ *
+ * @param name String name of the Connector Type to delete
+ * @throws AdminException
+ * if there's a system error.
+ */
+ void deleteConnectorType(String name) throws AdminException;
+
+ /**
+ * Export Connector Type rar file
+ *
+ * @param @param name of the Connector Type
+ * @return InputStream of contents of the rar file
+ * @throws AdminException if there's a system error.
+ */
+ InputStream exportConnectorType(String name) throws AdminException;
+
+ /**
+ * Deploy a {@link ConnectorBinding} to Configuration
+ *
+ * @param deployedName Connector Binding name that will be added to Configuration
+ * @param typeName Connector type name.
+ * @param properties Name & Value pair need to deploy the Connector Binding
+
+ * @throws AdminException if there's a system error.
+ */
+ void addConnectorBinding(String deployedName, String typeName, Properties properties) throws AdminException;
+
+ /**
+ * Delete the {@link ConnectorBinding} from the Configuration
+ *
+ * @param deployedName - deployed name of the connector binding
+ * @throws AdminException if there's a system error.
+ */
+ void deleteConnectorBinding(String deployedName) throws AdminException;
+
+ /**
+ * Export a {@link ConnectorBinding} to character Array in XML format
+ *
+ * @param deployedName the unique identifier for a {@link ConnectorBinding}.
+ * @return character Array in XML format
+ * @throws AdminException
+ * if there's a system error.
+ */
+ InputStream exportConnectorBinding(String deployedName) throws AdminException;
+
+ /**
+ * Deploy a {@link VDB} file.
+ * @param name Name of the VDB file to save under
+ * @param URL VDB file location.
+ * @throws AdminException
+ * if there's a system error.
+ * @return the {@link VDB} representing the current property values and runtime state.
+ */
+ public void deployVDB(String fileName, URL vdbURL) throws AdminException;
+
+
+ /**
+ * Delete the VDB with the given name and version
+ * @param vdbName
+ * @param version
+ * @throws AdminException
+ */
+ void deleteVDB(String vdbName, int vdbVersion) throws AdminException;
+
+ /**
+ * Export VDB to byte array
+ *
+ * @param vdbName identifier of the {@link VDB}
+ * @param vdbVersion {@link VDB} version
+ * @return InputStream of the VDB
+ * @throws AdminException if there's a system error.
+ */
+ InputStream exportVDB(String vdbName, int vdbVersion) throws AdminException;
+
+ /**
+ * Set a process level property.
+ * @param propertyName - name of the property
+ * @param propertyValue - value of the property
+ */
+ void setRuntimeProperty(String propertyName, String propertyValue) throws AdminException;
+
+ /**
+ * Get the Connector Types available in the configuration.
+ *
+ * @return Set of connector types.
+ * @throws AdminException if there's a system error.
+ */
+ Set<String> getConnectorTypes() throws AdminException;
+
+ /**
+ * Get the VDBs that currently deployed in the system
+ *
+ * @return Collection of {@link VDB}s. There could be multiple VDBs with the
+ * same name in the Collection but they will differ by VDB version.
+ * @throws AdminException if there's a system error.
+ */
+ Set<VDB> getVDBs() throws AdminException;
+
+ /**
+ * Get the VDB
+ * @param vdbName
+ * @param vbdVersion
+ * @throws AdminException if there's a system error.
+ * @return
+ */
+ VDB getVDB(String vdbName, int vbdVersion) throws AdminException;
+
+ /**
+ * Get the Connector Bindings that are available in the configuration
+ *
+ * @return Collection of {@link ConnectorBinding}
+ * @throws AdminException if there's a system error.
+ */
+ Collection<ConnectorBinding> getConnectorBindings() throws AdminException;
+
+ /**
+ * Get the connector binding by the given the deployed name.
+ * @param deployedName - name of the deployed connector binding
+ * @return null if not found a connector binding by the given name
+ * @throws AdminException if there's a system error.
+ */
+ ConnectorBinding getConnectorBinding(String deployedName) throws AdminException;
+
+ /**
+ * Get all the Connector Bindings for the given VDB identifier pattern
+ * @param vdbName - Name of the VDB
+ * @param vdbVersion - version of the VDB
+ * @return Collection of {@link ConnectorBinding}
+ * @throws AdminException if there's a system error.
+ */
+ Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, int vdbVersion) throws AdminException;
+
+ /**
+ * Get the Work Manager stats that correspond to the specified identifier pattern.
+ *
+ * @param identifier - an identifier for the queues {@link QueueWorkerPool}. "runtime" will return the stats for Query
+ * runtime Worker Pool. Also any Connector Binding name will return the stats for that connector binding.
+ * @return Collection of {@link QueueWorkerPool}
+ * @throws AdminException if there's a system error.
+ */
+ WorkerPoolStatistics getWorkManagerStats(String identifier) throws AdminException;
+
+
+ /**
+ * Get the Connection Pool Stats that correspond to the specified identifier pattern.
+ * If the {@link ConnectionPoolStatistics ConnectionPool} represents an XA connection, there
+ * will be 2 {@link ConnectionPoolStatistics ConnectionPool}s.
+ *
+ * @param deployedName - an identifier that corresponds to the ConnectorBinding Name
+ * @return {@link ConnectionPoolStatistics}
+ * @throws AdminException if there's a system error.
+ */
+ ConnectionPoolStatistics getConnectorConnectionPoolStats(String deployedName) throws AdminException;
+
+
+ /**
+ * Get the Caches that correspond to the specified identifier pattern
+ * @return Collection of {@link String}
+ * @throws AdminException if there's a system error.
+ */
+ Collection<String> getCacheTypes() throws AdminException;
+
+ /**
+ * Get all the current Sessions.
+ * @return Collection of {@link Session}
+ * @throws AdminException if there's a system error.
+ */
+ Collection<Session> getSessions() throws AdminException;
+
+ /**
+ * Get the all Requests that are currently in process
+ * @return Collection of {@link Request}
+ * @throws AdminException if there's a system error.
+ */
+ Collection<Request> getRequests() throws AdminException;
+
+ /**
+ * Get the Requests for the given session
+ * @return Collection of {@link Request}
+ * @throws AdminException if there's a system error.
+ */
+ Collection<Request> getRequestsForSession(long sessionId) throws AdminException;
+
+
+ /**
+ * Get all of the available Configuration Properties for the specified AdminObject, and details about them.
+ * @param connectorTypeIdentifier
+ * @return
+ * @throws AdminException
+ */
+ Collection<PropertyDefinition> getConnectorTypePropertyDefinitions(String connectorTypeIdentifier) throws AdminException;
+
+
+ /**
+ * Get all transaction matching the identifier.
+ * @return
+ * @throws AdminException
+ */
+ Collection<Transaction> getTransactions() throws AdminException;
+
+ /**
+ * Get the processes that correspond to the specified identifier pattern.
+ *
+ * @param processIdentifier the unique identifier for for a {@link org.teiid.adminapi.ProcessObject ProcessObject}
+ * in the system or "{@link org.teiid.adminapi.AdminObject#WILDCARD WILDCARD}"
+ * if all Processes are desired.
+ * @return Collection of {@link org.teiid.adminapi.ProcessObject ProcessObject}
+ * @throws AdminException if there's a system error.
+ */
+ Collection<ProcessObject> getProcesses(String processIdentifier) throws AdminException;
+
+
+ /**
+ * Start Connector Binding
+ *
+ * @param deployedName
+ * @throws AdminException if there's a system error.
+ */
+ void startConnectorBinding(ConnectorBinding binding) throws AdminException;
+
+ /**
+ * Stop Connector Binding
+ *
+ * @param deployedName identifier for {@link org.teiid.adminapi.ConnectorBinding}
+ */
+ void stopConnectorBinding(ConnectorBinding binding) throws AdminException;
+
+ /**
+ * Clear the cache or caches specified by the cacheIdentifier.
+ * @param cacheType Cache Type
+ * No wild cards currently supported, must be explicit
+ * @throws AdminException if there's a system error.
+ */
+ void clearCache(String cacheType) throws AdminException;
+
+ /**
+ * Terminate the Session
+ *
+ * @param identifier Session Identifier {@link org.teiid.adminapi.Session}.
+ * No wild cards currently supported, must be explicit
+ * @throws AdminException if there's a system error.
+ */
+ void terminateSession(long sessionId) throws AdminException;
+
+ /**
+ * Cancel Request
+ *
+ * @param sessionId session Identifier for the request.
+ * @param requestId request Identifier
+ *
+ * @throws AdminException if there's a system error.
+ */
+ void cancelRequest(long sessionId, long requestId) throws AdminException;
+
+ /**
+ * Mark the given global transaction as rollback only.
+ * @param transactionId
+ * @throws AdminException
+ */
+ void terminateTransaction(String transactionId) throws AdminException;
+
+ /**
+ * Stop the Teiid. If millisToWait is >0, then close to incoming queries, wait the time period
+ * for work to stop, then stop the MM Query. Otherwise, stop immediately, aborting all running queries.
+ * @param millisToWait Milliseconds to wait (if >0) or <=0 for no wait before stopping
+ * @throws AdminException
+ */
+ void shutdown(int millisToWait) throws AdminException;
+
+ /**
+ * Restart System
+ * @throws AdminException if there's a system error.
+ */
+ void restart() throws AdminException;
+
+ /**
+ * Adds JDBC XA Data Source in the container.
+ * @param dsName - name of the source
+ * @param properties - properties
+ * @throws AdminException
+ */
+ void addDataSource(String deploymentName, Properties properties) throws AdminException;
+
+ /**
+ * Delete data source.
+ * @param dsName
+ * @throws AdminException
+ */
+ void deleteDataSource(String deploymentName) throws AdminException;
+
+ /**
+ * Get the property definitions for creating the JDBC data source.
+ * @return
+ * @throws AdminException
+ */
+ Collection<PropertyDefinition> getDataSourcePropertyDefinitions() throws AdminException;
+
+ /**
+ * Closes the admin connection
+ */
+ void close();
}
Copied: trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/AdminFactory.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,243 @@
+/*
+ * 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;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.Properties;
+
+import org.teiid.adminapi.Admin;
+import org.teiid.adminapi.AdminComponentException;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.AdminObject;
+
+import com.metamatrix.admin.AdminPlugin;
+import com.metamatrix.api.exception.security.LogonException;
+import com.metamatrix.client.ExceptionUtil;
+import com.metamatrix.common.api.MMURL;
+import com.metamatrix.common.comm.api.ServerConnection;
+import com.metamatrix.common.comm.api.ServerConnectionFactory;
+import com.metamatrix.common.comm.exception.CommunicationException;
+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.PropertiesUtils;
+import com.metamatrix.core.MetaMatrixRuntimeException;
+
+/**
+ * Singleton factory for ServerAdmins.
+ * @since 4.3
+ */
+public class AdminFactory {
+
+ private static final int DEFAULT_BOUNCE_WAIT = 2000;
+
+ private final class ReconnectingProxy implements InvocationHandler {
+
+ private Admin target;
+ private ServerConnection registry;
+ private Properties p;
+ private boolean closed;
+
+ public ReconnectingProxy(Properties p) throws ConnectionException, CommunicationException {
+ this.p = p;
+ this.registry = serverConnectionFactory.getConnection(p);
+ this.target = registry.getService(Admin.class);
+ }
+
+ private synchronized Admin getTarget() throws AdminComponentException, CommunicationException {
+ if (closed) {
+ throw new AdminComponentException(CommPlatformPlugin.Util.getString("ERR.014.001.0001")); //$NON-NLS-1$
+ }
+ if (target != null && registry.isOpen()) {
+ return target;
+ }
+ try {
+ registry = serverConnectionFactory.getConnection(p);
+ } catch (ConnectionException e) {
+ throw new AdminComponentException(e);
+ }
+ target = registry.getService(Admin.class);
+ return target;
+ }
+
+ //## JDBC4.0-begin ##
+ @Override
+ //## JDBC4.0-end ##
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ if (method.getName().equals("close")) { //$NON-NLS-1$
+ close();
+ return null;
+ }
+ Throwable t = null;
+ for (int i = 0; i < 3; i++) {
+ try {
+ return method.invoke(getTarget(), args);
+ } catch (InvocationTargetException e) {
+ if (ExceptionUtil.getExceptionOfType(e, CommunicationException.class) != null) {
+ // communication exception occurred, lose the old connection and try again.
+ this.target = null;
+ if (method.getName().endsWith("restart")) { //$NON-NLS-1$
+ bounceSystem(true);
+ return null;
+ }
+ continue;
+ }
+ throw e.getTargetException();
+ } catch (CommunicationException e) {
+ t = e;
+ }
+ }
+ throw t;
+ }
+
+ public synchronized void close() {
+ if (closed) {
+ return;
+ }
+ this.closed = true;
+ if (registry != null) {
+ registry.close();
+ }
+ }
+
+ public void bounceSystem(boolean waitUntilDone) {
+ if (!waitUntilDone) {
+ return;
+ }
+ //we'll wait 2 seconds for the server to come up
+ try {
+ Thread.sleep(bounceWait);
+ } catch (InterruptedException e) {
+ throw new MetaMatrixRuntimeException(e);
+ }
+
+ //we'll wait 30 seconds for the server to come back up
+ for (int i = 0; i < 15; i++) {
+ try {
+ getTarget().getProcesses(AdminObject.WILDCARD);
+ return;
+ } catch (Exception e) {
+ //reestablish a connection and retry
+ try {
+ Thread.sleep(bounceWait);
+ } catch (InterruptedException ex) {
+ throw new MetaMatrixRuntimeException(ex);
+ }
+ }
+ }
+ }
+ }
+
+ public static final String DEFAULT_APPLICATION_NAME = "Admin"; //$NON-NLS-1$
+
+ /**Singleton instance*/
+ private static AdminFactory instance = new AdminFactory(SocketServerConnectionFactory.getInstance(), DEFAULT_BOUNCE_WAIT);
+
+ private ServerConnectionFactory serverConnectionFactory;
+ private int bounceWait;
+
+ AdminFactory(ServerConnectionFactory connFactory, int bounceWait) {
+ this.serverConnectionFactory = connFactory;
+ this.bounceWait = bounceWait;
+ }
+
+ /**Get the singleton instance*/
+ public static AdminFactory getInstance() {
+ return instance;
+ }
+
+
+ /**
+ * Creates a ServerAdmin with the specified connection properties.
+ * Uses the DEFAULT_APPLICATION_NAME as the application name.
+ * @param userName
+ * @param password
+ * @param serverURL
+ * @return
+ * @throws LogonException
+ * @throws AdminException
+ * @throws CommunicationException
+ * @throws LogonException
+ * @since 4.3
+ */
+ public Admin createAdmin(String userName,
+ char[] password,
+ String serverURL) throws AdminException {
+
+ return createAdmin(userName, password, serverURL, DEFAULT_APPLICATION_NAME);
+
+ }
+
+ /**
+ * Creates a ServerAdmin with the specified connection properties.
+ * @param userName
+ * @param password
+ * @param serverURL
+ * @return
+ * @throws LogonException
+ * @throws AdminException
+ * @throws CommunicationException
+ * @throws LogonException
+ * @since 4.3
+ */
+ public Admin createAdmin(String userName,
+ char[] password,
+ String serverURL,
+ String applicationName) throws AdminException {
+
+ if (userName == null || userName.trim().length() == 0) {
+ throw new IllegalArgumentException(AdminPlugin.Util.getString("ERR.014.001.0099")); //$NON-NLS-1$
+ }
+
+ final Properties p = new Properties();
+ p.setProperty(MMURL.CONNECTION.APP_NAME, applicationName);
+ p.setProperty(MMURL.CONNECTION.USER_NAME, userName);
+ if (password != null) {
+ p.setProperty(MMURL.CONNECTION.PASSWORD, new String(password));
+ }
+ p.setProperty(MMURL.CONNECTION.SERVER_URL, serverURL);
+ return createAdmin(p);
+ }
+
+ public Admin createAdmin(Properties p) throws AdminException {
+ p = PropertiesUtils.clone(p);
+ p.remove(MMURL.JDBC.VDB_NAME);
+ p.remove(MMURL.JDBC.VDB_VERSION);
+ p.setProperty(MMURL.CONNECTION.AUTO_FAILOVER, Boolean.TRUE.toString());
+ p.setProperty(MMURL.CONNECTION.ADMIN, Boolean.TRUE.toString());
+
+ try {
+ Admin serverAdmin = (Admin)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { Admin.class }, new ReconnectingProxy(p));
+ return serverAdmin;
+ } catch (ConnectionException e) {
+ throw new AdminComponentException(e);
+ } catch (CommunicationException e) {
+ throw new AdminComponentException(e);
+ }
+ }
+
+}
Modified: trunk/client/src/main/java/org/teiid/adminapi/AdminObject.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/AdminObject.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/AdminObject.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,6 +22,7 @@
package org.teiid.adminapi;
+import java.io.Serializable;
import java.util.Properties;
/**
@@ -36,7 +37,7 @@
*
* @since 4.3
*/
-public interface AdminObject {
+public interface AdminObject extends Serializable {
/**
* The character that delimits the atomic components of the identifier.
@@ -76,17 +77,7 @@
*/
public static final String ESCAPED_WILDCARD = "\\" + WILDCARD; //$NON-NLS-1$
-
/**
- * Get the Full Name for this AdminObject. This identifier will uniquely identify this object in the Teiid
- * system.
- *
- * @return String the unique Identifier
- * @since 4.3
- */
- String getIdentifier();
-
- /**
* Get the name for this AdminObject, usually the last component of the identifier.
*
* @return String Name
Modified: trunk/client/src/main/java/org/teiid/adminapi/AdminRoles.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/AdminRoles.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/AdminRoles.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -47,7 +47,7 @@
* @return the <code>Set</code> of <code>String</code> role names.
* @since 4.3
*/
- public static Set getAllRoleNames() {
+ public static Set<String> getAllRoleNames() {
return roleSet;
}
Copied: trunk/client/src/main/java/org/teiid/adminapi/ConnectionPoolStatistics.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/ConnectionPoolStatistics.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/ConnectionPoolStatistics.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/ConnectionPoolStatistics.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,83 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+
+
+/**
+ * This object holds the statistics for a ConnectionPool that is being utilized by a Connector.
+ * As per how many available connections
+ * processed etc.
+ */
+public interface ConnectionPoolStatistics extends AdminObject, Serializable {
+
+ /**
+ * The maximum number of connections that are available
+ * @return
+ */
+ long getAvailableConnectionCount();
+
+ /**
+ * The number of connections that are currently in the pool
+ * @return
+ */
+ int getConnectionCount();
+
+ /**
+ * The number of connections that have been created since the connector was last started
+ * @return
+ */
+ int getConnectionCreatedCount();
+
+ /**
+ * The number of connections that have been destroyed since the connector was last started
+ * @return
+ */
+ int getConnectionDestroyedCount();
+
+
+ /**
+ * The number of connections that are currently in use
+ * @return
+ */
+ long getInUseConnectionCount();
+
+ /**
+ * The most connections that have been simultaneously in use since this connector was started
+ * @return
+ */
+ long getMaxConnectionsInUseCount();
+
+ /**
+ * Max size
+ * @return
+ */
+ int getMaxSize();
+
+ /**
+ * Min Size
+ * @return
+ */
+ int getMinSize();
+}
Modified: trunk/client/src/main/java/org/teiid/adminapi/ConnectorBinding.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/ConnectorBinding.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/ConnectorBinding.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,83 +22,21 @@
package org.teiid.adminapi;
-import java.util.Date;
/**
- * Represents a connector binding (the instance of a connector type) in the MetaMatrix system.
- *
- * <p>The unique identifier pattern is [host]<{@link #DELIMITER}>[process]<{@link #DELIMITER}>[Connector Binding Name]
- * when running against a MetaMatrix server. The [Connector Binding Name] can itself have spaces in the name.
- * In the case of the MM Query, the [host] and [process] do not apply as MM Query is always local.</p>
- *
- * @since 4.3
+ * Represents a connector binding (the instance of a connector type) in the Teiid system.
*/
-public interface ConnectorBinding extends
- AdminObject {
- /**Registered by not initialized*/
- public static final int STATE_NOT_INITIALIZED = 0;
- /**Open and running*/
- public static final int STATE_OPEN = 1;
- /**Registered but closed*/
- public static final int STATE_CLOSED = 2;
- /**Failed after running successfully*/
- public static final int STATE_FAILED = 3;
- /**Failed during initialization*/
- public static final int STATE_INIT_FAILED = 4;
- /**Not registered*/
- public static final int STATE_NOT_REGISTERED = 5;
- /**Running, but the underlying data source is unavailable*/
- public static final int STATE_DATA_SOURCE_UNAVAILABLE = 6;
- /**Running, not deployed*/
- public static final int STATE_NOT_DEPLOYED = 7;
- /** failed to check the status */
- public static final int STATE_FAILED_TO_CHECK = 8;
+public interface ConnectorBinding extends AdminObject {
- /** Password connector property name */
- public static final String PASSWORD = "Password"; //$NON-NLS-1$
-
-
/**
- * Retrieve the current connector state. This will be one of the constants:
- * {@link ConnectorBinding#STATE_OPEN DQP.STATE_OPEN}.
- * {@link ConnectorBinding#STATE_NOT_INITIALIZED DQP.STATE_NOT_INITIALIZED}.
- * {@link ConnectorBinding#STATE_CLOSED DQP.STATE_CLOSED}.
- * {@link ConnectorBinding#STATE_FAILED DQP.STATE_FAILED}.
- * {@link ConnectorBinding#STATE_INIT_FAILED DQP.STATE_INIT_FAILED}.
- * {@link ConnectorBinding#STATE_NOT_REGISTERED DQP.STATE_NOT_REGISTERED}.
- * {@link ConnectorBinding#STATE_DATA_SOURCE_UNAVAILABLE DQP.STATE_DATA_SOURCE_UNAVAILABLE}.
- * {@link ConnectorBinding#STATE_NOT_DEPLOYED DQP.STATE_NOT_DEPLOYED}.
- * @return current connector state.
+ * Get the identifier for this connector binding's RAR file name
+ * @return Name of the RAR file used to create this binding
*/
- int getState();
+ String getRARFileName();
/**
- * Retrieve the current connector state as a printable <code>String</code>.
- * @return current connector state in String form.
+ * Get the JNDI Name of this connector
+ * @return
*/
- String getStateAsString();
-
- /**
- * Returns time of last state change.
- *
- * @return time of last state change.
- * @since 4.3
- */
- Date getStateChangedTime();
-
- /**
- * Returns the description
- *
- * @return description
- */
- String getDescription();
-
- /**
- * Get the identifier for this connector binding's {@link ConnectorType}.
- * @return the Connector Type identifier which can be used to
- * find the ConnectorType.
- * @since 4.3
- */
- String getConnectorTypeName();
-
+ String getJNDIName();
}
Copied: trunk/client/src/main/java/org/teiid/adminapi/Logger.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/Logger.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Logger.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/Logger.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,44 @@
+/*
+ * 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;
+
+
+/**
+ * Custom logging interface that provides a hook for custom implementations to log messages
+ * produced by MM Query.
+ * @since 4.3
+ */
+public interface Logger {
+
+ /**
+ * Logs the given message if the current logging level is >= the logLevel parameter.
+ * @param logLevel logging level for this message
+ * @param timestamp timestamp at which this log message was generated
+ * @param componentName name of the component that generated this message
+ * @param threadName name of the thread that generated this message
+ * @param message message body. May be null.
+ * @param throwable exception thrown. May be null.
+ * @since 4.3
+ */
+ void log(int logLevel, long timestamp, String componentName, String threadName, String message, Throwable throwable);
+}
Modified: trunk/client/src/main/java/org/teiid/adminapi/Model.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Model.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/Model.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -24,62 +24,47 @@
import java.util.List;
+
/**
- * Represents a metadata model in the MetaMatrix system.
+ * Represents a metadata model in the Teiid system.
*
* @since 4.3
*/
public interface Model extends AdminObject {
-
+
+ enum Type {PHYSICAL, VIRTUAL, FUNCTION};
+
/**
- * Return the connector binding names for this Virtual Databse.
- * @return connector bindings bound to this model.
- */
- List getConnectorBindingNames();
-
- /**
- * Determine if this model is a physical type.
+ * Determine if this model is a Source model.
*
- * @return <code>true</code> iff it contains physical group(s).
+ * @return <code>true</code> if it contains physical group(s).
*/
- boolean isPhysical();
+ boolean isSource();
/**
* Determine whether this model is exposed for querying.
*
- * @return <code>true</code> iff the model is visible
+ * @return <code>true</code> if the model is visible
* for querying.
*/
boolean isVisible();
/**
* Retrieve the model type.
- * TODO: one of ...
* @return model type
*/
- String getModelType();
+ Type getModelType();
- /**
- * Retrive the model URI.
- *
- * @return model URI
- */
- String getModelURI();
-
/**
* Determine whether this model can support more than one connector binding.
*
- * @return <code>true</code> iff this model supports multi-source bindings
+ * @return <code>true</code> if this model supports multi-source bindings
*/
- boolean supportsMultiSourceBindings();
+ boolean isSupportsMultiSourceBindings();
- /**
- * Determine whether this model is a Materialization Model
- *
- * @return isMaterialization whether the model is a Materialization Model.
- * @since 4.3
+ /**
+ * Associated Source Names for the Models (Connector Bindings)
+ * @return String
*/
-
- boolean isMaterialization();
-
+ List<String> getSourceNames();
}
\ No newline at end of file
Modified: trunk/client/src/main/java/org/teiid/adminapi/ProcessObject.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/ProcessObject.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/ProcessObject.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -136,5 +136,5 @@
* @return Returns the queueWorkerPool.
* @since 4.3
*/
- public QueueWorkerPool getQueueWorkerPool();
+ public WorkerPoolStatistics getQueueWorkerPool();
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/PropertyDefinition.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/PropertyDefinition.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/PropertyDefinition.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -42,14 +42,7 @@
public static final int UNBOUNDED_VALUE = Integer.MAX_VALUE;
-
/**
- * Get the current value of this property.
- * @return the current value of this property.
- */
- String getValue();
-
- /**
* Get the localized display name of this property.
* @return the displayable name for this property
*/
@@ -62,15 +55,7 @@
String getDescription();
-
/**
- * Get the type for values of this property.
- * @return the type that best describes the values of this property.
- */
- String getPropertyType();
-
-
- /**
* Get the name of the java class that best represents the property type.
* @return the name of the java class that best represents the property type.
*/
@@ -120,7 +105,7 @@
* @return true if this property is to be marked with the expert flag,
* or false otherwise.
*/
- boolean isExpert();
+ boolean isAdvanced();
/**
* The "required" flag is used to identify features that require at least
* one value (possibly a default value) by the consumer of the property. Whether
Modified: trunk/client/src/main/java/org/teiid/adminapi/Request.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Request.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/Request.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,7 +22,6 @@
package org.teiid.adminapi;
-import java.util.Date;
/**
@@ -33,73 +32,50 @@
*
* <p>A request is identified by a numbers separated by '|'. usually in they are arranged
* in the pattern [session]|[request] or [session]|[request]|[source request] </p>
- * @since 4.3
*/
public interface Request extends AdminObject {
+
/**
- * @return Date the request was created
- * @since 4.3
+ * Get the ExecutionId for a Request
+ * @return ExecutionId
*/
- public Date getCreated();
-
- /**
- * Get the RequestID for a Request
- * @return RequestID
- */
- public String getRequestID();
+ public long getExecutionId();
/**
* Get the SessionID for a Request
*
* @return long SessionID
*/
- public String getSessionID();
+ public long getSessionId();
/**
* Get the SQL Command sent to the Server for a Request
*
- * @return MetaMatrix SQL Command
+ * @return SQL Command
*/
- public String getSqlCommand();
+ public String getCommand();
/**
- * Get the Date processing began for the Request
+ * Get when the processing began for this Request
* @return Date processing began
*/
- public Date getProcessingDate();
+ public long getProcessingTime();
/**
* Get the TransactionID of the Request
*
* @return String of TransactionID if in a transaction
*/
- public String getTransactionID();
+ public String getTransactionId();
-
- /**
- * Get the UserName of the Request
- *
- * @return String username for the Request
- */
- public String getUserName();
-
-
/**
- * @return Returns the connectorBindingName.
- * @since 4.3
- */
- public String getConnectorBindingName();
-
- /**
* @return Returns whether this is a Source Request.
- * @since 4.3
*/
- public boolean isSource();
+ public boolean sourceRequest();
/**
* @return In the case that this is a source request this represents the node id. Otherwise blank
- * @since 4.3
*/
- public String getNodeID();
+ public int getNodeId();
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/Session.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Session.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/Session.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,104 +22,24 @@
package org.teiid.adminapi;
-import java.util.Date;
/**
- * A Session is a lasting connection between a client and a MetaMatrix System.
+ * A Session is a lasting connection between a client and a Teiid System.
*
* A user may be allowed to have multiple sessions active simultaneously.
*
- * <p>a Session identifier gets automatically assigned
- * to a connection when user logs into the system</p>
- *
- * @since 4.3
*/
-public interface Session extends
- AdminObject {
+public interface Session extends AdminObject {
-
/**
- * The session is open (active).
- */
- public static final int STATE_ACTIVE = 1;
-
- /**
- * The ejb server has passivated the session - it may become
- *open again in the future
- */
- public static final int STATE_PASSIVATED = 2;
-
- /**
- * The session is closed - this state cannot change once it
- *is reached.
- */
- public static final int STATE_CLOSED = 3;
-
- /**
- * The session has expired - this state cannot change once it
- *is reached.
- */
- public static final int STATE_EXPIRED = 4;
-
- /**
- * The session is terminated - this state cannot change once it
- *is reached.
- */
- public static final int STATE_TERMINATED = 5;
-
- /**
- * The description when the session has expired - this state cannot change once it
- * is reached.
- */
- public static final String EXPIRED_STATE_DESC = "Expired"; //$NON-NLS-1$
-
- /**
- * The description when the session is open (active).
- */
- public static final String ACTIVE_STATE_DESC = "Active";//$NON-NLS-1$
-
- /**
- * The description when the session is closed - this state cannot change once it
- * is reached.
- */
- public static final String CLOSED_STATE_DESC = "Closed";//$NON-NLS-1$
-
- /**
- * The description when the session is terminated - this state cannot change once it
- *is reached.
- */
- public static final String TERMINATED_STATE_DESC = "Terminated";//$NON-NLS-1$
-
- /**
- * The description when the ejb server has passivated the session - it may become
- * open again in the future
- */
- public static final String PASSIVATED_STATE_DESC = "Passivated";//$NON-NLS-1$
-
- /**
- * The description when the state of the session is not known.
- */
- public static final String UNKNOWN_STATE_DESC = "Unknown";//$NON-NLS-1$
-
-
-
-
- /**
* Get the Last time Client has check to see if the server is still available
*
* @return Date of the last ping to the server.
*/
- public Date getLastPingTime();
+ public long getLastPingTime();
/**
- * Get the Session State as a String.
- *
- * @return SessionState
- */
- public String getStateAsString();
-
- /**
* Get the Application Name
*
* @return String of the Application Name
@@ -127,21 +47,14 @@
public String getApplicationName();
/**
- * Get the unique MetaMatrix session
- * within a given MetaMatrix System
+ * Get the unique Teiid session
+ * within a given Teiid System
*
* @return String of the Session ID
*/
- public String getSessionID();
+ public long getSessionId();
/**
- * Get the State of the Session
- *
- * @return int of the Session's state
- */
- public int getState();
-
- /**
* Get User Name for this Session
*
* @return String of UserName
@@ -160,7 +73,7 @@
*
* @return String name/number of the VDB Version
*/
- public String getVDBVersion();
+ public int getVDBVersion();
/**
* Get the IPAddress for this Session
@@ -174,13 +87,19 @@
* accessing from
* @return
*/
- public String getHostName() ;
+ public String getClientHostName();
/**
* Get the time the {@link Session} was created.
* @return
*/
- public Date getCreatedDate();
+ public long getCreatedTime();
+
+ /**
+ * Security Domain user logged into currently
+ * @return
+ */
+ public String getSecurityDomain();
}
\ No newline at end of file
Copied: trunk/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,60 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+
+
+public abstract class TeiidAdmin implements Admin, Serializable {
+
+ @Override
+ public void assignBindingToModel(String vdbName, int vdbVersion, String modelName, String connectorBindingName)
+ throws AdminException {
+ // rameshTODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public Collection<ProcessObject> getProcesses(String processIdentifier) throws AdminException {
+ ArrayList<ProcessObject> list = new ArrayList<ProcessObject>();
+ //list.add(manager.getProcess());
+ return list;
+ }
+
+ @Override
+ public void restart() throws AdminException {
+ // rameshTODO Auto-generated method stub
+ }
+
+ @Override
+ public void shutdown(int millisToWait) throws AdminException {
+ // rameshTODO Auto-generated method stub
+ }
+
+ @Override
+ public void setRuntimeProperty(String propertyName, String propertyValue) throws AdminException {
+ // rameshTODO Auto-generated method stub
+ }
+}
Modified: trunk/client/src/main/java/org/teiid/adminapi/Transaction.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Transaction.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/Transaction.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,10 +22,7 @@
package org.teiid.adminapi;
-import java.util.Date;
-import javax.transaction.xa.Xid;
-
public interface Transaction extends AdminObject {
/**
@@ -33,7 +30,7 @@
* May be null for an unassociated Global transaction.
* @return
*/
- String getAssociatedSession();
+ long getAssociatedSession();
/**
* Get the scope for the transaction. Will be one of GLOBAL, LOCAL, or REQUEST
@@ -45,19 +42,13 @@
* Return the Xid of the Global transaction. Will be null for non-Global transactions.
* @return
*/
- Xid getXid();
+ String getXid();
- /**
- * Get the current status. See {@link javax.transaction.Status} for
- * possible values.
- * @return
- */
- String getStatus();
/**
* Get the date the transaction was created.
* @return
*/
- Date getCreated();
+ long getCreatedTime();
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/VDB.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/VDB.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/java/org/teiid/adminapi/VDB.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -22,13 +22,11 @@
package org.teiid.adminapi;
-import java.util.Collection;
-import java.util.Date;
+import java.util.Collection;
+import java.util.List;
-import com.metamatrix.core.vdb.VDBStatus;
-
/**
- * Represents a Virtual Database in the MetaMatrix system.
+ * Represents a Virtual Database in the Teiid System.
* <br>A VDB has a name and a version.</br>
*
* <p>The identifier pattern for a VDB is <CODE>"name<{@link #DELIMITER_CHAR}>version"</CODE>,
@@ -41,8 +39,7 @@
*
* @since 4.3
*/
-public interface VDB extends
- AdminObject {
+public interface VDB extends AdminObject {
/**
* Constant to denote the latest version of a VDB located
@@ -50,81 +47,46 @@
* VDB to the MetaMatrix Server from the server repository.
*/
public static final String SERVER_REPOSITORY_LATEST_VERSION = "LATEST"; //$NON-NLS-1$
-
- /**
- * Incomplete (if import does not have all the connector bindings)
- *
- * @since 4.3
- */
- public static final int INCOMPLETE = VDBStatus.INCOMPLETE;
- /**
- * Inactive VDB (can edit connector binding)
- *
- * @since 4.3
- */
- public static final int INACTIVE = VDBStatus.INACTIVE;
- /**
- * Active VDB
- *
- * @since 4.3
- */
- public static final int ACTIVE = VDBStatus.ACTIVE;
- /**
- * Mark VDB for Deletion
- *
- * @since 4.3
- */
- public static final int DELETED = VDBStatus.DELETED;
- /**
- * Active Default
- *
- * @since 5.5.3
- */
- public static final int ACTIVE_DEFAULT = VDBStatus.ACTIVE_DEFAULT;
+
+ public static enum Status{INCOMPLETE, INACTIVE, ACTIVE, DELETED, ACTIVE_DEFAULT};
- /**
- * @return date the VDB was versioned
- */
- public Date getVersionedDate();
/**
- * @return user that versioned the VDB
- */
- public String getVersionedBy();
-
- /**
* @return Collection of MMModels
*/
- public Collection getModels();
-
+ public Collection<? extends Model> getModels();
+
/**
* @return the status
*/
- public int getState();
+ public Status getStatus();
/**
- * @return the status
- */
- public String getStateAsString();
-
- /**
* @return the VDB version
*/
- public String getVDBVersion();
-
- /**
- * Check to see if this VDB has any Materialized Models
- *
- * @return true or false
- * @since 4.3
- */
- public boolean hasMaterializedViews();
-
- /**
- * Check to see if this VDB contains a WSDL.
- * @return true if it contains a WSDL.
- * @since 5.5.3
- */
- public boolean hasWSDL();
-
+ public int getVersion();
+
+ /**
+ * Get the URL for the VDB
+ * @return
+ */
+ public String getUrl();
+
+ /**
+ * Get the description of the VDB
+ * @return
+ */
+ public String getDescription();
+
+ /**
+ * Shows any validity errors present in the VDB
+ * @return
+ */
+ public List<String> getValidityErrors();
+
+ /**
+ * Shows if VDB is a valid entity
+ * @return
+ */
+ public boolean isValid();
}
Copied: trunk/client/src/main/java/org/teiid/adminapi/WorkerPoolStatistics.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/WorkerPoolStatistics.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/WorkerPoolStatistics.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/WorkerPoolStatistics.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,73 @@
+/*
+ * 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;
+
+public interface WorkerPoolStatistics extends AdminObject {
+
+ /**
+ * Current active thread count
+ * @return
+ */
+ public int getActiveThreads();
+
+ /**
+ * Highest Active threads recorded so far
+ * @return
+ */
+ public int getHighestActiveThreads();
+
+
+ /**
+ * Queue Name
+ * @return
+ */
+ public String getQueueName();
+
+
+ /**
+ * Max number of active threads allowed
+ * @return
+ */
+ public int getMaxThreads();
+
+ /**
+ * @return Returns the number of requests queued.
+ * @since 4.3
+ */
+ public int getQueued();
+
+ /**
+ * @return The number of completed tasks
+ */
+ long getTotalCompleted();
+
+
+ /**
+ * @return The number of submitted tasks
+ */
+ long getTotalSubmitted();
+
+ /**
+ * @return Returns the highest queue size
+ */
+ public int getHighestQueued();
+}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl)
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -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 org.teiid.adminapi.impl;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-
-import org.teiid.adminapi.AdminObject;
-
- at XmlAccessorType(XmlAccessType.NONE)
-public abstract class AdminObjectImpl implements AdminObject, Serializable {
-
- private static final long serialVersionUID = -6381303538713462682L;
-
- private String name;
-
- private ListOverMap<PropertyMetadata> properties = new ListOverMap<PropertyMetadata>(new KeyBuilder<PropertyMetadata>() {
- @Override
- public String getKey(PropertyMetadata entry) {
- return entry.getName();
- }
- });
-
- private transient Map<String, Object> attachments = Collections.synchronizedMap(new HashMap<String, Object>());
-
- @Override
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public Properties getProperties() {
- Properties props = new Properties();
- for (PropertyMetadata p:this.properties.getMap().values()) {
- props.setProperty(p.getName(), p.getValue());
- }
- return props;
- }
-
- public void setProperties(Properties props) {
- this.properties.clear();
- for (String key:props.stringPropertyNames()) {
- addProperty(key, props.getProperty(key));
- }
- }
-
- protected List<PropertyMetadata> getJAXBProperties(){
- return properties;
- }
-
- @Override
- public String getPropertyValue(String name) {
- return this.properties.getMap().get(name).getValue();
- }
-
- public void addProperty(String key, String value) {
- this.properties.getMap().put(key, new PropertyMetadata(key, value));
- }
-
- /**
- * Add attachment
- *
- * @param <T> the expected type
- * @param attachment the attachment
- * @param type the type
- * @return any previous attachment
- * @throws IllegalArgumentException for a null name, attachment or type
- * @throws UnsupportedOperationException when not supported by the implementation
- */
- public <T> T addAttchment(Class<T> type, T attachment) {
- if (type == null)
- throw new IllegalArgumentException("Null type");
- Object result = this.attachments.put(type.getName(), attachment);
- if (result == null)
- return null;
- return type.cast(result);
-
- }
-
- public Object addAttchment(String key, Object attachment) {
- if (key == null)
- throw new IllegalArgumentException("Null type");
- Object result = this.attachments.put(key, attachment);
- if (result == null)
- return null;
- return result;
- }
-
- /**
- * Remove attachment
- *
- * @param <T> the expected type
- * @return the attachment or null if not present
- * @param type the type
- * @throws IllegalArgumentException for a null name or type
- */
- public <T> T removeAttachment(Class<T> type) {
- if (type == null)
- throw new IllegalArgumentException("Null type");
- Object result = this.attachments.remove(type.getName());
- if (result == null)
- return null;
- return type.cast(result);
- }
-
- public Object removeAttachment(String key) {
- if (key == null)
- throw new IllegalArgumentException("Null type");
- Object result = this.attachments.remove(key);
- if (result == null)
- return null;
- return result;
- }
- /**
- * Get attachment
- *
- * @param <T> the expected type
- * @param type the type
- * @return the attachment or null if not present
- * @throws IllegalArgumentException for a null name or type
- */
- public <T> T getAttachment(Class<T> type) {
- if (type == null)
- throw new IllegalArgumentException("Null type");
- Object result = this.attachments.get(type.getName());
- if (result == null)
- return null;
- return type.cast(result);
- }
-
- public Object getAttachment(String key) {
- if (key == null)
- throw new IllegalArgumentException("Null type");
- Object result = this.attachments.get(key);
- if (result == null)
- return null;
- return result;
- }
-
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,170 @@
+/*
+ * 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.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+import org.teiid.adminapi.AdminObject;
+
+ at XmlAccessorType(XmlAccessType.NONE)
+public abstract class AdminObjectImpl implements AdminObject, Serializable {
+
+ private static final long serialVersionUID = -6381303538713462682L;
+
+ private String name;
+
+ private ListOverMap<PropertyMetadata> properties = new ListOverMap<PropertyMetadata>(new KeyBuilder<PropertyMetadata>() {
+ @Override
+ public String getKey(PropertyMetadata entry) {
+ return entry.getName();
+ }
+ });
+
+ private transient Map<String, Object> attachments = Collections.synchronizedMap(new HashMap<String, Object>());
+
+ @Override
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public Properties getProperties() {
+ Properties props = new Properties();
+ for (PropertyMetadata p:this.properties.getMap().values()) {
+ props.setProperty(p.getName(), p.getValue());
+ }
+ return props;
+ }
+
+ public void setProperties(Properties props) {
+ this.properties.clear();
+ for (String key:props.stringPropertyNames()) {
+ addProperty(key, props.getProperty(key));
+ }
+ }
+
+ protected List<PropertyMetadata> getJAXBProperties(){
+ return properties;
+ }
+
+ @Override
+ public String getPropertyValue(String name) {
+ return this.properties.getMap().get(name).getValue();
+ }
+
+ public void addProperty(String key, String value) {
+ this.properties.getMap().put(key, new PropertyMetadata(key, value));
+ }
+
+ /**
+ * Add attachment
+ *
+ * @param <T> the expected type
+ * @param attachment the attachment
+ * @param type the type
+ * @return any previous attachment
+ * @throws IllegalArgumentException for a null name, attachment or type
+ * @throws UnsupportedOperationException when not supported by the implementation
+ */
+ public <T> T addAttchment(Class<T> type, T attachment) {
+ if (type == null)
+ throw new IllegalArgumentException("Null type");
+ Object result = this.attachments.put(type.getName(), attachment);
+ if (result == null)
+ return null;
+ return type.cast(result);
+
+ }
+
+ public Object addAttchment(String key, Object attachment) {
+ if (key == null)
+ throw new IllegalArgumentException("Null type");
+ Object result = this.attachments.put(key, attachment);
+ if (result == null)
+ return null;
+ return result;
+ }
+
+ /**
+ * Remove attachment
+ *
+ * @param <T> the expected type
+ * @return the attachment or null if not present
+ * @param type the type
+ * @throws IllegalArgumentException for a null name or type
+ */
+ public <T> T removeAttachment(Class<T> type) {
+ if (type == null)
+ throw new IllegalArgumentException("Null type");
+ Object result = this.attachments.remove(type.getName());
+ if (result == null)
+ return null;
+ return type.cast(result);
+ }
+
+ public Object removeAttachment(String key) {
+ if (key == null)
+ throw new IllegalArgumentException("Null type");
+ Object result = this.attachments.remove(key);
+ if (result == null)
+ return null;
+ return result;
+ }
+ /**
+ * Get attachment
+ *
+ * @param <T> the expected type
+ * @param type the type
+ * @return the attachment or null if not present
+ * @throws IllegalArgumentException for a null name or type
+ */
+ public <T> T getAttachment(Class<T> type) {
+ if (type == null)
+ throw new IllegalArgumentException("Null type");
+ Object result = this.attachments.get(type.getName());
+ if (result == null)
+ return null;
+ return type.cast(result);
+ }
+
+ public Object getAttachment(String key) {
+ if (key == null)
+ throw new IllegalArgumentException("Null type");
+ Object result = this.attachments.get(key);
+ if (result == null)
+ return null;
+ return result;
+ }
+
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionPoolStatisticsMetadata.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ConnectionPoolStatisticsMetadata.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionPoolStatisticsMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,133 +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 org.teiid.adminapi.impl;
-
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.teiid.adminapi.ConnectionPoolStatistics;
-
-public class ConnectionPoolStatisticsMetadata extends AdminObjectImpl implements ConnectionPoolStatistics {
-
- private static final long serialVersionUID = 4420845831075045579L;
- private long availableConnectionCount;
- private int connectionCount;
- private int connectionCreatedCount;
- private int connectionDestroyedCount;
- private long inUseConnectionCount;
- private long maxConnectionsInUseCount;
- private int maxSize;
- private int minSize;
-
-
- @Override
- @ManagementProperty(description="The maximum number of connections that are available", readOnly=true)
- public long getAvailableConnectionCount() {
- return availableConnectionCount;
- }
-
- @Override
- @ManagementProperty(description="The number of connections that are currently in the pool", readOnly=true)
- public int getConnectionCount() {
- return connectionCount;
- }
-
- @Override
- @ManagementProperty(description="The number of connections that have been created since the connector was last started", readOnly=true)
- public int getConnectionCreatedCount() {
- return connectionCreatedCount;
- }
-
- @Override
- @ManagementProperty(description="The number of connections that have been destroyed since the connector was last started", readOnly=true)
- public int getConnectionDestroyedCount() {
- return connectionDestroyedCount;
- }
-
- @Override
- @ManagementProperty(description="The number of connections that are currently in use", readOnly=true)
- public long getInUseConnectionCount() {
- return inUseConnectionCount;
- }
-
- @Override
- @ManagementProperty(description="The most connections that have been simultaneously in use since this connector was started", readOnly=true)
- public long getMaxConnectionsInUseCount() {
- return maxConnectionsInUseCount;
- }
-
- @Override
- @ManagementProperty(description="Max configured size", readOnly=true)
- public int getMaxSize() {
- return maxSize;
- }
-
- @Override
- @ManagementProperty(description="Min Configured Size", readOnly=true)
- public int getMinSize() {
- return minSize;
- }
-
- public void setMaxSize(int maxSize) {
- this.maxSize = maxSize;
- }
-
- public void setAvailableConnectionCount(long availableConnectionCount) {
- this.availableConnectionCount = availableConnectionCount;
- }
-
- public void setConnectionCount(int connectionCount) {
- this.connectionCount = connectionCount;
- }
-
- public void setConnectionCreatedCount(int connectionCreatedCount) {
- this.connectionCreatedCount = connectionCreatedCount;
- }
-
- public void setConnectionDestroyedCount(int connectionDestroyedCount) {
- this.connectionDestroyedCount = connectionDestroyedCount;
- }
-
- public void setInUseConnectionCount(long inUseConnectionCount) {
- this.inUseConnectionCount = inUseConnectionCount;
- }
-
- public void setMaxConnectionsInUseCount(long maxConnectionsInUseCount) {
- this.maxConnectionsInUseCount = maxConnectionsInUseCount;
- }
-
- public void setMinSize(int minSize) {
- this.minSize = minSize;
- }
-
- public String toString() {
- StringBuilder str = new StringBuilder();
- str.append("ConnectionPoolStatisticsMetadata:"); //$NON-NLS-1$
- str.append(" availableConnectionCount = " + availableConnectionCount); //$NON-NLS-1$
- str.append("; connectionCount = " + connectionCount); //$NON-NLS-1$
- str.append("; connectionCreatedCount = " + connectionCreatedCount); //$NON-NLS-1$
- str.append("; connectionDestroyedCount = " + connectionDestroyedCount); //$NON-NLS-1$
- str.append("; inUseConnectionCount = " + inUseConnectionCount); //$NON-NLS-1$
- str.append("; maxConnectionsInUseCount = " + maxConnectionsInUseCount); //$NON-NLS-1$
- str.append("; maxSize = " + maxSize); //$NON-NLS-1$
- str.append("; minSize = " + minSize); //$NON-NLS-1$
- return str.toString();
- }
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionPoolStatisticsMetadata.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ConnectionPoolStatisticsMetadata.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionPoolStatisticsMetadata.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionPoolStatisticsMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,133 @@
+/*
+ * 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 org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.adminapi.ConnectionPoolStatistics;
+
+public class ConnectionPoolStatisticsMetadata extends AdminObjectImpl implements ConnectionPoolStatistics {
+
+ private static final long serialVersionUID = 4420845831075045579L;
+ private long availableConnectionCount;
+ private int connectionCount;
+ private int connectionCreatedCount;
+ private int connectionDestroyedCount;
+ private long inUseConnectionCount;
+ private long maxConnectionsInUseCount;
+ private int maxSize;
+ private int minSize;
+
+
+ @Override
+ @ManagementProperty(description="The maximum number of connections that are available", readOnly=true)
+ public long getAvailableConnectionCount() {
+ return availableConnectionCount;
+ }
+
+ @Override
+ @ManagementProperty(description="The number of connections that are currently in the pool", readOnly=true)
+ public int getConnectionCount() {
+ return connectionCount;
+ }
+
+ @Override
+ @ManagementProperty(description="The number of connections that have been created since the connector was last started", readOnly=true)
+ public int getConnectionCreatedCount() {
+ return connectionCreatedCount;
+ }
+
+ @Override
+ @ManagementProperty(description="The number of connections that have been destroyed since the connector was last started", readOnly=true)
+ public int getConnectionDestroyedCount() {
+ return connectionDestroyedCount;
+ }
+
+ @Override
+ @ManagementProperty(description="The number of connections that are currently in use", readOnly=true)
+ public long getInUseConnectionCount() {
+ return inUseConnectionCount;
+ }
+
+ @Override
+ @ManagementProperty(description="The most connections that have been simultaneously in use since this connector was started", readOnly=true)
+ public long getMaxConnectionsInUseCount() {
+ return maxConnectionsInUseCount;
+ }
+
+ @Override
+ @ManagementProperty(description="Max configured size", readOnly=true)
+ public int getMaxSize() {
+ return maxSize;
+ }
+
+ @Override
+ @ManagementProperty(description="Min Configured Size", readOnly=true)
+ public int getMinSize() {
+ return minSize;
+ }
+
+ public void setMaxSize(int maxSize) {
+ this.maxSize = maxSize;
+ }
+
+ public void setAvailableConnectionCount(long availableConnectionCount) {
+ this.availableConnectionCount = availableConnectionCount;
+ }
+
+ public void setConnectionCount(int connectionCount) {
+ this.connectionCount = connectionCount;
+ }
+
+ public void setConnectionCreatedCount(int connectionCreatedCount) {
+ this.connectionCreatedCount = connectionCreatedCount;
+ }
+
+ public void setConnectionDestroyedCount(int connectionDestroyedCount) {
+ this.connectionDestroyedCount = connectionDestroyedCount;
+ }
+
+ public void setInUseConnectionCount(long inUseConnectionCount) {
+ this.inUseConnectionCount = inUseConnectionCount;
+ }
+
+ public void setMaxConnectionsInUseCount(long maxConnectionsInUseCount) {
+ this.maxConnectionsInUseCount = maxConnectionsInUseCount;
+ }
+
+ public void setMinSize(int minSize) {
+ this.minSize = minSize;
+ }
+
+ public String toString() {
+ StringBuilder str = new StringBuilder();
+ str.append("ConnectionPoolStatisticsMetadata:"); //$NON-NLS-1$
+ str.append(" availableConnectionCount = " + availableConnectionCount); //$NON-NLS-1$
+ str.append("; connectionCount = " + connectionCount); //$NON-NLS-1$
+ str.append("; connectionCreatedCount = " + connectionCreatedCount); //$NON-NLS-1$
+ str.append("; connectionDestroyedCount = " + connectionDestroyedCount); //$NON-NLS-1$
+ str.append("; inUseConnectionCount = " + inUseConnectionCount); //$NON-NLS-1$
+ str.append("; maxConnectionsInUseCount = " + maxConnectionsInUseCount); //$NON-NLS-1$
+ str.append("; maxSize = " + maxSize); //$NON-NLS-1$
+ str.append("; minSize = " + minSize); //$NON-NLS-1$
+ return str.toString();
+ }
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,65 +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 org.teiid.adminapi.impl;
-
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.teiid.adminapi.ConnectorBinding;
-
- at ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="connector"))
-public class ConnectorBindingMetaData extends AdminObjectImpl implements ConnectorBinding {
-
- private static final long serialVersionUID = -4865836616882247016L;
- private transient Object type;
-
- @ManagementProperty(description="Connector Binding Name", readOnly=true)
- @ManagementObjectID(type="binding")
- public String getName() {
- return super.getName();
- }
-
- @Override
- @ManagementProperty(description="RAR file name", readOnly=true)
- public String getRARFileName() {
- return getPropertyValue("rar-name");
- }
-
- @Override
- @ManagementProperty(description="JNDI name", readOnly=true)
- public String getJNDIName() {
- return getPropertyValue("jndi-name");
- }
-
- public void setComponentType(Object type) {
- this.type = type;
- }
-
- public Object getComponentType() {
- return this.type;
- }
-
- public String toString() {
- return getName();
- }
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,65 @@
+/*
+ * 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 org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.adminapi.ConnectorBinding;
+
+ at ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="connector"))
+public class ConnectorBindingMetaData extends AdminObjectImpl implements ConnectorBinding {
+
+ private static final long serialVersionUID = -4865836616882247016L;
+ private transient Object type;
+
+ @ManagementProperty(description="Connector Binding Name", readOnly=true)
+ @ManagementObjectID(type="binding")
+ public String getName() {
+ return super.getName();
+ }
+
+ @Override
+ @ManagementProperty(description="RAR file name", readOnly=true)
+ public String getRARFileName() {
+ return getPropertyValue("rar-name");
+ }
+
+ @Override
+ @ManagementProperty(description="JNDI name", readOnly=true)
+ public String getJNDIName() {
+ return getPropertyValue("jndi-name");
+ }
+
+ public void setComponentType(Object type) {
+ this.type = type;
+ }
+
+ public Object getComponentType() {
+ return this.type;
+ }
+
+ public String toString() {
+ return getName();
+ }
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/DataRoleMetadata.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/DataRoleMetadata.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/DataRoleMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,137 +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 org.teiid.adminapi.impl;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.managed.api.annotation.ManagementObject;
-
-
-/**
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * <element name="resource-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * <element name="allow-create" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- * <element name="allow-read" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- * <element name="allow-update" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- * <element name="allow-delete" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- * </sequence>
- * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- */
- at XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(name = "", propOrder = {
- "description",
- "resourceName",
- "allowCreate",
- "allowRead",
- "allowUpdate",
- "allowDelete"
-})
- at ManagementObject
-public class DataRoleMetadata implements Serializable {
-
- @XmlAttribute(name = "name", required = true)
- protected String name;
- @XmlElement(name = "description")
- protected String description;
- @XmlElement(name = "resource-name", required = true)
- protected String resourceName;
- @XmlElement(name = "allow-create")
- protected Boolean allowCreate;
- @XmlElement(name = "allow-read")
- protected Boolean allowRead;
- @XmlElement(name = "allow-update")
- protected Boolean allowUpdate;
- @XmlElement(name = "allow-delete")
- protected Boolean allowDelete;
-
- public String getName() {
- return name;
- }
-
- public void setName(String value) {
- this.name = value;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String value) {
- this.description = value;
- }
-
- public String getResourceName() {
- return resourceName;
- }
-
- public void setResourceName(String value) {
- this.resourceName = value;
- }
-
- public Boolean isAllowCreate() {
- return allowCreate;
- }
-
- public void setAllowCreate(Boolean value) {
- this.allowCreate = value;
- }
-
- public Boolean isAllowRead() {
- return allowRead;
- }
-
- public void setAllowRead(Boolean value) {
- this.allowRead = value;
- }
-
- public Boolean isAllowUpdate() {
- return allowUpdate;
- }
-
- public void setAllowUpdate(Boolean value) {
- this.allowUpdate = value;
- }
-
- public Boolean isAllowDelete() {
- return allowDelete;
- }
-
- public void setAllowDelete(Boolean value) {
- this.allowDelete = value;
- }
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/DataRoleMetadata.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/DataRoleMetadata.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/DataRoleMetadata.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/DataRoleMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,137 @@
+/*
+ * 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.io.Serializable;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.managed.api.annotation.ManagementObject;
+
+
+/**
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="resource-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="allow-create" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ * <element name="allow-read" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ * <element name="allow-update" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ * <element name="allow-delete" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "", propOrder = {
+ "description",
+ "resourceName",
+ "allowCreate",
+ "allowRead",
+ "allowUpdate",
+ "allowDelete"
+})
+ at ManagementObject
+public class DataRoleMetadata implements Serializable {
+
+ @XmlAttribute(name = "name", required = true)
+ protected String name;
+ @XmlElement(name = "description")
+ protected String description;
+ @XmlElement(name = "resource-name", required = true)
+ protected String resourceName;
+ @XmlElement(name = "allow-create")
+ protected Boolean allowCreate;
+ @XmlElement(name = "allow-read")
+ protected Boolean allowRead;
+ @XmlElement(name = "allow-update")
+ protected Boolean allowUpdate;
+ @XmlElement(name = "allow-delete")
+ protected Boolean allowDelete;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String value) {
+ this.description = value;
+ }
+
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ public void setResourceName(String value) {
+ this.resourceName = value;
+ }
+
+ public Boolean isAllowCreate() {
+ return allowCreate;
+ }
+
+ public void setAllowCreate(Boolean value) {
+ this.allowCreate = value;
+ }
+
+ public Boolean isAllowRead() {
+ return allowRead;
+ }
+
+ public void setAllowRead(Boolean value) {
+ this.allowRead = value;
+ }
+
+ public Boolean isAllowUpdate() {
+ return allowUpdate;
+ }
+
+ public void setAllowUpdate(Boolean value) {
+ this.allowUpdate = value;
+ }
+
+ public Boolean isAllowDelete() {
+ return allowDelete;
+ }
+
+ public void setAllowDelete(Boolean value) {
+ this.allowDelete = value;
+ }
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright (C) 2008 Red Hat, Inc.
- * Copyright (C) 2000-2007 MetaMatrix, Inc.
- * Licensed to Red Hat, Inc. under one or more contributor
- * license agreements. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * 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.AbstractList;
-import java.util.LinkedHashMap;
-import java.util.Set;
-
-final class ListOverMap<E> extends AbstractList<E> {
-
- private LinkedHashMap<String, E> map = new LinkedHashMap<String, E>();
- private KeyBuilder<E> builder;
-
- public ListOverMap(KeyBuilder<E> builder) {
- this.builder = builder;
- }
-
- public LinkedHashMap<String, E> getMap() {
- return map;
- }
-
- @Override
- public void add(int index, E element) {
- this.map.put(builder.getKey(element), element);
- }
-
- @Override
- public E remove(int index) {
- String key = getKey(index);
- if (key == null) {
- throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return this.map.remove(key);
- }
-
- @Override
- public E get(int index) {
- String key = getKey(index);
- if (key == null) {
- throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return this.map.get(key);
- }
-
- private String getKey(int index) {
- Set<String> keys = this.map.keySet();
- int i = 0;
- for (String key:keys) {
- if (i == index) {
- return key;
- }
- i++;
- }
- return null;
- }
-
- @Override
- public int size() {
- return this.map.size();
- }
-}
-
-interface KeyBuilder<E> {
- String getKey(E entry);
-}
-
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2000-2007 MetaMatrix, Inc.
+ * Licensed to Red Hat, Inc. under one or more contributor
+ * license agreements. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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.AbstractList;
+import java.util.LinkedHashMap;
+import java.util.Set;
+
+final class ListOverMap<E> extends AbstractList<E> {
+
+ private LinkedHashMap<String, E> map = new LinkedHashMap<String, E>();
+ private KeyBuilder<E> builder;
+
+ public ListOverMap(KeyBuilder<E> builder) {
+ this.builder = builder;
+ }
+
+ public LinkedHashMap<String, E> getMap() {
+ return map;
+ }
+
+ @Override
+ public void add(int index, E element) {
+ this.map.put(builder.getKey(element), element);
+ }
+
+ @Override
+ public E remove(int index) {
+ String key = getKey(index);
+ if (key == null) {
+ throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return this.map.remove(key);
+ }
+
+ @Override
+ public E get(int index) {
+ String key = getKey(index);
+ if (key == null) {
+ throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return this.map.get(key);
+ }
+
+ private String getKey(int index) {
+ Set<String> keys = this.map.keySet();
+ int i = 0;
+ for (String key:keys) {
+ if (i == index) {
+ return key;
+ }
+ i++;
+ }
+ return null;
+ }
+
+ @Override
+ public int size() {
+ return this.map.size();
+ }
+}
+
+interface KeyBuilder<E> {
+ String getKey(E entry);
+}
+
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,267 +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 org.teiid.adminapi.impl;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.teiid.adminapi.Model;
-
-import com.metamatrix.core.vdb.ModelType;
-
-
- at XmlAccessorType(XmlAccessType.NONE)
- at XmlType(name = "", propOrder = {
- "JAXBProperties",
- "JAXBSources",
- "errors"
-})
- at ManagementObject(properties=ManagementProperties.EXPLICIT)
-public class ModelMetaData extends AdminObjectImpl implements Model {
-
- private static final String SUPPORTS_MULTI_SOURCE_BINDINGS_KEY = "supports-multi-source-bindings"; //$NON-NLS-1$
- private static final long serialVersionUID = 3714234763056162230L;
-
- private ListOverMap<SourceMapping> sources = new ListOverMap(new KeyBuilder<SourceMapping>() {
- @Override
- public String getKey(SourceMapping entry) {
- return entry.getName();
- }
- });
-
- @XmlAttribute(name = "type")
- protected String modelType = Type.PHYSICAL.name(); //$NON-NLS-1$
-
- @XmlAttribute(name = "visible")
- private Boolean visible = true;
-
- @XmlElement(name = "validation-error")
- protected List<ValidationError> errors;
-
- @ManagementProperty(description="Model Name", readOnly=true)
- @ManagementObjectID(type="model")
- @XmlAttribute(name = "name", required = true)
- public String getName() {
- return super.getName();
- }
-
- // This is needed by JAXB
- public void setName(String name) {
- super.setName(name);
- }
-
- @Override
- @ManagementProperty(description = "Is Model Source model", readOnly=true)
- public boolean isSource() {
- if (modelType != null) {
- return ModelType.parseString(modelType.toUpperCase()) == ModelType.PHYSICAL;
- }
- throw new IllegalStateException("Model state is not correctly set");
- }
-
- @Override
- @ManagementProperty(description = "Is Model Visible", readOnly=true)
- public boolean isVisible() {
- return this.visible;
- }
-
- @Override
- @ManagementProperty(description = "Model Type", readOnly=true)
- public Type getModelType() {
- return Type.valueOf(modelType);
- }
-
- @Override
- @ManagementProperty(description = "Does Model supports multi-source bindings", readOnly=true)
- public boolean isSupportsMultiSourceBindings() {
- String supports = getPropertyValue(SUPPORTS_MULTI_SOURCE_BINDINGS_KEY);
- return Boolean.parseBoolean(supports);
- }
-
- @Override
- @ManagementProperty(description = "Properties", readOnly=true)
- public Properties getProperties() {
- return new Properties(super.getProperties());
- }
-
- @Override
- @XmlElement(name = "property", type = PropertyMetadata.class)
- protected List<PropertyMetadata> getJAXBProperties(){
- return super.getJAXBProperties();
- }
-
- public void setSupportsMultiSourceBindings(boolean supports) {
- addProperty(SUPPORTS_MULTI_SOURCE_BINDINGS_KEY, Boolean.toString(supports));
- }
-
- public void setModelType(String modelType) {
- this.modelType = modelType;
- }
-
- public String toString() {
- return getName() + this.sources;
- }
-
- public void setVisible(Boolean value) {
- this.visible = value;
- }
-
- @ManagementProperty(description = "Source Mappings (defined by user)")
- public List<SourceMapping> getSourceMappings(){
- return new ArrayList<SourceMapping>(this.sources.getMap().values());
- }
-
- @XmlElement(name = "source")
- protected List<SourceMapping> getJAXBSources(){
- // do not wrap this in another List object; we need direct access for jaxb
- return this.sources;
- }
-
- @Override
- public List<String> getSourceNames() {
- return new ArrayList<String>(this.sources.getMap().keySet());
- }
-
- public String getSourceJndiName(String sourceName) {
- SourceMapping s = this.sources.getMap().get(sourceName);
- return s.getJndiName();
- }
-
- public void addSourceMapping(String name, String jndiName) {
- this.sources.getMap().put(name, new SourceMapping(name, jndiName));
- }
-
- @ManagementProperty(description = "Model Validity Errors", readOnly=true)
- public List<ValidationError> getErrors(){
- return this.errors;
- }
-
- public void addError(String severity, String message) {
- if (this.errors == null) {
- this.errors = new ArrayList<ValidationError>();
- }
- this.errors.add(new ValidationError(severity, message));
- }
-
- @XmlAccessorType(XmlAccessType.NONE)
- @XmlType(name = "", propOrder = {
- "value"
- })
- @ManagementObject(properties=ManagementProperties.EXPLICIT)
- public static class ValidationError implements Serializable{
- private static final long serialVersionUID = 2044197069467559527L;
-
- public enum Severity {ERROR, WARNING};
-
- @XmlValue
- protected String value;
-
- @XmlAttribute(name = "severity")
- protected String severity;
-
- public ValidationError() {};
-
- public ValidationError(String severity, String msg) {
- this.severity = severity;
- this.value = msg;
- }
-
- @ManagementProperty (description="Error Message", readOnly = true)
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- @ManagementProperty (description="Severity", readOnly = true)
- public String getSeverity() {
- return severity;
- }
-
- public void setSeverity(String severity) {
- this.severity = severity;
- }
- }
-
- @XmlAccessorType(XmlAccessType.NONE)
- @XmlType(name = "")
- @ManagementObject(properties=ManagementProperties.EXPLICIT)
- public static class SourceMapping implements Serializable {
- private static final long serialVersionUID = -4417878417697685794L;
-
- @XmlAttribute(name = "name", required = true)
- private String name;
-
- @XmlAttribute(name = "jndi-name")
- private String jndiName;
-
-
- public SourceMapping() {}
-
- public SourceMapping(String name, String jndiName) {
- this.name = name;
- this.jndiName = jndiName;
- }
-
- @ManagementProperty (description="Source Name", readOnly = true)
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @ManagementProperty (description="JNDI Name of the resource to assosiate with Source name")
- public String getJndiName() {
- // this default could be controlled if needed.
- if (this.jndiName == null) {
- return "java:"+name;
- }
- return jndiName;
- }
-
- public void setJndiName(String jndiName) {
- this.jndiName = jndiName;
- }
-
- public String toString() {
- return getName()+":"+getJndiName();
- }
- }
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,267 @@
+/*
+ * 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.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.adminapi.Model;
+
+import com.metamatrix.core.vdb.ModelType;
+
+
+ at XmlAccessorType(XmlAccessType.NONE)
+ at XmlType(name = "", propOrder = {
+ "JAXBProperties",
+ "JAXBSources",
+ "errors"
+})
+ at ManagementObject(properties=ManagementProperties.EXPLICIT)
+public class ModelMetaData extends AdminObjectImpl implements Model {
+
+ private static final String SUPPORTS_MULTI_SOURCE_BINDINGS_KEY = "supports-multi-source-bindings"; //$NON-NLS-1$
+ private static final long serialVersionUID = 3714234763056162230L;
+
+ private ListOverMap<SourceMapping> sources = new ListOverMap(new KeyBuilder<SourceMapping>() {
+ @Override
+ public String getKey(SourceMapping entry) {
+ return entry.getName();
+ }
+ });
+
+ @XmlAttribute(name = "type")
+ protected String modelType = Type.PHYSICAL.name(); //$NON-NLS-1$
+
+ @XmlAttribute(name = "visible")
+ private Boolean visible = true;
+
+ @XmlElement(name = "validation-error")
+ protected List<ValidationError> errors;
+
+ @ManagementProperty(description="Model Name", readOnly=true)
+ @ManagementObjectID(type="model")
+ @XmlAttribute(name = "name", required = true)
+ public String getName() {
+ return super.getName();
+ }
+
+ // This is needed by JAXB
+ public void setName(String name) {
+ super.setName(name);
+ }
+
+ @Override
+ @ManagementProperty(description = "Is Model Source model", readOnly=true)
+ public boolean isSource() {
+ if (modelType != null) {
+ return ModelType.parseString(modelType.toUpperCase()) == ModelType.PHYSICAL;
+ }
+ throw new IllegalStateException("Model state is not correctly set");
+ }
+
+ @Override
+ @ManagementProperty(description = "Is Model Visible", readOnly=true)
+ public boolean isVisible() {
+ return this.visible;
+ }
+
+ @Override
+ @ManagementProperty(description = "Model Type", readOnly=true)
+ public Type getModelType() {
+ return Type.valueOf(modelType);
+ }
+
+ @Override
+ @ManagementProperty(description = "Does Model supports multi-source bindings", readOnly=true)
+ public boolean isSupportsMultiSourceBindings() {
+ String supports = getPropertyValue(SUPPORTS_MULTI_SOURCE_BINDINGS_KEY);
+ return Boolean.parseBoolean(supports);
+ }
+
+ @Override
+ @ManagementProperty(description = "Properties", readOnly=true)
+ public Properties getProperties() {
+ return new Properties(super.getProperties());
+ }
+
+ @Override
+ @XmlElement(name = "property", type = PropertyMetadata.class)
+ protected List<PropertyMetadata> getJAXBProperties(){
+ return super.getJAXBProperties();
+ }
+
+ public void setSupportsMultiSourceBindings(boolean supports) {
+ addProperty(SUPPORTS_MULTI_SOURCE_BINDINGS_KEY, Boolean.toString(supports));
+ }
+
+ public void setModelType(String modelType) {
+ this.modelType = modelType;
+ }
+
+ public String toString() {
+ return getName() + this.sources;
+ }
+
+ public void setVisible(Boolean value) {
+ this.visible = value;
+ }
+
+ @ManagementProperty(description = "Source Mappings (defined by user)")
+ public List<SourceMapping> getSourceMappings(){
+ return new ArrayList<SourceMapping>(this.sources.getMap().values());
+ }
+
+ @XmlElement(name = "source")
+ protected List<SourceMapping> getJAXBSources(){
+ // do not wrap this in another List object; we need direct access for jaxb
+ return this.sources;
+ }
+
+ @Override
+ public List<String> getSourceNames() {
+ return new ArrayList<String>(this.sources.getMap().keySet());
+ }
+
+ public String getSourceJndiName(String sourceName) {
+ SourceMapping s = this.sources.getMap().get(sourceName);
+ return s.getJndiName();
+ }
+
+ public void addSourceMapping(String name, String jndiName) {
+ this.sources.getMap().put(name, new SourceMapping(name, jndiName));
+ }
+
+ @ManagementProperty(description = "Model Validity Errors", readOnly=true)
+ public List<ValidationError> getErrors(){
+ return this.errors;
+ }
+
+ public void addError(String severity, String message) {
+ if (this.errors == null) {
+ this.errors = new ArrayList<ValidationError>();
+ }
+ this.errors.add(new ValidationError(severity, message));
+ }
+
+ @XmlAccessorType(XmlAccessType.NONE)
+ @XmlType(name = "", propOrder = {
+ "value"
+ })
+ @ManagementObject(properties=ManagementProperties.EXPLICIT)
+ public static class ValidationError implements Serializable{
+ private static final long serialVersionUID = 2044197069467559527L;
+
+ public enum Severity {ERROR, WARNING};
+
+ @XmlValue
+ protected String value;
+
+ @XmlAttribute(name = "severity")
+ protected String severity;
+
+ public ValidationError() {};
+
+ public ValidationError(String severity, String msg) {
+ this.severity = severity;
+ this.value = msg;
+ }
+
+ @ManagementProperty (description="Error Message", readOnly = true)
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ @ManagementProperty (description="Severity", readOnly = true)
+ public String getSeverity() {
+ return severity;
+ }
+
+ public void setSeverity(String severity) {
+ this.severity = severity;
+ }
+ }
+
+ @XmlAccessorType(XmlAccessType.NONE)
+ @XmlType(name = "")
+ @ManagementObject(properties=ManagementProperties.EXPLICIT)
+ public static class SourceMapping implements Serializable {
+ private static final long serialVersionUID = -4417878417697685794L;
+
+ @XmlAttribute(name = "name", required = true)
+ private String name;
+
+ @XmlAttribute(name = "jndi-name")
+ private String jndiName;
+
+
+ public SourceMapping() {}
+
+ public SourceMapping(String name, String jndiName) {
+ this.name = name;
+ this.jndiName = jndiName;
+ }
+
+ @ManagementProperty (description="Source Name", readOnly = true)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @ManagementProperty (description="JNDI Name of the resource to assosiate with Source name")
+ public String getJndiName() {
+ // this default could be controlled if needed.
+ if (this.jndiName == null) {
+ return "java:"+name;
+ }
+ return jndiName;
+ }
+
+ public void setJndiName(String jndiName) {
+ this.jndiName = jndiName;
+ }
+
+ public String toString() {
+ return getName()+":"+getJndiName();
+ }
+ }
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetadataMapper.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ModelMetadataMapper.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetadataMapper.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,110 +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 org.teiid.adminapi.impl;
-
-import java.lang.reflect.Type;
-import java.util.Properties;
-
-import org.jboss.metatype.api.types.CompositeMetaType;
-import org.jboss.metatype.api.types.MapCompositeMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.MapCompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.PropertiesMetaValue;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
-import org.jboss.metatype.spi.values.MetaMapper;
-
-public class ModelMetadataMapper extends MetaMapper<ModelMetaData> {
- private static final MutableCompositeMetaType metaType;
- private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
-
- static {
- metaType = new MutableCompositeMetaType(ModelMetaData.class.getName(), "The Model meta data");
- metaType.addItem("name", "name", SimpleMetaType.STRING);
- metaType.addItem("visible", "visible", SimpleMetaType.BOOLEAN_PRIMITIVE);
- metaType.addItem("modelType", "modelType", SimpleMetaType.STRING);
-
-
-
- //metaType.addItem("properties", "properties", new MapCompositeMetaType());
- metaType.freeze();
- }
-
- @Override
- public Type mapToType() {
- return ModelMetaData.class;
- }
-
- @Override
- public MetaType getMetaType() {
- return metaType;
- }
-
- @Override
- public MetaValue createMetaValue(MetaType metaType, ModelMetaData object) {
- if (object == null)
- return null;
- if (metaType instanceof CompositeMetaType) {
- CompositeMetaType composite = (CompositeMetaType) metaType;
- CompositeValueSupport request = new CompositeValueSupport(composite);
-
- request.set("modelType", SimpleValueSupport.wrap(object.getModelType().name()));
- request.set("visible", SimpleValueSupport.wrap(object.isVisible()));
- request.set("name",SimpleValueSupport.wrap(object.getName()));
- request.set("properties", new PropertiesMetaValue(object.getProperties()));
-
- return request;
- }
- throw new IllegalArgumentException("Cannot convert request " + object);
- }
-
- @Override
- public ModelMetaData unwrapMetaValue(MetaValue metaValue) {
- if (metaValue == null)
- return null;
-
- if (metaValue instanceof CompositeValue) {
- CompositeValue compositeValue = (CompositeValue) metaValue;
-
- ModelMetaData model = new ModelMetaData();
- String type = (String) metaValueFactory.unwrap(compositeValue.get("modelType"));
- if (type != null) {
- model.setModelType(type);
- }
- else {
- model.setModelType("PHYSICAL");
- }
-
- model.setVisible((Boolean) metaValueFactory.unwrap(compositeValue.get("visible")));
- model.setName((String) metaValueFactory.unwrap(compositeValue.get("name")));
- model.setProperties((Properties) metaValueFactory.unwrap(compositeValue.get("properties")));
- return model;
- }
- throw new IllegalStateException("Unable to unwrap request " + metaValue);
- }
-
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetadataMapper.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ModelMetadataMapper.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetadataMapper.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetadataMapper.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,110 @@
+/*
+ * 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.lang.reflect.Type;
+import java.util.Properties;
+
+import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.types.MapCompositeMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CompositeValue;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MapCompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.PropertiesMetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+public class ModelMetadataMapper extends MetaMapper<ModelMetaData> {
+ private static final MutableCompositeMetaType metaType;
+ private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
+
+ static {
+ metaType = new MutableCompositeMetaType(ModelMetaData.class.getName(), "The Model meta data");
+ metaType.addItem("name", "name", SimpleMetaType.STRING);
+ metaType.addItem("visible", "visible", SimpleMetaType.BOOLEAN_PRIMITIVE);
+ metaType.addItem("modelType", "modelType", SimpleMetaType.STRING);
+
+
+
+ //metaType.addItem("properties", "properties", new MapCompositeMetaType());
+ metaType.freeze();
+ }
+
+ @Override
+ public Type mapToType() {
+ return ModelMetaData.class;
+ }
+
+ @Override
+ public MetaType getMetaType() {
+ return metaType;
+ }
+
+ @Override
+ public MetaValue createMetaValue(MetaType metaType, ModelMetaData object) {
+ if (object == null)
+ return null;
+ if (metaType instanceof CompositeMetaType) {
+ CompositeMetaType composite = (CompositeMetaType) metaType;
+ CompositeValueSupport request = new CompositeValueSupport(composite);
+
+ request.set("modelType", SimpleValueSupport.wrap(object.getModelType().name()));
+ request.set("visible", SimpleValueSupport.wrap(object.isVisible()));
+ request.set("name",SimpleValueSupport.wrap(object.getName()));
+ request.set("properties", new PropertiesMetaValue(object.getProperties()));
+
+ return request;
+ }
+ throw new IllegalArgumentException("Cannot convert request " + object);
+ }
+
+ @Override
+ public ModelMetaData unwrapMetaValue(MetaValue metaValue) {
+ if (metaValue == null)
+ return null;
+
+ if (metaValue instanceof CompositeValue) {
+ CompositeValue compositeValue = (CompositeValue) metaValue;
+
+ ModelMetaData model = new ModelMetaData();
+ String type = (String) metaValueFactory.unwrap(compositeValue.get("modelType"));
+ if (type != null) {
+ model.setModelType(type);
+ }
+ else {
+ model.setModelType("PHYSICAL");
+ }
+
+ model.setVisible((Boolean) metaValueFactory.unwrap(compositeValue.get("visible")));
+ model.setName((String) metaValueFactory.unwrap(compositeValue.get("name")));
+ model.setProperties((Properties) metaValueFactory.unwrap(compositeValue.get("properties")));
+ return model;
+ }
+ throw new IllegalStateException("Unable to unwrap request " + metaValue);
+ }
+
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,215 +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 org.teiid.adminapi.impl;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.teiid.adminapi.PropertyDefinition;
-
-import com.metamatrix.admin.AdminPlugin;
-
-
-public class PropertyDefinitionMetadata extends AdminObjectImpl implements PropertyDefinition {
- private static final long serialVersionUID = 6612838530524627205L;
- private Collection allowedValues = new ArrayList();
- private Object defaultValue = null;
- private String description = null;
- private String displayName = null;
- private String propertyTypeClassName = String.class.getName();
- private RestartType requiresRestart = RestartType.NONE;
- private boolean advanced = false;
- private boolean masked = false;
- private boolean modifiable = true;
- private boolean required = false;
-
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Display_name")).append(getDisplayName()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Description")).append(getDescription()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Property_type_class_name")).append(getPropertyTypeClassName()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Default_value")).append(getDefaultValue()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Constrained_to_allow_values")).append(isConstrainedToAllowedValues()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Allowed_values")).append(getAllowedValues()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Required")).append(isRequired()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Expert")).append(isAdvanced()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Masked")).append(isMasked()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Modifiable")).append(isModifiable()); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("MMPropertyDefinition.RequiresRestart")).append(getRequiresRestart()); //$NON-NLS-1$
- return result.toString();
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getAllowedValues()
- */
- public Collection getAllowedValues() {
- return allowedValues;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getDefaultValue()
- */
- public Object getDefaultValue() {
- return defaultValue;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getDescription()
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getDisplayName()
- */
- public String getDisplayName() {
- return displayName;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getPropertyTypeClassName()
- */
- public String getPropertyTypeClassName() {
- return propertyTypeClassName;
- }
-
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#getRequiresRestart()
- */
- public RestartType getRequiresRestart() {
- return requiresRestart;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#isExpert()
- * @since 4.3
- */
- public boolean isAdvanced() {
- return advanced;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#isMasked()
- */
- public boolean isMasked() {
- return masked;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#isModifiable()
- */
- public boolean isModifiable() {
- return modifiable;
- }
-
- /**
- * @see org.teiid.adminapi.PropertyDefinition#isRequired()
- */
- public boolean isRequired() {
- return required;
- }
-
- /**
- * @param allowedValues The allowedValues to set.
- */
- public void setAllowedValues(Collection allowedValues) {
- this.allowedValues = allowedValues;
- }
-
- /**
- * @param defaultValue The defaultValue to set.
- */
- public void setDefaultValue(Serializable defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- /**
- * @param description The description to set.
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
-
- /**
- * @param displayName The displayName to set.
- */
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
-
-
- /**
- * @param expert The value of expert to set.
- */
- public void setAdvanced(boolean expert) {
- this.advanced = expert;
- }
-
- /**
- * @param masked The value of masked to set.
- */
- public void setMasked(boolean masked) {
- this.masked = masked;
- }
- /**
- * @param modifiable The value of modifiable to set.
- */
- public void setModifiable(boolean modifiable) {
- this.modifiable = modifiable;
- }
-
- /**
- * @param propertyTypeClassName The propertyTypeName to set.
- */
- public void setPropertyTypeClassName(String propertyTypeClassName) {
- this.propertyTypeClassName = propertyTypeClassName;
- }
-
-
- /**
- * @param required The value of required to set.
- */
- public void setRequired(boolean required) {
- this.required = required;
- }
-
- /**
- * @param requiresRestart The value of requiresRestart to set.
- */
- public void setRequiresRestart(RestartType requiresRestart) {
- this.requiresRestart = requiresRestart;
- }
-
- @Override
- public boolean isConstrainedToAllowedValues() {
- return allowedValues != null && !allowedValues.isEmpty();
- }
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,215 @@
+/*
+ * 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.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.teiid.adminapi.PropertyDefinition;
+
+import com.metamatrix.admin.AdminPlugin;
+
+
+public class PropertyDefinitionMetadata extends AdminObjectImpl implements PropertyDefinition {
+ private static final long serialVersionUID = 6612838530524627205L;
+ private Collection allowedValues = new ArrayList();
+ private Object defaultValue = null;
+ private String description = null;
+ private String displayName = null;
+ private String propertyTypeClassName = String.class.getName();
+ private RestartType requiresRestart = RestartType.NONE;
+ private boolean advanced = false;
+ private boolean masked = false;
+ private boolean modifiable = true;
+ private boolean required = false;
+
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer result = new StringBuffer();
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Display_name")).append(getDisplayName()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Description")).append(getDescription()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Property_type_class_name")).append(getPropertyTypeClassName()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Default_value")).append(getDefaultValue()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Constrained_to_allow_values")).append(isConstrainedToAllowedValues()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Allowed_values")).append(getAllowedValues()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Required")).append(isRequired()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Expert")).append(isAdvanced()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Masked")).append(isMasked()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.Modifiable")).append(isModifiable()); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("MMPropertyDefinition.RequiresRestart")).append(getRequiresRestart()); //$NON-NLS-1$
+ return result.toString();
+ }
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#getAllowedValues()
+ */
+ public Collection getAllowedValues() {
+ return allowedValues;
+ }
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#getDefaultValue()
+ */
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#getDescription()
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#getDisplayName()
+ */
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#getPropertyTypeClassName()
+ */
+ public String getPropertyTypeClassName() {
+ return propertyTypeClassName;
+ }
+
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#getRequiresRestart()
+ */
+ public RestartType getRequiresRestart() {
+ return requiresRestart;
+ }
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#isExpert()
+ * @since 4.3
+ */
+ public boolean isAdvanced() {
+ return advanced;
+ }
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#isMasked()
+ */
+ public boolean isMasked() {
+ return masked;
+ }
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#isModifiable()
+ */
+ public boolean isModifiable() {
+ return modifiable;
+ }
+
+ /**
+ * @see org.teiid.adminapi.PropertyDefinition#isRequired()
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /**
+ * @param allowedValues The allowedValues to set.
+ */
+ public void setAllowedValues(Collection allowedValues) {
+ this.allowedValues = allowedValues;
+ }
+
+ /**
+ * @param defaultValue The defaultValue to set.
+ */
+ public void setDefaultValue(Serializable defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ /**
+ * @param description The description to set.
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+
+ /**
+ * @param displayName The displayName to set.
+ */
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+
+ /**
+ * @param expert The value of expert to set.
+ */
+ public void setAdvanced(boolean expert) {
+ this.advanced = expert;
+ }
+
+ /**
+ * @param masked The value of masked to set.
+ */
+ public void setMasked(boolean masked) {
+ this.masked = masked;
+ }
+ /**
+ * @param modifiable The value of modifiable to set.
+ */
+ public void setModifiable(boolean modifiable) {
+ this.modifiable = modifiable;
+ }
+
+ /**
+ * @param propertyTypeClassName The propertyTypeName to set.
+ */
+ public void setPropertyTypeClassName(String propertyTypeClassName) {
+ this.propertyTypeClassName = propertyTypeClassName;
+ }
+
+
+ /**
+ * @param required The value of required to set.
+ */
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+ /**
+ * @param requiresRestart The value of requiresRestart to set.
+ */
+ public void setRequiresRestart(RestartType requiresRestart) {
+ this.requiresRestart = requiresRestart;
+ }
+
+ @Override
+ public boolean isConstrainedToAllowedValues() {
+ return allowedValues != null && !allowedValues.isEmpty();
+ }
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,83 +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 org.teiid.adminapi.impl;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * <pre>
- * <complexType name="property">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- at XmlAccessorType(XmlAccessType.NONE)
- at XmlType(name = "property")
-public class PropertyMetadata implements Serializable{
- private static final long serialVersionUID = -5040224539939758816L;
-
- @XmlAttribute(name = "name", required = true)
- protected String name;
- @XmlAttribute(name = "value", required = true)
- protected String value;
-
- public PropertyMetadata() {
- }
-
- public PropertyMetadata(String key, String value) {
- this.name = key;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String toString() {
- return this.name+"="+this.value;
- }
-}
\ No newline at end of file
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,83 @@
+/*
+ * 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.io.Serializable;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * <pre>
+ * <complexType name="property">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ at XmlAccessorType(XmlAccessType.NONE)
+ at XmlType(name = "property")
+public class PropertyMetadata implements Serializable{
+ private static final long serialVersionUID = -5040224539939758816L;
+
+ @XmlAttribute(name = "name", required = true)
+ protected String name;
+ @XmlAttribute(name = "value", required = true)
+ protected String value;
+
+ public PropertyMetadata() {
+ }
+
+ public PropertyMetadata(String key, String value) {
+ this.name = key;
+ this.value = value;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String toString() {
+ return this.name+"="+this.value;
+ }
+}
\ No newline at end of file
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/ReferenceMappingMetadata.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ReferenceMappingMetadata.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ReferenceMappingMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,130 +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 org.teiid.adminapi.impl;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementProperty;
-
-
-/**
- * <pre>
- * <complexType name="reference-mapping">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="ref-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * <element name="resource-name" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- at XmlAccessorType(XmlAccessType.NONE)
- at XmlType(name = "reference-mapping", propOrder = {
- "refName",
- "resourceNames"
-})
- at ManagementObject
-public class ReferenceMappingMetadata implements Serializable {
-
- @XmlElement(name = "ref-name", required = true)
- protected String refName;
-
- @XmlElement(name = "resource-name", required = true)
- protected List<String> resourceNames;
-
- public ReferenceMappingMetadata() {
- }
-
- public ReferenceMappingMetadata(String refName, String resourceName) {
- setRefName(refName);
- addResourceName(resourceName);
- }
-
- public ReferenceMappingMetadata(String refName, List<String> resourceNames) {
- setRefName(refName);
- this.resourceNames = new ArrayList<String>(resourceNames);
- }
-
- @ManagementProperty(description="Reference Name", readOnly=true)
- public String getRefName() {
- return refName;
- }
-
- public void setRefName(String value) {
- this.refName = value;
- }
-
- @ManagementProperty(description="Resource Names")
- public List<String> getResourceNames() {
- if (this.resourceNames == null) {
- this.resourceNames = new ArrayList<String>();
- }
- return this.resourceNames;
- }
-
- public void setResourceNames(List<String> names) {
- this.resourceNames = new ArrayList<String>(names);
- }
-
- public void addResourceName(String name) {
- getResourceNames().add(name);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((refName == null) ? 0 : refName.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ReferenceMappingMetadata other = (ReferenceMappingMetadata) obj;
- if (refName == null) {
- if (other.refName != null)
- return false;
- } else if (!refName.equals(other.refName))
- return false;
- return true;
- }
-
-
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/ReferenceMappingMetadata.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ReferenceMappingMetadata.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ReferenceMappingMetadata.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ReferenceMappingMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,130 @@
+/*
+ * 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.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
+
+/**
+ * <pre>
+ * <complexType name="reference-mapping">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="ref-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="resource-name" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ at XmlAccessorType(XmlAccessType.NONE)
+ at XmlType(name = "reference-mapping", propOrder = {
+ "refName",
+ "resourceNames"
+})
+ at ManagementObject
+public class ReferenceMappingMetadata implements Serializable {
+
+ @XmlElement(name = "ref-name", required = true)
+ protected String refName;
+
+ @XmlElement(name = "resource-name", required = true)
+ protected List<String> resourceNames;
+
+ public ReferenceMappingMetadata() {
+ }
+
+ public ReferenceMappingMetadata(String refName, String resourceName) {
+ setRefName(refName);
+ addResourceName(resourceName);
+ }
+
+ public ReferenceMappingMetadata(String refName, List<String> resourceNames) {
+ setRefName(refName);
+ this.resourceNames = new ArrayList<String>(resourceNames);
+ }
+
+ @ManagementProperty(description="Reference Name", readOnly=true)
+ public String getRefName() {
+ return refName;
+ }
+
+ public void setRefName(String value) {
+ this.refName = value;
+ }
+
+ @ManagementProperty(description="Resource Names")
+ public List<String> getResourceNames() {
+ if (this.resourceNames == null) {
+ this.resourceNames = new ArrayList<String>();
+ }
+ return this.resourceNames;
+ }
+
+ public void setResourceNames(List<String> names) {
+ this.resourceNames = new ArrayList<String>(names);
+ }
+
+ public void addResourceName(String name) {
+ getResourceNames().add(name);
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((refName == null) ? 0 : refName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ReferenceMappingMetadata other = (ReferenceMappingMetadata) obj;
+ if (refName == null) {
+ if (other.refName != null)
+ return false;
+ } else if (!refName.equals(other.refName))
+ return false;
+ return true;
+ }
+
+
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,151 +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 org.teiid.adminapi.impl;
-
-import java.util.Date;
-
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.metatype.api.annotations.MetaMapping;
-import org.teiid.adminapi.Request;
-
-import com.metamatrix.core.util.HashCodeUtil;
-
-
- at MetaMapping(RequestMetadataMapper.class)
-public class RequestMetadata extends AdminObjectImpl implements Request {
-
- private static final long serialVersionUID = -2779106368517784259L;
-
- private long executionId;
- private long sessionId;
- private String command;
- private long createdTime;
- private long processTime;
- private boolean sourceRequest;
- private int nodeID = Integer.MIN_VALUE;
- private String transactionId;
-
- @Override
- @ManagementProperty(description="Unique Identifier for Request", readOnly=true)
- public long getExecutionId() {
- return executionId;
- }
-
- public void setExecutionId(long id) {
- this.executionId = id;
- }
-
- @Override
- @ManagementProperty(description="Session ID", readOnly=true)
- public long getSessionId() {
- return this.sessionId;
- }
-
- public void setSessionId(long session) {
- this.sessionId = session;
- }
-
- @Override
- @ManagementProperty(description="Processing time for the request", readOnly=true)
- public long getProcessingTime() {
- return this.processTime;
- }
-
- public void setProcessingTime(long time) {
- this.processTime = time;
- }
-
- @Override
- @ManagementProperty(description="Executing Command", readOnly=true)
- public String getCommand() {
- return this.command;
- }
-
- public void setCommand(String cmd) {
- this.command = cmd;
- }
-
- @Override
- @ManagementProperty(description="Is this Connector level request", readOnly=true)
- public boolean sourceRequest() {
- return sourceRequest;
- }
-
- public void setSourceRequest(boolean sourceRequest) {
- this.sourceRequest = sourceRequest;
- }
-
- @Override
- @ManagementProperty(description="Node Id", readOnly=true)
- public int getNodeId() {
- return this.nodeID;
- }
-
- public void setNodeId(int nodeID) {
- this.nodeID = nodeID;
- }
-
- @Override
- @ManagementProperty(description="Get Transaction XID if transaction involved", readOnly=true)
- public String getTransactionId() {
- return this.transactionId;
- }
-
- public void setTransactionId(String id) {
- this.transactionId = id;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof RequestMetadata)) {
- return false;
- }
- RequestMetadata value = (RequestMetadata)obj;
- if (!sourceRequest()) {
- return sessionId == value.sessionId && executionId == value.executionId;
- }
- return sessionId == value.sessionId && executionId == value.executionId && nodeID == value.nodeID;
- }
-
- public int hashCode() {
- return HashCodeUtil.hashCode((int)executionId, (int)sessionId);
- }
-
- public String toString() {
- StringBuilder str = new StringBuilder();
- str.append("Request: sessionid=").append(sessionId);
- str.append("; executionId=").append(executionId);
- if (nodeID != Integer.MIN_VALUE) {
- str.append("; nodeId=").append(nodeID);
- }
- if (transactionId != null) {
- str.append("; transactionId=").append(transactionId);
- }
- str.append("; sourceRequest=").append(sourceRequest);
- str.append("; createdTime=").append(new Date(createdTime));
- str.append("; processingTime=").append(new Date(processTime));
- str.append("; command=").append(command);
-
- return str.toString();
- }
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,151 @@
+/*
+ * 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.Date;
+
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.metatype.api.annotations.MetaMapping;
+import org.teiid.adminapi.Request;
+
+import com.metamatrix.core.util.HashCodeUtil;
+
+
+ at MetaMapping(RequestMetadataMapper.class)
+public class RequestMetadata extends AdminObjectImpl implements Request {
+
+ private static final long serialVersionUID = -2779106368517784259L;
+
+ private long executionId;
+ private long sessionId;
+ private String command;
+ private long createdTime;
+ private long processTime;
+ private boolean sourceRequest;
+ private int nodeID = Integer.MIN_VALUE;
+ private String transactionId;
+
+ @Override
+ @ManagementProperty(description="Unique Identifier for Request", readOnly=true)
+ public long getExecutionId() {
+ return executionId;
+ }
+
+ public void setExecutionId(long id) {
+ this.executionId = id;
+ }
+
+ @Override
+ @ManagementProperty(description="Session ID", readOnly=true)
+ public long getSessionId() {
+ return this.sessionId;
+ }
+
+ public void setSessionId(long session) {
+ this.sessionId = session;
+ }
+
+ @Override
+ @ManagementProperty(description="Processing time for the request", readOnly=true)
+ public long getProcessingTime() {
+ return this.processTime;
+ }
+
+ public void setProcessingTime(long time) {
+ this.processTime = time;
+ }
+
+ @Override
+ @ManagementProperty(description="Executing Command", readOnly=true)
+ public String getCommand() {
+ return this.command;
+ }
+
+ public void setCommand(String cmd) {
+ this.command = cmd;
+ }
+
+ @Override
+ @ManagementProperty(description="Is this Connector level request", readOnly=true)
+ public boolean sourceRequest() {
+ return sourceRequest;
+ }
+
+ public void setSourceRequest(boolean sourceRequest) {
+ this.sourceRequest = sourceRequest;
+ }
+
+ @Override
+ @ManagementProperty(description="Node Id", readOnly=true)
+ public int getNodeId() {
+ return this.nodeID;
+ }
+
+ public void setNodeId(int nodeID) {
+ this.nodeID = nodeID;
+ }
+
+ @Override
+ @ManagementProperty(description="Get Transaction XID if transaction involved", readOnly=true)
+ public String getTransactionId() {
+ return this.transactionId;
+ }
+
+ public void setTransactionId(String id) {
+ this.transactionId = id;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof RequestMetadata)) {
+ return false;
+ }
+ RequestMetadata value = (RequestMetadata)obj;
+ if (!sourceRequest()) {
+ return sessionId == value.sessionId && executionId == value.executionId;
+ }
+ return sessionId == value.sessionId && executionId == value.executionId && nodeID == value.nodeID;
+ }
+
+ public int hashCode() {
+ return HashCodeUtil.hashCode((int)executionId, (int)sessionId);
+ }
+
+ public String toString() {
+ StringBuilder str = new StringBuilder();
+ str.append("Request: sessionid=").append(sessionId);
+ str.append("; executionId=").append(executionId);
+ if (nodeID != Integer.MIN_VALUE) {
+ str.append("; nodeId=").append(nodeID);
+ }
+ if (transactionId != null) {
+ str.append("; transactionId=").append(transactionId);
+ }
+ str.append("; sourceRequest=").append(sourceRequest);
+ str.append("; createdTime=").append(new Date(createdTime));
+ str.append("; processingTime=").append(new Date(processTime));
+ str.append("; command=").append(command);
+
+ return str.toString();
+ }
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,106 +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 org.teiid.adminapi.impl;
-
-import java.lang.reflect.Type;
-
-import org.jboss.metatype.api.types.CompositeMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
-import org.jboss.metatype.spi.values.MetaMapper;
-
-public class RequestMetadataMapper extends MetaMapper<RequestMetadata> {
- private static final MutableCompositeMetaType metaType;
- private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
-
- static {
- metaType = new MutableCompositeMetaType(RequestMetadata.class.getName(), "The Session domain meta data");
- metaType.addItem("executionId", "executionId", SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem("sessionId", "sessionId", SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem("createdTime", "createdTime", SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem("processingTime", "processingTime", SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem("command", "command", SimpleMetaType.STRING);
- metaType.addItem("sourceRequest", "sourceRequest", SimpleMetaType.BOOLEAN_PRIMITIVE);
- metaType.addItem("nodeId", "nodeId", SimpleMetaType.INTEGER_PRIMITIVE);
- metaType.addItem("transactionId", "transactionId", SimpleMetaType.STRING);
- metaType.freeze();
- }
-
- @Override
- public Type mapToType() {
- return RequestMetadata.class;
- }
-
- @Override
- public MetaType getMetaType() {
- return metaType;
- }
-
- @Override
- public MetaValue createMetaValue(MetaType metaType, RequestMetadata object) {
- if (object == null)
- return null;
- if (metaType instanceof CompositeMetaType) {
- CompositeMetaType composite = (CompositeMetaType) metaType;
- CompositeValueSupport request = new CompositeValueSupport(composite);
-
- request.set("executionId", SimpleValueSupport.wrap(object.getExecutionId()));
- request.set("sessionId", SimpleValueSupport.wrap(object.getSessionId()));
- request.set("processingTime", SimpleValueSupport.wrap(object.getProcessingTime()));
- request.set("command", SimpleValueSupport.wrap(object.getCommand()));
- request.set("sourceRequest", SimpleValueSupport.wrap(object.sourceRequest()));
- request.set("nodeId", SimpleValueSupport.wrap(object.getNodeId()));
- request.set("transactionId",SimpleValueSupport.wrap(object.getTransactionId()));
-
- return request;
- }
- throw new IllegalArgumentException("Cannot convert request " + object);
- }
-
- @Override
- public RequestMetadata unwrapMetaValue(MetaValue metaValue) {
- if (metaValue == null)
- return null;
-
- if (metaValue instanceof CompositeValue) {
- CompositeValue compositeValue = (CompositeValue) metaValue;
-
- RequestMetadata request = new RequestMetadata();
- request.setExecutionId((Long) metaValueFactory.unwrap(compositeValue.get("executionId")));
- request.setSessionId((Long) metaValueFactory.unwrap(compositeValue.get("sessionId")));
- request.setProcessingTime((Long) metaValueFactory.unwrap(compositeValue.get("processingTime")));
- request.setCommand((String) metaValueFactory.unwrap(compositeValue.get("command")));
- request.setSourceRequest((Boolean) metaValueFactory.unwrap(compositeValue.get("sourceRequest")));
- request.setNodeId((Integer) metaValueFactory.unwrap(compositeValue.get("nodeId")));
- request.setTransactionId((String) metaValueFactory.unwrap(compositeValue.get("transactionId")));
- return request;
- }
- throw new IllegalStateException("Unable to unwrap request " + metaValue);
- }
-
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,106 @@
+/*
+ * 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.lang.reflect.Type;
+
+import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CompositeValue;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+public class RequestMetadataMapper extends MetaMapper<RequestMetadata> {
+ private static final MutableCompositeMetaType metaType;
+ private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
+
+ static {
+ metaType = new MutableCompositeMetaType(RequestMetadata.class.getName(), "The Session domain meta data");
+ metaType.addItem("executionId", "executionId", SimpleMetaType.LONG_PRIMITIVE);
+ metaType.addItem("sessionId", "sessionId", SimpleMetaType.LONG_PRIMITIVE);
+ metaType.addItem("createdTime", "createdTime", SimpleMetaType.LONG_PRIMITIVE);
+ metaType.addItem("processingTime", "processingTime", SimpleMetaType.LONG_PRIMITIVE);
+ metaType.addItem("command", "command", SimpleMetaType.STRING);
+ metaType.addItem("sourceRequest", "sourceRequest", SimpleMetaType.BOOLEAN_PRIMITIVE);
+ metaType.addItem("nodeId", "nodeId", SimpleMetaType.INTEGER_PRIMITIVE);
+ metaType.addItem("transactionId", "transactionId", SimpleMetaType.STRING);
+ metaType.freeze();
+ }
+
+ @Override
+ public Type mapToType() {
+ return RequestMetadata.class;
+ }
+
+ @Override
+ public MetaType getMetaType() {
+ return metaType;
+ }
+
+ @Override
+ public MetaValue createMetaValue(MetaType metaType, RequestMetadata object) {
+ if (object == null)
+ return null;
+ if (metaType instanceof CompositeMetaType) {
+ CompositeMetaType composite = (CompositeMetaType) metaType;
+ CompositeValueSupport request = new CompositeValueSupport(composite);
+
+ request.set("executionId", SimpleValueSupport.wrap(object.getExecutionId()));
+ request.set("sessionId", SimpleValueSupport.wrap(object.getSessionId()));
+ request.set("processingTime", SimpleValueSupport.wrap(object.getProcessingTime()));
+ request.set("command", SimpleValueSupport.wrap(object.getCommand()));
+ request.set("sourceRequest", SimpleValueSupport.wrap(object.sourceRequest()));
+ request.set("nodeId", SimpleValueSupport.wrap(object.getNodeId()));
+ request.set("transactionId",SimpleValueSupport.wrap(object.getTransactionId()));
+
+ return request;
+ }
+ throw new IllegalArgumentException("Cannot convert request " + object);
+ }
+
+ @Override
+ public RequestMetadata unwrapMetaValue(MetaValue metaValue) {
+ if (metaValue == null)
+ return null;
+
+ if (metaValue instanceof CompositeValue) {
+ CompositeValue compositeValue = (CompositeValue) metaValue;
+
+ RequestMetadata request = new RequestMetadata();
+ request.setExecutionId((Long) metaValueFactory.unwrap(compositeValue.get("executionId")));
+ request.setSessionId((Long) metaValueFactory.unwrap(compositeValue.get("sessionId")));
+ request.setProcessingTime((Long) metaValueFactory.unwrap(compositeValue.get("processingTime")));
+ request.setCommand((String) metaValueFactory.unwrap(compositeValue.get("command")));
+ request.setSourceRequest((Boolean) metaValueFactory.unwrap(compositeValue.get("sourceRequest")));
+ request.setNodeId((Integer) metaValueFactory.unwrap(compositeValue.get("nodeId")));
+ request.setTransactionId((String) metaValueFactory.unwrap(compositeValue.get("transactionId")));
+ return request;
+ }
+ throw new IllegalStateException("Unable to unwrap request " + metaValue);
+ }
+
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,165 +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 org.teiid.adminapi.impl;
-
-import java.util.Date;
-
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.metatype.api.annotations.MetaMapping;
-import org.teiid.adminapi.Session;
-
-
-/**
- * Add and delete properties also in the Mapper class for correct wrapping for profile service.
- */
- at MetaMapping(SessionMetadataMapper.class)
-public class SessionMetadata extends AdminObjectImpl implements Session {
-
- private static final long serialVersionUID = 918638989081830034L;
- private String applicationName;
- private long lastPingTime;
- private long createdTime;
- private String ipAddress;
- private String clientHostName;
- private String userName;
- private String vdbName;
- private int vdbVersion;
- private long sessionId;
- private String securityDomain;
-
- @Override
- @ManagementProperty(description="Application assosiated with Session", readOnly=true)
- public String getApplicationName() {
- return this.applicationName;
- }
-
- public void setApplicationName(String applicationName) {
- this.applicationName = applicationName;
- }
-
- @Override
- @ManagementProperty(description="When session created", readOnly=true)
- public long getCreatedTime() {
- return this.createdTime;
- }
-
- public void setCreatedTime(long createdTime) {
- this.createdTime = createdTime;
- }
-
- @Override
- @ManagementProperty(description="Host name from where the session created", readOnly=true)
- public String getClientHostName() {
- return this.clientHostName;
- }
-
- public void setClientHostName(String clientHostname) {
- this.clientHostName = clientHostname;
- }
-
- @Override
- @ManagementProperty(description="IP address from where session is created", readOnly=true)
- public String getIPAddress() {
- return this.ipAddress;
- }
-
- public void setIPAddress(String ipAddress) {
- this.ipAddress = ipAddress;
- }
-
- @Override
- @ManagementProperty(description="Last ping time", readOnly=true)
- public long getLastPingTime() {
- return this.lastPingTime;
- }
-
- public void setLastPingTime(long lastPingTime) {
- this.lastPingTime = lastPingTime;
- }
-
- @Override
- @ManagementProperty(description="Session ID", readOnly=true)
- @ManagementObjectID(type="session")
- public long getSessionId() {
- return this.sessionId;
- }
-
- public void setSessionId(long sessionId) {
- this.sessionId = sessionId;
- }
-
- @Override
- @ManagementProperty(description="User name assosiated with session", readOnly=true)
- public String getUserName() {
- return this.userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- @Override
- @ManagementProperty(description="VDB name assosiated with session", readOnly=true)
- public String getVDBName() {
- return this.vdbName;
- }
-
- public void setVDBName(String vdbName) {
- this.vdbName = vdbName;
- }
-
- @Override
- @ManagementProperty(description="VDB version name assosiated with session", readOnly=true)
- public int getVDBVersion() {
- return this.vdbVersion;
- }
-
- public void setVDBVersion(int vdbVersion) {
- this.vdbVersion = vdbVersion;
- }
-
- @Override
- @ManagementProperty(description="Security Domain that session logged into", readOnly=true)
- public String getSecurityDomain() {
- return this.securityDomain;
- }
-
- public void setSecurityDomain(String domain) {
- this.securityDomain = domain;
- }
-
- public String toString() {
- StringBuilder str = new StringBuilder();
- str.append("session: sessionid=").append(sessionId);
- str.append("; userName=").append(userName);
- str.append("; vdbName=").append(vdbName);
- str.append("; vdbVersion=").append(vdbVersion);
- str.append("; createdTime=").append(new Date(createdTime));
- str.append("; applicationName=").append(applicationName);
- str.append("; clientHostName=").append(clientHostName);
- str.append("; IPAddress=").append(ipAddress);
- str.append("; securityDomain=").append(securityDomain);
- str.append("; lastPingTime=").append(new Date(lastPingTime));
- return str.toString();
- }
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,165 @@
+/*
+ * 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.Date;
+
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.metatype.api.annotations.MetaMapping;
+import org.teiid.adminapi.Session;
+
+
+/**
+ * Add and delete properties also in the Mapper class for correct wrapping for profile service.
+ */
+ at MetaMapping(SessionMetadataMapper.class)
+public class SessionMetadata extends AdminObjectImpl implements Session {
+
+ private static final long serialVersionUID = 918638989081830034L;
+ private String applicationName;
+ private long lastPingTime;
+ private long createdTime;
+ private String ipAddress;
+ private String clientHostName;
+ private String userName;
+ private String vdbName;
+ private int vdbVersion;
+ private long sessionId;
+ private String securityDomain;
+
+ @Override
+ @ManagementProperty(description="Application assosiated with Session", readOnly=true)
+ public String getApplicationName() {
+ return this.applicationName;
+ }
+
+ public void setApplicationName(String applicationName) {
+ this.applicationName = applicationName;
+ }
+
+ @Override
+ @ManagementProperty(description="When session created", readOnly=true)
+ public long getCreatedTime() {
+ return this.createdTime;
+ }
+
+ public void setCreatedTime(long createdTime) {
+ this.createdTime = createdTime;
+ }
+
+ @Override
+ @ManagementProperty(description="Host name from where the session created", readOnly=true)
+ public String getClientHostName() {
+ return this.clientHostName;
+ }
+
+ public void setClientHostName(String clientHostname) {
+ this.clientHostName = clientHostname;
+ }
+
+ @Override
+ @ManagementProperty(description="IP address from where session is created", readOnly=true)
+ public String getIPAddress() {
+ return this.ipAddress;
+ }
+
+ public void setIPAddress(String ipAddress) {
+ this.ipAddress = ipAddress;
+ }
+
+ @Override
+ @ManagementProperty(description="Last ping time", readOnly=true)
+ public long getLastPingTime() {
+ return this.lastPingTime;
+ }
+
+ public void setLastPingTime(long lastPingTime) {
+ this.lastPingTime = lastPingTime;
+ }
+
+ @Override
+ @ManagementProperty(description="Session ID", readOnly=true)
+ @ManagementObjectID(type="session")
+ public long getSessionId() {
+ return this.sessionId;
+ }
+
+ public void setSessionId(long sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ @Override
+ @ManagementProperty(description="User name assosiated with session", readOnly=true)
+ public String getUserName() {
+ return this.userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ @Override
+ @ManagementProperty(description="VDB name assosiated with session", readOnly=true)
+ public String getVDBName() {
+ return this.vdbName;
+ }
+
+ public void setVDBName(String vdbName) {
+ this.vdbName = vdbName;
+ }
+
+ @Override
+ @ManagementProperty(description="VDB version name assosiated with session", readOnly=true)
+ public int getVDBVersion() {
+ return this.vdbVersion;
+ }
+
+ public void setVDBVersion(int vdbVersion) {
+ this.vdbVersion = vdbVersion;
+ }
+
+ @Override
+ @ManagementProperty(description="Security Domain that session logged into", readOnly=true)
+ public String getSecurityDomain() {
+ return this.securityDomain;
+ }
+
+ public void setSecurityDomain(String domain) {
+ this.securityDomain = domain;
+ }
+
+ public String toString() {
+ StringBuilder str = new StringBuilder();
+ str.append("session: sessionid=").append(sessionId);
+ str.append("; userName=").append(userName);
+ str.append("; vdbName=").append(vdbName);
+ str.append("; vdbVersion=").append(vdbVersion);
+ str.append("; createdTime=").append(new Date(createdTime));
+ str.append("; applicationName=").append(applicationName);
+ str.append("; clientHostName=").append(clientHostName);
+ str.append("; IPAddress=").append(ipAddress);
+ str.append("; securityDomain=").append(securityDomain);
+ str.append("; lastPingTime=").append(new Date(lastPingTime));
+ return str.toString();
+ }
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,114 +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 org.teiid.adminapi.impl;
-
-import java.lang.reflect.Type;
-
-import org.jboss.metatype.api.types.CompositeMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
-import org.jboss.metatype.spi.values.MetaMapper;
-
-public class SessionMetadataMapper extends MetaMapper<SessionMetadata> {
- private static final MutableCompositeMetaType metaType;
- private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
-
- static {
- metaType = new MutableCompositeMetaType(SessionMetadata.class.getName(), "The Session domain meta data");
- metaType.addItem("applicationName", "applicationName", SimpleMetaType.STRING);
- metaType.addItem("createdTime", "createdTime", SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem("clientHostName", "clientHostName", SimpleMetaType.STRING);
- metaType.addItem("IPAddress", "IPAddress", SimpleMetaType.STRING);
- metaType.addItem("lastPingTime", "lastPingTime", SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem("sessionId", "sessionId", SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem("userName", "userName", SimpleMetaType.STRING);
- metaType.addItem("VDBName", "VDBName", SimpleMetaType.STRING);
- metaType.addItem("VDBVersion", "VDBVersion", SimpleMetaType.INTEGER_PRIMITIVE);
- metaType.addItem("securityDomain", "SecurityDomain", SimpleMetaType.STRING);
- metaType.freeze();
- }
-
- @Override
- public Type mapToType() {
- return SessionMetadata.class;
- }
-
- @Override
- public MetaType getMetaType() {
- return metaType;
- }
-
- @Override
- public MetaValue createMetaValue(MetaType metaType, SessionMetadata object) {
- if (object == null)
- return null;
- if (metaType instanceof CompositeMetaType) {
- CompositeMetaType composite = (CompositeMetaType) metaType;
- CompositeValueSupport session = new CompositeValueSupport(composite);
-
- session.set("applicationName", SimpleValueSupport.wrap(object.getName()));
- session.set("createdTime", SimpleValueSupport.wrap(object.getCreatedTime()));
- session.set("clientHostName", SimpleValueSupport.wrap(object.getClientHostName()));
- session.set("IPAddress", SimpleValueSupport.wrap(object.getIPAddress()));
- session.set("lastPingTime", SimpleValueSupport.wrap(object.getLastPingTime()));
- session.set("sessionId", SimpleValueSupport.wrap(object.getSessionId()));
- session.set("userName", SimpleValueSupport.wrap(object.getUserName()));
- session.set("VDBName",SimpleValueSupport.wrap(object.getVDBName()));
- session.set("VDBVersion", SimpleValueSupport.wrap(object.getVDBVersion()));
- session.set("securityDomain", SimpleValueSupport.wrap(object.getSecurityDomain()));
-
- return session;
- }
- throw new IllegalArgumentException("Cannot convert session " + object);
- }
-
- @Override
- public SessionMetadata unwrapMetaValue(MetaValue metaValue) {
- if (metaValue == null)
- return null;
-
- if (metaValue instanceof CompositeValue) {
- CompositeValue compositeValue = (CompositeValue) metaValue;
-
- SessionMetadata session = new SessionMetadata();
- session.setApplicationName((String) metaValueFactory.unwrap(compositeValue.get("applicationName")));
- session.setCreatedTime((Long) metaValueFactory.unwrap(compositeValue.get("createdTime")));
- session.setClientHostName((String) metaValueFactory.unwrap(compositeValue.get("clientHostName")));
- session.setIPAddress((String) metaValueFactory.unwrap(compositeValue.get("IPAddress")));
- session.setLastPingTime((Long) metaValueFactory.unwrap(compositeValue.get("lastPingTime")));
- session.setSessionId((Long) metaValueFactory.unwrap(compositeValue.get("sessionId")));
- session.setUserName((String) metaValueFactory.unwrap(compositeValue.get("userName")));
- session.setVDBName((String) metaValueFactory.unwrap(compositeValue.get("VDBName")));
- session.setVDBVersion((Integer) metaValueFactory.unwrap(compositeValue.get("VDBVersion")));
- session.setSecurityDomain((String) metaValueFactory.unwrap(compositeValue.get("securityDomain")));
- return session;
- }
- throw new IllegalStateException("Unable to unwrap session " + metaValue);
- }
-
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,114 @@
+/*
+ * 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.lang.reflect.Type;
+
+import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CompositeValue;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+public class SessionMetadataMapper extends MetaMapper<SessionMetadata> {
+ private static final MutableCompositeMetaType metaType;
+ private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
+
+ static {
+ metaType = new MutableCompositeMetaType(SessionMetadata.class.getName(), "The Session domain meta data");
+ metaType.addItem("applicationName", "applicationName", SimpleMetaType.STRING);
+ metaType.addItem("createdTime", "createdTime", SimpleMetaType.LONG_PRIMITIVE);
+ metaType.addItem("clientHostName", "clientHostName", SimpleMetaType.STRING);
+ metaType.addItem("IPAddress", "IPAddress", SimpleMetaType.STRING);
+ metaType.addItem("lastPingTime", "lastPingTime", SimpleMetaType.LONG_PRIMITIVE);
+ metaType.addItem("sessionId", "sessionId", SimpleMetaType.LONG_PRIMITIVE);
+ metaType.addItem("userName", "userName", SimpleMetaType.STRING);
+ metaType.addItem("VDBName", "VDBName", SimpleMetaType.STRING);
+ metaType.addItem("VDBVersion", "VDBVersion", SimpleMetaType.INTEGER_PRIMITIVE);
+ metaType.addItem("securityDomain", "SecurityDomain", SimpleMetaType.STRING);
+ metaType.freeze();
+ }
+
+ @Override
+ public Type mapToType() {
+ return SessionMetadata.class;
+ }
+
+ @Override
+ public MetaType getMetaType() {
+ return metaType;
+ }
+
+ @Override
+ public MetaValue createMetaValue(MetaType metaType, SessionMetadata object) {
+ if (object == null)
+ return null;
+ if (metaType instanceof CompositeMetaType) {
+ CompositeMetaType composite = (CompositeMetaType) metaType;
+ CompositeValueSupport session = new CompositeValueSupport(composite);
+
+ session.set("applicationName", SimpleValueSupport.wrap(object.getName()));
+ session.set("createdTime", SimpleValueSupport.wrap(object.getCreatedTime()));
+ session.set("clientHostName", SimpleValueSupport.wrap(object.getClientHostName()));
+ session.set("IPAddress", SimpleValueSupport.wrap(object.getIPAddress()));
+ session.set("lastPingTime", SimpleValueSupport.wrap(object.getLastPingTime()));
+ session.set("sessionId", SimpleValueSupport.wrap(object.getSessionId()));
+ session.set("userName", SimpleValueSupport.wrap(object.getUserName()));
+ session.set("VDBName",SimpleValueSupport.wrap(object.getVDBName()));
+ session.set("VDBVersion", SimpleValueSupport.wrap(object.getVDBVersion()));
+ session.set("securityDomain", SimpleValueSupport.wrap(object.getSecurityDomain()));
+
+ return session;
+ }
+ throw new IllegalArgumentException("Cannot convert session " + object);
+ }
+
+ @Override
+ public SessionMetadata unwrapMetaValue(MetaValue metaValue) {
+ if (metaValue == null)
+ return null;
+
+ if (metaValue instanceof CompositeValue) {
+ CompositeValue compositeValue = (CompositeValue) metaValue;
+
+ SessionMetadata session = new SessionMetadata();
+ session.setApplicationName((String) metaValueFactory.unwrap(compositeValue.get("applicationName")));
+ session.setCreatedTime((Long) metaValueFactory.unwrap(compositeValue.get("createdTime")));
+ session.setClientHostName((String) metaValueFactory.unwrap(compositeValue.get("clientHostName")));
+ session.setIPAddress((String) metaValueFactory.unwrap(compositeValue.get("IPAddress")));
+ session.setLastPingTime((Long) metaValueFactory.unwrap(compositeValue.get("lastPingTime")));
+ session.setSessionId((Long) metaValueFactory.unwrap(compositeValue.get("sessionId")));
+ session.setUserName((String) metaValueFactory.unwrap(compositeValue.get("userName")));
+ session.setVDBName((String) metaValueFactory.unwrap(compositeValue.get("VDBName")));
+ session.setVDBVersion((Integer) metaValueFactory.unwrap(compositeValue.get("VDBVersion")));
+ session.setSecurityDomain((String) metaValueFactory.unwrap(compositeValue.get("securityDomain")));
+ return session;
+ }
+ throw new IllegalStateException("Unable to unwrap session " + metaValue);
+ }
+
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,92 +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 org.teiid.adminapi.impl;
-
-import java.util.Date;
-
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.metatype.api.annotations.MetaMapping;
-import org.teiid.adminapi.Transaction;
-
-import com.metamatrix.admin.AdminPlugin;
-
- at MetaMapping(TransactionMetadataMapper.class)
-public class TransactionMetadata extends AdminObjectImpl implements Transaction {
-
- private static final long serialVersionUID = -8588785315218789068L;
- private long associatedSession;
- private String scope;
- private String xid;
- private long createdTime;
-
- @Override
- @ManagementProperty(description="Session ID", readOnly=true)
- public long getAssociatedSession() {
- return associatedSession;
- }
-
- public void setAssociatedSession(long associatedSession) {
- this.associatedSession = associatedSession;
- }
-
- @Override
- @ManagementProperty(description="Scope", readOnly=true)
- public String getScope() {
- return scope;
- }
-
- public void setScope(String scope) {
- this.scope = scope;
- }
-
- @Override
- @ManagementProperty(description="XID", readOnly=true)
- public String getXid() {
- return xid;
- }
-
- public void setXid(String xid) {
- this.xid = xid;
- }
-
- @Override
- @ManagementProperty(description="Transaction created time", readOnly=true)
- public long getCreatedTime() {
- return createdTime;
- }
-
- public void setCreatedTime(long time) {
- this.createdTime = time;
- }
-
- @Override
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(AdminPlugin.Util.getString("TransactionImpl.associatedSession")).append(associatedSession); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("TransactionImpl.scope")).append(scope); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("TransactionImpl.xid")).append(xid); //$NON-NLS-1$
- result.append(AdminPlugin.Util.getString("TransactionImpl.createdTime")).append(new Date(createdTime)); //$NON-NLS-1$
- return result.toString();
- }
-
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,92 @@
+/*
+ * 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.Date;
+
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.metatype.api.annotations.MetaMapping;
+import org.teiid.adminapi.Transaction;
+
+import com.metamatrix.admin.AdminPlugin;
+
+ at MetaMapping(TransactionMetadataMapper.class)
+public class TransactionMetadata extends AdminObjectImpl implements Transaction {
+
+ private static final long serialVersionUID = -8588785315218789068L;
+ private long associatedSession;
+ private String scope;
+ private String xid;
+ private long createdTime;
+
+ @Override
+ @ManagementProperty(description="Session ID", readOnly=true)
+ public long getAssociatedSession() {
+ return associatedSession;
+ }
+
+ public void setAssociatedSession(long associatedSession) {
+ this.associatedSession = associatedSession;
+ }
+
+ @Override
+ @ManagementProperty(description="Scope", readOnly=true)
+ public String getScope() {
+ return scope;
+ }
+
+ public void setScope(String scope) {
+ this.scope = scope;
+ }
+
+ @Override
+ @ManagementProperty(description="XID", readOnly=true)
+ public String getXid() {
+ return xid;
+ }
+
+ public void setXid(String xid) {
+ this.xid = xid;
+ }
+
+ @Override
+ @ManagementProperty(description="Transaction created time", readOnly=true)
+ public long getCreatedTime() {
+ return createdTime;
+ }
+
+ public void setCreatedTime(long time) {
+ this.createdTime = time;
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer result = new StringBuffer();
+ result.append(AdminPlugin.Util.getString("TransactionImpl.associatedSession")).append(associatedSession); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("TransactionImpl.scope")).append(scope); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("TransactionImpl.xid")).append(xid); //$NON-NLS-1$
+ result.append(AdminPlugin.Util.getString("TransactionImpl.createdTime")).append(new Date(createdTime)); //$NON-NLS-1$
+ return result.toString();
+ }
+
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,96 +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 org.teiid.adminapi.impl;
-
-import java.lang.reflect.Type;
-
-import org.jboss.metatype.api.types.CompositeMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
-import org.jboss.metatype.spi.values.MetaMapper;
-
-public class TransactionMetadataMapper extends MetaMapper<TransactionMetadata> {
- private static final MutableCompositeMetaType metaType;
- private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
-
- static {
- metaType = new MutableCompositeMetaType(TransactionMetadata.class.getName(), "The Session domain meta data");
- metaType.addItem("associatedSession", "associatedSession", SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem("createdTime", "createdTime", SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem("scope", "scope", SimpleMetaType.STRING);
- metaType.addItem("xid", "xid", SimpleMetaType.STRING);
- metaType.freeze();
- }
-
- @Override
- public Type mapToType() {
- return TransactionMetadata.class;
- }
-
- @Override
- public MetaType getMetaType() {
- return metaType;
- }
-
- @Override
- public MetaValue createMetaValue(MetaType metaType, TransactionMetadata object) {
- if (object == null)
- return null;
- if (metaType instanceof CompositeMetaType) {
- CompositeMetaType composite = (CompositeMetaType) metaType;
- CompositeValueSupport transaction = new CompositeValueSupport(composite);
-
- transaction.set("associatedSession", SimpleValueSupport.wrap(object.getAssociatedSession()));
- transaction.set("createdTime", SimpleValueSupport.wrap(object.getCreatedTime()));
- transaction.set("scope", SimpleValueSupport.wrap(object.getScope()));
- transaction.set("xid", SimpleValueSupport.wrap(object.getXid()));
-
- return transaction;
- }
- throw new IllegalArgumentException("Cannot convert session " + object);
- }
-
- @Override
- public TransactionMetadata unwrapMetaValue(MetaValue metaValue) {
- if (metaValue == null)
- return null;
-
- if (metaValue instanceof CompositeValue) {
- CompositeValue compositeValue = (CompositeValue) metaValue;
-
- TransactionMetadata transaction = new TransactionMetadata();
- transaction.setAssociatedSession((Long) metaValueFactory.unwrap(compositeValue.get("associatedSession")));
- transaction.setCreatedTime((Long) metaValueFactory.unwrap(compositeValue.get("createdTime")));
- transaction.setScope((String) metaValueFactory.unwrap(compositeValue.get("scope")));
- transaction.setXid((String) metaValueFactory.unwrap(compositeValue.get("xid")));
- return transaction;
- }
- throw new IllegalStateException("Unable to unwrap session " + metaValue);
- }
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,96 @@
+/*
+ * 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.lang.reflect.Type;
+
+import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CompositeValue;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+public class TransactionMetadataMapper extends MetaMapper<TransactionMetadata> {
+ private static final MutableCompositeMetaType metaType;
+ private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
+
+ static {
+ metaType = new MutableCompositeMetaType(TransactionMetadata.class.getName(), "The Session domain meta data");
+ metaType.addItem("associatedSession", "associatedSession", SimpleMetaType.LONG_PRIMITIVE);
+ metaType.addItem("createdTime", "createdTime", SimpleMetaType.LONG_PRIMITIVE);
+ metaType.addItem("scope", "scope", SimpleMetaType.STRING);
+ metaType.addItem("xid", "xid", SimpleMetaType.STRING);
+ metaType.freeze();
+ }
+
+ @Override
+ public Type mapToType() {
+ return TransactionMetadata.class;
+ }
+
+ @Override
+ public MetaType getMetaType() {
+ return metaType;
+ }
+
+ @Override
+ public MetaValue createMetaValue(MetaType metaType, TransactionMetadata object) {
+ if (object == null)
+ return null;
+ if (metaType instanceof CompositeMetaType) {
+ CompositeMetaType composite = (CompositeMetaType) metaType;
+ CompositeValueSupport transaction = new CompositeValueSupport(composite);
+
+ transaction.set("associatedSession", SimpleValueSupport.wrap(object.getAssociatedSession()));
+ transaction.set("createdTime", SimpleValueSupport.wrap(object.getCreatedTime()));
+ transaction.set("scope", SimpleValueSupport.wrap(object.getScope()));
+ transaction.set("xid", SimpleValueSupport.wrap(object.getXid()));
+
+ return transaction;
+ }
+ throw new IllegalArgumentException("Cannot convert session " + object);
+ }
+
+ @Override
+ public TransactionMetadata unwrapMetaValue(MetaValue metaValue) {
+ if (metaValue == null)
+ return null;
+
+ if (metaValue instanceof CompositeValue) {
+ CompositeValue compositeValue = (CompositeValue) metaValue;
+
+ TransactionMetadata transaction = new TransactionMetadata();
+ transaction.setAssociatedSession((Long) metaValueFactory.unwrap(compositeValue.get("associatedSession")));
+ transaction.setCreatedTime((Long) metaValueFactory.unwrap(compositeValue.get("createdTime")));
+ transaction.setScope((String) metaValueFactory.unwrap(compositeValue.get("scope")));
+ transaction.setXid((String) metaValueFactory.unwrap(compositeValue.get("xid")));
+ return transaction;
+ }
+ throw new IllegalStateException("Unable to unwrap session " + metaValue);
+ }
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,251 +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 org.teiid.adminapi.impl;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.teiid.adminapi.Model;
-import org.teiid.adminapi.VDB;
-import org.teiid.adminapi.impl.ModelMetaData.ValidationError;
-
-import com.metamatrix.core.CoreConstants;
-
- at ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="vdb"))
- at XmlAccessorType(XmlAccessType.NONE)
- at XmlType(name = "", propOrder = {
- "description",
- "JAXBProperties",
- "JAXBModels",
- "securityRoleMappings"
-})
- at XmlRootElement(name = "vdb")
-public class VDBMetaData extends AdminObjectImpl implements VDB {
- private static final String STATUS_KEY = "status"; //$NON-NLS-1$
-
- private static final long serialVersionUID = -4723595252013356436L;
-
- private ListOverMap<ModelMetaData> models = new ListOverMap<ModelMetaData>(new KeyBuilder<ModelMetaData>() {
- @Override
- public String getKey(ModelMetaData entry) {
- return entry.getName();
- }
- });
-
- @XmlAttribute(name = "version", required = true)
- private int version = 1;
-
- @XmlElement(name = "description")
- private String description;
-
- @XmlElement(name = "role-mapping")
- protected ListOverMap<ReferenceMappingMetadata> securityRoleMappings = new ListOverMap<ReferenceMappingMetadata>(new KeyBuilder<ReferenceMappingMetadata>() {
- @Override
- public String getKey(ReferenceMappingMetadata entry) {
- return entry.getRefName();
- }
- });
-
- private String fileUrl = null;
-
- public VDBMetaData() {
- // auto add sytem model.
- ModelMetaData system = new ModelMetaData();
- system.setName(CoreConstants.SYSTEM_MODEL);
- system.setVisible(true);
- system.setModelType(Model.Type.PHYSICAL.name());
- system.addSourceMapping("system", "system");
- system.setSupportsMultiSourceBindings(false);
-
- addModel(system);
- }
-
- @ManagementProperty(description="Name of the VDB", readOnly=true)
- @ManagementObjectID(type="vdb")
- @XmlAttribute(name = "name", required = true)
- public String getName() {
- return super.getName();
- }
-
- // This needed by JAXB marshaling
- public void setName(String name) {
- super.setName(name);
- }
-
- @Override
- @ManagementProperty(description="VDB Status")
- public Status getStatus() {
- String status = getPropertyValue(STATUS_KEY);
- if (status != null) {
- return VDB.Status.valueOf(status);
- }
- return VDB.Status.ACTIVE;
- }
-
- public void setStatus(Status s) {
- addProperty(STATUS_KEY, s.name());
- }
-
- @Override
- @ManagementProperty(description="VDB version", readOnly=true)
- public int getVersion() {
- return this.version;
- }
-
- public void setVersion(int version) {
- this.version = version;
- }
-
- @Override
- @ManagementProperty(description = "The VDB file url", readOnly=true)
- public String getUrl() {
- return this.fileUrl;
- }
-
- public void setUrl(String url) {
- this.fileUrl = url;
- }
-
- @ManagementProperty(description="Models in a VDB", managed=true)
- public List<ModelMetaData> getModels(){
- return new ArrayList<ModelMetaData>(this.models.getMap().values());
- }
-
- /**
- * This simulating a list over a map. JAXB requires a list and performance recommends
- * map and we would like to keep one variable to represent both.
- * @return
- */
- @XmlElement(name = "model", required = true, type = ModelMetaData.class)
- protected List<ModelMetaData> getJAXBModels(){
- return models;
- }
-
- public void addModel(ModelMetaData m) {
- this.models.getMap().put(m.getName(), m);
- }
-
- @Override
- @ManagementProperty(description = "Description", readOnly=true)
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String desc) {
- this.description = desc;
- }
-
- @Override
- @ManagementProperty(description = "VDB validity errors", readOnly=true)
- public List<String> getValidityErrors(){
- List<String> allErrors = new ArrayList<String>();
- for (ModelMetaData model:this.models.getMap().values()) {
- List<ValidationError> errors = model.getErrors();
- if (errors != null && !errors.isEmpty()) {
- for (ValidationError m:errors) {
- if (ValidationError.Severity.valueOf(m.getSeverity()).equals(ValidationError.Severity.ERROR)) {
- allErrors.add(m.getValue());
- }
- }
- }
- }
- return allErrors;
- }
-
- @Override
- @ManagementProperty(description = "Is VDB Valid", readOnly=true)
- public boolean isValid() {
- if (!getValidityErrors().isEmpty()) {
- return false;
- }
-
- if (getModels().isEmpty()) {
- return false;
- }
- for(ModelMetaData m: this.models.getMap().values()) {
- if (m.isSource()) {
- List<String> resourceNames = m.getSourceNames();
- if (resourceNames.isEmpty()) {
- return false;
- }
- }
- }
- return true;
- }
-
- public String toString() {
- return getName()+"."+getVersion()+ models.getMap().values(); //$NON-NLS-1$
- }
-
- @ManagementOperation(description = "Get the model with given name")
- public ModelMetaData getModel(String modelName) {
- return this.models.getMap().get(modelName);
- }
-
- public Set<String> getMultiSourceModelNames(){
- Set<String> list = new HashSet<String>();
- for(ModelMetaData m: models.getMap().values()) {
- if (m.isSupportsMultiSourceBindings()) {
- list.add(m.getName());
- }
- }
- return list;
- }
-
- @ManagementProperty(description="Security refrence mappings", managed=true)
- public List<ReferenceMappingMetadata> getSecurityRoleMappings() {
- return new ArrayList<ReferenceMappingMetadata>(this.securityRoleMappings);
- }
-
- public void addSecurityRoleMapping(ReferenceMappingMetadata data) {
- this.securityRoleMappings.getMap().put(data.getRefName(), data);
- }
-
- // this one manages the Management API
- @Override
- @ManagementProperty(description = "Properties", readOnly=true)
- public Properties getProperties() {
- return super.getProperties();
- }
-
- // This one manages the JAXB binding
- @Override
- @XmlElement(name = "property", type = PropertyMetadata.class)
- protected List<PropertyMetadata> getJAXBProperties(){
- return super.getJAXBProperties();
- }
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,251 @@
+/*
+ * 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.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementOperation;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.adminapi.Model;
+import org.teiid.adminapi.VDB;
+import org.teiid.adminapi.impl.ModelMetaData.ValidationError;
+
+import com.metamatrix.core.CoreConstants;
+
+ at ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="vdb"))
+ at XmlAccessorType(XmlAccessType.NONE)
+ at XmlType(name = "", propOrder = {
+ "description",
+ "JAXBProperties",
+ "JAXBModels",
+ "securityRoleMappings"
+})
+ at XmlRootElement(name = "vdb")
+public class VDBMetaData extends AdminObjectImpl implements VDB {
+ private static final String STATUS_KEY = "status"; //$NON-NLS-1$
+
+ private static final long serialVersionUID = -4723595252013356436L;
+
+ private ListOverMap<ModelMetaData> models = new ListOverMap<ModelMetaData>(new KeyBuilder<ModelMetaData>() {
+ @Override
+ public String getKey(ModelMetaData entry) {
+ return entry.getName();
+ }
+ });
+
+ @XmlAttribute(name = "version", required = true)
+ private int version = 1;
+
+ @XmlElement(name = "description")
+ private String description;
+
+ @XmlElement(name = "role-mapping")
+ protected ListOverMap<ReferenceMappingMetadata> securityRoleMappings = new ListOverMap<ReferenceMappingMetadata>(new KeyBuilder<ReferenceMappingMetadata>() {
+ @Override
+ public String getKey(ReferenceMappingMetadata entry) {
+ return entry.getRefName();
+ }
+ });
+
+ private String fileUrl = null;
+
+ public VDBMetaData() {
+ // auto add sytem model.
+ ModelMetaData system = new ModelMetaData();
+ system.setName(CoreConstants.SYSTEM_MODEL);
+ system.setVisible(true);
+ system.setModelType(Model.Type.PHYSICAL.name());
+ system.addSourceMapping("system", "system");
+ system.setSupportsMultiSourceBindings(false);
+
+ addModel(system);
+ }
+
+ @ManagementProperty(description="Name of the VDB", readOnly=true)
+ @ManagementObjectID(type="vdb")
+ @XmlAttribute(name = "name", required = true)
+ public String getName() {
+ return super.getName();
+ }
+
+ // This needed by JAXB marshaling
+ public void setName(String name) {
+ super.setName(name);
+ }
+
+ @Override
+ @ManagementProperty(description="VDB Status")
+ public Status getStatus() {
+ String status = getPropertyValue(STATUS_KEY);
+ if (status != null) {
+ return VDB.Status.valueOf(status);
+ }
+ return VDB.Status.ACTIVE;
+ }
+
+ public void setStatus(Status s) {
+ addProperty(STATUS_KEY, s.name());
+ }
+
+ @Override
+ @ManagementProperty(description="VDB version", readOnly=true)
+ public int getVersion() {
+ return this.version;
+ }
+
+ public void setVersion(int version) {
+ this.version = version;
+ }
+
+ @Override
+ @ManagementProperty(description = "The VDB file url", readOnly=true)
+ public String getUrl() {
+ return this.fileUrl;
+ }
+
+ public void setUrl(String url) {
+ this.fileUrl = url;
+ }
+
+ @ManagementProperty(description="Models in a VDB", managed=true)
+ public List<ModelMetaData> getModels(){
+ return new ArrayList<ModelMetaData>(this.models.getMap().values());
+ }
+
+ /**
+ * This simulating a list over a map. JAXB requires a list and performance recommends
+ * map and we would like to keep one variable to represent both.
+ * @return
+ */
+ @XmlElement(name = "model", required = true, type = ModelMetaData.class)
+ protected List<ModelMetaData> getJAXBModels(){
+ return models;
+ }
+
+ public void addModel(ModelMetaData m) {
+ this.models.getMap().put(m.getName(), m);
+ }
+
+ @Override
+ @ManagementProperty(description = "Description", readOnly=true)
+ public String getDescription() {
+ return this.description;
+ }
+
+ public void setDescription(String desc) {
+ this.description = desc;
+ }
+
+ @Override
+ @ManagementProperty(description = "VDB validity errors", readOnly=true)
+ public List<String> getValidityErrors(){
+ List<String> allErrors = new ArrayList<String>();
+ for (ModelMetaData model:this.models.getMap().values()) {
+ List<ValidationError> errors = model.getErrors();
+ if (errors != null && !errors.isEmpty()) {
+ for (ValidationError m:errors) {
+ if (ValidationError.Severity.valueOf(m.getSeverity()).equals(ValidationError.Severity.ERROR)) {
+ allErrors.add(m.getValue());
+ }
+ }
+ }
+ }
+ return allErrors;
+ }
+
+ @Override
+ @ManagementProperty(description = "Is VDB Valid", readOnly=true)
+ public boolean isValid() {
+ if (!getValidityErrors().isEmpty()) {
+ return false;
+ }
+
+ if (getModels().isEmpty()) {
+ return false;
+ }
+ for(ModelMetaData m: this.models.getMap().values()) {
+ if (m.isSource()) {
+ List<String> resourceNames = m.getSourceNames();
+ if (resourceNames.isEmpty()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public String toString() {
+ return getName()+"."+getVersion()+ models.getMap().values(); //$NON-NLS-1$
+ }
+
+ @ManagementOperation(description = "Get the model with given name")
+ public ModelMetaData getModel(String modelName) {
+ return this.models.getMap().get(modelName);
+ }
+
+ public Set<String> getMultiSourceModelNames(){
+ Set<String> list = new HashSet<String>();
+ for(ModelMetaData m: models.getMap().values()) {
+ if (m.isSupportsMultiSourceBindings()) {
+ list.add(m.getName());
+ }
+ }
+ return list;
+ }
+
+ @ManagementProperty(description="Security refrence mappings", managed=true)
+ public List<ReferenceMappingMetadata> getSecurityRoleMappings() {
+ return new ArrayList<ReferenceMappingMetadata>(this.securityRoleMappings);
+ }
+
+ public void addSecurityRoleMapping(ReferenceMappingMetadata data) {
+ this.securityRoleMappings.getMap().put(data.getRefName(), data);
+ }
+
+ // this one manages the Management API
+ @Override
+ @ManagementProperty(description = "Properties", readOnly=true)
+ public Properties getProperties() {
+ return super.getProperties();
+ }
+
+ // This one manages the JAXB binding
+ @Override
+ @XmlElement(name = "property", type = PropertyMetadata.class)
+ protected List<PropertyMetadata> getJAXBProperties(){
+ return super.getJAXBProperties();
+ }
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadata.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadata.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,140 +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 org.teiid.adminapi.impl;
-
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.teiid.adminapi.WorkerPoolStatistics;
-
-/**
- * This class is a holder for all the statistics gathered about a worker pool.
- */
-public class WorkerPoolStatisticsMetadata extends AdminObjectImpl implements WorkerPoolStatistics {
-
- private static final long serialVersionUID = -4917902925523802295L;
-
- // Current state
- private int queued;
- private int highestQueued;
- private int maxThreads;
- private int activeThreads;
- private int highestActiveThreads;
- private long totalSubmitted;
- private long totalCompleted;
-
- @Override
- @ManagementProperty(description="Number of Active Threads", readOnly=true)
- public int getActiveThreads() {
- return activeThreads;
- }
-
- @Override
- @ManagementProperty(description="Highest active threads", readOnly=true)
- public int getHighestActiveThreads() {
- return highestActiveThreads;
- }
-
- @Override
- @ManagementProperty(description="Total Completed Tasks", readOnly=true)
- public long getTotalCompleted() {
- return totalCompleted;
- }
-
- @Override
- @ManagementProperty(description="Total submitted Tasks", readOnly=true)
- public long getTotalSubmitted() {
- return totalSubmitted;
- }
-
- @Override
- @ManagementProperty(description="Queue Name", readOnly=true)
- public String getQueueName() {
- return getName();
- }
-
- @Override
- @ManagementProperty(description="Currently Queued Tasks", readOnly=true)
- public int getQueued() {
- return queued;
- }
-
- @Override
- @ManagementProperty(description="Highest Queued Tasks", readOnly=true)
- public int getHighestQueued() {
- return highestQueued;
- }
-
- @Override
- @ManagementProperty(description="Max Threads", readOnly=true)
- public int getMaxThreads() {
- return maxThreads;
- }
-
- public void setQueued(int queued) {
- this.queued = queued;
- }
-
- public void setHighestQueued(int highestQueued) {
- this.highestQueued = highestQueued;
- }
-
- public void setMaxThreads(int maxThreads) {
- this.maxThreads = maxThreads;
- }
-
- public void setActiveThreads(int activeThreads) {
- this.activeThreads = activeThreads;
- }
-
- public void setHighestActiveThreads(int highestActiveThreads) {
- this.highestActiveThreads = highestActiveThreads;
- }
-
- public void setTotalSubmitted(long totalSubmitted) {
- this.totalSubmitted = totalSubmitted;
- }
-
- public void setTotalCompleted(long totalCompleted) {
- this.totalCompleted = totalCompleted;
- }
-
- public void setQueueName(String name) {
- setName(name);
- }
-
- public String toString() {
- StringBuilder str = new StringBuilder();
-
- str.append("WorkerPoolStats:"); //$NON-NLS-1$
- str.append(" queue-name = " + getName()); //$NON-NLS-1$
- str.append("; queued = " + queued); //$NON-NLS-1$
- str.append("; highestQueued = " + highestQueued); //$NON-NLS-1$
- str.append("; maxThreads = " + maxThreads); //$NON-NLS-1$
- str.append("; activeThreads = " + activeThreads); //$NON-NLS-1$
- str.append("; highestActiveThreads = " + highestActiveThreads); //$NON-NLS-1$
- str.append("; totalSubmitted = " + totalSubmitted); //$NON-NLS-1$
- str.append("; totalCompleted = " + totalCompleted); //$NON-NLS-1$
- return str.toString();
- }
-
-}
-
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadata.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadata.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadata.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadata.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,140 @@
+/*
+ * 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 org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.adminapi.WorkerPoolStatistics;
+
+/**
+ * This class is a holder for all the statistics gathered about a worker pool.
+ */
+public class WorkerPoolStatisticsMetadata extends AdminObjectImpl implements WorkerPoolStatistics {
+
+ private static final long serialVersionUID = -4917902925523802295L;
+
+ // Current state
+ private int queued;
+ private int highestQueued;
+ private int maxThreads;
+ private int activeThreads;
+ private int highestActiveThreads;
+ private long totalSubmitted;
+ private long totalCompleted;
+
+ @Override
+ @ManagementProperty(description="Number of Active Threads", readOnly=true)
+ public int getActiveThreads() {
+ return activeThreads;
+ }
+
+ @Override
+ @ManagementProperty(description="Highest active threads", readOnly=true)
+ public int getHighestActiveThreads() {
+ return highestActiveThreads;
+ }
+
+ @Override
+ @ManagementProperty(description="Total Completed Tasks", readOnly=true)
+ public long getTotalCompleted() {
+ return totalCompleted;
+ }
+
+ @Override
+ @ManagementProperty(description="Total submitted Tasks", readOnly=true)
+ public long getTotalSubmitted() {
+ return totalSubmitted;
+ }
+
+ @Override
+ @ManagementProperty(description="Queue Name", readOnly=true)
+ public String getQueueName() {
+ return getName();
+ }
+
+ @Override
+ @ManagementProperty(description="Currently Queued Tasks", readOnly=true)
+ public int getQueued() {
+ return queued;
+ }
+
+ @Override
+ @ManagementProperty(description="Highest Queued Tasks", readOnly=true)
+ public int getHighestQueued() {
+ return highestQueued;
+ }
+
+ @Override
+ @ManagementProperty(description="Max Threads", readOnly=true)
+ public int getMaxThreads() {
+ return maxThreads;
+ }
+
+ public void setQueued(int queued) {
+ this.queued = queued;
+ }
+
+ public void setHighestQueued(int highestQueued) {
+ this.highestQueued = highestQueued;
+ }
+
+ public void setMaxThreads(int maxThreads) {
+ this.maxThreads = maxThreads;
+ }
+
+ public void setActiveThreads(int activeThreads) {
+ this.activeThreads = activeThreads;
+ }
+
+ public void setHighestActiveThreads(int highestActiveThreads) {
+ this.highestActiveThreads = highestActiveThreads;
+ }
+
+ public void setTotalSubmitted(long totalSubmitted) {
+ this.totalSubmitted = totalSubmitted;
+ }
+
+ public void setTotalCompleted(long totalCompleted) {
+ this.totalCompleted = totalCompleted;
+ }
+
+ public void setQueueName(String name) {
+ setName(name);
+ }
+
+ public String toString() {
+ StringBuilder str = new StringBuilder();
+
+ str.append("WorkerPoolStats:"); //$NON-NLS-1$
+ str.append(" queue-name = " + getName()); //$NON-NLS-1$
+ str.append("; queued = " + queued); //$NON-NLS-1$
+ str.append("; highestQueued = " + highestQueued); //$NON-NLS-1$
+ str.append("; maxThreads = " + maxThreads); //$NON-NLS-1$
+ str.append("; activeThreads = " + activeThreads); //$NON-NLS-1$
+ str.append("; highestActiveThreads = " + highestActiveThreads); //$NON-NLS-1$
+ str.append("; totalSubmitted = " + totalSubmitted); //$NON-NLS-1$
+ str.append("; totalCompleted = " + totalCompleted); //$NON-NLS-1$
+ return str.toString();
+ }
+
+}
+
Copied: trunk/client/src/main/java/org/teiid/transport (from rev 1900, branches/JCA/client/src/main/java/org/teiid/transport)
Deleted: trunk/client/src/main/java/org/teiid/transport/ClientServiceRegistry.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/transport/ClientServiceRegistry.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/transport/ClientServiceRegistry.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,31 +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 org.teiid.transport;
-
-import com.metamatrix.api.exception.ComponentNotFoundException;
-
-public interface ClientServiceRegistry {
-
- <T> T getClientService(Class<T> iface) throws ComponentNotFoundException;
-
-}
Copied: trunk/client/src/main/java/org/teiid/transport/ClientServiceRegistry.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/transport/ClientServiceRegistry.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/transport/ClientServiceRegistry.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/transport/ClientServiceRegistry.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,31 @@
+/*
+ * 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.transport;
+
+import com.metamatrix.api.exception.ComponentNotFoundException;
+
+public interface ClientServiceRegistry {
+
+ <T> T getClientService(Class<T> iface) throws ComponentNotFoundException;
+
+}
Deleted: trunk/client/src/main/java/org/teiid/transport/LocalServerConnection.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/transport/LocalServerConnection.java 2010-03-04 15:18:19 UTC (rev 1900)
+++ trunk/client/src/main/java/org/teiid/transport/LocalServerConnection.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -1,148 +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 org.teiid.transport;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Properties;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.LogonException;
-import com.metamatrix.client.ExceptionUtil;
-import com.metamatrix.common.comm.CommonCommPlugin;
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.common.comm.platform.CommPlatformPlugin;
-import com.metamatrix.platform.security.api.ILogon;
-import com.metamatrix.platform.security.api.LogonResult;
-import com.metamatrix.platform.security.api.SessionToken;
-
-public class LocalServerConnection implements ServerConnection {
- private static final String TEIID_RUNTIME = "teiid/engine-deployer";
-
- private final LogonResult result;
- private boolean shutdown;
-
- public LocalServerConnection(Properties connectionProperties) throws CommunicationException, ConnectionException{
- this.result = authenticate(connectionProperties);
- }
-
- public synchronized LogonResult authenticate(Properties connProps) throws ConnectionException, CommunicationException {
- try {
- connProps.setProperty(ServerConnection.LOCAL_CONNECTION, Boolean.TRUE.toString());
- LogonResult logonResult = this.getService(ILogon.class).logon(connProps);
- return logonResult;
- } catch (LogonException e) {
- // Propagate the original message as it contains the message we want
- // to give to the user
- throw new ConnectionException(e, e.getMessage());
- } catch (MetaMatrixComponentException e) {
- if (e.getCause() instanceof CommunicationException) {
- throw (CommunicationException)e.getCause();
- }
- throw new CommunicationException(e, CommPlatformPlugin.Util.getString("PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to_MetaMatrix")); //$NON-NLS-1$
- }
- }
-
- public <T> T getService(final Class<T> iface) {
- return iface.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new InvocationHandler() {
-
- public Object invoke(Object arg0, Method arg1, Object[] arg2) throws Throwable {
- if (!isOpen()) {
- throw ExceptionUtil.convertException(arg1, new MetaMatrixComponentException(CommonCommPlugin.Util.getString("LocalTransportHandler.Transport_shutdown"))); //$NON-NLS-1$
- }
- try {
- ClientServiceRegistry scf = lookup(TEIID_RUNTIME);
- T service = scf.getClientService(iface);
-
- if (!(iface.equals(ILogon.class))) {
- SessionToken.setSession(result.getSessionToken());
- }
-
- return arg1.invoke(service, arg2);
- } catch(NamingException e){
- throw ExceptionUtil.convertException(arg1, new MetaMatrixComponentException(CommonCommPlugin.Util.getString("LocalTransportHandler.Transport_shutdown"))); //$NON-NLS-1$
- } finally {
- SessionToken.setSession(null);
- }
- }
- }));
- }
-
- public boolean isOpen() {
- return !shutdown;
- }
-
- public void close() {
- shutdown(true);
- }
-
- private void shutdown(boolean logoff) {
- if (shutdown) {
- return;
- }
-
- if (logoff) {
- try {
- //make a best effort to send the logoff
- Future<?> writeFuture = this.getService(ILogon.class).logoff();
- if (writeFuture != null) {
- writeFuture.get(5000, TimeUnit.MILLISECONDS);
- }
- } catch (InvalidSessionException e) {
- //ignore
- } catch (InterruptedException e) {
- //ignore
- } catch (ExecutionException e) {
- //ignore
- } catch (TimeoutException e) {
- //ignore
- }
- }
- this.shutdown = true;
- }
-
- public LogonResult getLogonResult() {
- return result;
- }
-
- @Override
- public boolean isSameInstance(ServerConnection conn) throws CommunicationException {
- return (conn instanceof LocalServerConnection);
- }
-
- protected <T> T lookup(String jndiName) throws NamingException {
- InitialContext ic = new InitialContext();
- return (T)ic.lookup(jndiName);
- }
-}
Copied: trunk/client/src/main/java/org/teiid/transport/LocalServerConnection.java (from rev 1900, branches/JCA/client/src/main/java/org/teiid/transport/LocalServerConnection.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/transport/LocalServerConnection.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/transport/LocalServerConnection.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,148 @@
+/*
+ * 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.transport;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.Properties;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import com.metamatrix.admin.api.exception.security.InvalidSessionException;
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+import com.metamatrix.api.exception.security.LogonException;
+import com.metamatrix.client.ExceptionUtil;
+import com.metamatrix.common.comm.CommonCommPlugin;
+import com.metamatrix.common.comm.api.ServerConnection;
+import com.metamatrix.common.comm.exception.CommunicationException;
+import com.metamatrix.common.comm.exception.ConnectionException;
+import com.metamatrix.common.comm.platform.CommPlatformPlugin;
+import com.metamatrix.platform.security.api.ILogon;
+import com.metamatrix.platform.security.api.LogonResult;
+import com.metamatrix.platform.security.api.SessionToken;
+
+public class LocalServerConnection implements ServerConnection {
+ private static final String TEIID_RUNTIME = "teiid/engine-deployer";
+
+ private final LogonResult result;
+ private boolean shutdown;
+
+ public LocalServerConnection(Properties connectionProperties) throws CommunicationException, ConnectionException{
+ this.result = authenticate(connectionProperties);
+ }
+
+ public synchronized LogonResult authenticate(Properties connProps) throws ConnectionException, CommunicationException {
+ try {
+ connProps.setProperty(ServerConnection.LOCAL_CONNECTION, Boolean.TRUE.toString());
+ LogonResult logonResult = this.getService(ILogon.class).logon(connProps);
+ return logonResult;
+ } catch (LogonException e) {
+ // Propagate the original message as it contains the message we want
+ // to give to the user
+ throw new ConnectionException(e, e.getMessage());
+ } catch (MetaMatrixComponentException e) {
+ if (e.getCause() instanceof CommunicationException) {
+ throw (CommunicationException)e.getCause();
+ }
+ throw new CommunicationException(e, CommPlatformPlugin.Util.getString("PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to_MetaMatrix")); //$NON-NLS-1$
+ }
+ }
+
+ public <T> T getService(final Class<T> iface) {
+ return iface.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new InvocationHandler() {
+
+ public Object invoke(Object arg0, Method arg1, Object[] arg2) throws Throwable {
+ if (!isOpen()) {
+ throw ExceptionUtil.convertException(arg1, new MetaMatrixComponentException(CommonCommPlugin.Util.getString("LocalTransportHandler.Transport_shutdown"))); //$NON-NLS-1$
+ }
+ try {
+ ClientServiceRegistry scf = lookup(TEIID_RUNTIME);
+ T service = scf.getClientService(iface);
+
+ if (!(iface.equals(ILogon.class))) {
+ SessionToken.setSession(result.getSessionToken());
+ }
+
+ return arg1.invoke(service, arg2);
+ } catch(NamingException e){
+ throw ExceptionUtil.convertException(arg1, new MetaMatrixComponentException(CommonCommPlugin.Util.getString("LocalTransportHandler.Transport_shutdown"))); //$NON-NLS-1$
+ } finally {
+ SessionToken.setSession(null);
+ }
+ }
+ }));
+ }
+
+ public boolean isOpen() {
+ return !shutdown;
+ }
+
+ public void close() {
+ shutdown(true);
+ }
+
+ private void shutdown(boolean logoff) {
+ if (shutdown) {
+ return;
+ }
+
+ if (logoff) {
+ try {
+ //make a best effort to send the logoff
+ Future<?> writeFuture = this.getService(ILogon.class).logoff();
+ if (writeFuture != null) {
+ writeFuture.get(5000, TimeUnit.MILLISECONDS);
+ }
+ } catch (InvalidSessionException e) {
+ //ignore
+ } catch (InterruptedException e) {
+ //ignore
+ } catch (ExecutionException e) {
+ //ignore
+ } catch (TimeoutException e) {
+ //ignore
+ }
+ }
+ this.shutdown = true;
+ }
+
+ public LogonResult getLogonResult() {
+ return result;
+ }
+
+ @Override
+ public boolean isSameInstance(ServerConnection conn) throws CommunicationException {
+ return (conn instanceof LocalServerConnection);
+ }
+
+ protected <T> T lookup(String jndiName) throws NamingException {
+ InitialContext ic = new InitialContext();
+ return (T)ic.lookup(jndiName);
+ }
+}
Modified: trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties
===================================================================
--- trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties 2010-03-04 18:25:21 UTC (rev 1904)
@@ -200,6 +200,7 @@
TransactionImpl.scope=\n\ Scope:\
TransactionImpl.status=\n\ Status:\
TransactionImpl.xid=\n\ Xid:\
+TransactionImpl.createdTime=\n\ Created Time:\
AdminStatus.CODE_UNKNOWN=Unknown.
AdminStatus.CODE_SUCCESS=Success.
Modified: trunk/client/src/main/resources/com/metamatrix/common/comm/i18n.properties
===================================================================
--- trunk/client/src/main/resources/com/metamatrix/common/comm/i18n.properties 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/resources/com/metamatrix/common/comm/i18n.properties 2010-03-04 18:25:21 UTC (rev 1904)
@@ -27,4 +27,6 @@
TrustedSessionToken.token_null = The trusted token for a session token may not be null.
StreamImpl.Unable_to_read_data_from_stream=Unable to read data from the stream: {0}
-RequestMessage.invalid_txnAutoWrap=''{0}'' is an invalid transaction autowrap mode.
\ No newline at end of file
+RequestMessage.invalid_txnAutoWrap=''{0}'' is an invalid transaction autowrap mode.
+
+LocalTransportHandler.Transport_shutdown=Tranport has been shutdown.
Modified: trunk/client/src/main/resources/com/metamatrix/common/comm/platform/i18n.properties
===================================================================
--- trunk/client/src/main/resources/com/metamatrix/common/comm/platform/i18n.properties 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/main/resources/com/metamatrix/common/comm/platform/i18n.properties 2010-03-04 18:25:21 UTC (rev 1904)
@@ -33,8 +33,8 @@
PlatformServerConnectionFactory.Missing_required_property=Missing required property:
PlatformServerConnectionFactory.Error_encrypting_user_password=Error encrypting user password
PlatformServerConnectionFactory.Error_communicating_with_app_server=Error communicating with app server
-PlatformServerConnectionFactory.Error_logging_on_to_MetaMatrix=Error logging on to MetaMatrix: {0}
-PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to_MetaMatrix=Unable to find a component used in logging on to MetaMatrix
+PlatformServerConnectionFactory.Error_logging_on_to_MetaMatrix=Error logging on to Teiid: {0}
+PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to=Unable to find a component used authenticate on to Teiid
PlatformServerConnectionFactory.Unable_to_get_a_PlatformServerConnection=Unable to get a PlatformServerConnection
PlatformServerConnectionFactory.Error_comunicating_with_LogonAPI=Error communicating with LogonAPI
PlatformServerConnectionFactory.JNDI_library_mismatch_plugin=Client library may not match server vendor or version for server {1}. Client code loaded from plugin: {2}, initial context factory: {0}.
Copied: trunk/client/src/main/resources/vdb-deployer.xsd (from rev 1900, branches/JCA/client/src/main/resources/vdb-deployer.xsd)
===================================================================
--- trunk/client/src/main/resources/vdb-deployer.xsd (rev 0)
+++ trunk/client/src/main/resources/vdb-deployer.xsd 2010-03-04 18:25:21 UTC (rev 1904)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:element name="vdb">
+ <xs:annotation>
+ <xs:documentation>Describes the configuration for a VDB</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="description" type="xs:string" minOccurs="0"/>
+ <xs:element name="property" type="property" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="model" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="property" type="property" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="source" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="jndi-name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="validation-error" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="severity">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ERROR"/>
+ <xs:enumeration value="WARNING"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="type" default="PHYSICAL">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="PHYSICAL"/>
+ <xs:enumeration value="VIRTUAL"/>
+ <xs:enumeration value="FUNCTION"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="visible" type="xs:boolean" default="true"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="role" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="description" type="xs:string" minOccurs="0"/>
+ <xs:element name="resource-name" type="xs:string"/>
+ <xs:element name="allow-create" type="xs:boolean" minOccurs="0"/>
+ <xs:element name="allow-read" type="xs:boolean" minOccurs="0"/>
+ <xs:element name="allow-update" type="xs:boolean" minOccurs="0"/>
+ <xs:element name="allow-delete" type="xs:boolean" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="description" type="xs:string" minOccurs="0"/>
+ <xs:element name="property" type="property" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="path" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="role-mapping" type="reference-mapping" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="version" type="xs:int" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="property">
+ <xs:annotation>
+ <xs:documentation> property</xs:documentation>
+ </xs:annotation>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="value" type="xs:string" use="required"/>
+ </xs:complexType>
+ <xs:complexType name="reference-mapping">
+ <xs:sequence>
+ <xs:element name="ref-name" type="xs:string"/>
+ <xs:element name="resource-name" type="xs:string" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Modified: trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -45,7 +45,6 @@
import com.metamatrix.dqp.client.ResultsFuture;
import com.metamatrix.platform.security.api.ILogon;
import com.metamatrix.platform.security.api.LogonResult;
-import com.metamatrix.platform.security.api.MetaMatrixSessionID;
import com.metamatrix.platform.security.api.SessionToken;
/**
@@ -82,7 +81,7 @@
Properties connectionProperties)
throws LogonException,
MetaMatrixComponentException {
- return new LogonResult(new SessionToken(new MetaMatrixSessionID(1), "fooUser"), new Properties(), "fake"); //$NON-NLS-1$ //$NON-NLS-2$
+ return new LogonResult(new SessionToken(1, "fooUser"), "foo", 1, "fake"); //$NON-NLS-1$ //$NON-NLS-2$
}
//## JDBC4.0-begin ##
@@ -146,7 +145,7 @@
public void testLogon() throws Exception {
SocketServerConnection connection = createConnection(null);
- assertEquals("1", connection.getLogonResult().getSessionID().toString()); //$NON-NLS-1$
+ assertEquals(1, connection.getLogonResult().getSessionID()); //$NON-NLS-1$
}
/**
Modified: trunk/client/src/test/java/com/metamatrix/common/xa/TestMMXid.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/xa/TestMMXid.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/test/java/com/metamatrix/common/xa/TestMMXid.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -53,8 +53,8 @@
public void testToString() {
assertEquals(XID1Copy.toString(), XID1.toString());
- assertEquals("MMXid global:1 branch:null format:0", XID1.toString()); //$NON-NLS-1$
- assertEquals("MMXid global:2 branch:3 format:0", XID2.toString()); //$NON-NLS-1$
+ assertEquals("Teiid-Xid global:1 branch:null format:0", XID1.toString()); //$NON-NLS-1$
+ assertEquals("Teiid-Xid global:2 branch:3 format:0", XID2.toString()); //$NON-NLS-1$
}
}
Modified: trunk/client/src/test/java/com/metamatrix/dqp/message/TestRequestMessage.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/dqp/message/TestRequestMessage.java 2010-03-04 18:04:53 UTC (rev 1903)
+++ trunk/client/src/test/java/com/metamatrix/dqp/message/TestRequestMessage.java 2010-03-04 18:25:21 UTC (rev 1904)
@@ -23,13 +23,13 @@
package com.metamatrix.dqp.message;
import java.util.ArrayList;
-import java.util.Date;
import java.util.List;
import junit.framework.TestCase;
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.core.util.UnitTestUtil;
+import com.metamatrix.dqp.message.RequestMessage.StatementType;
import com.metamatrix.jdbc.api.ExecutionProperties;
public class TestRequestMessage extends TestCase {
@@ -44,7 +44,7 @@
public static RequestMessage example() {
RequestMessage message = new RequestMessage();
- message.setCallableStatement(true);
+ message.setStatementType(StatementType.CALLABLE);
message.setFetchSize(100);
List params = new ArrayList();
params.add(new Integer(100));
@@ -54,9 +54,6 @@
message.setParameterValues(params);
message.setPartialResults(true);
- message.setPreparedStatement(false);
- message.setSubmittedTimestamp(new Date(11111111L));
- message.setProcessingTimestamp(new Date(12345678L));
message.setStyleSheet("myStyleSheet"); //$NON-NLS-1$
message.setExecutionPayload("myExecutionPayload"); //$NON-NLS-1$
try {
@@ -85,8 +82,6 @@
assertEquals(new Integer(400), copy.getParameterValues().get(3));
assertFalse(copy.isPreparedStatement());
- assertEquals(new Date(11111111L), copy.getSubmittedTimestamp());
- assertEquals(new Date(12345678L), copy.getProcessingTimestamp());
assertEquals("myStyleSheet", copy.getStyleSheet()); //$NON-NLS-1$
assertEquals("myExecutionPayload", copy.getExecutionPayload()); //$NON-NLS-1$
assertEquals(ExecutionProperties.TXN_WRAP_ON, copy.getTxnAutoWrapMode()); //$NON-NLS-1$
More information about the teiid-commits
mailing list