teiid SVN: r2023 - in trunk: build/kit-jboss-container/deployers/teiid.deployer and 16 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-04-05 15:52:52 -0400 (Mon, 05 Apr 2010)
New Revision: 2023
Added:
trunk/client/src/main/java/org/teiid/adminapi/ConnectionFactory.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionFactoryMetaData.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectionFactoryDeployer.java
Removed:
trunk/client/src/main/java/org/teiid/adminapi/ConnectorBinding.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectorBindingDeployer.java
Modified:
trunk/adminshell/src/main/resources/scripts/adminapi.bsh
trunk/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
trunk/client/src/main/java/org/teiid/adminapi/Admin.java
trunk/connectors/connector-xml-soap/src/main/resources/org/teiid/connector/xml/i18n.properties
trunk/connectors/connector-xml/src/main/resources/com/metamatrix/connector/xml/base/I18N.properties
trunk/documentation/admin-guide/src/main/docbook/en-US/content/connection-management.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/getting-started.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/introduction.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/working-with-scripts.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/writing-tests.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml
trunk/documentation/reference/src/main/docbook/en-US/content/architecture.xml
trunk/documentation/reference/src/main/docbook/en-US/content/connectors.xml
trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
trunk/engine/src/main/resources/com/metamatrix/query/execution/i18n.properties
trunk/engine/src/main/resources/org/teiid/adminapi/impl/i18n.properties
trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/BaseConnection.java
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
Log:
TEIID-1032: Changing the Admin API and log messages from Connector Binding to Connection Factory. Also modified few documents references.
Modified: trunk/adminshell/src/main/resources/scripts/adminapi.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2010-04-05 19:52:52 UTC (rev 2023)
@@ -16,7 +16,7 @@
VDB deployVDB(String vdbFile) {
debug("Adding VDB " + name + " from " + vdbFile);
checkAdmin();
- return internalAdmin.addVDB(vdbFile, new File(vdbFile).toURL());
+ return internalAdmin.deployVDB(vdbFile, new FileInputStream(new File(vdbFile)));
}
/**
@@ -51,44 +51,44 @@
}
/**
- * Deploy a {@link ConnectorBinding} to Configuration
+ * Deploy a {@link ConnectionFactory} to Configuration
*
- * @param deployedName Connector Binding name that will be added to Configuration
+ * @param deployedName Connection Factory name that will be added to Configuration
* @param typeName Connector type name.
- * @param properties Name & Value pair need to deploy the Connector Binding
+ * @param properties Name & Value pair need to deploy the Connection Factory
- * @throws AdminException if there's a system error.
+ * @throws AdminException
*/
-void addConnectorBinding(String deployedName, String typeName, Properties properties) {
- debug("Adding Connector Binding " + deployedName);
+void addConnectionFactory(String deployedName, String typeName, Properties properties) {
+ debug("Adding Connection Factory " + deployedName);
checkAdmin();
- return internalAdmin.addConnectorBinding(deployedName, typeName, properties);
+ return internalAdmin.addConnectionFactory(deployedName, typeName, properties);
}
/**
- * Delete the {@link ConnectorBinding} from the Configuration
+ * Delete the {@link ConnectionFactory} from the Configuration
*
- * @param deployedName - deployed name of the connector binding
- * @throws AdminException if there's a system error.
+ * @param deployedName - deployed name of the connection factory
+ * @throws AdminException
*/
-void deleteConnectorBinding(String bindingName) throws AdminException {
- debug("Deleting Connector Binding " + bindingName);
+void deleteConnectionFactory(String bindingName) throws AdminException {
+ debug("Deleting Connection Factory " + bindingName);
checkAdmin();
- internalAdmin.deleteConnectorBinding(bindingName);
+ internalAdmin.deleteConnectionFactory(bindingName);
}
/**
- * Export a {@link ConnectorBinding} to character Array in XML format
+ * Export a {@link ConnectionFactory} to character Array in XML format
*
- * @param deployedName the unique identifier for a {@link ConnectorBinding}.
- * @return character Array in XML format
+ * @param deployedName the unique identifier for a {@link ConnectionFactory}.
+ * @param fileName - Name under which exported content stored under
* @throws AdminException
- * if there's a system error.
+ *
*/
-void exportConnectorBinding(String bindingName, String fileName){
- debug("Exporting Connector Binding " + bindingName + " to file " + fileName);
+void exportConnectionFactory(String bindingName, String fileName){
+ debug("Exporting Connection Factory " + bindingName + " to file " + fileName);
checkAdmin();
- contents = internalAdmin.exportConnectorBinding(bindingName);
+ contents = internalAdmin.exportConnectionFactory(bindingName);
if (contents != null) {
ObjectConverterUtil.write(contents, fileName);
}
@@ -98,19 +98,19 @@
}
/**
- * Assign a {@link ConnectorBinding} to a {@link VDB}'s Model
+ * Assign a {@link ConnectionFactory} to a {@link VDB}'s Model
*
* @param vdbName Name of the VDB
* @param vdbVersion Version of the VDB
- * @param modelName Name of the Model to map Connector Binding
+ * @param modelName Name of the Model to map Connection Factory
* @param sourceName sourceName for the model
* @param jndiName JNDI names to which the source name needs to map to
- * @throws AdminException if there's a system error or if there's a user input error.
+ * @throws AdminException
*/
-void assignBindingToModel(String vdbName, int vdbVersion, String modelName, String sourceName, String jndiName) throws AdminException{
- debug("Assigning Connector Binding, source name:" + sourceName +" to JNDI resource: "+jndiName+ " for Model " + modelName + " in VDB " + vdbName + " version " + vdbVersion);
+void assignConnectionFactoryToModel(String vdbName, int vdbVersion, String modelName, String sourceName, String jndiName) throws AdminException{
+ debug("Assigning Connection Factory, source name:" + sourceName +" to JNDI resource: "+jndiName+ " for Model " + modelName + " in VDB " + vdbName + " version " + vdbVersion);
checkAdmin();
- internalAdmin.assignBindingToModel(vdbName, vdbVersion, modelName, sourceName, jndiName);
+ internalAdmin.assignConnectionFactoryToModel(vdbName, vdbVersion, modelName, sourceName, jndiName);
}
@@ -152,50 +152,46 @@
/**
* 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.
+ * @param name of the Connector to add
+ * @param rarFile RAR file to be added
+ * @throws AdminException
*/
-void addConnectorType(String name, String rarFile) {
- debug("Adding Connector Type " + name + " from " + rarFile);
+void addConnector(String name, String rarFile) {
+ debug("Adding Connector " + name + " from " + rarFile);
checkAdmin();
- internalAdmin.addConnectorType(name, new File(rarFile).toURI().toURL());
+ internalAdmin.addConnector(name, new FileInputStream(new File(rarFile)));
}
/**
* Delete Connector Type from Next Configuration
*
- * @param name String name of the Connector Type to delete
- * @throws AdminException if there's a system error.
+ * @param name String name of the Connector to delete
+ * @throws AdminException
*/
-void deleteConnectorType(String name){
- debug("Deleting Connector Type " + name);
+void deleteConnector(String name){
+ debug("Deleting Connector " + name);
checkAdmin();
- internalAdmin.deleteConnectorType(name);
+ internalAdmin.deleteConnector(name);
}
/**
- * Export Connector Type to character array
- *
- * @param connectorTypeIdentifier
- * the unique identifier for for a {@link ConnectorType}
- * @param fileName
- * Name of the file to export to.
- * @throws AdminException
- * if there's a system error.
- * @since 4.3
+ * Export Connector RAR file
+ *
+ * @param name of the Connector
+ * @return fileName - File name to be saved under
+ * @throws AdminException
*/
-void exportConnectorType(String connectorTypeIdentifier, String fileName) {
- debug("Exporting Connector Type " + connectorTypeIdentifier + " to file " + fileName);
+void exportConnector(String name, String fileName) {
+ debug("Exporting Connector Type " + name + " to file " + fileName);
checkAdmin();
- contents = internalAdmin.exportConnectorType(connectorTypeIdentifier);
+ contents = internalAdmin.exportConnector(name);
if (contents != null) {
ObjectConverterUtil.write(contents, fileName);
}
else {
- throw new AdminProcessingException("Connector type with name "+ connectorTypeIdentifier + " is not found to export");
+ throw new AdminProcessingException("Connector type with name "+ name + " is not found to export");
}
}
@@ -227,54 +223,32 @@
/**
- * Set/update the property for the Connector Binding identified by the given deployed name.
+ * Set/update the property for the Connection Factory identified by the given deployed name.
* @param deployedName
* @param propertyName
* @param propertyValue
* @throws AdminException
*/
-void setConnectorBindingProperty(String deployedName, String propertyName, String propertyValue) {
- debug("Setting property for Connector Binding: "+deployedName+" with property="+propertyName+" value="+propertyValue);
+void setConnectionFactoryProperty(String deployedName, String propertyName, String propertyValue) {
+ debug("Setting property for Connection Factory: "+deployedName+" with property="+propertyName+" value="+propertyValue);
checkAdmin();
- internalAdmin.setConnectorBindingProperty(deployedName, propertyName, propertyValue);
+ internalAdmin.setConnectionFactoryProperty(deployedName, propertyName, propertyValue);
}
-/**
- * Assign {@link ConnectorBinding}s to a {@link VDB}'s Model. If the supplied model does not
- * support MultiSource bindings, then only the first binding in the supplied array is assigned and
- * the remainder are ignored.
- *
- * @param connectorBindingNames
- * Names of the ConnectorBindings
- * @param vdbName
- * Name of the VDB
- * @param vdbVersion
- * Version of the VDB
- * @param modelName
- * Name of the Model to map Connector Bindings
- * @throws AdminException
- * if there's a system error or if there's a user input error.
- */
-void assignBindingsToModel(String[] connectorBindingNames, String vdbName, String vdbVersion, String modelName) {
- debug("Assigning the bindings to model");
- checkAdmin();
- internalAdmin.assignBindingsToModel(connectorBindingNames, vdbName, vdbVersion, modelName);
-}
-
// *********************************************************************************************
// Monitor Methods
//
// *********************************************************************************************
/**
- * Get the Connector Types available in the configuration.
+ * Get the Connectors available in the configuration.
*
- * @return Set of connector types.
- * @throws AdminException if there's a system error.
+ * @return Set of connector names.
+ * @throws AdminException
*/
-Set getConnectorTypes() {
+Set getConnectorNames() {
checkAdmin();
- result = internalAdmin.getConnectorTypes();
+ result = internalAdmin.getConnectorNames();
debug(result);
return result;
}
@@ -308,43 +282,42 @@
}
/**
- * Get all the Connector Bindings for the given VDB identifier pattern
+ * Get all the Connection Factories 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.
- * @since 4.3
+ * @return Collection of {@link ConnectionFactory}
+ * @throws AdminException
*/
-Collection getConnectorBindingsInVDB(String vdbName, int vdbVersion) {
+Collection getConnectionFactoriesInVDB(String vdbName, int vdbVersion) {
checkAdmin();
- result = internalAdmin.getConnectorBindingsInVDB(vdbName, vdbVersion);
+ result = internalAdmin.getConnectionFactoriesInVDB(vdbName, vdbVersion);
debug(result);
return result;
}
/**
- * Get the Connector Bindings that are available in the configuration
+ * Get the Connection Factories that are available in the configuration
*
- * @return Collection of {@link ConnectorBinding}
- * @throws AdminException if there's a system error.
+ * @return Collection of {@link ConnectionFactory}
+ * @throws AdminException
*/
-Collection getConnectorBindings() {
+Collection getConnectionFactories() {
checkAdmin();
- result = internalAdmin.getConnectorBindings();
+ result = internalAdmin.getConnectionFactories();
debug(result);
return result;
}
/**
- * 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.
+ * Get the Connection Factory by the given the deployed name.
+ * @param deployedName - name of the deployed Connection Factory
+ * @return null if not found a Connection Factory by the given name
+ * @throws AdminException
*/
-ConnectorBinding getConnectorBinding(String deployedName) {
+ConnectionFactory getConnectionFactory(String deployedName) {
checkAdmin();
- result = internalAdmin.getConnectorBinding(deployedName);
+ result = internalAdmin.getConnectionFactory(deployedName);
debug(result);
return result;
}
@@ -369,13 +342,13 @@
* 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
+ * @param deployedName - an identifier that corresponds to the connection factory Name
* @return {@link ConnectionPoolStatistics}
* @throws AdminException if there's a system error.
*/
-ConnectionPoolStatistics getConnectorConnectionPoolStats(String deployedName) {
+ConnectionPoolStatistics getConnectionFactoryStats(String deployedName) {
checkAdmin();
- result =internalAdmin.getConnectorConnectionPoolStats(deployedName);
+ result =internalAdmin.getConnectionFactoryStats(deployedName);
debug(result);
return result;
}
@@ -429,14 +402,14 @@
}
/**
- * Get all of the available Configuration Properties for the specified AdminObject, and details about them.
- * @param connectorTypeIdentifier
- * @return
+ * Get all of the available Configuration Properties for the specified connector
+ * @param connectorName - Name of the connector
+ * @return set of property definitions
* @throws AdminException
*/
-Collection getConnectorTypePropertyDefinitions(String identifier){
+Collection getConnectorPropertyDefinitions(String connectorName){
checkAdmin();
- result = internalAdmin.getConnectorTypePropertyDefinitions(identifier);
+ result = internalAdmin.getConnectorPropertyDefinitions(connectorName);
debug(result);
return result;
}
@@ -467,26 +440,27 @@
/**
- * Start Connector Binding
+ * Start Connection Factory
*
- * @param deployedName
- * @throws AdminException if there's a system error.
+ * @param factory
+ * @throws AdminException
*/
-void startConnectorBinding(String deployedName) {
- debug("Starting Connector Binding " + deployedName);
+void startConnectionFactory(String deployedName) {
+ debug("Starting Connection Factory " + deployedName);
checkAdmin();
- internalAdmin.startConnectorBinding(deployedName);
+ internalAdmin.startConnectionFactory(deployedName);
}
/**
- * Stop Connector Binding
+ * Stop Connection Factory
*
- * @param deployedName identifier for {@link org.teiid.adminapi.ConnectorBinding}
+ * @param factory
+ * @throws AdminException
*/
-void stopConnectorBinding(String deployedName) {
- debug("Stoping Connector Binding " + deployedName);
+void stopConnectionFactory(String deployedName) {
+ debug("Stoping Connection Factory " + deployedName);
checkAdmin();
- internalAdmin.stopConnectorBinding(deployedName, true);
+ internalAdmin.stopConnectionFactory(deployedName, true);
}
/**
@@ -573,16 +547,16 @@
}
/**
- * Checks to make sure the given binging exists.
- * @param bindingName - Name of the Binding.
+ * Checks to make sure the given connection factory exists.
+ * @param factoryName - Name of the connection factory
* @return boolean - true if exists; false otherwise
*/
-boolean hasBinding(String bindingName) {
+boolean hasConnectionFactory(String factoryName) {
checkAdmin();
- Collection bindings = internalAdmin.getConnectorBindings();
+ Collection bindings = internalAdmin.getConnectionFactories();
- for (ConnectorBinding binding:bindings) {
- if (binding.getName().equals(bindingName)) {
+ for (ConnectionFactory binding:bindings) {
+ if (binding.getName().equals(factoryName)) {
debug(true);
return true;
}
@@ -592,16 +566,16 @@
}
/**
- * Checks if given Connector Type exists in system
- * @param typeName - Binding type name
+ * Checks if given Connector exists in system
+ * @param typeName - connector name
* @return boolean - true if exists; false otherwise
*/
-boolean hasConnectorType(String typeName) {
+boolean hasConnector(String typeName) {
checkAdmin();
- Collection types = internalAdmin.getConnectorTypes();
+ Collection types = internalAdmin.getConnectorNames();
- for (ConnectorType type:types) {
- if (type.getName().equals(typeName)) {
+ for (String type:types) {
+ if (type.equals(typeName)) {
debug(true);
return true;
}
Modified: trunk/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
===================================================================
--- trunk/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -54,7 +54,7 @@
<property name="VDBRepository"><inject bean="VDBRepository"/></property>
</bean>
- <bean name="ConnectorBindingDeployer" class="org.teiid.jboss.deployers.ConnectorBindingDeployer">
+ <bean name="ConnectionFactoryDeployer" class="org.teiid.jboss.deployers.ConnectionFactoryDeployer">
<property name="securityHelper"><inject bean="SecurityHelper"/></property>
<property name="connectorManagerRepository"><inject bean="ConnectorManagerRepository"/></property>
<property name="managedObjectFactory"><inject bean="ManagedObjectFactory"/></property>
Modified: trunk/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -33,92 +33,87 @@
public enum Cache {CODE_TABLE_CACHE,PREPARED_PLAN_CACHE, QUERY_SERVICE_RESULT_SET_CACHE};
/**
- * Assign a {@link ConnectorBinding} to a {@link VDB}'s Model
+ * Assign a {@link ConnectionFactory} to a {@link VDB}'s Model
*
* @param vdbName Name of the VDB
* @param vdbVersion Version of the VDB
- * @param modelName Name of the Model to map Connector Binding
+ * @param modelName Name of the Model to map Connection Factory
* @param sourceName sourceName for the model
* @param jndiName JNDI names to which the source name needs to map to
- * @throws AdminException if there's a system error or if there's a user input error.
+ * @throws AdminException
*/
- void assignBindingToModel(String vdbName,
- int vdbVersion,
- String modelName,
- String sourceName,
- String jndiName) throws AdminException;
+ void assignConnectionFactoryToModel(String vdbName, int vdbVersion, String modelName, String sourceName, String jndiName) throws AdminException;
/**
- * Set/update the property for the Connector Binding identified by the given deployed name.
+ * Set/update the property for the Connection Factory identified by the given deployed name.
* @param deployedName
* @param propertyName
* @param propertyValue
* @throws AdminException
*/
- void setConnectorBindingProperty(String deployedName, String propertyName, String propertyValue) throws AdminException;
+ void setConnectionFactoryProperty(String deployedName, String propertyName, String propertyValue) throws AdminException;
/**
- * Add Connector Type, will import Connector Type from a file
+ * Add Connector, will import RAR from a file
*
- * @param name of the Connector Type to add
+ * @param name of the Connector to add
* @param rar RAR file
- * @throws AdminException if there's a system error.
+ * @throws AdminException
*/
- void addConnectorType(String name, InputStream rar) throws AdminException;
+ void addConnector(String name, InputStream rar) throws AdminException;
/**
- * Delete Connector Type from Next Configuration
+ * Delete Connector
*
- * @param name String name of the Connector Type to delete
- * @throws AdminException
- * if there's a system error.
+ * @param name String name of the Connector to delete
+ * @throws AdminException
*/
- void deleteConnectorType(String name) throws AdminException;
+ void deleteConnector(String name) throws AdminException;
/**
- * Export Connector Type rar file
+ * Export Connector RAR file
*
- * @param @param name of the Connector Type
+ * @param name of the Connector
* @return InputStream of contents of the rar file
- * @throws AdminException if there's a system error.
+ * @throws AdminException
*/
- InputStream exportConnectorType(String name) throws AdminException;
+ InputStream exportConnector(String name) throws AdminException;
/**
- * Deploy a {@link ConnectorBinding} to Configuration
+ * Deploy a {@link ConnectionFactory} to Configuration
*
- * @param deployedName Connector Binding name that will be added to Configuration
+ * @param deployedName Connection Factory name that will be added to Configuration
* @param typeName Connector type name.
- * @param properties Name & Value pair need to deploy the Connector Binding
+ * @param properties Name & Value pair need to deploy the Connection Factory
- * @throws AdminException if there's a system error.
+ * @throws AdminException
*/
- ConnectorBinding addConnectorBinding(String deployedName, String typeName, Properties properties) throws AdminException;
+ ConnectionFactory addConnectionFactory(String deployedName, String typeName, Properties properties) throws AdminException;
/**
- * Delete the {@link ConnectorBinding} from the Configuration
+ * Delete the {@link ConnectionFactory} from the Configuration
*
- * @param deployedName - deployed name of the connector binding
- * @throws AdminException if there's a system error.
+ * @param deployedName - deployed name of the connection factory
+ * @throws AdminException
*/
- void deleteConnectorBinding(String deployedName) throws AdminException;
+ void deleteConnectionFactory(String deployedName) throws AdminException;
/**
- * Export a {@link ConnectorBinding} to character Array in XML format
+ * Export a {@link ConnectionFactory} to character Array in XML format
*
- * @param deployedName the unique identifier for a {@link ConnectorBinding}.
+ * @param deployedName the unique identifier for a {@link ConnectionFactory}.
* @return Reader in XML format
* @throws AdminException
- * if there's a system error.
+ *
*/
- Reader exportConnectorBinding(String deployedName) throws AdminException;
+ Reader exportConnectionFactory(String deployedName) throws AdminException;
/**
* Deploy a {@link VDB} file.
* @param name Name of the VDB file to save under
* @param VDB VDB.
* @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, InputStream vdb) throws AdminException;
@@ -138,7 +133,7 @@
* @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.
+ * @throws AdminException
*/
InputStream exportVDB(String vdbName, int vdbVersion) throws AdminException;
@@ -150,19 +145,19 @@
void setRuntimeProperty(String propertyName, String propertyValue) throws AdminException;
/**
- * Get the Connector Types available in the configuration.
+ * Get the Connectors available in the configuration.
*
- * @return Set of connector types.
- * @throws AdminException if there's a system error.
+ * @return Set of connector names.
+ * @throws AdminException
*/
- Set<String> getConnectorTypes() throws AdminException;
+ Set<String> getConnectorNames() 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.
+ * @throws AdminException
*/
Set<VDB> getVDBs() throws AdminException;
@@ -170,43 +165,42 @@
* Get the VDB
* @param vdbName
* @param vbdVersion
- * @throws AdminException if there's a system error.
+ * @throws AdminException
* @return
*/
VDB getVDB(String vdbName, int vbdVersion) throws AdminException;
/**
- * Get the Connector Bindings that are available in the configuration
+ * Get the Connection Factories that are available in the configuration
*
- * @return Collection of {@link ConnectorBinding}
- * @throws AdminException if there's a system error.
+ * @return Collection of {@link ConnectionFactory}
+ * @throws AdminException
*/
- Collection<ConnectorBinding> getConnectorBindings() throws AdminException;
+ Collection<ConnectionFactory> getConnectionFactories() 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.
+ * Get the Connection Factory by the given the deployed name.
+ * @param deployedName - name of the deployed Connection Factory
+ * @return null if not found a Connection Factory by the given name
+ * @throws AdminException
*/
- ConnectorBinding getConnectorBinding(String deployedName) throws AdminException;
+ ConnectionFactory getConnectionFactory(String deployedName) throws AdminException;
/**
- * Get all the Connector Bindings for the given VDB identifier pattern
+ * Get all the Connection Factories 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.
+ * @return Collection of {@link ConnectionFactory}
+ * @throws AdminException
*/
- Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, int vdbVersion) throws AdminException;
+ Collection<ConnectionFactory> getConnectionFactoriesInVDB(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.
+ * @param identifier - an identifier for the queues {@link QueueWorkerPool}.
* @return Collection of {@link QueueWorkerPool}
- * @throws AdminException if there's a system error.
+ * @throws AdminException
*/
WorkerPoolStatistics getWorkManagerStats(String identifier) throws AdminException;
@@ -216,49 +210,49 @@
* 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
+ * @param deployedName - an identifier that corresponds to the connection factory Name
* @return {@link ConnectionPoolStatistics}
- * @throws AdminException if there's a system error.
+ * @throws AdminException
*/
- ConnectionPoolStatistics getConnectorConnectionPoolStats(String deployedName) throws AdminException;
+ ConnectionPoolStatistics getConnectionFactoryStats(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.
+ * @throws AdminException
*/
Collection<String> getCacheTypes() throws AdminException;
/**
* Get all the current Sessions.
* @return Collection of {@link Session}
- * @throws AdminException if there's a system error.
+ * @throws AdminException
*/
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.
+ * @throws AdminException
*/
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.
+ * @throws AdminException
*/
Collection<Request> getRequestsForSession(long sessionId) throws AdminException;
/**
- * Get all of the available Configuration Properties for the specified AdminObject, and details about them.
- * @param connectorTypeIdentifier
+ * Get all of the available configuration Properties for the specified connector
+ * @param connectorName - Name of the connector
* @return
* @throws AdminException
*/
- Collection<PropertyDefinition> getConnectorTypePropertyDefinitions(String connectorTypeIdentifier) throws AdminException;
+ Collection<PropertyDefinition> getConnectorPropertyDefinitions(String connectorName) throws AdminException;
/**
@@ -268,7 +262,8 @@
*/
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}
@@ -278,28 +273,29 @@
* @throws AdminException if there's a system error.
*/
Collection<ProcessObject> getProcesses(String processIdentifier) throws AdminException;
+
-
/**
- * Start Connector Binding
+ * Start Connection Factory
*
- * @param deployedName
- * @throws AdminException if there's a system error.
+ * @param factory
+ * @throws AdminException
*/
- void startConnectorBinding(ConnectorBinding binding) throws AdminException;
+ void startConnectionFactory(ConnectionFactory factory) throws AdminException;
/**
- * Stop Connector Binding
+ * Stop Connection Factory
*
- * @param deployedName identifier for {@link org.teiid.adminapi.ConnectorBinding}
+ * @param factory
+ * @throws AdminException
*/
- void stopConnectorBinding(ConnectorBinding binding) throws AdminException;
+ void stopConnectionFactory(ConnectionFactory factory) 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.
+ * @throws AdminException
*/
void clearCache(String cacheType) throws AdminException;
@@ -308,7 +304,7 @@
*
* @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.
+ * @throws AdminException
*/
void terminateSession(long sessionId) throws AdminException;
@@ -318,7 +314,7 @@
* @param sessionId session Identifier for the request.
* @param requestId request Identifier
*
- * @throws AdminException if there's a system error.
+ * @throws AdminException
*/
void cancelRequest(long sessionId, long requestId) throws AdminException;
Copied: trunk/client/src/main/java/org/teiid/adminapi/ConnectionFactory.java (from rev 2020, trunk/client/src/main/java/org/teiid/adminapi/ConnectorBinding.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/ConnectionFactory.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/ConnectionFactory.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.adminapi;
+
+
+/**
+ * Represents a connector binding (the instance of a connector type) in the Teiid system.
+ */
+public interface ConnectionFactory extends AdminObject {
+
+ /**
+ * Get the identifier for this connector binding's RAR file name
+ * @return Name of the RAR file used to create this binding
+ */
+ String getRARFileName();
+
+ /**
+ * Get the JNDI Name of this connector
+ * @return
+ */
+ String getJNDIName();
+}
Deleted: trunk/client/src/main/java/org/teiid/adminapi/ConnectorBinding.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/ConnectorBinding.java 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/client/src/main/java/org/teiid/adminapi/ConnectorBinding.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -1,42 +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;
-
-
-/**
- * Represents a connector binding (the instance of a connector type) in the Teiid system.
- */
-public interface ConnectorBinding extends AdminObject {
-
- /**
- * Get the identifier for this connector binding's RAR file name
- * @return Name of the RAR file used to create this binding
- */
- String getRARFileName();
-
- /**
- * Get the JNDI Name of this connector
- * @return
- */
- String getJNDIName();
-}
Copied: trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionFactoryMetaData.java (from rev 2021, trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionFactoryMetaData.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionFactoryMetaData.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -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.impl;
+
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.adminapi.ConnectionFactory;
+
+@ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="connector"))
+public class ConnectionFactoryMetaData extends AdminObjectImpl implements ConnectionFactory {
+
+ private static final long serialVersionUID = -4865836616882247016L;
+ private transient Object type;
+ private String rarFileName;
+ private String jndiName;
+
+ @ManagementProperty(description="Connector Binding Name")
+ public String getName() {
+ return super.getName();
+ }
+
+ @Override
+ @ManagementProperty(description="RAR file name")
+ public String getRARFileName() {
+ return this.rarFileName;
+ }
+
+ public void setRARFileName(String name) {
+ this.rarFileName = name;
+ }
+
+ @Override
+ @ManagementProperty(description="JNDI name")
+ public String getJNDIName() {
+ return this.jndiName;
+ }
+
+ public void setJNDIName(String name) {
+ this.jndiName = name;
+ }
+
+ public void setComponentType(Object type) {
+ this.type = type;
+ }
+
+ public Object getComponentType() {
+ return this.type;
+ }
+
+ public String toString() {
+ return getName();
+ }
+}
Property changes on: trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectionFactoryMetaData.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -1,73 +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.ManagementProperty;
-import org.teiid.adminapi.ConnectorBinding;
-
-@ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="connector"))
-public class ConnectorBindingMetaData extends AdminObjectImpl implements ConnectorBinding {
-
- private static final long serialVersionUID = -4865836616882247016L;
- private transient Object type;
- private String rarFileName;
- private String jndiName;
-
- @ManagementProperty(description="Connector Binding Name")
- public String getName() {
- return super.getName();
- }
-
- @Override
- @ManagementProperty(description="RAR file name")
- public String getRARFileName() {
- return this.rarFileName;
- }
-
- public void setRARFileName(String name) {
- this.rarFileName = name;
- }
-
- @Override
- @ManagementProperty(description="JNDI name")
- public String getJNDIName() {
- return this.jndiName;
- }
-
- public void setJNDIName(String name) {
- this.jndiName = name;
- }
-
- public void setComponentType(Object type) {
- this.type = type;
- }
-
- public Object getComponentType() {
- return this.type;
- }
-
- public String toString() {
- return getName();
- }
-}
Modified: trunk/connectors/connector-xml/src/main/resources/com/metamatrix/connector/xml/base/I18N.properties
===================================================================
--- trunk/connectors/connector-xml/src/main/resources/com/metamatrix/connector/xml/base/I18N.properties 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/connectors/connector-xml/src/main/resources/com/metamatrix/connector/xml/base/I18N.properties 2010-04-05 19:52:52 UTC (rev 2023)
@@ -51,7 +51,7 @@
HTTPExecutor.error.building.column=Error building input parameters
QueryAnalyzer.multiple.responseid.supplied=Multiple different values for Response In field(s) supplied
QueryAnalyzer.multiple.locations.supplied=Multiple different values for Location field(s) supplied
-document.expired.can.not.recreate=The cached document has expired and the connector binding is set to not recreate it
+document.expired.can.not.recreate=The cached document has expired and the connection factory is set to not recreate it
HTTPExecutor.root.element.required=All XML requests require a root input element.
Executor.error.decoding.request.id=Unable to decode request id
Executor.unable.to.encode.response.id=Unable to encode response id
@@ -62,10 +62,10 @@
DocumentBuilder.encoding.type.required=Native types are required when using RPC-encoded or Document-Encoded messages
document.expired.can.not.recreate=The target document has expired from the cache.
SecureConnectorState.error.loading.trust.deserializer=An error occured loading the Trust Deserializer class.
-SecureConnectorState.empty.trust.deserializer=The Trust Deserializer field in the connector binding is null or empty.
-SOAPConnectorStateImpl.empty.ENCODING_STYLE_PROPERTY_NAME=The Encoding Style in the connector binding is null or empty.
-SOAPConnectorStateImpl.invalid.ENCODING_STYLE_PROPERTY_NAME=The Encoding Style in the connector binding is not one of the expected values: {0}, {1}, {2}, {3}.
+SecureConnectorState.empty.trust.deserializer=The Trust Deserializer field in the connection factory is null or empty.
+SOAPConnectorStateImpl.empty.ENCODING_STYLE_PROPERTY_NAME=The Encoding Style in the connection factory is null or empty.
+SOAPConnectorStateImpl.invalid.ENCODING_STYLE_PROPERTY_NAME=The Encoding Style in the connection factory is not one of the expected values: {0}, {1}, {2}, {3}.
SOAPConnectorStateImpl.empty.AUTH_USER_PROPERTY_NAME=Authentication is enabled but the Authentication User Name is null or empty.
SOAPConnectorStateImpl.empty.AUTH_PASSWORD_PROPERTY_NAME=Authentication is enabled but the Authentication Password is null or empty.
-SOAPConnectorStateImpl.empty.CONNECTOR_EXCEPTION_ON_SOAP_FAULT=The Exception On Intra-Query Cache Expiration field in the connector binding is null or empty.
+SOAPConnectorStateImpl.empty.CONNECTOR_EXCEPTION_ON_SOAP_FAULT=The Exception On Intra-Query Cache Expiration field in the connection factory is null or empty.
InputStream_reset_not_supported=Mark/Reset are not supported on the InputStreamFilterClass
\ No newline at end of file
Modified: trunk/connectors/connector-xml-soap/src/main/resources/org/teiid/connector/xml/i18n.properties
===================================================================
--- trunk/connectors/connector-xml-soap/src/main/resources/org/teiid/connector/xml/i18n.properties 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/connectors/connector-xml-soap/src/main/resources/org/teiid/connector/xml/i18n.properties 2010-04-05 19:52:52 UTC (rev 2023)
@@ -52,7 +52,7 @@
using_timestamp_profile=Using the Timestamp Ws-Security Profile
no_encryption_property_file=No encryption.properties file defined; This crypto file is needed for the Encrypt Security profile
No_such_auth_type=Requested Authorization support is currently not available:{0}; Or invalid type specified.
-No_ws_security_type=Ws-Secuirty type selected for web service authentication, however the type of WS-Security being used not specified, Please provide "WSSecurityType" property in the connector binding properties
-No_such_ws_security_type=The specified WS-Secuity type "{0}" is invalid or not currently supported, please correct the connector binding properties.
+No_ws_security_type=Ws-Secuirty type selected for web service authentication, however the type of WS-Security being used not specified, Please provide "WSSecurityType" property in the connection factory properties
+No_such_ws_security_type=The specified WS-Secuity type "{0}" is invalid or not currently supported, please correct the connection factory properties.
XML_file_does_not_UTF8=XML File being read can not be converted to UTF-8 encoding.
support_only_doc_literal=Web service execution only supports DOC-Literal style of web services.
\ No newline at end of file
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/connection-management.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/connection-management.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/connection-management.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -28,7 +28,7 @@
</sect1>
<sect1>
<title>Handling Multiple Connections</title>
- <para>Using MMAdmin, user can actively manage more than one connection to a single or multiple Teiid
+ <para>Using AdminShell, user can actively manage more than one connection to a single or multiple Teiid
systems. For example, two separate connections can be maintained, one to the development server and one to
the integration server at the same time. This is possible because Admin Shell supports a feature called named
connections. </para>
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/getting-started.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/getting-started.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/getting-started.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="getting_started">
- <title>Getting Started with MMAdmin</title>
+ <title>Getting Started with Admin Shell</title>
<para>
To learn the basics of BeanShell (<ulink url="http://beanshell.org/">http://beanshell.org</ulink>)
take a look at their documents and tutorials on their website A copy of the BeanShell document is also can
- be found in the Admin Shell installation directory. Learn how basic scripts can be written and get familiar with
+ be found in the AdminShell installation directory. Learn how basic scripts can be written and get familiar with
some commonly used commands.
</para>
<para>Note: BeanShell documentation provided is of version 1.3, which is taken as is from their website,
for latest changes refer to BeanShell website. The BeanShell version 2.0b4 is currently being used in
- MMAdmin.</para>
+ AdminShell.</para>
<para>
Basic knowledge of the Java programming language is required in order to effectively design and develop
- scripts using the MMAdmin. To learn Java language find learning resources at
+ scripts using the AdminShell. To learn Java language find learning resources at
<ulink url="http://java.sun.com/">http://java.sun.com</ulink>.
</para>
<para>You can learn about the Teiid administrative API either using “help()” command or find JavaDoc
for in the installation directory.</para>
- <para>Admin Shell is a specialized version of BeanShell with lots of pre-built libraries and scripts
- designed to be used with the Teiid system. Admin Shell works in two different modes: interactive or script
+ <para>AdminShell is a specialized version of BeanShell with lots of pre-built libraries and scripts
+ designed to be used with the Teiid system. AdminShell works in two different modes: interactive or script
run mode.</para>
<para>In interactive mode, user can invoke the tool and connect to a live Teiid system and issue any
ad-hoc commands to control the system or issue a SQL query against connected virtual database and view the
@@ -30,8 +30,8 @@
system</para>
<sect1>
- <title>Essential rules to follow in using MMAdmin</title>
- <para>To use Admin Shell successfully, there are some syntactical rules you should keep in mind.</para>
+ <title>Essential rules to follow in using AdminShell</title>
+ <para>To use AdminShell successfully, there are some syntactical rules you should keep in mind.</para>
<orderedlist>
<listitem>
<para>All the commands end with semi-colon [;]. Commands without any input parameters end with open
@@ -81,13 +81,13 @@
script finishes the tool will exit automatically, however you still have to disconnect from Teiid
system in the script.</para>
<para>Note: If SSL is turned on the Teiid server, you would need to supply the correct certificates
- for connection. Edit the command file used to execute the Admin Shell and make sure correct trust store is
+ for connection. Edit the command file used to execute the AdminShell and make sure correct trust store is
defined in the path.</para>
</sect1>
<sect1>
<title>Basic commands to get started</title>
- <para>The list below contains some common commands used in Admin Shell. The best way to learn scripting in the
- Admin Shell is to read the scripts in "samples" directory in the Admin Shell kit's installation directory, and
+ <para>The list below contains some common commands used in AdminShell. The best way to learn scripting in the
+ AdminShell is to read the scripts in "samples" directory in the AdminShell kit's installation directory, and
experiment your own scripts using a developer instance of Teiid System.</para>
<programlisting><![CDATA[
print("xxx"); // print something to console
@@ -113,7 +113,7 @@
</sect1>
<sect1>
<title>"help" command</title>
- <para>This below command lists all the available administrative API commands in the MMAdmin. Please note
+ <para>This below command lists all the available administrative API commands in the AdminShell. Please note
that none of the BeanShell commands or custom commands will be shown in this list. Documentation is only
source for reviewing those commands presently.</para>
<programlisting><![CDATA[
@@ -122,18 +122,16 @@
<para>To get a specific definition about a command and it's required input parameters , use the below form
of help. The example shown will show detailed JavaDoc description about "addVDB" method.</para>
<programlisting><![CDATA[
-admin $ help("addVDB");
-/**
- * Import a {@link VDB} file.
- * <br>A VDB file with internal definitions. This is the default VDB export configuration
- * begining with MetaMatrix version 4.3.</br>
- *
- * @param name VDB Name
- * @param vdbFile byte array of the VDB Archive
- * @param option Code of the AdminOptions to use when executing this method. There are
- choices aboutwhat to do when a connector binding with the given identifier already exists in the system.
- */
-VDB addVDB ( String name , String vdbFile , int option
+admin $ help("deployVDB");
+ /**
+ * Deploy a {@link VDB} file.
+ * @param name Name of the VDB file to save under
+ * @param VDB VDB.
+ * @throws AdminException
+ *
+ * @return the {@link VDB} representing the current property values and runtime state.
+ */
+public void deployVDB(String fileName, InputStream vdb)
]]></programlisting>
<para />
<para>If not sure about exact command, and to narrow the list available commands, help can be used in the
@@ -141,9 +139,9 @@
<programlisting><![CDATA[
admin $ help(“get*”);
]]></programlisting>
- <para>This will list all the commands available that begin with “get”, for example “getconnectorBindings,
+ <para>This will list all the commands available that begin with “get”, for example “getConnectionFactories,
getVDBs” etc.</para>
- <para>For every administrative API call, there is corresponding command in MMAdmin. For a reference to
+ <para>For every administrative API call, there is corresponding command in AdminShell. For a reference to
full administrative API, please look at “documents” sections in the installation directory.</para>
</sect1>
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/introduction.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/introduction.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/introduction.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -3,10 +3,10 @@
<chapter id="introduction">
<title>Introduction Teiid Admin Shell</title>
<sect1>
- <title>Introduction to MMAdmin</title>
+ <title>Introduction to AdminShell</title>
<para>
Admin Shell is a script based programming environment that enables user to access, monitor and control Teiid
- Server and MMQuery environments. This tool is built using programming language called BeanShell (
+ Server. This tool is built using programming language called BeanShell (
<ulink url="http://beanshell.org/">http://beanshell.org</ulink>
). Admin Shell can be used in ad-hoc scripting, or to run pre-defined scripts. It is not a graphical tool; it's a
command line driven environment.
@@ -27,7 +27,7 @@
</listitem>
<listitem>
<para>It is a migration tool. This can be used to develop scripts like moving the Virtual Databases
- (VDB), Connector Bindings, and Configuration from one development environment to another. This will
+ (VDB), Connection Factories, and Configuration from one development environment to another. This will
enable users to test and automate their migration scripts before production deployments.</para>
</listitem>
<listitem>
@@ -42,7 +42,7 @@
</orderedlist>
<sect2>
<title>Where can you find Admin Shell?</title>
- <para>Admin Shell is available under the “tools” package. Download and unzip this
+ <para>Admin Shell is distributed along with other Teiid downloads under "teiid-{version}-adminshell-dist.zip" name. Download and unzip this
file to any directory. Once you have unzipped the file, in root directory
you will find “adminshell” executable script to invoke the tool.</para>
<para>Windows: Double click or execute "adminshell.cmd"</para>
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/working-with-scripts.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/working-with-scripts.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/working-with-scripts.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -76,7 +76,7 @@
captured in the “directory/filename.bsh” file. This gives the user an option to capture only certain portions
of the interactive session tat they are interested in and ignore the rest of it.</para>
<para />
- <para>Also note that all the output during the interactive mode is sent to "mmadmin.log" file. In the
+ <para>Also note that all the output during the interactive mode is sent to "adminshell.log" file. In the
script mode, no such files are created. In script mode, user can capture the standard out and redirect to a
file if they need the log file.</para>
</sect1>
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/writing-tests.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/writing-tests.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/writing-tests.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="writing_tests">
- <title>Writing Tests using MMAdmin</title>
+ <title>Writing Tests using AdminShell</title>
<para>
<ulink url="http://junit.org">JUnit</ulink>
- testing framework is integrated into the MMAdmin, so you can write regression tests and run tests in the JUnit
+ testing framework is integrated into the AdminShell, so you can write regression tests and run tests in the JUnit
style. To write a test,
<orderedlist>
<listitem>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -28,24 +28,24 @@
</listitem>
<listitem>
<para>
- Before we can deploy the VDB to the server, we need to create and deploy the required Connector Bindings for Derby
- and File sources. Connector bindings are JCA sources that provide the data then their data is integrated through Teiid. If you are
+ Before we can deploy the VDB to the server, we need to create and deploy the required Connection Factories for Derby
+ and File sources. Connection Factories are sources that provide the data then their data is integrated through Teiid. If you are
familiar with creating data sources or connection factories in JBoss AS, then this is exactly the same operation.
</para>
<para>For this example we need to create three (3) different data sources. You would first need to create a data source to Derby.
See ${teiid-examples}/portfolio/PortfolioModel/portfolio-ds.xml.
- Then create Teiid specific connectors to Derby and File sources.
+ Then create Teiid specific connection factories to Derby and File sources.
See ${teiid-examples}/portfolio/PortfolioModel/derby-connector-ds.xml
and ${teiid-examples}/portfolio/PortfolioModel/text-connector-ds.xml</para>
- <para>The reason we created a data source and also a connector binding for Derby is, the data source provides a
- JDBC connection to the portfolio database, and the connector binding provides a Teiid wrapper around
+ <para>The reason we created a data source and also a Connection Factory for Derby is, the data source provides a
+ JDBC connection to the portfolio database, and the Connection Factory provides a Teiid wrapper around
data source that understands execution and query translation defined by the Teiid runtime. The concerns about the
connection and Teiid access are separated into two different sources. So, the data source can be used by any other application
- however the Teid connector is only used by the Teiid. This will be case for any JDBC
+ however the Teid connection factory is only used by the Teiid. This will be case for any JDBC
based sources. The same is not true for File source, because File Connector can access the resource directly itself.</para>
- <para>To deploy these connector bindings copy the "-ds.xml" files into "${jboss-install}/server/{profile}/deploy" directory.
+ <para>To deploy these connection factories copy the "-ds.xml" files into "${jboss-install}/server/{profile}/deploy" directory.
Make sure they are started correctly and you have supplied correct credentials for data source. </para>
</listitem>
<listitem>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/architecture.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/architecture.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/architecture.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -68,7 +68,7 @@
<title>Buffer Management</title>
<para> The buffer manager manages memory for all result sets used
in the query engine. That includes result sets read from a
- connector binding, result sets used temporarily during
+ connection factory, result sets used temporarily during
processing, and result sets prepared for a user. Each result set
is referred to in the buffer manager as a tuple source.</para>
<para>When retrieving batches from the buffer manager, the
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/connectors.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/connectors.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/connectors.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -30,13 +30,12 @@
<tbody>
<row>
<entry>
- <para>ConnectorBindingName</para>
+ <para>ConnectorClass</para>
</entry>
<entry>
- <para>The name of the connector binding. Must be unique
- across all connector bindings. This property is not
- editable, and is not seen in the Designer in the
- connector properties table.</para>
+ <para>The class name of the custom connector class that
+ connects to the data source. Required. Not editable.
+ </para>
</entry>
<entry>
<para>string</para>
@@ -47,12 +46,10 @@
</row>
<row>
<entry>
- <para>ConnectorClass</para>
+ <para>CapabilitiesClass</para>
</entry>
<entry>
- <para>The class name of the custom connector class that
- connects to the data source. Required. Not editable.
- </para>
+ <para>The class is used to provide the Connector Capabilities</para>
</entry>
<entry>
<para>string</para>
@@ -63,14 +60,13 @@
</row>
<row>
<entry>
- <para>ConnectorMaxThreads</para>
+ <para>Immutable</para>
</entry>
<entry>
- <para>The maximum number of connector worker threads.
- Required.</para>
+ <para>True if the source never changes.</para>
</entry>
<entry>
- <para>integer</para>
+ <para>boolean</para>
</entry>
<entry>
<para />
@@ -78,6 +74,20 @@
</row>
<row>
<entry>
+ <para>XaCapable</para>
+ </entry>
+ <entry>
+ <para>True, if this connector supports XA Transactions</para>
+ </entry>
+ <entry>
+ <para>boolean</para>
+ </entry>
+ <entry>
+ <para />
+ </entry>
+ </row>
+ <row>
+ <entry>
<para>ExceptionOnMaxRows</para>
</entry>
<entry>
@@ -116,4 +126,9 @@
</tgroup>
</informaltable>
</sect1>
+ <sect1>
+ <title>Source Security</title>
+ <para>For the configuring the Connection Factories and Data Sources with security check out JBoss AS documentation.</para>
+ </sect1>
+
</chapter>
\ No newline at end of file
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -323,7 +323,7 @@
<sect3>
<title>Source Unavailability</title>
<para>A source is considered to be 'unavailable' if the
- connector binding associated with the source issues an
+ connection factory associated with the source issues an
exception in response to a query. The exception will be
propagated to the query processor, where it will become a
warning in the result set.</para>
@@ -472,7 +472,7 @@
<itemizedlist>
<listitem>
<para>Access - Access a source. A source query is sent
- to the connector binding associated with the source. [For a
+ to the connection factory associated with the source. [For a
dependent join, this node is called Dependent Select.]
</para>
<para />
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-04-05 19:52:52 UTC (rev 2023)
@@ -2097,11 +2097,8 @@
<para>Optionally extend the OracleSQLTranslator to insert new FunctionModifiers to handle translation of these functions. Given that the syntax of these functions is same as other typical functions, this probably isn't needed - the default translation should work.</para>
</listitem>
<listitem>
- <para>Create a new connector type - the easiest way is to export the Oracle ANSI connector type from the Console and just modify the properties such as the connector name (to differentiate it from base Oracle connector) and the capabilities class (to use the extended version) and possibly the translation class (if that was extended for b. Also, connector classpath needs to be extended to include a new jar of your changes above.</para>
+ <para>Create a new connector - The easiest way is to copy JDBC connector rar file from the distribution and modify the "ra.xml" file. Change the capabilities class (to use the extended version) and possibly the translation class (if that was extended for b. Also, include a new jar of your changes above in the same rar file. Rename the RAR file to different name to differentiate from original JDBC rar file.</para>
</listitem>
- <listitem>
- <para>Install the code as an extension module and add your new connector type in the Console.</para>
- </listitem>
</itemizedlist>
</sect2>
<sect2>
Modified: trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties 2010-04-05 19:52:52 UTC (rev 2023)
@@ -96,7 +96,7 @@
DataTierManager.Could_not_deliver_partial_results_for_{0}_as_the_atomic_query_request_could_not_be_obtained_for_nodeID_{1}=Could not deliver partial results for {0} as the atomic query request could not be obtained for nodeID {1}
DataTierManager.Unable_to_load_code_table_for_requestID_{0}_of_and_nodeID_of_{1}_because_result_sizes_exceeds_the_allowed_parameter_-_MaxCodeTableRecords.=Unable to load code table for requestID {0} of and nodeID of {1} because result sizes exceeds the allowed parameter - MaxCodeTableRecords.
DataTierManager.Failed_to_register_request.=Failed to register request.
-DataTierManager.could_not_obtain_connector_id=Could not obtain a connector binding ID or a connector ID from the atomic request.
+DataTierManager.could_not_obtain_connector_id=Could not obtain a connection factory ID or a connector ID from the atomic request.
DataTierManager.Could_not_deliver_response_for_{0}_as_a_matching_atomic_request_could_not_be_found.=Could not deliver response for {0} as a matching atomic request could not be found.
DataTierManager.Could_not_deliver_response_for_{0}_as_the_QueryProcessor_could_not_be_obtained.=Could not deliver response for {0} as the QueryProcessor could not be obtained.
DataTierManager.Unable_to_load_code_table_because_code_table_entries_exceeds_the_allowed_parameter_-_MaxCodeTables.=Unable to load code table because code table entries exceeds the allowed parameter - MaxCodeTables.
@@ -104,7 +104,7 @@
DataTierManager.cannot_register_request=Could not register a request on connector "{0}" with connector ID "{1}". Please ensure that the connector is running. Cause: {2}
DataTierManager.Unable_to_resolve_query.=Unable to resolve query.
DataTierManager.Unable_to_add_txn_result_for_request_{0}=Unable to add txn result for request {0}.
-DataTierManager.could_not_obtain_connector_binding=Could not obtain connector binding for model {0} in VDB name= {1}, version {2}
+DataTierManager.could_not_obtain_connector_binding=Could not obtain connection factory for model {0} in VDB name= {1}, version {2}
DataTierManager.Error_lob=Error during fetching the chunks of data for lob with value id {0}
DQPBufferService.Error_initializing_buffer_manager__missing_required_property_7=Error initializing buffer manager: missing required property {0}
@@ -234,7 +234,7 @@
ERR.018.003.0055 = {0} {1} Error occurred while collecting results.
ERR.018.003.0056 = {0} {1} Unable to rollback transaction: {2}
ERR.018.003.0057 = {0} {1} Error in cleaning up tuple source storage after error.
-ERR.018.003.0058 = {0} {1} Could not obtain current configuration information, while trying to obtain connector binding name.
+ERR.018.003.0058 = {0} {1} Could not obtain current configuration information, while trying to obtain connection factory name.
ERR.018.003.0059 = {0} Unable to rollback transaction: {1}
ERR.018.003.0060 = Unable to start subtxn.
ERR.018.003.0061 = {0} Unable to start subtxn.
@@ -270,7 +270,7 @@
ERR.018.005.0005 = Could not deliver response for {0} as the QueryProcessor could not be obtained.
ERR.018.005.0006 = Could not deliver partial results for {0} as the atomic query request could not be obtained for nodeID {1}
ERR.018.005.0007 = Could not deliver response for {0} as a matching atomic request could not be found.
-ERR.018.005.0008 = Could not obtain current configuration information, while trying to obtain connector binding name.
+ERR.018.005.0008 = Could not obtain current configuration information, while trying to obtain connection factory name.
ERR.018.005.0009 = Request {0} does not have a response receiver.
ERR.018.005.0010 = Message for {0} could not be deliver.
ERR.018.005.0011 = Unable to listen for extension source cache reload events.
Modified: trunk/engine/src/main/resources/com/metamatrix/query/execution/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/com/metamatrix/query/execution/i18n.properties 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/engine/src/main/resources/com/metamatrix/query/execution/i18n.properties 2010-04-05 19:52:52 UTC (rev 2023)
@@ -43,7 +43,7 @@
ERR.015.004.0020= Error getting model for {0}
ERR.015.004.0021= Error checking model''s abilities for {0}
ERR.015.004.0023= Error rewriting criteria: {0}
-ERR.015.004.0024= Unable to create a query plan that sends a criteria to \"{0}\". This connector binding requires criteria set to true indicating that a query against this model requires criteria.
+ERR.015.004.0024= Unable to create a query plan that sends a criteria to \"{0}\". This connection factory requires criteria set to true indicating that a query against this model requires criteria.
ERR.015.004.0029= Could not resolve group symbol {0}
ERR.015.004.0030= Could not parse query transformation {0}
ERR.015.004.0033= Found two different contexts with {0}: {1} and {2}
Modified: trunk/engine/src/main/resources/org/teiid/adminapi/impl/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/adminapi/impl/i18n.properties 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/engine/src/main/resources/org/teiid/adminapi/impl/i18n.properties 2010-04-05 19:52:52 UTC (rev 2023)
@@ -75,7 +75,7 @@
MMModel.type=\n Type:\
MMModel.physical=\n Physical:\
MMModel.visible=\n Visible:\
-MMModel.connector_bindings=\n Connector Bindings:\
+MMModel.connector_bindings=\n connection factory:\
MMModel.modelURI=\n URI:\
MMModel.properties=\n Properties:\
MMModel.created=\n Created:\
@@ -204,7 +204,7 @@
AdminStatus.CODE_UNKNOWN=Unknown.
AdminStatus.CODE_SUCCESS=Success.
-AdminStatus.CODE_DECRYPTION_FAILED=Warning: The following connector bindings have NOT been imported because the passwords could not be decrypted: {0}. The bindings may have been exported from a system with a different keystore. You must either import with AdminOptions.BINDINGS_IGNORE_DECRYPT_ERROR then manually re-enter the passwords by setting the properties on the Connector binding via the Admin API, or via the Console ''Properties'' tab, or convert the file with the ''convertpasswords'' utility and re-import.
+AdminStatus.CODE_DECRYPTION_FAILED=Warning: The following connection factories have NOT been imported because the passwords could not be decrypted: {0}. The bindings may have been exported from a system with a different keystore. You must either import with AdminOptions.BINDINGS_IGNORE_DECRYPT_ERROR then manually re-enter the passwords by setting the properties on the connection factory via the Admin API, or via the Console ''Properties'' tab, or convert the file with the ''convertpasswords'' utility and re-import.
MMScriptsContainer.unable_to_locate_directory=Unable to locate directory {0}.
MMScriptsContainer.unable_to_write_to_directory=Unable to write to directory {0}.
Modified: trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -67,7 +67,7 @@
import org.teiid.adminapi.AdminObject;
import org.teiid.adminapi.AdminProcessingException;
import org.teiid.adminapi.ConnectionPoolStatistics;
-import org.teiid.adminapi.ConnectorBinding;
+import org.teiid.adminapi.ConnectionFactory;
import org.teiid.adminapi.Model;
import org.teiid.adminapi.PropertyDefinition;
import org.teiid.adminapi.Request;
@@ -77,7 +77,7 @@
import org.teiid.adminapi.VDB;
import org.teiid.adminapi.WorkerPoolStatistics;
import org.teiid.adminapi.impl.ConnectionPoolStatisticsMetadata;
-import org.teiid.adminapi.impl.ConnectorBindingMetaData;
+import org.teiid.adminapi.impl.ConnectionFactoryMetaData;
import org.teiid.adminapi.impl.DataPolicyMetadata;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.PropertyDefinitionMetadata;
@@ -160,15 +160,15 @@
// }
@Override
- public Collection<ConnectorBinding> getConnectorBindings() throws AdminException {
- ArrayList<ConnectorBinding> bindings = new ArrayList<ConnectorBinding>();
+ public Collection<ConnectionFactory> getConnectionFactories() throws AdminException {
+ ArrayList<ConnectionFactory> bindings = new ArrayList<ConnectionFactory>();
findConnectorBindings(bindings, "NoTx"); //$NON-NLS-1$
findConnectorBindings(bindings, "Tx"); //$NON-NLS-1$
return bindings;
}
@Override
- public ConnectorBinding getConnectorBinding(String deployedName) throws AdminException {
+ public ConnectionFactory getConnectionFactory(String deployedName) throws AdminException {
ManagedComponent mc = getConnectorBindingComponent(deployedName);
if (mc != null) {
return buildConnectorBinding(mc);
@@ -177,7 +177,7 @@
}
@Override
- public Reader exportConnectorBinding(String deployedName) throws AdminException {
+ public Reader exportConnectionFactory(String deployedName) throws AdminException {
ManagedComponent mc = getConnectorBindingComponent(deployedName);
if (mc != null) {
return new InputStreamReader(exportDeployment(mc.getDeployment().getName()));
@@ -221,8 +221,8 @@
return null;
}
- private ConnectorBinding buildConnectorBinding(ManagedComponent mc) {
- ConnectorBindingMetaData connector = new ConnectorBindingMetaData();
+ private ConnectionFactory buildConnectorBinding(ManagedComponent mc) {
+ ConnectionFactoryMetaData connector = new ConnectionFactoryMetaData();
connector.setName(mc.getName());
connector.setComponentType(mc.getType());
connector.addProperty("deployer-name", mc.getDeployment().getName());//$NON-NLS-1$
@@ -258,7 +258,7 @@
return Connector.class.getName().equals(connectionDefinition);
}
- private void findConnectorBindings(ArrayList<ConnectorBinding> bindings, String subType) throws AdminException {
+ private void findConnectorBindings(ArrayList<ConnectionFactory> bindings, String subType) throws AdminException {
try {
ComponentType type = new ComponentType("ConnectionFactory", subType); //$NON-NLS-1$
Set<ManagedComponent> jcaConnectors = getView().getComponentsForType(type);
@@ -276,18 +276,18 @@
}
@Override
- public ConnectorBinding addConnectorBinding(String deploymentName, String typeName, Properties properties) throws AdminException {
- if (getConnectorBinding(deploymentName) != null) {
+ public ConnectionFactory addConnectionFactory(String deploymentName, String typeName, Properties properties) throws AdminException {
+ if (getConnectionFactory(deploymentName) != null) {
throw new AdminProcessingException(IntegrationPlugin.Util.getString("connector_binding_exists",deploymentName)); //$NON-NLS-1$;
}
properties.setProperty("connection-definition", Connector.class.getName()); //$NON-NLS-1$
addConnectionfactory(deploymentName, typeName, properties);
- return getConnectorBinding(deploymentName);
+ return getConnectionFactory(deploymentName);
}
@Override
- public void setConnectorBindingProperty(String deployedName, String propertyName, String propertyValue) throws AdminException{
+ public void setConnectionFactoryProperty(String deployedName, String propertyName, String propertyValue) throws AdminException{
ManagedComponent mc = getConnectorBindingComponent(deployedName);
if (mc == null) {
throw new AdminProcessingException(IntegrationPlugin.Util.getString("connector_binding_exists",deployedName)); //$NON-NLS-1$;
@@ -311,7 +311,7 @@
}
@Override
- public void deleteConnectorBinding(String deployedName) throws AdminException {
+ public void deleteConnectionFactory(String deployedName) throws AdminException {
ManagedComponent mc = getConnectorBindingComponent(deployedName);
if (mc != null) {
ManagedUtil.removeArchive(getDeploymentManager(),mc.getDeployment().getName());
@@ -319,7 +319,7 @@
}
@Override
- public void startConnectorBinding(ConnectorBinding binding) throws AdminException {
+ public void startConnectionFactory(ConnectionFactory binding) throws AdminException {
try {
String deployerName = binding.getPropertyValue("deployer-name"); //$NON-NLS-1$
if (deployerName == null) {
@@ -332,7 +332,7 @@
}
@Override
- public void stopConnectorBinding(ConnectorBinding binding) throws AdminException {
+ public void stopConnectionFactory(ConnectionFactory binding) throws AdminException {
try {
String deployerName = binding.getPropertyValue("deployer-name");//$NON-NLS-1$
if (deployerName == null) {
@@ -345,14 +345,14 @@
}
@Override
- public Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, int vdbVersion) throws AdminException {
- HashMap<String, ConnectorBinding> bindingMap = new HashMap<String, ConnectorBinding>();
+ public Collection<ConnectionFactory> getConnectionFactoriesInVDB(String vdbName, int vdbVersion) throws AdminException {
+ HashMap<String, ConnectionFactory> bindingMap = new HashMap<String, ConnectionFactory>();
VDBMetaData vdb = (VDBMetaData) getVDB(vdbName, vdbVersion);
if (vdb != null) {
for (Model model:vdb.getModels()) {
if (model.isSource()) {
for (String sourceName : model.getSourceNames()) {
- ConnectorBinding binding = getConnectorBinding(((ModelMetaData)model).getSourceJndiName(sourceName));
+ ConnectionFactory binding = getConnectionFactory(((ModelMetaData)model).getSourceJndiName(sourceName));
if (binding != null) {
bindingMap.put(sourceName, binding);
}
@@ -365,7 +365,7 @@
@Override
- public Set<String> getConnectorTypes() throws AdminException{
+ public Set<String> getConnectorNames() throws AdminException{
Set<String> names = getView().getTemplateNames();
HashSet<String> matched = new HashSet<String>();
for(String name:names) {
@@ -645,7 +645,7 @@
}
@Override
- public void addConnectorType(String connectorName, InputStream rar) throws AdminException{
+ public void addConnector(String connectorName, InputStream rar) throws AdminException{
if (!connectorName.startsWith("connector-")) {//$NON-NLS-1$
throw new AdminProcessingException(IntegrationPlugin.Util.getString("bad_connector_type_name")); //$NON-NLS-1$
}
@@ -668,12 +668,12 @@
ManagedUtil.deployArchive(getDeploymentManager(), connectorNameWithoutExt+"-template.jar", jarFile.toURI().toURL(), false);//$NON-NLS-1$
jarFile.delete();
} catch (IOException e) {
- deleteConnectorType(connectorName);
+ deleteConnector(connectorName);
}
}
@Override
- public void deleteConnectorType(String connectorName) throws AdminException {
+ public void deleteConnector(String connectorName) throws AdminException {
if (!connectorName.endsWith(".rar")) {//$NON-NLS-1$
connectorName = connectorName + ".rar";//$NON-NLS-1$
}
@@ -688,7 +688,7 @@
}
@Override
- public InputStream exportConnectorType(String connectorName) throws AdminException {
+ public InputStream exportConnector(String connectorName) throws AdminException {
if (!connectorName.endsWith(".rar")) {//$NON-NLS-1$
connectorName = connectorName + ".rar";//$NON-NLS-1$
}
@@ -763,7 +763,7 @@
}
@Override
- public ConnectionPoolStatistics getConnectorConnectionPoolStats(String deployedName) throws AdminException {
+ public ConnectionPoolStatistics getConnectionFactoryStats(String deployedName) throws AdminException {
ManagedComponent mc = getConnectorBindingComponent(deployedName);
if (mc != null) {
return buildConnectorConnectionPool(mc);
@@ -786,7 +786,7 @@
}
@Override
- public Collection<PropertyDefinition> getConnectorTypePropertyDefinitions(String typeName) throws AdminException {
+ public Collection<PropertyDefinition> getConnectorPropertyDefinitions(String typeName) throws AdminException {
try {
DeploymentTemplateInfo info = getView().getTemplate(typeName);
if(info == null) {
@@ -902,7 +902,7 @@
@Override
public Collection<PropertyDefinition> getDataSourcePropertyDefinitions() throws AdminException {
- return getConnectorTypePropertyDefinitions(XA_DATA_SOURCE_TEMPLATE);
+ return getConnectorPropertyDefinitions(XA_DATA_SOURCE_TEMPLATE);
}
private static final String connectorTemplate =
@@ -941,7 +941,7 @@
@Override
- public void assignBindingToModel(String vdbName, int vdbVersion, String modelName, String sourceName, String jndiName) throws AdminException {
+ public void assignConnectionFactoryToModel(String vdbName, int vdbVersion, String modelName, String sourceName, String jndiName) throws AdminException {
ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
if (mc == null) {
Copied: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectionFactoryDeployer.java (from rev 2020, trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectorBindingDeployer.java)
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectionFactoryDeployer.java (rev 0)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectionFactoryDeployer.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -0,0 +1,224 @@
+/*
+ * 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.jboss.deployers;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.spi.deployer.managed.ManagedObjectCreator;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.factory.ManagedObjectFactory;
+import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup;
+import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentMetaData;
+import org.teiid.adminapi.Model;
+import org.teiid.adminapi.VDB;
+import org.teiid.adminapi.impl.ModelMetaData;
+import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.connector.api.Connector;
+import org.teiid.deployers.VDBRepository;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
+import org.teiid.jboss.IntegrationPlugin;
+import org.teiid.security.SecurityHelper;
+
+import com.metamatrix.common.log.LogConstants;
+import com.metamatrix.common.log.LogManager;
+
+public class ConnectionFactoryDeployer extends AbstractSimpleRealDeployer<ManagedConnectionFactoryDeploymentGroup> implements ManagedObjectCreator {
+ private ManagedObjectFactory mof;
+ private SecurityHelper securityHelper;
+
+ private ConnectorManagerRepository connectorManagerRepository;
+ private VDBRepository vdbRepository;
+
+ public ConnectionFactoryDeployer() {
+ super(ManagedConnectionFactoryDeploymentGroup.class);
+ setRelativeOrder(3000);
+ }
+
+ @Override
+ public void deploy(DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup group) throws DeploymentException {
+ List<ManagedConnectionFactoryDeploymentMetaData> deployments = group.getDeployments();
+
+ ConnectorManagerGroup cmGroup = new ConnectorManagerGroup();
+
+ for (ManagedConnectionFactoryDeploymentMetaData data : deployments) {
+ String connectorDefinition = data.getConnectionDefinition();
+ if (connectorDefinition.equals(Connector.class.getName())) {
+ String connectorName = "java:"+data.getJndiName(); //$NON-NLS-1$
+
+ ConnectorManager cm = createConnectorManger(connectorName, data.getMaxSize());
+ cm.start();
+ cmGroup.addConnectorManager(cm);
+
+ // Add the references to the mgr as loaded.
+ this.connectorManagerRepository.addConnectorManager(connectorName, cm);
+
+ connectorAdded(connectorName);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("connector_started", connectorName)); //$NON-NLS-1$
+ }
+ else {
+ // check if data source is down
+ }
+ }
+
+ if (!cmGroup.getConnectorManagers().isEmpty()) {
+ unit.addAttachment(ConnectorManagerGroup.class, cmGroup);
+ }
+ }
+
+
+ ConnectorManager createConnectorManger(String deployedConnectorName, int maxThreads) {
+ ConnectorManager mgr = new ConnectorManager(deployedConnectorName, maxThreads, securityHelper);
+ return mgr;
+ }
+
+ public void setConnectorManagerRepository(ConnectorManagerRepository repo) {
+ this.connectorManagerRepository = repo;
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup group) {
+ super.undeploy(unit, group);
+ List<ManagedConnectionFactoryDeploymentMetaData> deployments = group.getDeployments();
+
+ for (ManagedConnectionFactoryDeploymentMetaData data : deployments) {
+ String connectorDefinition = data.getConnectionDefinition();
+ if (connectorDefinition.equals(Connector.class.getName())) {
+ String connectorName = "java:"+data.getJndiName(); //$NON-NLS-1$
+ if (this.connectorManagerRepository != null) {
+ ConnectorManager cm = this.connectorManagerRepository.removeConnectorManager(connectorName);
+ if (cm != null) {
+ cm.stop();
+ }
+ }
+ connectorRemoved(connectorName);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("connector_stopped", connectorName)); //$NON-NLS-1$
+ }
+ }
+ }
+
+ @Override
+ public void build(DeploymentUnit unit, Set<String> attachmentNames, Map<String, ManagedObject> managedObjects)
+ throws DeploymentException {
+
+ ConnectorManagerGroup cmGroup = unit.removeAttachment(ConnectorManagerGroup.class);
+ if (cmGroup != null) {
+ for (ConnectorManager mgr:cmGroup.getConnectorManagers()) {
+ ManagedObject mo = this.mof.initManagedObject(mgr, ConnectorManager.class, mgr.getName(), mgr.getName());
+ if (mo == null) {
+ throw new DeploymentException("could not create managed object"); //$NON-NLS-1$
+ }
+ managedObjects.put(mo.getName(), mo);
+ }
+ }
+ }
+
+ public void setManagedObjectFactory(ManagedObjectFactory mof) {
+ this.mof = mof;
+ }
+
+ public void setSecurityHelper(SecurityHelper securityHelper) {
+ this.securityHelper = securityHelper;
+ }
+
+ public void setVDBRepository(VDBRepository repo) {
+ this.vdbRepository = repo;
+ }
+
+ public void connectorAdded(String connectorName) {
+ for (VDBMetaData vdb:this.vdbRepository.getVDBs()) {
+ if (vdb.getStatus() == VDB.Status.ACTIVE) {
+ continue;
+ }
+ for (Model m:vdb.getModels()) {
+ ModelMetaData model = (ModelMetaData)m;
+ if (model.getErrors().isEmpty()) {
+ continue;
+ }
+
+ boolean inUse = false;
+ for (String sourceName:model.getSourceNames()) {
+ if (connectorName.equals(model.getSourceJndiName(sourceName))) {
+ inUse = true;
+ }
+ }
+
+ if (inUse) {
+ model.clearErrors();
+ for (String sourceName:model.getSourceNames()) {
+ if (!connectorName.equals(model.getSourceJndiName(sourceName))) {
+ try {
+ InitialContext ic = new InitialContext();
+ ic.lookup(model.getSourceJndiName(sourceName));
+ } catch (NamingException e) {
+ String msg = IntegrationPlugin.Util.getString("jndi_not_found", vdb.getName(), vdb.getVersion(), model.getSourceJndiName(sourceName), sourceName); //$NON-NLS-1$
+ model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
+ }
+ }
+ }
+ }
+ }
+
+ boolean valid = true;
+ for (Model m:vdb.getModels()) {
+ ModelMetaData model = (ModelMetaData)m;
+ if (!model.getErrors().isEmpty()) {
+ valid = false;
+ break;
+ }
+ }
+
+ if (valid) {
+ vdb.setStatus(VDB.Status.ACTIVE);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("vdb_activated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
+ }
+
+ }
+ }
+
+ public void connectorRemoved(String connectorName) {
+ for (VDBMetaData vdb:this.vdbRepository.getVDBs()) {
+ for (Model m:vdb.getModels()) {
+ ModelMetaData model = (ModelMetaData)m;
+ for (String sourceName:model.getSourceNames()) {
+ if (connectorName.equals(model.getSourceJndiName(sourceName))) {
+ vdb.setStatus(VDB.Status.INACTIVE);
+ String msg = IntegrationPlugin.Util.getString("jndi_not_found", vdb.getName(), vdb.getVersion(), model.getSourceJndiName(sourceName), sourceName); //$NON-NLS-1$
+ model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("vdb_inactivated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ }
+
+}
Deleted: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectorBindingDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectorBindingDeployer.java 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectorBindingDeployer.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -1,224 +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.jboss.deployers;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
-import org.jboss.deployers.spi.deployer.managed.ManagedObjectCreator;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentMetaData;
-import org.teiid.adminapi.Model;
-import org.teiid.adminapi.VDB;
-import org.teiid.adminapi.impl.ModelMetaData;
-import org.teiid.adminapi.impl.VDBMetaData;
-import org.teiid.connector.api.Connector;
-import org.teiid.deployers.VDBRepository;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
-import org.teiid.jboss.IntegrationPlugin;
-import org.teiid.security.SecurityHelper;
-
-import com.metamatrix.common.log.LogConstants;
-import com.metamatrix.common.log.LogManager;
-
-public class ConnectorBindingDeployer extends AbstractSimpleRealDeployer<ManagedConnectionFactoryDeploymentGroup> implements ManagedObjectCreator {
- private ManagedObjectFactory mof;
- private SecurityHelper securityHelper;
-
- private ConnectorManagerRepository connectorManagerRepository;
- private VDBRepository vdbRepository;
-
- public ConnectorBindingDeployer() {
- super(ManagedConnectionFactoryDeploymentGroup.class);
- setRelativeOrder(3000);
- }
-
- @Override
- public void deploy(DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup group) throws DeploymentException {
- List<ManagedConnectionFactoryDeploymentMetaData> deployments = group.getDeployments();
-
- ConnectorManagerGroup cmGroup = new ConnectorManagerGroup();
-
- for (ManagedConnectionFactoryDeploymentMetaData data : deployments) {
- String connectorDefinition = data.getConnectionDefinition();
- if (connectorDefinition.equals(Connector.class.getName())) {
- String connectorName = "java:"+data.getJndiName(); //$NON-NLS-1$
-
- ConnectorManager cm = createConnectorManger(connectorName, data.getMaxSize());
- cm.start();
- cmGroup.addConnectorManager(cm);
-
- // Add the references to the mgr as loaded.
- this.connectorManagerRepository.addConnectorManager(connectorName, cm);
-
- connectorAdded(connectorName);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("connector_started", connectorName)); //$NON-NLS-1$
- }
- else {
- // check if data source is down
- }
- }
-
- if (!cmGroup.getConnectorManagers().isEmpty()) {
- unit.addAttachment(ConnectorManagerGroup.class, cmGroup);
- }
- }
-
-
- ConnectorManager createConnectorManger(String deployedConnectorName, int maxThreads) {
- ConnectorManager mgr = new ConnectorManager(deployedConnectorName, maxThreads, securityHelper);
- return mgr;
- }
-
- public void setConnectorManagerRepository(ConnectorManagerRepository repo) {
- this.connectorManagerRepository = repo;
- }
-
- @Override
- public void undeploy(DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup group) {
- super.undeploy(unit, group);
- List<ManagedConnectionFactoryDeploymentMetaData> deployments = group.getDeployments();
-
- for (ManagedConnectionFactoryDeploymentMetaData data : deployments) {
- String connectorDefinition = data.getConnectionDefinition();
- if (connectorDefinition.equals(Connector.class.getName())) {
- String connectorName = "java:"+data.getJndiName(); //$NON-NLS-1$
- if (this.connectorManagerRepository != null) {
- ConnectorManager cm = this.connectorManagerRepository.removeConnectorManager(connectorName);
- if (cm != null) {
- cm.stop();
- }
- }
- connectorRemoved(connectorName);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("connector_stopped", connectorName)); //$NON-NLS-1$
- }
- }
- }
-
- @Override
- public void build(DeploymentUnit unit, Set<String> attachmentNames, Map<String, ManagedObject> managedObjects)
- throws DeploymentException {
-
- ConnectorManagerGroup cmGroup = unit.removeAttachment(ConnectorManagerGroup.class);
- if (cmGroup != null) {
- for (ConnectorManager mgr:cmGroup.getConnectorManagers()) {
- ManagedObject mo = this.mof.initManagedObject(mgr, ConnectorManager.class, mgr.getName(), mgr.getName());
- if (mo == null) {
- throw new DeploymentException("could not create managed object"); //$NON-NLS-1$
- }
- managedObjects.put(mo.getName(), mo);
- }
- }
- }
-
- public void setManagedObjectFactory(ManagedObjectFactory mof) {
- this.mof = mof;
- }
-
- public void setSecurityHelper(SecurityHelper securityHelper) {
- this.securityHelper = securityHelper;
- }
-
- public void setVDBRepository(VDBRepository repo) {
- this.vdbRepository = repo;
- }
-
- public void connectorAdded(String connectorName) {
- for (VDBMetaData vdb:this.vdbRepository.getVDBs()) {
- if (vdb.getStatus() == VDB.Status.ACTIVE) {
- continue;
- }
- for (Model m:vdb.getModels()) {
- ModelMetaData model = (ModelMetaData)m;
- if (model.getErrors().isEmpty()) {
- continue;
- }
-
- boolean inUse = false;
- for (String sourceName:model.getSourceNames()) {
- if (connectorName.equals(model.getSourceJndiName(sourceName))) {
- inUse = true;
- }
- }
-
- if (inUse) {
- model.clearErrors();
- for (String sourceName:model.getSourceNames()) {
- if (!connectorName.equals(model.getSourceJndiName(sourceName))) {
- try {
- InitialContext ic = new InitialContext();
- ic.lookup(model.getSourceJndiName(sourceName));
- } catch (NamingException e) {
- String msg = IntegrationPlugin.Util.getString("jndi_not_found", vdb.getName(), vdb.getVersion(), model.getSourceJndiName(sourceName), sourceName); //$NON-NLS-1$
- model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
- }
- }
- }
- }
- }
-
- boolean valid = true;
- for (Model m:vdb.getModels()) {
- ModelMetaData model = (ModelMetaData)m;
- if (!model.getErrors().isEmpty()) {
- valid = false;
- break;
- }
- }
-
- if (valid) {
- vdb.setStatus(VDB.Status.ACTIVE);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("vdb_activated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
- }
-
- }
- }
-
- public void connectorRemoved(String connectorName) {
- for (VDBMetaData vdb:this.vdbRepository.getVDBs()) {
- for (Model m:vdb.getModels()) {
- ModelMetaData model = (ModelMetaData)m;
- for (String sourceName:model.getSourceNames()) {
- if (connectorName.equals(model.getSourceJndiName(sourceName))) {
- vdb.setStatus(VDB.Status.INACTIVE);
- String msg = IntegrationPlugin.Util.getString("jndi_not_found", vdb.getName(), vdb.getVersion(), model.getSourceJndiName(sourceName), sourceName); //$NON-NLS-1$
- model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("vdb_inactivated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
- }
- }
- }
- }
- }
-
-}
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2010-04-05 19:52:52 UTC (rev 2023)
@@ -25,14 +25,14 @@
socket_enabled={0} {1}
engine_stopped=Teiid Engine stopped {0}
admin_connection_closed=Teiid admin connection is already closed.
-connector_binding_exists=Connector binding with name "{0}" already exists.
+connector_binding_exists=Connection factory with name "{0}" already exists.
failed_to_connector_deployer=Failed to find deployer name of the connector. Can not start!
-failed_to_start_connector=Failed to start Connector Binding = {0}
-failed_to_stop_connector=Failed to start Connector Binding = {0}
+failed_to_start_connector=Failed to start Connection factory = {0}
+failed_to_stop_connector=Failed to start Connection factory = {0}
bad_vdb_extension=The extension of the file name must be either ".vdb" for designer vdb or "xxx-vdb.xml" for dynamic VDBs
-bad_connector_type_name="Teiid connector type names must start with \"connector-\""
-connector_type_exists=Connector type with name:"{0}" already exists!
-connector_type_not_found=Connector Type template "{0}" not found in the configuration.
+bad_connector_type_name="Teiid connector names must start with \"connector-\""
+connector_type_exists=Connector with name:"{0}" already exists!
+connector_type_not_found=Connector template "{0}" not found in the configuration.
vdb_not_found=VDB with name "{0}" version "{1}" not found in configuration
model_not_found=Model name "{0}" not found in the VDB with name "{1}" version "{2}"
policy_not_found=Policy name "{0}" not found in the VDB with name "{1}" version "{2}"
Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-04-05 19:52:52 UTC (rev 2023)
@@ -39,10 +39,10 @@
ServerConfiguration.Err_interpreting_property=Error interpreting property \"{0}\" with value \"{1}\" as a URL.
ServerConfiguration.Req_prop_not_specified=Required property \"{0}\" not specified
-VDBConfigFileReader.Connector_type_names_do_not_match=Connector type names do not match: \"{0}\" and \"{1}\".
-VDBConfigFileReader.No_connector_type_for_connector=Configuration has no connector type definition for type \"{0}\" for connector binding \"{1}\".
-VDBConfigFileReader.Already_contains_connector_type=Configuration has two definitions for connector type \"{0}\".
-VDBConfigFileReader.No_connector_binding_in_config = A model \"{0}\" specifies a connector binding "{1}" for which there is no definition found in the configuration or VDB definition files.
+VDBConfigFileReader.Connector_type_names_do_not_match=Connector names do not match: \"{0}\" and \"{1}\".
+VDBConfigFileReader.No_connector_type_for_connector=Configuration has no connector definition for type \"{0}\" for connection factory \"{1}\".
+VDBConfigFileReader.Already_contains_connector_type=Configuration has two definitions for connector \"{0}\".
+VDBConfigFileReader.No_connector_binding_in_config = A model \"{0}\" specifies a connection factory "{1}" for which there is no definition found in the configuration or VDB definition files.
VDBService.VDB_does_not_exist._2=VDB \"{0}\" version \"{1}\" is not active.
VDBService.VDB_does_not_exist._3=In VDB \"{0}\" version \"{1}\" the Model \"{2}\" does not exist.
@@ -54,18 +54,18 @@
VDBService.vdb_deleted=VDB \"{0}\" with version \"{1}\" deleted from VDB Service and configuration
VDBService.vdb_change_status=VDB \"{0}\" with version \"{1}\" has changed its status from \"{2}\" to \"{3}\" in VDBService
VDBService.vdb_change_status_failed=VDB \"{0}\" with version \"{1}\" has failed to change its status from \"{2}\" to \"{3}\" in VDBService
-VDBService.connector_binding_changed=VDB \"{0}\" with version \"{1}\" has changed its connector binding for model name \"{2}\" with \"{3}\"
+VDBService.connector_binding_changed=VDB \"{0}\" with version \"{1}\" has changed its connection factory for model name \"{2}\" with \"{3}\"
VDBService.vdb_already_exists=VDB \"{0}\" with version \"{1}\" already exists in the configuration, saving as a new version of the VDB
VDBService.vdb_deployed=VDB \"{0}\" with version \"{1}\" has been deployed to the Teiid system.
VDBService.vdb_loded=VDB \"{0}\" with version \"{1}\" has been loaded from the configuration.
-VDBService.vdb_missing_bindings=VDB \"{0}\" with version \"{1}\" is incomplete, it does not have all the connector bindings mapped to their physical models.
+VDBService.vdb_missing_bindings=VDB \"{0}\" with version \"{1}\" is incomplete, it does not have all the connection factories mapped to their physical models.
VDBService.lookup=VDB \"{0}\" with version \"{1}\" being loaded from configuration
VDBService.vdb_deleted=VDB \"{0}\" with version \"{1}\" deleted from VDB Service and configuration
-VDBService.connector_binding_changed=VDB \"{0}\" with version \"{1}\" has changed its connector binding for model name {2} with {3}
+VDBService.connector_binding_changed=VDB \"{0}\" with version \"{1}\" has changed its connection factory for model name {2} with {3}
VDBService.vdb_already_exists=VDB \"{0}\" with version \"{1}\" already exists in the configuration, saving as a new version of the VDB
VDBService.vdb_deployed=VDB \"{0}\" with version \"{1}\" has been deployed to the Teiid system.
VDBService.vdb_loded=VDB \"{0}\" with version \"{1}\" has been loaded from the configuration.
-VDBService.vdb_missing_bindings=VDB \"{0}\" with version \"{1}\" is incomplete, it does not have all the connector bindings mapped to their physical models.
+VDBService.vdb_missing_bindings=VDB \"{0}\" with version \"{1}\" is incomplete, it does not have all the connection factories mapped to their physical models.
VDBService.vdb_active=VDB \"{0}\" with version \"{1}\" is set to ACTIVE.
VDBService.validityErrors=Failed to deploy VDB \"{0}\" because it has following validity errors; {1}
VDBService.vdb_missing_models=VDB \"{0}\" with version \"{1}\" is Invalid; This archive has no models defined.
@@ -73,39 +73,39 @@
DataService.Didnt_find_caps=Unable to find capabilities for {0}
DataService.Unable_to_find_connector_manager_for_{0}_1=Unable to find connector manager for \"{0}\"
DataService.Unable_to_find_connector=Invalid Connector name supplied or Connector not found: \"{0}\"
-DataService.System_model_initialze_error=Connector Binding for the System Model is not initialized
+DataService.System_model_initialze_error=Connection factory for the System Model is not initialized
DataService.System_model_failed_start=Failed to add the System Model connector to the system
-DataService.failed_to_load_connector=Failed to load the Connector Binding with name \"{0}\" in the configuration
-DataService.Connector_State_invalid=Connector Binding \"{0}\" failed to start, or did not start correctly. Please check the connector binding properties. Check the log file for more information.
+DataService.failed_to_load_connector=Failed to load the Connection factory with name \"{0}\" in the configuration
+DataService.Connector_State_invalid=Connection factory \"{0}\" failed to start, or did not start correctly. Please check the Connection factory properties. Check the log file for more information.
DataService.useClassloader=Connector is using the following Classpth to load a new ClassLoader=\"{0}\"
-DataService.Failed_To_Start=Embedded DataService Failed to start. Check the Connector Binding proeprties.
-DataService.Failed_Initialize_CM=Failed to Properly initialize the Connector manager for Connector Binding \"{0}\"
-DataService.Stopped= Data Service is stopped. All the Connector bindings have been stopped.
+DataService.Failed_To_Start=Embedded DataService Failed to start. Check the Connection factory proeprties.
+DataService.Failed_Initialize_CM=Failed to Properly initialize the Connector manager for Connection factory \"{0}\"
+DataService.Stopped= Data Service is stopped. All the Connection factories have been stopped.
DataService.Started=Data Service initialized and started and running..
DataService.Connector_Stopped=Connector Service \"{0}\" has been stopped
DataService.Connector_Started=Connector Service \"{0}\" has been started.
DataService.Connector_Deleted=Connector Service \"{0}\" has been Deleted from the Data Service and Configuration
DataService.Connector_Added=Connector Service \"{0}\" has been Added to the Data Service and also Configuration
-DataService.Connector_exists=Connector binding with name \"{0}\" already exists. Connector name must be unique.
-DataService.Connector_does_not_exists=Connector binding with name \"{0}\" does not exist in the configuration.
-DataService.Connector_modified=Connector Binding with name \"{0}\" has been modified.
+DataService.Connector_exists=Connection factory with name \"{0}\" already exists. Connector name must be unique.
+DataService.Connector_does_not_exists=Connection factory with name \"{0}\" does not exist in the configuration.
+DataService.Connector_modified=Connection factory with name \"{0}\" has been modified.
DataService.Connector_Stopped=Connector Service {0} has been stopped
DataService.Connector_Started=Connector Service {0} has been started.
DataService.Connector_Deleted=Connector Service {0} has been Deleted from the Data Service and Configuration
DataService.Connector_Added=Connector Service {0} has been Added to the Data Service and also Configuration
-DataService.Connector_exists_replace=Connector binding with name {0} already exists. The old connector will be replaced with the new connector.
-DataService.Connector_exists=Connector binding with name {0} already exists. Connector name must be unique to add, using the old connector as it is.
-DataService.Connector_does_not_exists=Connector binding with name {0} does not exist in the configuration.
-DataService.Connector_modified=Connector Binding with name {0} has been modified.
-DataService.Connector_type_does_not_exists=Connector Binding type specified for Connector Binding \"{0}\" does not exist in the configuration, add Connector type first.
+DataService.Connector_exists_replace=Connection factory with name {0} already exists. The old connector will be replaced with the new connector.
+DataService.Connector_exists=Connection factory with name {0} already exists. Connector name must be unique to add, using the old connector as it is.
+DataService.Connector_does_not_exists=Connection factory with name {0} does not exist in the configuration.
+DataService.Connector_modified=Connection factory with name {0} has been modified.
+DataService.Connector_type_does_not_exists=Connection factory type specified for Connection factory \"{0}\" does not exist in the configuration, add Connector first.
DataService.ext_module_not_found=Required extension module \"{0}\" not found in the extensions directory. if not using extension modules ignore.
-DataService.Connector_still_used=Connector Binding \"{0}\" can not be deleted because it is still in use by VDBs. Remove the assosiation with VDB before deletion.
-DataService.decryption_failed=initialization of the connector binding \"{0}\" failed because, system failed to decrypt the property \"{1}\"
-DataService.FailedStop=Failed to stop the connector binding "{0}"
-DataService.FailedStart=Failed to start the connector binding "{0}"
+DataService.Connector_still_used=Connection factory \"{0}\" can not be deleted because it is still in use by VDBs. Remove the assosiation with VDB before deletion.
+DataService.decryption_failed=initialization of the Connection factory \"{0}\" failed because, system failed to decrypt the property \"{1}\"
+DataService.FailedStop=Failed to stop the Connection factory "{0}"
+DataService.FailedStart=Failed to start the Connection factory "{0}"
DataService.ext_module_not_found=Required extension module {0} not found in the extensions directory. if not using extension modules ignore.
-DataService.Connector_still_used=Connector Binding {0} can not be deleted because it is still in use by VDBs. Remove the assosiation with VDB before deletion.
-DataService.Connector_failed_start=Connector Binding {0} failed to start, check the properties and start again.
+DataService.Connector_still_used=Connection factory {0} can not be deleted because it is still in use by VDBs. Remove the assosiation with VDB before deletion.
+DataService.Connector_failed_start=Connection factory {0} failed to start, check the properties and start again.
DataService.no_connectors_defined=No connectors defined for binding
Failed_To_Service=Failed to get service requested
@@ -117,29 +117,29 @@
EmbeddedConfigurationService.Server_Config_notfound=ServerConfig.xml file not found the location \"{0}\"
EmbeddedConfigurationService.Server_Config_failedload=Server Configuration file failed to load \"{0}\"
EmbeddedConfigurationService.Server_Config_notdefined=Server Configuration file is not defined in the properties file
-EmbeddedConfigurationService.Alternate_binding_inuse=Connector binding \"{0}\" is using alternate properties defined in the system configuration file.
-EmbeddedConfigurationService.ConnectorBinding_in_use_failed_delete=Connector binding with Name \"{0}\" is currenlty in use by VDB \"{1}\" with version \"{2}\"; Can not delete; Remove the assosiation first
+EmbeddedConfigurationService.Alternate_binding_inuse=Connection factory \"{0}\" is using alternate properties defined in the system configuration file.
+EmbeddedConfigurationService.ConnectorBinding_in_use_failed_delete=Connection factory with Name \"{0}\" is currenlty in use by VDB \"{1}\" with version \"{2}\"; Can not delete; Remove the assosiation first
#EmbeddedConfigurationService.Alternate_binding_inuse=Connector binding {0} is using alternate properties defined in the system configuration file.
-EmbeddedConfigurationService.ConnectorBinding_in_use_failed_delete=Connector binding with Name {0} is currenlty in use by VDB {1} with version {2}; Can not delete; Remove the assosiation first
+EmbeddedConfigurationService.ConnectorBinding_in_use_failed_delete=Connection factory with Name {0} is currenlty in use by VDB {1} with version {2}; Can not delete; Remove the assosiation first
EmbeddedConfigurationService.savingConfiguration=Teiid Configuration is being saved.
EmbeddedConfigurationService.vdb_delete=VDB with name \"{0}\" and version \"{1}\" is being deleted from the configuration.
EmbeddedConfigurationService.vdb_delete_failed=configuration service failed to delte VDB with name \"{0}\" and version \"{1}\".
EmbeddedConfigurationService.vdb_saved=VDB with name \"{0}\" and version \"{1}\" is being saved by the configuration to \"{2}\" file name.
EmbeddedConfigurationService.add_system_property=Adding a System property \"{0}\" with value \"{1}\" is being added to the configuration.
EmbeddedConfigurationService.update_system_properties=Adding System properties to the configuration: {0}.
-EmbeddedConfigurationService.connector_save=Connector Binding with name \"{0}\" is being saved.
-EmbeddedConfigurationService.connector_delete=Connector Binding with name \"{0}\" is being deleted from the configuration.
-EmbeddedConfigurationService.connector_type_save=Connector Type with name \"{0}\" is being saved to configuration.
-EmbeddedConfigurationService.connector_type_save=Connector Type with name \"{0}\" is being deleted from configuration.
-EmbeddedConfigurationService.connector_type_delete_failed=Connector Type with name \"{0}\" failed to delete from configuration as they type is not found in configuration.
-EmbeddedConfigurationService.custom_connectors_restricted=License does not allow adding connector types.
+EmbeddedConfigurationService.connector_save=Connection factory with name \"{0}\" is being saved.
+EmbeddedConfigurationService.connector_delete=Connection factory with name \"{0}\" is being deleted from the configuration.
+EmbeddedConfigurationService.connector_type_save=Connector with name \"{0}\" is being saved to configuration.
+EmbeddedConfigurationService.connector_type_save=Connector with name \"{0}\" is being deleted from configuration.
+EmbeddedConfigurationService.connector_type_delete_failed=Connector with name \"{0}\" failed to delete from configuration as they type is not found in configuration.
+EmbeddedConfigurationService.custom_connectors_restricted=License does not allow adding connectors.
EmbeddedConfigurationService.Failed_to_load_vdb=Failed to load the VDB \"{0}\" during the initialization of Teiid
EmbeddedConfigurationService.loaded_vdb=Loaded the VDB \"{0}\" sucessfully into Teiid.
EmbeddedConfigurationService.not_loaded_vdb=VDB \"{0}\" is not loaded into Teiid due to licensing issues.
-EmbeddedConfigurationService.connector_binding_delete_failed=Delete of Connector Binding \"{0}\" failed. Binding not found in the configuration.
-EmbeddedConfigurationService.connector_type_in_use=Delete of Connector type \"{0}\" failed. Currently in use by a Connector Binding.
+EmbeddedConfigurationService.connector_binding_delete_failed=Delete of Connection factory \"{0}\" failed. Binding not found in the configuration.
+EmbeddedConfigurationService.connector_type_in_use=Delete of Connector \"{0}\" failed. Currently in use by a Connection factory.
EmbeddedConfigurationService.duplicate_vdb_found=Duplicate VDB \"{0}\" is being loaded. Can not load have multiple VDBs with same name and version.
-EmbeddedConfigurationService.connector_type_delete=Connector type \"{0}\" is deleted from the configuration.
+EmbeddedConfigurationService.connector_type_delete=Connector \"{0}\" is deleted from the configuration.
EmbeddedConfigurationService.connectionAdded=Connection added to VDB \"{0}\" with version \"{1}\" with connection id \"{2}\"
EmbeddedConfigurationService.connectionRemoved=Connection removed from VDB \"{0}\" with version \"{1}\" with connection id \"{2}\"
EmbeddedConfigurationService.dqp_loading=Teiid instance with instance id \"{0}\" is being loaded.
@@ -147,9 +147,9 @@
EmbeddedConfigurationService.udf_classspath_failure=Failed to resolve the user defined function''s classpath
EmbeddedConfigurationService.udf_load=User Defined Functions file \"{0}\" is loaded, using classloader \"{1}\"
EmbeddedConfigurationService.udf_unload=User Defined Functions file unloaded
-EmbeddedConfigurationService.bindings_exceeded_limit=VDB {1} has {0} connector bindings, that exceeds MetaMatrix license allowed number of connector bindings.
+EmbeddedConfigurationService.bindings_exceeded_limit=VDB {1} has {0} Connection factories, that exceeds MetaMatrix license allowed number of Connection factories.
EmbeddedConfigurationService.Invalid_connector_binding=Can not assign binding "{2}" to VDB "{0}" with "{1}", because it is a private binding from another vdb.
-EmbeddedConfigurationService.connector_binding_deployed=Connector binding {0} deployed
+EmbeddedConfigurationService.connector_binding_deployed=Connection factory {0} deployed
ExtensionModuleReader.ext_module_failed_to_read=failed to read the extension module \"{0}\" from file system.
ExtensionModuleReader.ext_module_does_not_exist=Extension module \"{0}\" does not exist in the configuration
@@ -165,18 +165,18 @@
Admin.ext_path_invalid=Extension directory path is wrong or does not exists
Admin.admin_isnull=Admin Object supplied is null
Admin.can_not_set_property=Currently setting property on this type of Admin object is not supported.
-Admin.connector_load_failed_wrong_contents=Failed to load the Connector binding with name \"{0}\". Contents supplied are incorrect, check the contents again.
-Admin.connector_load_failed_wrong_type=Failed to load the Connector binding with name \"{0}\". Conntextor Type supplied and Connector Type used in binding are different.
-Admin.Connector_binding_does_not_exists=Connector Binding with name \"{0}\" does not exist in the configuration
-Admin.Connector_type_does_not_exists=Connector Type with name \"{0}\" does not exist in the configuration
+Admin.connector_load_failed_wrong_contents=Failed to load the Connection factory with name \"{0}\". Contents supplied are incorrect, check the contents again.
+Admin.connector_load_failed_wrong_type=Failed to load the Connection factory with name \"{0}\". Conntextor Type supplied and Connector used in binding are different.
+Admin.Connector_binding_does_not_exists=Connection factory with name \"{0}\" does not exist in the configuration
+Admin.Connector_type_does_not_exists=Connector with name \"{0}\" does not exist in the configuration
Admin.ext_module_does_not_exists=Extension Module with name \"{0}\" does not exist in the configuration
Admin.vdb_does_not_exists=VDB with name \"{0}\" and version \"{1}\" does not exist in the configuration
Admin.Invalid_ext_source=Source contents supplied for Extension module can not be null.
Admin.Invalid_ext_source_name=Source name can not be null, use a proper file name with extension as name for the Extension Module.
-Admin.Invalid_cb_name=Connector Binding name can not be null, a valid name must be supplied
-Admin.Invalid_cb_source=Connector Binding''s source contents can not be null
-Admin.Invalid_ct_name=Connector Type name can not be null or use of special characters is not allowed, a valid name must be supplied
-Admin.Invalid_ct_source=Connector type''s source contents can not be null
+Admin.Invalid_cb_name=Connection factory name can not be null, a valid name must be supplied
+Admin.Invalid_cb_source=Connection factory''s source contents can not be null
+Admin.Invalid_ct_name=Connector name can not be null or use of special characters is not allowed, a valid name must be supplied
+Admin.Invalid_ct_source=Connector''s source contents can not be null
Admin.Invalid_vdb_name=VDB name can not be null or use of special characters is allowed, a valid name must be supplied
Admin.Invalid_vdb_source=VDB source contents can not be null
Admin.load_combined_vdb=Loading the VDB file \"{0}\", where DEF/VDB are combined in single source
@@ -184,18 +184,18 @@
Admin.Invalid_identifier=Identifier supplied can not be null and must adhere to the naming patterns; Please check the java docs for the proper naming patterns.
Admin_invalid_log_listener=Supplied log listener can not be null
Admin.Invalid_ext_module=Extension module specified is not the JAR type, currently only ".jar" extension modules supported.
-Admin.Connector_type_exists=Connector Type \"{0}\" already exists; Can not add a duplicate, try delete and add again.
+Admin.Connector_type_exists=Connector \"{0}\" already exists; Can not add a duplicate, try delete and add again.
Admin.extension_module_exists=Extension Module \"{0}\" already exists; Can not add a duplicate, delete first and add again.
-Admin.addBindingEixists=Connector Binding \"{0}\" already exists in exists in the configuration, use a unique name for the connector binding in the given Teiid instance.
-Admin.addBinding_type_exists=Adding Connector Binding \"{0}\" failed, because the Connector Type \"{1}\" already exists, and admin option set to fail on conflict
-Admin.connector_type_not_exists=Connector Type \"{0}\" does not exists in the configuration, please add Connector Type.
+Admin.addBindingEixists=Connection factory \"{0}\" already exists in exists in the configuration, use a unique name for the Connection factory in the given Teiid instance.
+Admin.addBinding_type_exists=Adding Connection factory \"{0}\" failed, because the Connector \"{1}\" already exists, and admin option set to fail on conflict
+Admin.connector_type_not_exists=Connector \"{0}\" does not exists in the configuration, please add Connector.
Admin.Invalid Request=Request submitted does not match the requirement \"{0}\"
Admin.No_Objects_Found=No AdminObjects found for identifier {0} and class {1}.
Admin.Multiple_Objects_Found=Multiple AdminObjects found for identifier {0} and class {1}.
Admin.Unsupported_Object_Class=AdminObjects class {0} not supported for this operation.
-Admin.bindings_exceeded_limit=You have reached the MetaMatrix license limit of connector bindings, Failed to add connector bindings.
-Admin.cb_doesnot_exist=The connector binding does not exist:{0}
-Admin.ct_doesnot_exist=The connector type does not exist:{0}
+Admin.bindings_exceeded_limit=You have reached the MetaMatrix license limit of Connection factories, Failed to add Connection factories.
+Admin.cb_doesnot_exist=The Connection factory does not exist:{0}
+Admin.ct_doesnot_exist=The connector does not exist:{0}
Admin.CODE_DECRYPTION_FAILED=Decryption of the password property failed; Check to make sure encryption libraries are correctly installed or provide a plain text password.
DQPEmbeddedManager.start_dqp=Teiid is started at time = {0}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -201,11 +201,11 @@
TestLogger.logInfo("Set up Connector Binding (model:mapping:type): " + m.getName() + ":" + useName + ":" + ds.getConnectorType()); //$NON-NLS-1$
- api.addConnectorBinding(ds.getName(),ds.getConnectorType(), ds.getProperties());
+ api.addConnectionFactory(ds.getName(),ds.getConnectorType(), ds.getProperties());
- api.assignBindingToModel(vdb.getName(), vdb.getVersion(), m.getName(), ds.getName(), ds.getProperty("jndi-name"));
+ api.assignConnectionFactoryToModel(vdb.getName(), vdb.getVersion(), m.getName(), ds.getName(), ds.getProperty("jndi-name"));
- api.startConnectorBinding(api.getConnectorBinding(ds.getName()));
+ api.startConnectionFactory(api.getConnectionFactory(ds.getName()));
} else {
throw new QueryTestFailedException(
"Error: Unable to create binding to map to model : "
Modified: trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/BaseConnection.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/BaseConnection.java 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/BaseConnection.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -13,11 +13,11 @@
static String user = "admin";
static String password = "teiid";
- interface ConnectionFactory{
+ interface DataSourceFactory{
Connection getConnection(String vdbName) throws Exception;
}
- static class ServerDatasourceConnection implements ConnectionFactory {
+ static class ServerDatasourceConnection implements DataSourceFactory {
public Connection getConnection(String vdbName) throws Exception {
TeiidDataSource ds = new TeiidDataSource();
ds.setUser(user);
@@ -30,7 +30,7 @@
}
}
- public void execute(ConnectionFactory connF, String vdbName, String sql) throws Exception {
+ public void execute(DataSourceFactory connF, String vdbName, String sql) throws Exception {
Connection connection = connF.getConnection(vdbName);
try {
connection.getMetaData();
Modified: trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-04-05 15:26:20 UTC (rev 2022)
+++ trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-04-05 19:52:52 UTC (rev 2023)
@@ -1,7 +1,11 @@
package org.teiid.adminapi.jboss;
-import static junit.framework.Assert.*;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertTrue;
import java.io.File;
import java.io.FileInputStream;
@@ -16,15 +20,14 @@
import java.util.Set;
import org.junit.After;
-import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.teiid.adminapi.Admin;
import org.teiid.adminapi.AdminException;
import org.teiid.adminapi.AdminFactory;
+import org.teiid.adminapi.ConnectionFactory;
import org.teiid.adminapi.ConnectionPoolStatistics;
-import org.teiid.adminapi.ConnectorBinding;
import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.Model;
import org.teiid.adminapi.PropertyDefinition;
@@ -68,10 +71,10 @@
}
@Test public void testConnectorBinding() throws Exception {
- ConnectorBinding binding = admin.getConnectorBinding("test-mysql-cb"); //$NON-NLS-1$
+ ConnectionFactory binding = admin.getConnectionFactory("test-mysql-cb"); //$NON-NLS-1$
if (binding != null) {
- admin.deleteConnectorBinding("test-mysql-cb"); //$NON-NLS-1$
+ admin.deleteConnectionFactory("test-mysql-cb"); //$NON-NLS-1$
}
Properties p = new Properties();
@@ -80,27 +83,27 @@
p.setProperty("CapabilitiesClass", "org.teiid.connector.jdbc.derby.DerbyCapabilities"); //$NON-NLS-1$ //$NON-NLS-2$
p.setProperty("XaCapable", "true"); //$NON-NLS-1$ //$NON-NLS-2$
p.setProperty("SourceJNDIName", "java:DerbyDS"); //$NON-NLS-1$ //$NON-NLS-2$
- admin.addConnectorBinding("test-mysql-cb","connector-jdbc-7.0.0-SNAPSHOT", p); //$NON-NLS-1$ //$NON-NLS-2$
+ admin.addConnectionFactory("test-mysql-cb","connector-jdbc-7.0.0-SNAPSHOT", p); //$NON-NLS-1$ //$NON-NLS-2$
- binding = admin.getConnectorBinding("test-mysql-cb"); //$NON-NLS-1$
+ binding = admin.getConnectionFactory("test-mysql-cb"); //$NON-NLS-1$
assertNotNull(binding);
assertEquals("java:DerbyDS", binding.getPropertyValue("SourceJNDIName")); //$NON-NLS-1$ //$NON-NLS-2$
- admin.stopConnectorBinding(binding);
+ admin.stopConnectionFactory(binding);
- admin.startConnectorBinding(binding);
+ admin.startConnectionFactory(binding);
- admin.setConnectorBindingProperty("test-mysql-cb", "SourceJNDIName", "DummyDS"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ admin.setConnectionFactoryProperty("test-mysql-cb", "SourceJNDIName", "DummyDS"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- binding = admin.getConnectorBinding("test-mysql-cb"); //$NON-NLS-1$
+ binding = admin.getConnectionFactory("test-mysql-cb"); //$NON-NLS-1$
assertEquals("DummyDS", binding.getPropertyValue("SourceJNDIName")); //$NON-NLS-1$ //$NON-NLS-2$
- admin.deleteConnectorBinding("test-mysql-cb"); //$NON-NLS-1$
+ admin.deleteConnectionFactory("test-mysql-cb"); //$NON-NLS-1$
- binding = admin.getConnectorBinding("test-mysql-cb"); //$NON-NLS-1$
+ binding = admin.getConnectionFactory("test-mysql-cb"); //$NON-NLS-1$
assertNull(binding);
}
@@ -119,7 +122,7 @@
Set<VDB> vdbs = admin.getVDBs();
assertTrue(vdbs.size() >= 1);
- Collection<ConnectorBinding> bindings = admin.getConnectorBindingsInVDB("TransactionsRevisited",1); //$NON-NLS-1$
+ Collection<ConnectionFactory> bindings = admin.getConnectionFactoriesInVDB("TransactionsRevisited",1); //$NON-NLS-1$
assertEquals(2, bindings.size());
admin.deleteVDB("TransactionsRevisited", 1); //$NON-NLS-1$
@@ -250,14 +253,14 @@
@Test
public void testConnectionPool() throws Exception {
- ConnectionPoolStatistics stats = admin.getConnectorConnectionPoolStats("mysql-connector-binding"); //$NON-NLS-1$
+ ConnectionPoolStatistics stats = admin.getConnectionFactoryStats("mysql-connector-binding"); //$NON-NLS-1$
System.out.println(stats);
assertNotNull(stats);
}
@Test
public void testConnectorTypeProperties() throws Exception {
- Collection<PropertyDefinition> defs = admin.getConnectorTypePropertyDefinitions("connector-jdbc-7.0.0-SNAPSHOT"); //$NON-NLS-1$
+ Collection<PropertyDefinition> defs = admin.getConnectorPropertyDefinitions("connector-jdbc-7.0.0-SNAPSHOT"); //$NON-NLS-1$
for (PropertyDefinition pd:defs) {
System.out.println(pd.getName());
if (pd.getName().equals("ExtensionTranslationClassName")) { //$NON-NLS-1$
@@ -285,7 +288,7 @@
@Test
public void testConnectorTypes() throws Exception {
- Set<String> defs = admin.getConnectorTypes();
+ Set<String> defs = admin.getConnectorNames();
assertTrue(defs.contains("connector-salesforce-7.0.0-SNAPSHOT")); //$NON-NLS-1$
assertTrue(defs.contains("connector-jdbc-7.0.0-SNAPSHOT")); //$NON-NLS-1$
assertTrue(defs.contains("connector-text-7.0.0-SNAPSHOT")); //$NON-NLS-1$
@@ -306,15 +309,15 @@
public void testTemplate() throws Exception{
File f = new File(UnitTestUtil.getTestDataPath()+"/connector-loopback.rar"); //$NON-NLS-1$
FileInputStream fis = new FileInputStream(f);
- admin.addConnectorType("connector-loopy", fis); //$NON-NLS-1$
+ admin.addConnector("connector-loopy", fis); //$NON-NLS-1$
fis.close();
- Set<String> names = admin.getConnectorTypes();
+ Set<String> names = admin.getConnectorNames();
assertTrue(names.contains("connector-loopy")); //$NON-NLS-1$
- admin.deleteConnectorType("connector-loopy"); //$NON-NLS-1$
+ admin.deleteConnector("connector-loopy"); //$NON-NLS-1$
- names = admin.getConnectorTypes();
+ names = admin.getConnectorNames();
//assertTrue(!names.contains("connector-loopy")); //$NON-NLS-1$
}
@@ -334,7 +337,7 @@
}
@Test public void testAssignConnectorBinding() throws Exception {
- admin.assignBindingToModel("TransactionsRevisited", 1, "pm1", "mysql", "jndi:FOO"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ admin.assignConnectionFactoryToModel("TransactionsRevisited", 1, "pm1", "mysql", "jndi:FOO"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
boolean checked = false;
VDB vdb = admin.getVDB("TransactionsRevisited", 1); //$NON-NLS-1$
14 years, 8 months
teiid SVN: r2022 - in trunk: client/src/main/java/org/teiid/adminapi/impl and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-05 11:26:20 -0400 (Mon, 05 Apr 2010)
New Revision: 2022
Modified:
trunk/client/src/main/java/org/teiid/adminapi/Request.java
trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
Log:
TEIID-1033 adding state to the request metadata
Modified: trunk/client/src/main/java/org/teiid/adminapi/Request.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Request.java 2010-04-04 21:59:34 UTC (rev 2021)
+++ trunk/client/src/main/java/org/teiid/adminapi/Request.java 2010-04-05 15:26:20 UTC (rev 2022)
@@ -24,6 +24,7 @@
+
/**
* When a user submits a SQL command to the system for processing, usually that represents
* a single request. A single request might have one or more source
@@ -34,6 +35,12 @@
* in the pattern [session]|[request] or [session]|[request]|[source request] </p>
*/
public interface Request extends AdminObject {
+
+ public enum State {
+ PROCESSING,
+ DONE,
+ CANCELED
+ }
/**
* Get the ExecutionId for a Request
@@ -74,8 +81,13 @@
public boolean sourceRequest();
/**
+ * @return In the case that this is a source request this represents the node id. Otherwise null
+ */
+ public Integer getNodeId();
+
+ /**
* @return In the case that this is a source request this represents the node id. Otherwise blank
*/
- public int getNodeId();
+ State getState();
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java 2010-04-04 21:59:34 UTC (rev 2021)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadata.java 2010-04-05 15:26:20 UTC (rev 2022)
@@ -41,8 +41,9 @@
private String command;
private long startTime;
private boolean sourceRequest;
- private int nodeID = Integer.MIN_VALUE;
+ private Integer nodeID;
private String transactionId;
+ private State state;
@Override
@ManagementProperty(description="Unique Identifier for Request", readOnly=true)
@@ -52,9 +53,19 @@
public void setExecutionId(long id) {
this.executionId = id;
- }
+ }
@Override
+ @ManagementProperty(description="State of the Request", readOnly=true)
+ public State getState() {
+ return state;
+ }
+
+ public void setState(State state) {
+ this.state = state;
+ }
+
+ @Override
@ManagementProperty(description="Session ID", readOnly=true)
public long getSessionId() {
return this.sessionId;
@@ -96,7 +107,7 @@
@Override
@ManagementProperty(description="Node Id", readOnly=true)
- public int getNodeId() {
+ public Integer getNodeId() {
return this.nodeID;
}
@@ -130,7 +141,8 @@
return HashCodeUtil.hashCode((int)executionId, (int)sessionId);
}
- public String toString() {
+ @SuppressWarnings("nls")
+ public String toString() {
StringBuilder str = new StringBuilder();
str.append("Request: sessionid=").append(sessionId);
str.append("; executionId=").append(executionId);
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java 2010-04-04 21:59:34 UTC (rev 2021)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java 2010-04-05 15:26:20 UTC (rev 2022)
@@ -33,6 +33,7 @@
import org.jboss.metatype.api.values.SimpleValueSupport;
import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
import org.jboss.metatype.spi.values.MetaMapper;
+import org.teiid.adminapi.Request.State;
public class RequestMetadataMapper extends MetaMapper<RequestMetadata> {
private static final String TRANSACTION_ID = "transactionId"; //$NON-NLS-1$
@@ -43,6 +44,7 @@
private static final String CREATED_TIME = "createdTime"; //$NON-NLS-1$
private static final String SESSION_ID = "sessionId"; //$NON-NLS-1$
private static final String EXECUTION_ID = "executionId"; //$NON-NLS-1$
+ private static final String STATE = "state"; //$NON-NLS-1$
private static final MutableCompositeMetaType metaType;
private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
@@ -56,6 +58,7 @@
metaType.addItem(SOURCE_REQUEST, SOURCE_REQUEST, SimpleMetaType.BOOLEAN_PRIMITIVE);
metaType.addItem(NODE_ID, NODE_ID, SimpleMetaType.INTEGER_PRIMITIVE);
metaType.addItem(TRANSACTION_ID, TRANSACTION_ID, SimpleMetaType.STRING);
+ metaType.addItem(STATE, STATE, SimpleMetaType.STRING);
metaType.freeze();
}
@@ -84,7 +87,7 @@
request.set(SOURCE_REQUEST, SimpleValueSupport.wrap(object.sourceRequest()));
request.set(NODE_ID, SimpleValueSupport.wrap(object.getNodeId()));
request.set(TRANSACTION_ID,SimpleValueSupport.wrap(object.getTransactionId()));
-
+ request.set(STATE,SimpleValueSupport.wrap(object.getState()));
return request;
}
throw new IllegalArgumentException("Cannot convert RequestMetadata " + object); //$NON-NLS-1$
@@ -106,6 +109,7 @@
request.setSourceRequest((Boolean) metaValueFactory.unwrap(compositeValue.get(SOURCE_REQUEST)));
request.setNodeId((Integer) metaValueFactory.unwrap(compositeValue.get(NODE_ID)));
request.setTransactionId((String) metaValueFactory.unwrap(compositeValue.get(TRANSACTION_ID)));
+ request.setState((State) metaValueFactory.unwrap(compositeValue.get(STATE)));
return request;
}
throw new IllegalStateException("Unable to unwrap RequestMetadata " + metaValue); //$NON-NLS-1$
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-04-04 21:59:34 UTC (rev 2021)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-04-05 15:26:20 UTC (rev 2022)
@@ -42,6 +42,7 @@
import org.teiid.adminapi.Admin;
import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.Request.State;
import org.teiid.adminapi.impl.RequestMetadata;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
import org.teiid.client.DQP;
@@ -246,7 +247,7 @@
req.setSessionId(Long.parseLong(holder.requestID.getConnectionID()));
req.setCommand(holder.requestMsg.getCommandString());
req.setStartTime(holder.getProcessingTimestamp());
-
+ req.setState(holder.isCanceled()?State.CANCELED:holder.isDoneProcessing()?State.DONE:State.PROCESSING);
if (holder.getTransactionContext() != null && holder.getTransactionContext().getTransactionType() != Scope.NONE) {
req.setTransactionId(holder.getTransactionContext().getTransactionId());
}
@@ -268,7 +269,7 @@
info.setStartTime(arm.getProcessingTimestamp());
info.setSourceRequest(true);
info.setNodeId(arm.getAtomicRequestID().getNodeID());
-
+ info.setState(conInfo.isCanceled()?State.CANCELED:conInfo.isDone()?State.DONE:State.PROCESSING);
results.add(info);
}
results.add(req);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2010-04-04 21:59:34 UTC (rev 2021)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2010-04-05 15:26:20 UTC (rev 2022)
@@ -53,8 +53,9 @@
private ConnectorWork cwi;
private int index;
private int rowsProcessed;
- private AtomicResultsMessage arm;
+ private volatile AtomicResultsMessage arm;
private boolean closed;
+ private volatile boolean canceled;
/**
* Constructor for DataTierTupleSource.
@@ -82,7 +83,7 @@
if (index < arm.getResults().length) {
return this.arm.getResults()[index++];
}
- if (this.arm.getFinalRow() > 0) {
+ if (isDone()) {
return null;
}
try {
@@ -92,6 +93,10 @@
}
}
}
+
+ public boolean isDone() {
+ return this.arm != null && this.arm.getFinalRow() > 0;
+ }
void open() throws MetaMatrixComponentException, MetaMatrixProcessingException {
try {
@@ -116,7 +121,12 @@
}
}
+ public boolean isCanceled() {
+ return canceled;
+ }
+
public void cancelRequest() {
+ this.canceled = true;
if (this.cwi != null) {
this.cwi.cancel();
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-04-04 21:59:34 UTC (rev 2021)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-04-05 15:26:20 UTC (rev 2022)
@@ -110,7 +110,7 @@
// This exception contains details of all the atomic requests that failed when query is run in partial results mode.
private List<MetaMatrixException> warnings = new LinkedList<MetaMatrixException>();
private boolean doneProducingBatches;
- private boolean isClosed;
+ private volatile boolean isClosed;
private volatile boolean isCanceled;
private volatile boolean closeRequested;
//results request
14 years, 8 months
teiid SVN: r2021 - in trunk: client/src/main/java/org/teiid/adminapi/impl and 10 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-04-04 17:59:34 -0400 (Sun, 04 Apr 2010)
New Revision: 2021
Modified:
trunk/client/src/main/java/org/teiid/adminapi/Admin.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/DataPolicyMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/SourceMappingMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java
trunk/engine/src/test/java/org/teiid/metadata/TestTransformationMetadata.java
trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/VDBMetaDataInstanceClassFactory.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
trunk/test-integration/db/src/test/resources/TransactionsRevisited.vdb
Log:
TEIID-1017: Adding capability to add/remove to role to a data policy through admin api
Modified: trunk/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -355,5 +355,25 @@
* Closes the admin connection
*/
void close();
+
+ /**
+ * Assign a Role name to the Data Policy in a given VDB
+ *
+ * @param vdbName
+ * @param vdbVersion
+ * @param policyName
+ * @param role
+ */
+ void addRoleToDataPolicy(String vdbName, int vdbVersion, String policyName, String role) throws AdminException;
+
+ /**
+ * Assign a Role name to the Data Policy in a given VDB
+ *
+ * @param vdbName
+ * @param vdbVersion
+ * @param policyName
+ * @param role
+ */
+ void removeRoleFromDataPolicy(String vdbName, int vdbVersion, String policyName, String role) throws AdminException;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ConnectorBindingMetaData.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -23,7 +23,6 @@
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;
@@ -32,25 +31,34 @@
private static final long serialVersionUID = -4865836616882247016L;
private transient Object type;
+ private String rarFileName;
+ private String jndiName;
- @ManagementProperty(description="Connector Binding Name", readOnly=true)
- @ManagementObjectID(type="binding")
+ @ManagementProperty(description="Connector Binding Name")
public String getName() {
return super.getName();
}
@Override
- @ManagementProperty(description="RAR file name", readOnly=true)
+ @ManagementProperty(description="RAR file name")
public String getRARFileName() {
- return getPropertyValue("rar-name"); //$NON-NLS-1$
+ return this.rarFileName;
}
+ public void setRARFileName(String name) {
+ this.rarFileName = name;
+ }
+
@Override
- @ManagementProperty(description="JNDI name", readOnly=true)
+ @ManagementProperty(description="JNDI name")
public String getJNDIName() {
- return getPropertyValue("jndi-name"); //$NON-NLS-1$
+ return this.jndiName;
}
-
+
+ public void setJNDIName(String name) {
+ this.jndiName = name;
+ }
+
public void setComponentType(Object type) {
this.type = type;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/DataPolicyMetadata.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/DataPolicyMetadata.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/DataPolicyMetadata.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -32,7 +32,6 @@
import javax.xml.bind.annotation.XmlType;
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.DataPolicy;
@@ -63,11 +62,11 @@
});
@XmlElement(name = "mapped-role-name")
- protected List<String> mappedRoleNames;
+ protected List<String> mappedRoleNames = new ArrayList<String>();
@Override
@ManagementProperty(description="Policy Name")
- @ManagementObjectID(type="policy")
+ //@ManagementObjectID(type="policy")
public String getName() {
return name;
}
@@ -112,9 +111,14 @@
}
public void setMappedRoleNames(List<String> names) {
- this.mappedRoleNames = names;
+ this.mappedRoleNames.clear();
+ this.mappedRoleNames.addAll(names);
}
+ public void addMappedRoleName(String name) {
+ this.mappedRoleNames.add(name);
+ }
+
public boolean allows(String resourceName, DataPolicy.PermissionType type) {
for(PermissionMetaData permission:this.permissions.getMap().values()) {
if (permission.getResourceName().equalsIgnoreCase(resourceName) ) {
@@ -140,9 +144,9 @@
"allowDelete"
})
@ManagementObject(properties=ManagementProperties.EXPLICIT)
- public static class PermissionMetaData implements DataPermission{
-
- private static final String SEPARATOR = "."; //$NON-NLS-1$
+ public static class PermissionMetaData implements DataPermission, Serializable {
+ private static final long serialVersionUID = 7034744531663164277L;
+ private static final String SEPARATOR = "."; //$NON-NLS-1$
public static final String RECURSIVE = "*"; //$NON-NLS-1$
private static final String ALL_NODES = RECURSIVE;
public static final String SEPARATOR_WITH_RECURSIVE = SEPARATOR + RECURSIVE;
@@ -164,7 +168,7 @@
@Override
@ManagementProperty(description="Resource Name, for which permission defined")
- @ManagementObjectID(type="permission")
+ //@ManagementObjectID(type="permission")
@XmlElement(name = "resource-name", required = true)
public String getResourceName() {
return resourceName;
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -35,7 +35,6 @@
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;
@@ -76,7 +75,6 @@
protected List<ValidationError> errors;
@ManagementProperty(description="Model Name")
- @ManagementObjectID(type="model")
@XmlAttribute(name = "name", required = true)
public String getName() {
return super.getName();
@@ -132,8 +130,8 @@
addProperty(SUPPORTS_MULTI_SOURCE_BINDINGS_KEY, Boolean.toString(supports));
}
- public void setModelType(String modelType) {
- this.modelType = modelType;
+ public void setModelType(Model.Type modelType) {
+ this.modelType = modelType.name();
}
public String toString() {
@@ -216,7 +214,6 @@
}
@ManagementProperty (description="Error Message")
- @ManagementObjectID(type="error")
public String getValue() {
return value;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/PropertyMetadata.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -30,7 +30,6 @@
import javax.xml.bind.annotation.XmlType;
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;
@@ -68,7 +67,6 @@
}
@ManagementProperty(description="property key")
- @ManagementObjectID(type="property")
public String getName() {
return name;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -26,7 +26,6 @@
import javax.security.auth.Subject;
import javax.security.auth.login.LoginContext;
-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;
@@ -111,7 +110,6 @@
@Override
@ManagementProperty(description="Session ID", readOnly=true)
- @ManagementObjectID(type="session")
public long getSessionId() {
return this.sessionId;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/SourceMappingMetadata.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/SourceMappingMetadata.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/SourceMappingMetadata.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -31,7 +31,6 @@
import javax.xml.bind.annotation.XmlType;
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;
@@ -56,7 +55,6 @@
}
@ManagementProperty (description="Source Name")
- @ManagementObjectID(type="sourceMapping")
public String getName() {
return name;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -24,7 +24,6 @@
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;
@@ -36,7 +35,6 @@
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.ManagementProperties;
import org.jboss.managed.api.annotation.ManagementProperty;
import org.teiid.adminapi.DataPolicy;
@@ -55,7 +53,6 @@
})
@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;
@@ -87,10 +84,10 @@
private String fileUrl = null;
private boolean dynamic = false;
+ private VDB.Status status = VDB.Status.INACTIVE;
@ManagementProperty(description="Name of the VDB")
- @ManagementObjectID(type="vdb")
@XmlAttribute(name = "name", required = true)
public String getName() {
return super.getName();
@@ -102,21 +99,17 @@
}
@Override
- @ManagementProperty(description="VDB Status", readOnly=true)
+ @ManagementProperty(description="VDB Status")
public Status getStatus() {
- String status = getPropertyValue(STATUS_KEY);
- if (status != null) {
- return VDB.Status.valueOf(status);
- }
- return VDB.Status.ACTIVE;
+ return this.status;
}
public void setStatus(Status s) {
- addProperty(STATUS_KEY, s.name());
+ this.status = s;
}
@Override
- @ManagementProperty(description="VDB version", readOnly=true)
+ @ManagementProperty(description="VDB version")
public int getVersion() {
return this.version;
}
@@ -142,8 +135,8 @@
}
/**
- * This method required to make the JNDI assignment on the model work; if not present Management framework
- * treating "models" as ReadOnly property.
+ * This method required to make the JNDI assignment on the model work; if not persistent Management framework
+ * treating "models" as ReadOnly property. The actual assignment is done in the VDBMetaDataClassInstancefactory
* @param models
*/
public void setModels(List<Model> models) {
@@ -252,7 +245,8 @@
}
/**
- * This method is required by the Management framework to write the mappings.
+ * This method is required by the Management framework to write the mappings to the persistent form. The actual assignment is done
+ * in the VDBMetaDataClassInstancefactory
* @param policies
*/
public void setDataPolicies(List<DataPolicy> policies){
Modified: trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
===================================================================
--- trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -55,7 +55,7 @@
ModelMetaData modelOne = new ModelMetaData();
modelOne.setName("model-one"); //$NON-NLS-1$
modelOne.addSourceMapping("s1", "java:mybinding"); //$NON-NLS-1$ //$NON-NLS-2$
- modelOne.setModelType("PHYSICAL"); //$NON-NLS-1$
+ modelOne.setModelType(Model.Type.PHYSICAL); //$NON-NLS-1$
modelOne.addProperty("model-prop", "model-value"); //$NON-NLS-1$ //$NON-NLS-2$
modelOne.addProperty("model-prop", "model-value-override"); //$NON-NLS-1$ //$NON-NLS-2$
modelOne.setVisible(false);
@@ -67,7 +67,7 @@
modelTwo.setName("model-two"); //$NON-NLS-1$
modelTwo.addSourceMapping("s1", "java:binding-one"); //$NON-NLS-1$ //$NON-NLS-2$
modelTwo.addSourceMapping("s2", "java:binding-two"); //$NON-NLS-1$ //$NON-NLS-2$
- modelTwo.setModelType("VIRTUAL"); //$NON-NLS-1$
+ modelTwo.setModelType(Model.Type.VIRTUAL); //$NON-NLS-1$
modelTwo.addProperty("model-prop", "model-value"); //$NON-NLS-1$ //$NON-NLS-2$
vdb.addModel(modelTwo);
Modified: trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -29,6 +29,7 @@
import java.util.Iterator;
import java.util.List;
+import org.teiid.adminapi.Model;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.SessionMetadata;
import org.teiid.adminapi.impl.VDBMetaData;
@@ -40,7 +41,6 @@
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.core.vdb.ModelType;
import com.metamatrix.query.mapping.relational.QueryNode;
import com.metamatrix.query.mapping.xml.MappingAttribute;
import com.metamatrix.query.mapping.xml.MappingDocument;
@@ -155,10 +155,10 @@
ModelMetaData model = new ModelMetaData();
model.setName(name);
if (source) {
- model.setModelType(ModelType.getString(ModelType.PHYSICAL));
+ model.setModelType(Model.Type.PHYSICAL);
}
else {
- model.setModelType(ModelType.getString(ModelType.VIRTUAL));
+ model.setModelType(Model.Type.PHYSICAL);
}
model.setVisible(true);
model.setSupportsMultiSourceBindings(false);
@@ -2381,7 +2381,7 @@
ModelMetaData model = new ModelMetaData();
model.setName("MultiModel");
- model.setModelType(ModelType.getString(ModelType.PHYSICAL));
+ model.setModelType(Model.Type.PHYSICAL);
model.setVisible(true);
model.setSupportsMultiSourceBindings(true);
Modified: trunk/engine/src/test/java/org/teiid/metadata/TestTransformationMetadata.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/metadata/TestTransformationMetadata.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/engine/src/test/java/org/teiid/metadata/TestTransformationMetadata.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -22,7 +22,8 @@
package org.teiid.metadata;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
import java.util.Arrays;
import java.util.Collection;
@@ -31,6 +32,7 @@
import java.util.Properties;
import org.junit.Test;
+import org.teiid.adminapi.Model;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.connector.metadata.runtime.Datatype;
@@ -38,7 +40,6 @@
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.core.vdb.ModelType;
import com.metamatrix.query.unittest.FakeMetadataFactory;
public class TestTransformationMetadata {
@@ -72,7 +73,7 @@
ModelMetaData buildModel(String name) {
ModelMetaData model = new ModelMetaData();
model.setName(name);
- model.setModelType(ModelType.getString(ModelType.PHYSICAL));
+ model.setModelType(Model.Type.PHYSICAL);
model.setVisible(true);
return model;
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -51,6 +51,7 @@
import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.plugins.DefaultFieldsImpl;
import org.jboss.managed.plugins.WritethroughManagedPropertyImpl;
+import org.jboss.metatype.api.types.CollectionMetaType;
import org.jboss.metatype.api.types.MapCompositeMetaType;
import org.jboss.metatype.api.types.SimpleMetaType;
import org.jboss.metatype.api.values.CollectionValueSupport;
@@ -77,6 +78,7 @@
import org.teiid.adminapi.WorkerPoolStatistics;
import org.teiid.adminapi.impl.ConnectionPoolStatisticsMetadata;
import org.teiid.adminapi.impl.ConnectorBindingMetaData;
+import org.teiid.adminapi.impl.DataPolicyMetadata;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.PropertyDefinitionMetadata;
import org.teiid.adminapi.impl.RequestMetadata;
@@ -84,6 +86,7 @@
import org.teiid.adminapi.impl.TransactionMetadata;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
+import org.teiid.adminapi.impl.DataPolicyMetadata.PermissionMetaData;
import org.teiid.connector.api.Connector;
import org.teiid.jboss.IntegrationPlugin;
import org.teiid.jboss.deployers.RuntimeEngineDeployer;
@@ -467,17 +470,69 @@
vdb.addModel(buildModel(mo));
}
- // TODO: add the following
// SecurityRoleMappings
-
+ mp = mc.getProperty("dataPolicies");//$NON-NLS-1$
+ List<ManagedObject> policies = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(mp.getValue());
+ if (policies != null && !policies.isEmpty()) {
+ for(ManagedObject mo:policies) {
+ vdb.addDataPolicy(buildDataPolicy(mo));
+ }
+ }
return vdb;
}
+ private DataPolicyMetadata buildDataPolicy(ManagedObject managedPolicy) {
+ DataPolicyMetadata policy = new DataPolicyMetadata();
+ policy.setName(ManagedUtil.getSimpleValue(managedPolicy, "name", String.class));//$NON-NLS-1$
+ policy.setDescription(ManagedUtil.getSimpleValue(managedPolicy, "description", String.class));//$NON-NLS-1$
+
+ ManagedProperty mappedRoleNames = managedPolicy.getProperty("mappedRoleNames");//$NON-NLS-1$
+ CollectionValueSupport roleCollection = (CollectionValueSupport)mappedRoleNames.getValue();
+ if (roleCollection != null) {
+ MetaValue[] roleNames = roleCollection.getElements();
+ for (MetaValue mv:roleNames) {
+ policy.addMappedRoleName((String)((SimpleValueSupport)mv).getValue());
+ }
+ }
+
+ ManagedProperty permissions = managedPolicy.getProperty("permissions");//$NON-NLS-1$
+ if (permissions != null) {
+ List<ManagedObject> permissionCollection = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(permissions.getValue());
+ if (permissionCollection != null) {
+ for (ManagedObject mo:permissionCollection) {
+ PermissionMetaData permission = new PermissionMetaData();
+
+ permission.setResourceName(ManagedUtil.getSimpleValue(mo, "resourceName", String.class));//$NON-NLS-1$
+
+ if (ManagedUtil.getSimpleValue(mo, "allowCreate", Boolean.class) != null) {
+ permission.setAllowCreate(ManagedUtil.getSimpleValue(mo, "allowCreate", Boolean.class));
+ }
+
+ if (ManagedUtil.getSimpleValue(mo, "allowRead", Boolean.class) != null) {
+ permission.setAllowRead(ManagedUtil.getSimpleValue(mo, "allowRead", Boolean.class));
+ }
+
+ if (ManagedUtil.getSimpleValue(mo, "allowUpdate", Boolean.class) != null) {
+ permission.setAllowUpdate(ManagedUtil.getSimpleValue(mo, "allowUpdate", Boolean.class));
+ }
+
+ if (ManagedUtil.getSimpleValue(mo, "allowDelete", Boolean.class) != null) {
+ permission.setAllowDelete(ManagedUtil.getSimpleValue(mo, "allowDelete", Boolean.class));
+ }
+
+ policy.addPermission(permission);
+ }
+ }
+ }
+
+ return policy;
+ }
+
private ModelMetaData buildModel(ManagedObject managedModel) {
ModelMetaData model = new ModelMetaData();
model.setName(ManagedUtil.getSimpleValue(managedModel, "name", String.class));//$NON-NLS-1$
model.setVisible(ManagedUtil.getSimpleValue(managedModel, "visible", Boolean.class));//$NON-NLS-1$
- model.setModelType(ManagedUtil.getSimpleValue(managedModel, "modelType", String.class));//$NON-NLS-1$
+ model.setModelType(Model.Type.valueOf(ManagedUtil.getSimpleValue(managedModel, "modelType", String.class)));//$NON-NLS-1$
ManagedProperty prop = managedModel.getProperty("JAXBProperties"); //$NON-NLS-1$
List<ManagedObject> properties = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(prop.getValue());
@@ -932,6 +987,69 @@
} catch (Exception e) {
throw new AdminComponentException(e.getMessage(), e);
}
+ }
+
+ private void manageRoleToDataPolicy(String vdbName, int vdbVersion, String policyName, String role, boolean add) throws AdminException {
+ ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
+ if (mc == null) {
+ throw new AdminProcessingException(IntegrationPlugin.Util.getString("vdb_not_found", vdbName, vdbVersion)); //$NON-NLS-1$
+ }
+
+ ManagedProperty mp = mc.getProperty("dataPolicies");//$NON-NLS-1$
+ List<ManagedObject> policies = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(mp.getValue());
+ ManagedObject managedPolicy = null;
+ if (policies != null && !policies.isEmpty()) {
+ for(ManagedObject mo:policies) {
+ String name = ManagedUtil.getSimpleValue(mo, "name", String.class); //$NON-NLS-1$
+ if (policyName.equals(name)) {
+ managedPolicy = mo;
+ }
+ }
+ }
+
+ if (managedPolicy == null) {
+ throw new AdminProcessingException(IntegrationPlugin.Util.getString("policy_not_found", policyName, vdbName, vdbVersion)); //$NON-NLS-1$
+ }
+
+ ManagedProperty mappedRoleNames = managedPolicy.getProperty("mappedRoleNames");//$NON-NLS-1$
+ CollectionValueSupport roleCollection = (CollectionValueSupport)mappedRoleNames.getValue();
+ ArrayList<MetaValue> modifiedRoleNames = new ArrayList<MetaValue>();
+ if (roleCollection != null) {
+ MetaValue[] roleNames = roleCollection.getElements();
+ for (MetaValue mv:roleNames) {
+ String existing = (String)((SimpleValueSupport)mv).getValue();
+ if (!existing.equals(role)) {
+ modifiedRoleNames.add(mv);
+ }
+ }
+ }
+ else {
+ roleCollection = new CollectionValueSupport(new CollectionMetaType("java.util.List", SimpleMetaType.STRING));
+ mappedRoleNames.setValue(roleCollection);
+ }
+
+ if (add) {
+ modifiedRoleNames.add(ManagedUtil.wrap(SimpleMetaType.STRING, role));
+ }
+
+ roleCollection.setElements(modifiedRoleNames.toArray(new MetaValue[modifiedRoleNames.size()]));
+
+ try {
+ getView().updateComponent(mc);
+ } catch (Exception e) {
+ throw new AdminComponentException(e.getMessage(), e);
+ }
+ }
+
+
+ @Override
+ public void addRoleToDataPolicy(String vdbName, int vdbVersion, String policyName, String role) throws AdminException {
+ manageRoleToDataPolicy(vdbName, vdbVersion, policyName, role, true);
+ }
+
+ @Override
+ public void removeRoleFromDataPolicy(String vdbName, int vdbVersion, String policyName, String role) throws AdminException{
+ manageRoleToDataPolicy(vdbName, vdbVersion, policyName, role, false);
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/VDBMetaDataInstanceClassFactory.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/VDBMetaDataInstanceClassFactory.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/VDBMetaDataInstanceClassFactory.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -30,6 +30,7 @@
import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.MetaValueFactory;
+import org.teiid.adminapi.impl.DataPolicyMetadata;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.jboss.ManagedUtil;
@@ -74,6 +75,19 @@
vdb.addProperty(ManagedUtil.getSimpleValue(managedProperty, "name", String.class), ManagedUtil.getSimpleValue(managedProperty, "value", String.class)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
+ else if (property.getName().equals("dataPolicies")) { //$NON-NLS-1$
+ List<ManagedObject> policies = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(property.getValue());
+ for(ManagedObject managedPolicy:policies) {
+ String policyName = ManagedUtil.getSimpleValue(managedPolicy, "name", String.class); //$NON-NLS-1$
+ DataPolicyMetadata policy = vdb.getDataPolicy(policyName);
+
+ ManagedProperty mappedRoleNames = managedPolicy.getProperty("mappedRoleNames");//$NON-NLS-1$
+ if (mappedRoleNames != null){
+ List<String> roleNames = (List<String>)MetaValueFactory.getInstance().unwrap(mappedRoleNames.getValue());
+ policy.setMappedRoleNames(roleNames);
+ }
+ }
+ }
else {
super.setValue(beanInfo, property, vdb, value);
}
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2010-04-04 21:59:34 UTC (rev 2021)
@@ -35,6 +35,8 @@
connector_type_not_found=Connector Type template "{0}" not found in the configuration.
vdb_not_found=VDB with name "{0}" version "{1}" not found in configuration
model_not_found=Model name "{0}" not found in the VDB with name "{1}" version "{2}"
+policy_not_found=Policy name "{0}" not found in the VDB with name "{1}" version "{2}"
+
sourcename_not_found=No source name {0} found in the model: {1}.{2}.{3}
connector_started= Teiid connector {0} started
connector_stopped=Teiid connector {0} stopped
Modified: trunk/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -53,7 +53,7 @@
ModelMetaData system = new ModelMetaData();
system.setName(CoreConstants.SYSTEM_MODEL);
system.setVisible(true);
- system.setModelType(Model.Type.PHYSICAL.name());
+ system.setModelType(Model.Type.PHYSICAL);
system.addSourceMapping(CoreConstants.SYSTEM_MODEL, CoreConstants.SYSTEM_MODEL);
system.setSupportsMultiSourceBindings(false);
vdb.addModel(system);
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -173,7 +173,7 @@
ModelMetaData system = new ModelMetaData();
system.setName(CoreConstants.SYSTEM_MODEL);
system.setVisible(true);
- system.setModelType(Model.Type.PHYSICAL.name());
+ system.setModelType(Model.Type.PHYSICAL);
system.addSourceMapping(CoreConstants.SYSTEM_MODEL, CoreConstants.SYSTEM_MODEL);
system.setSupportsMultiSourceBindings(false);
vdb.addModel(system);
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -49,6 +49,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;
+import org.teiid.adminapi.VDB;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.client.DQP;
@@ -103,6 +104,7 @@
vdbMetaData.setName(p.getProperty(TeiidURL.JDBC.VDB_NAME));
vdbMetaData.addAttchment(QueryMetadataInterface.class, metadata);
vdbMetaData.addAttchment(TransformationMetadata.class, metadata);
+ vdbMetaData.setStatus(VDB.Status.ACTIVE);
repo.addMetadata(vdbMetaData, metadata);
for (Schema schema : metadata.getMetadataStore().getSchemas().values()) {
ModelMetaData model = new ModelMetaData();
Modified: trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-04-02 00:46:43 UTC (rev 2020)
+++ trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-04-04 21:59:34 UTC (rev 2021)
@@ -25,6 +25,7 @@
import org.teiid.adminapi.AdminFactory;
import org.teiid.adminapi.ConnectionPoolStatistics;
import org.teiid.adminapi.ConnectorBinding;
+import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.Model;
import org.teiid.adminapi.PropertyDefinition;
import org.teiid.adminapi.Request;
@@ -55,7 +56,7 @@
admin.close();
}
- @AfterClass
+ //@AfterClass
public static void end() throws Exception {
admin = AdminFactory.getInstance().createAdmin("admin", "admin".toCharArray(), "mm://localhost:31443"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -352,4 +353,37 @@
assertTrue("Test not veryfied", checked); //$NON-NLS-1$
}
+
+
+ @Test public void testAddRoleNames() throws Exception {
+ installVDB();
+ admin.addRoleToDataPolicy("TransactionsRevisited", 1, "policy1", "managers"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ VDB vdb = admin.getVDB("TransactionsRevisited", 1); //$NON-NLS-1$
+ List<DataPolicy> policies = vdb.getDataPolicies();
+ assertTrue (!policies.isEmpty());
+ for (DataPolicy policy:policies) {
+ if (policy.getName().equals("policy1")) { //$NON-NLS-1$
+ List<String> sources = policy.getMappedRoleNames();
+ assertTrue(sources.contains("managers"));
+ }
+ }
+
+ // remove the role
+ admin.removeRoleFromDataPolicy("TransactionsRevisited", 1, "policy1", "managers");
+
+ vdb = admin.getVDB("TransactionsRevisited", 1); //$NON-NLS-1$
+ policies = vdb.getDataPolicies();
+ assertTrue (!policies.isEmpty());
+
+ for (DataPolicy policy:policies) {
+ if (policy.getName().equals("policy1")) { //$NON-NLS-1$
+ List<String> sources = policy.getMappedRoleNames();
+ assertFalse(sources.contains("managers"));
+ }
+ }
+
+ // remove non-existent role name
+ admin.removeRoleFromDataPolicy("TransactionsRevisited", 1, "policy1", "FOO");
+ }
}
Modified: trunk/test-integration/db/src/test/resources/TransactionsRevisited.vdb
===================================================================
(Binary files differ)
14 years, 9 months
teiid SVN: r2020 - in trunk: client/src/main/java/org/teiid/client and 19 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-01 20:46:43 -0400 (Thu, 01 Apr 2010)
New Revision: 2020
Added:
trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionServiceException.java
Removed:
trunk/engine/src/main/java/com/metamatrix/api/
trunk/engine/src/main/java/com/metamatrix/query/analysis/QueryAnnotation.java
trunk/engine/src/main/java/com/metamatrix/query/processor/program/ProgramUtil.java
Modified:
trunk/client/src/main/java/org/teiid/adminapi/Admin.java
trunk/client/src/main/java/org/teiid/client/ResultsMessage.java
trunk/client/src/main/java/org/teiid/client/plan/Annotation.java
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/BufferManagerImpl.java
trunk/engine/src/main/java/com/metamatrix/common/log/LogManager.java
trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionService.java
trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/RelationalPlanner.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/AssignmentInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/CreateCursorResultSetInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ErrorInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/IfInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/LoopInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ProcedurePlan.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/WhileInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/program/Program.java
trunk/engine/src/main/java/com/metamatrix/query/processor/program/ProgramInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNodeStatistics.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/test/java/com/metamatrix/query/analysis/TestAnalysisRecord.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/TestMaterialization.java
trunk/engine/src/test/java/com/metamatrix/query/processor/FakeProcessorPlan.java
trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java
Log:
TEIID-1026 consolidating to a single annotation class, adding logging to ping and dqp/admin
Modified: trunk/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -30,7 +30,7 @@
public interface Admin {
- public enum Cache {CODE_TABLE_CACHE,PREPARED_PLAN_CACHE, QUERY_SERVICE_RESULT_SET_CACHE, CONNECTOR_RESULT_SET_CACHE};
+ public enum Cache {CODE_TABLE_CACHE,PREPARED_PLAN_CACHE, QUERY_SERVICE_RESULT_SET_CACHE};
/**
* Assign a {@link ConnectorBinding} to a {@link VDB}'s Model
Modified: trunk/client/src/main/java/org/teiid/client/ResultsMessage.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/ResultsMessage.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/client/src/main/java/org/teiid/client/ResultsMessage.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -31,6 +31,8 @@
import java.util.List;
import java.util.Map;
+import org.teiid.client.plan.Annotation;
+
import com.metamatrix.api.exception.ExceptionHolder;
import com.metamatrix.api.exception.MetaMatrixException;
import com.metamatrix.core.util.ExternalizeUtil;
@@ -75,7 +77,7 @@
* Collection of Object[] where each Object[] holds annotation information
* that can be used to create an Annotation implementation in JDBC.
*/
- private Collection annotations;
+ private Collection<Annotation> annotations;
private boolean isUpdateResult;
@@ -266,7 +268,7 @@
parameters = ExternalizeUtil.readList(in);
debugLog = (String)in.readObject();
- annotations = (Collection)in.readObject();
+ annotations = ExternalizeUtil.readList(in, Annotation.class);
isUpdateResult = in.readBoolean();
}
@@ -300,14 +302,14 @@
ExternalizeUtil.writeList(out, parameters);
out.writeObject(debugLog);
- out.writeObject(annotations);
+ ExternalizeUtil.writeCollection(out, annotations);
out.writeBoolean(isUpdateResult);
}
/**
* @return
*/
- public Collection getAnnotations() {
+ public Collection<Annotation> getAnnotations() {
return annotations;
}
@@ -321,7 +323,7 @@
/**
* @param collection
*/
- public void setAnnotations(Collection collection) {
+ public void setAnnotations(Collection<Annotation> collection) {
annotations = collection;
}
Modified: trunk/client/src/main/java/org/teiid/client/plan/Annotation.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/plan/Annotation.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/client/src/main/java/org/teiid/client/plan/Annotation.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -22,42 +22,52 @@
package org.teiid.client.plan;
+import java.io.Serializable;
/**
+ * Annotation describing a decision made during query execution.
*/
-public class Annotation {
-
+public class Annotation implements Serializable {
+
+ private static final long serialVersionUID = 7389738177788185542L;
+ public static final String MATERIALIZED_VIEW = "Materialized View"; //$NON-NLS-1$
+ public static final String HINTS = "Hints"; //$NON-NLS-1$
+
+ public enum Priority {
+ LOW,
+ MEDIUM,
+ HIGH
+ }
+
private String category;
- private String description;
+ private String annotation;
private String resolution;
- private int severity;
-
- public Annotation(String[] serverAnnotation) {
- category = serverAnnotation[0];
- description = serverAnnotation[1];
- resolution = serverAnnotation[2];
-
- severity = Integer.parseInt(serverAnnotation[3]);
+ private Priority priority = Priority.LOW;
+
+ public Annotation(String category, String annotation, String resolution, Priority priority) {
+ this.category = category;
+ this.annotation = annotation;
+ this.resolution = resolution;
+ this.priority = priority;
}
-
+
public String getCategory() {
- return category;
+ return this.category;
}
-
+
public String getAnnotation() {
- return description;
+ return this.annotation;
}
-
+
public String getResolution() {
- return resolution;
+ return this.resolution;
}
-
- public int getSeverity() {
- return severity;
+
+ public Priority getPriority() {
+ return this.priority;
}
public String toString() {
- return description;
+ return "QueryAnnotation<" + getCategory() + ", " + getAnnotation() + ">"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
}
-
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -112,7 +112,7 @@
private String debugLog;
// the last query annotations
- private List<Annotation> annotations;
+ private Collection<Annotation> annotations;
// resultSet object produced by execute methods on the statement.
protected ResultSetImpl resultSet;
@@ -887,10 +887,6 @@
this.debugLog = debugLog;
}
- void setAnnotations(List<Annotation> annotations) {
- this.annotations = annotations;
- }
-
/**
* Get Query plan description.
* If the Statement has a resultSet, we get the plan description from the result set
@@ -954,17 +950,7 @@
protected void setAnalysisInfo(ResultsMessage resultsMsg) {
this.debugLog = resultsMsg.getDebugLog();
this.currentPlanDescription = resultsMsg.getPlanDescription();
- Collection serverAnnotations = resultsMsg.getAnnotations();
- if(serverAnnotations != null) {
- List<Annotation> annotations = new ArrayList<Annotation>(serverAnnotations.size());
- Iterator annIter = serverAnnotations.iterator();
- while(annIter.hasNext()) {
- String[] serverAnnotation = (String[]) annIter.next();
- Annotation annotation = new Annotation(serverAnnotation);
- annotations.add(annotation);
- }
- this.annotations = annotations;
- }
+ this.annotations = resultsMsg.getAnnotations();
}
Calendar getDefaultCalendar() {
Modified: trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/BufferManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/BufferManagerImpl.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/BufferManagerImpl.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -51,7 +51,6 @@
import com.metamatrix.common.buffer.TupleBatch;
import com.metamatrix.common.buffer.TupleBuffer;
import com.metamatrix.common.buffer.BatchManager.ManagedBatch;
-import com.metamatrix.common.buffer.FileStore.FileStoreOutputStream;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.common.types.InputStreamFactory;
Modified: trunk/engine/src/main/java/com/metamatrix/common/log/LogManager.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/log/LogManager.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/common/log/LogManager.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -84,7 +84,58 @@
*/
public final class LogManager {
- static LogConfiguration configuration = new LogConfigurationImpl(MessageLevel.DETAIL); // either injected or manually set using the set methods
+ public static class LoggingProxy implements InvocationHandler {
+ private final Object instance;
+ private final String loggingContext;
+ private final int level;
+
+ public LoggingProxy(Object instance, String loggingContext, int level) {
+ this.instance = instance;
+ this.loggingContext = loggingContext;
+ this.level = level;
+ }
+
+ public Object invoke(Object proxy,
+ Method method,
+ Object[] args) throws Throwable {
+ boolean log = LogManager.isMessageToBeRecorded(loggingContext, level);
+ if (log) {
+ StringBuffer message = new StringBuffer();
+ message.append("before "); //$NON-NLS-1$
+ message.append(method.getName());
+ message.append(":"); //$NON-NLS-1$
+ message.append(instance);
+ message.append("("); //$NON-NLS-1$
+ if (args != null) {
+ for (int i = 0; i < args.length; i++) {
+ if (args[i] != null) {
+ message.append(args[i]);
+ } else {
+ message.append("null"); //$NON-NLS-1$
+ }
+ if (i != args.length - 1) {
+ message.append(","); //$NON-NLS-1$
+ }
+ }
+ }
+ message.append(")"); //$NON-NLS-1$
+ LogManager.log(level, loggingContext, message.toString());
+ }
+ try {
+ Object result = method.invoke(instance, args);
+ if (log) {
+ LogManager.log(level, loggingContext,
+ "after " + method.getName()+ " : "+result); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return result;
+ } catch (InvocationTargetException e) {
+ throw e.getTargetException();
+ }
+ }
+ }
+
+
+ static LogConfiguration configuration = new LogConfigurationImpl(MessageLevel.DETAIL); // either injected or manually set using the set methods
static LogListener logListener = new JavaLogWriter(); // either injected or manually set using the set methods
@@ -367,45 +418,6 @@
final Object instance,
final Class<?>[] interfaces,
final int level) {
- return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, new InvocationHandler() {
-
- public Object invoke(Object proxy,
- Method method,
- Object[] args) throws Throwable {
- boolean log = LogManager.isMessageToBeRecorded(loggingContext, level);
- if (log) {
- StringBuffer message = new StringBuffer();
- message.append("before "); //$NON-NLS-1$
- message.append(method.getName());
- message.append(":"); //$NON-NLS-1$
- message.append(instance);
- message.append("("); //$NON-NLS-1$
- if (args != null) {
- for (int i = 0; i < args.length; i++) {
- if (args[i] != null) {
- message.append(args[i]);
- } else {
- message.append("null"); //$NON-NLS-1$
- }
- if (i != args.length - 1) {
- message.append(","); //$NON-NLS-1$
- }
- }
- }
- message.append(")"); //$NON-NLS-1$
- LogManager.log(level, loggingContext, message.toString());
- }
- try {
- Object result = method.invoke(instance, args);
- if (log) {
- LogManager.log(level, loggingContext,
- "after " + method.getName()+ " : "+result); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return result;
- } catch (InvocationTargetException e) {
- throw e.getTargetException();
- }
- }
- });
+ return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, new LoggingProxy(instance, loggingContext, level));
}
}
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionService.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionService.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -32,7 +32,6 @@
import org.teiid.dqp.internal.process.DQPCore;
import org.teiid.security.Credentials;
-import com.metamatrix.api.exception.security.SessionServiceException;
/**
* <p>
Copied: trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionServiceException.java (from rev 2014, trunk/engine/src/main/java/com/metamatrix/api/exception/security/SessionServiceException.java)
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionServiceException.java (rev 0)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionServiceException.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -0,0 +1,81 @@
+/*
+ * 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.service;
+
+import org.teiid.client.security.MetaMatrixSecurityException;
+
+
+public class SessionServiceException extends MetaMatrixSecurityException {
+ /**
+ * No-Arg Constructor
+ */
+ public SessionServiceException( ) {
+ super( );
+ }
+ /**
+ * Constructs an instance of the exception with the specified detail message. A detail
+ * message is a String that describes this particular exception.
+ * @param the detail message
+ */
+ public SessionServiceException(String message) {
+ super(message);
+ }
+ /**
+ * Constructs an instance of the exception with no detail message but with a
+ * single exception.
+ * @param e the exception that is encapsulated by this exception
+ */
+ public SessionServiceException(Throwable e) {
+ super(e);
+ }
+ /**
+ * Constructs an instance of the exception with the specified detail message
+ * and a single exception. A detail message is a String that describes this
+ * particular exception.
+ * @param message the detail message
+ * @param e the exception that is encapsulated by this exception
+ */
+ public SessionServiceException( Throwable e, String message ) {
+ super(e, message);
+ }
+ /**
+ * Construct an instance with an error code and message specified.
+ *
+ * @param message The error message
+ * @param code The error code
+ */
+ public SessionServiceException( String code, String message ) {
+ super( code, message );
+ }
+ /**
+ * Construct an instance with a linked exception, and an error code and
+ * message, specified.
+ *
+ * @param e An exception to chain to this exception
+ * @param message The error message
+ * @param code The error code
+ */
+ public SessionServiceException( Throwable e, String code, String message ) {
+ super( e, code, message );
+ }
+}
Modified: trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -25,6 +25,8 @@
import java.io.*;
import java.util.*;
+import org.teiid.client.plan.Annotation;
+
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.core.log.MessageLevel;
@@ -50,7 +52,7 @@
private Map queryPlan;
// Annotations
- private Collection<QueryAnnotation> annotations;
+ private Collection<Annotation> annotations;
// Debug trace log
private StringWriter stringWriter; // inner
@@ -62,7 +64,7 @@
this.recordDebug = recordDebug | LogManager.isMessageToBeRecorded(LogConstants.CTX_QUERY_PLANNER, MessageLevel.TRACE);
if(this.recordQueryPlan) {
- this.annotations = new ArrayList<QueryAnnotation>();
+ this.annotations = new ArrayList<Annotation>();
}
if(this.recordDebug) {
@@ -124,7 +126,7 @@
* returns true.
* @param annotation Annotation to add
*/
- public void addAnnotation(QueryAnnotation annotation) {
+ public void addAnnotation(Annotation annotation) {
this.annotations.add(annotation);
}
@@ -132,7 +134,7 @@
* Get annotations.
* @return
*/
- public Collection<QueryAnnotation> getAnnotations() {
+ public Collection<Annotation> getAnnotations() {
return this.annotations;
}
Deleted: trunk/engine/src/main/java/com/metamatrix/query/analysis/QueryAnnotation.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/analysis/QueryAnnotation.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/analysis/QueryAnnotation.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -1,68 +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.query.analysis;
-
-/**
- * Annotation describing a decision made during query execution.
- */
-public class QueryAnnotation {
-
- public static final String MATERIALIZED_VIEW = "Materialized View"; //$NON-NLS-1$
- public static final String HINTS = "Hints"; //$NON-NLS-1$
-
- public static final int LOW = 1;
- public static final int MEDIUM = 2;
- public static final int HIGH = 3;
-
- private String category;
- private String annotation;
- private String resolution;
- private int priority = LOW;
-
- public QueryAnnotation(String category, String annotation, String resolution, int priority) {
- this.category = category;
- this.annotation = annotation;
- this.resolution = resolution;
- this.priority = priority;
- }
-
- public String getCategory() {
- return this.category;
- }
-
- public String getAnnotation() {
- return this.annotation;
- }
-
- public String getResolution() {
- return this.resolution;
- }
-
- public int getPriority() {
- return this.priority;
- }
-
- public String toString() {
- return "QueryAnnotation<" + getCategory() + ", " + getAnnotation() + ">"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- }
-}
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/RelationalPlanner.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/RelationalPlanner.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -31,6 +31,8 @@
import java.util.Map;
import java.util.Set;
+import org.teiid.client.plan.Annotation;
+import org.teiid.client.plan.Annotation.Priority;
import org.teiid.dqp.internal.process.Request;
import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -44,7 +46,6 @@
import com.metamatrix.core.id.IDGenerator;
import com.metamatrix.query.QueryPlugin;
import com.metamatrix.query.analysis.AnalysisRecord;
-import com.metamatrix.query.analysis.QueryAnnotation;
import com.metamatrix.query.execution.QueryExecPlugin;
import com.metamatrix.query.mapping.relational.QueryNode;
import com.metamatrix.query.metadata.QueryMetadataInterface;
@@ -263,7 +264,7 @@
if(! appliedHint) {
String msg = QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0010, groupName);
if (this.analysisRecord.recordAnnotations()) {
- this.analysisRecord.addAnnotation(new QueryAnnotation(QueryAnnotation.HINTS, msg, "ignoring hint", QueryAnnotation.MEDIUM)); //$NON-NLS-1$
+ this.analysisRecord.addAnnotation(new Annotation(Annotation.HINTS, msg, "ignoring hint", Priority.MEDIUM)); //$NON-NLS-1$
}
}
}
@@ -941,10 +942,10 @@
String matTableName, String msg) {
if ( analysis.recordAnnotations() ) {
Object[] params = new Object[] {virtualGroup, matTableName};
- QueryAnnotation annotation = new QueryAnnotation(QueryAnnotation.MATERIALIZED_VIEW,
+ Annotation annotation = new Annotation(Annotation.MATERIALIZED_VIEW,
QueryPlugin.Util.getString(msg, params),
null,
- QueryAnnotation.LOW);
+ Priority.LOW);
analysis.addAnnotation(annotation);
}
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/AssignmentInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/AssignmentInstruction.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/AssignmentInstruction.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -47,7 +47,7 @@
/**
* @see com.metamatrix.query.processor.program.ProgramInstruction#clone()
*/
- public Object clone() {
+ public AssignmentInstruction clone() {
AssignmentInstruction clone = new AssignmentInstruction();
this.cloneState(clone);
return clone;
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/CreateCursorResultSetInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/CreateCursorResultSetInstruction.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/CreateCursorResultSetInstruction.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -71,7 +71,7 @@
/**
* Returns a deep clone
*/
- public Object clone(){
+ public CreateCursorResultSetInstruction clone(){
ProcessorPlan clonedPlan = this.plan.clone();
return new CreateCursorResultSetInstruction(this.rsName, clonedPlan);
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ErrorInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ErrorInstruction.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ErrorInstruction.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -47,7 +47,7 @@
/**
* @see com.metamatrix.query.processor.program.ProgramInstruction#clone()
*/
- public Object clone() {
+ public ErrorInstruction clone() {
ErrorInstruction clone = new ErrorInstruction();
this.cloneState(clone);
return clone;
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -322,7 +322,7 @@
/**
* Returns a deep clone
*/
- public Object clone() {
+ public ExecDynamicSqlInstruction clone() {
ExecDynamicSqlInstruction clone = new ExecDynamicSqlInstruction(
parentProcCommand, dynamicCommand, metadata, idGenerator, capFinder);
return clone;
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/IfInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/IfInstruction.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/IfInstruction.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -115,7 +115,7 @@
/**
* Returns a deep clone
*/
- public Object clone(){
+ public IfInstruction clone(){
Program cloneIf = (Program) this.ifProgram.clone();
Program cloneElse = null;
if(elseProgram != null) {
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/LoopInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/LoopInstruction.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/LoopInstruction.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -73,7 +73,7 @@
/**
* Returns a deep clone
*/
- public Object clone(){
+ public LoopInstruction clone(){
ProcessorPlan clonedPlan = this.plan.clone();
return new LoopInstruction((Program)this.loopProgram.clone(), this.rsName, clonedPlan);
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ProcedurePlan.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ProcedurePlan.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ProcedurePlan.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -54,7 +54,6 @@
import com.metamatrix.query.processor.TempTableDataManager;
import com.metamatrix.query.processor.program.Program;
import com.metamatrix.query.processor.program.ProgramInstruction;
-import com.metamatrix.query.processor.program.ProgramUtil;
import com.metamatrix.query.processor.relational.SubqueryAwareEvaluator;
import com.metamatrix.query.sql.ProcedureReservedWords;
import com.metamatrix.query.sql.lang.Criteria;
@@ -320,7 +319,7 @@
}
public String toString() {
- return "ProcedurePlan:\n" + ProgramUtil.programToString(this.originalProgram); //$NON-NLS-1$
+ return "ProcedurePlan:\n" + this.originalProgram; //$NON-NLS-1$
}
public ProcessorPlan clone(){
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/WhileInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/WhileInstruction.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/WhileInstruction.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -58,7 +58,7 @@
/**
* Returns a deep clone
*/
- public Object clone(){
+ public WhileInstruction clone(){
return new WhileInstruction((Program)this.whileProgram.clone(), this.condition);
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/program/Program.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/program/Program.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/program/Program.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -22,10 +22,15 @@
package com.metamatrix.query.processor.program;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import com.metamatrix.query.processor.Describable;
-import com.metamatrix.query.processor.ProcessorPlan;
+import com.metamatrix.query.processor.proc.IfInstruction;
+import com.metamatrix.query.processor.proc.WhileInstruction;
/**
* A program is a sequence of {@link ProgramInstruction ProgramInstruction}. Certain
@@ -34,7 +39,7 @@
*/
public class Program implements Cloneable, Describable {
- private List programInstructions;
+ private List<ProgramInstruction> programInstructions;
private int counter = 0;
/**
@@ -109,10 +114,6 @@
}
}
- public String toString(){
- return ("PROGRAM size " + getProcessorInstructions().size() + ", counter " + this.counter); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
/**
* Produces a deep clone.
*/
@@ -121,10 +122,9 @@
program.counter = this.counter;
if (this.programInstructions != null){
- ArrayList clonedInstructions = new ArrayList(this.programInstructions.size());
- Iterator i = this.programInstructions.iterator();
- while (i.hasNext()){
- clonedInstructions.add( ((ProgramInstruction)i.next()).clone() );
+ ArrayList<ProgramInstruction> clonedInstructions = new ArrayList<ProgramInstruction>(this.programInstructions.size());
+ for (ProgramInstruction pi : this.programInstructions) {
+ clonedInstructions.add( pi.clone() );
}
program.programInstructions = clonedInstructions;
}
@@ -149,26 +149,6 @@
return props;
}
- /**
- * Finds all nested plans and returns them.
- * @return List of ProcessorPlan
- * @since 4.2
- */
- public List<ProcessorPlan> getChildPlans() {
- List<ProcessorPlan> plans = new ArrayList<ProcessorPlan>();
- if (programInstructions != null) {
- for(int i=0; i<programInstructions.size(); i++) {
- ProgramInstruction inst = (ProgramInstruction) programInstructions.get(i);
- Collection<ProcessorPlan> instPlans = inst.getChildPlans();
- if(instPlans != null) {
- plans.addAll(instPlans);
- }
- }
- }
- return plans;
- }
-
-
//=========================================================================
//UTILITY
//=========================================================================
@@ -182,17 +162,68 @@
private ProgramInstruction getInstructionAtIndex(int instructionIndex){
if (programInstructions != null){
if (instructionIndex < getProcessorInstructions().size()){
- return (ProgramInstruction)getProcessorInstructions().get(instructionIndex);
+ return getProcessorInstructions().get(instructionIndex);
}
}
return null;
}
- public List getProcessorInstructions(){
+ public List<ProgramInstruction> getProcessorInstructions(){
if (programInstructions == null){
- programInstructions = new ArrayList();
+ programInstructions = new ArrayList<ProgramInstruction>();
}
return programInstructions;
}
+
+ public String toString() {
+ StringBuilder str = new StringBuilder();
+
+ programToString(str);
+
+ return "PROGRAM counter " + this.counter + " " + str.toString(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ /**
+ * This method calls itself recursively if either a While or If instruction is encountered.
+ * The sub program(s) from those kinds of instructions are passed, recursively, into this
+ * method.
+ */
+ private final int programToString(StringBuilder str) {
+
+ int instructionIndex = 0;
+ ProgramInstruction inst = getInstructionAt(instructionIndex);
+
+ while(inst != null) {
+
+ printLine(counter++, inst.toString(), str);
+
+ if(counter > 1000) {
+ printLine(counter, "[OUTPUT TRUNCATED...]", str); //$NON-NLS-1$
+ break;
+ }
+
+ instructionIndex++;
+ inst = getInstructionAt(instructionIndex);
+
+ }
+
+ return counter;
+ }
+
+
+ private static final void printLine(int counter, String line, StringBuilder buffer) {
+ // Pad counter with spaces
+ String counterStr = "" + counter + ": "; //$NON-NLS-1$ //$NON-NLS-2$
+ if(counter < 10) {
+ counterStr += " "; //$NON-NLS-1$
+ }
+ if(counterStr.length() == 1) {
+ counterStr += " "; //$NON-NLS-1$
+ } else if(counterStr.length() == 2) {
+ counterStr += " "; //$NON-NLS-1$
+ }
+
+ buffer.append(counterStr + line + "\n"); //$NON-NLS-1$
+ }
+
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/program/ProgramInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/program/ProgramInstruction.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/program/ProgramInstruction.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -73,9 +73,9 @@
* override with custom safe or deep cloning.
* @return shallow clone
*/
- public Object clone() {
+ public ProgramInstruction clone() {
try {
- return super.clone();
+ return (ProgramInstruction)super.clone();
} catch (CloneNotSupportedException e) {
//should never get here, since
//this Class does support clone
Deleted: trunk/engine/src/main/java/com/metamatrix/query/processor/program/ProgramUtil.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/program/ProgramUtil.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/program/ProgramUtil.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -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.query.processor.program;
-
-/**
- * Utility to print out a {@link Program Program}.
- */
-public final class ProgramUtil {
-
- private ProgramUtil() {
- }
-
- public static final String programToString(Program program) {
-
- StringBuffer str = new StringBuffer();
-
- int counter = 1;
- int tabs = 0;
-
- programToString(program, counter, tabs, str);
-
- return str.toString();
- }
-
- /**
- * This method calls itself recursively if either a While or If instruction is encountered.
- * The sub program(s) from those kinds of instructions are passed, recursively, into this
- * method.
- */
- private static final int programToString(Program program, int counter, int tabs, StringBuffer str) {
-
- int instructionIndex = 0;
- ProgramInstruction inst = program.getInstructionAt(instructionIndex);
-// Program subprogram = null;
-
- while(inst != null) {
-
- printLine(counter++, tabs, inst.toString(), str);
-
- if(counter > 1000) {
- printLine(counter, tabs, "[OUTPUT TRUNCATED...]", str); //$NON-NLS-1$
- break;
- }
-
- instructionIndex++;
- inst = program.getInstructionAt(instructionIndex);
-
- }
-
- return counter;
- }
-
-
- private static final void printLine(int counter, int tabs, String line, StringBuffer buffer) {
- // Pad counter with spaces
- String counterStr = "" + counter + ": "; //$NON-NLS-1$ //$NON-NLS-2$
- if(counter < 10) {
- counterStr += " "; //$NON-NLS-1$
- }
- if(counterStr.length() == 1) {
- counterStr += " "; //$NON-NLS-1$
- } else if(counterStr.length() == 2) {
- counterStr += " "; //$NON-NLS-1$
- }
-
- buffer.append(counterStr + getTab(tabs) + line + "\n"); //$NON-NLS-1$
- }
-
- private static final String getTab(int tabs) {
- if(tabs == 0) {
- return ""; //$NON-NLS-1$
- }
- StringBuffer str = new StringBuffer();
- for(int i=0; i<tabs; i++) {
- str.append(" "); //$NON-NLS-1$
- }
- return str.toString();
- }
-
-}
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNodeStatistics.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNodeStatistics.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNodeStatistics.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -22,32 +22,21 @@
package com.metamatrix.query.processor.relational;
-import java.sql.Timestamp;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import com.metamatrix.common.buffer.TupleBatch;
-import com.metamatrix.query.processor.Describable;
/**
* @since 4.2
*/
-public class RelationalNodeStatistics implements Describable {
+public class RelationalNodeStatistics {
// Statistics
- static final String NODE_OUTPUT_ROWS = "nodeOutputRows"; //$NON-NLS-1$
- static final String NODE_PROCESS_TIME = "nodeProcessingTime"; //$NON-NLS-1$
- static final String NODE_CUMULATIVE_PROCESS_TIME = "nodeCumulativeProcessingTime"; //$NON-NLS-1$
- static final String NODE_CUMULATIVE_NEXTBATCH_PROCESS_TIME = "nodeCumulativeNextBatchProcessingTime"; //$NON-NLS-1$
- static final String NODE_NEXT_BATCH_CALLS = "nodeNextBatchCalls"; //$NON-NLS-1$
- static final String NODE_BLOCKS = "nodeBlocks"; //$NON-NLS-1$
static final int BATCHCOMPLETE_STOP = 0;
static final int BLOCKEDEXCEPTION_STOP = 1;
- private Map statisticsProperties;
private List statisticsList;
private boolean setNodeStartTime;
@@ -58,10 +47,6 @@
private long nodeStartTime;
private long nodeEndTime;
- // Start and End timestamps for the node
- private Timestamp nodeStartTimestamp;
- private Timestamp nodeEndTimestamp;
-
// Start and End system time for each batch
private long batchStartTime;
private long batchEndTime;
@@ -82,7 +67,6 @@
private int nodeBlocks;
public RelationalNodeStatistics() {
- this.statisticsProperties = new HashMap();
this.statisticsList = new ArrayList();
this.setNodeStartTime = false;
}
@@ -110,15 +94,12 @@
this.nodeBlocks++;
break;
}
- //this.reset();
}
public void collectNodeStats(RelationalNode[] relationalNodes, String className) {
// set nodeEndTime to the time gathered at the end of the last batch
this.nodeEndTime = this.batchEndTime;
this.nodeCumulativeProcessingTime = this.nodeEndTime - this.nodeStartTime;
- this.nodeEndTimestamp = new Timestamp(this.nodeEndTime);
- this.nodeStartTimestamp = new Timestamp(this.nodeStartTime);
if(relationalNodes[0] != null) {
long maxUnionChildCumulativeProcessingTime = 0;
for (int i = 0; i < relationalNodes.length; i++) {
@@ -135,19 +116,6 @@
}
}
- public void setDescriptionProperties() {
- this.statisticsProperties.put(NODE_OUTPUT_ROWS, new Integer(this.nodeOutputRows));
- this.statisticsProperties.put(NODE_PROCESS_TIME, new Long(this.nodeProcessingTime));
- this.statisticsProperties.put(NODE_CUMULATIVE_PROCESS_TIME, new Long(this.nodeCumulativeProcessingTime));
- this.statisticsProperties.put(NODE_CUMULATIVE_NEXTBATCH_PROCESS_TIME, new Long(this.nodeCumulativeNextBatchProcessingTime));
- this.statisticsProperties.put(NODE_NEXT_BATCH_CALLS, new Integer(this.nodeNextBatchCalls));
- this.statisticsProperties.put(NODE_BLOCKS, new Integer(this.nodeBlocks));
- }
-
- public Map getDescriptionProperties() {
- return this.statisticsProperties;
- }
-
public void setStatisticsList() {
this.statisticsList.clear();
this.statisticsList.add("Node Output Rows: " + this.nodeOutputRows); //$NON-NLS-1$
@@ -162,11 +130,6 @@
return this.statisticsList;
}
- public void reset() {
- this.batchStartTime = 0;
- this.batchEndTime = 0;
- }
-
/**
* @return Returns the nodeBlocks.
* @since 4.2
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -516,7 +516,6 @@
ArrayList<String> caches = new ArrayList<String>();
caches.add(Admin.Cache.CODE_TABLE_CACHE.toString());
caches.add(Admin.Cache.PREPARED_PLAN_CACHE.toString());
- caches.add(Admin.Cache.CONNECTOR_RESULT_SET_CACHE.toString());
caches.add(Admin.Cache.QUERY_SERVICE_RESULT_SET_CACHE.toString());
return caches;
}
@@ -530,11 +529,9 @@
case PREPARED_PLAN_CACHE:
clearPlanCache();
break;
- case CONNECTOR_RESULT_SET_CACHE:
+ case QUERY_SERVICE_RESULT_SET_CACHE:
clearResultSetCache();
break;
- case QUERY_SERVICE_RESULT_SET_CACHE:
- break;
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -36,6 +36,7 @@
import org.teiid.client.SourceWarning;
import org.teiid.client.lob.LobChunk;
import org.teiid.client.metadata.ParameterInfo;
+import org.teiid.client.plan.Annotation;
import org.teiid.client.util.ResultsReceiver;
import org.teiid.client.xa.XATransactionException;
import org.teiid.connector.api.DataNotAvailableException;
@@ -60,7 +61,6 @@
import com.metamatrix.dqp.service.TransactionService;
import com.metamatrix.dqp.service.TransactionContext.Scope;
import com.metamatrix.query.analysis.AnalysisRecord;
-import com.metamatrix.query.analysis.QueryAnnotation;
import com.metamatrix.query.execution.QueryExecPlugin;
import com.metamatrix.query.processor.BatchCollector;
import com.metamatrix.query.processor.QueryProcessor;
@@ -501,24 +501,7 @@
if(analysisRecord != null) {
response.setPlanDescription(analysisRecord.getQueryPlan());
response.setDebugLog(analysisRecord.getDebugLog());
-
- // Convert annotations to JDBC expected format - String[4]
- Collection anns = analysisRecord.getAnnotations();
- Collection converted = null;
- if(anns != null) {
- converted = new ArrayList(anns.size());
- Iterator annIter = anns.iterator();
- while(annIter.hasNext()) {
- QueryAnnotation ann = (QueryAnnotation) annIter.next();
- String[] jdbcAnn = new String[4];
- jdbcAnn[0] = ann.getCategory();
- jdbcAnn[1] = ann.getAnnotation();
- jdbcAnn[2] = ann.getResolution();
- jdbcAnn[3] = "" + ann.getPriority(); //$NON-NLS-1$
- converted.add(jdbcAnn);
- }
- response.setAnnotations(converted);
- }
+ response.setAnnotations(analysisRecord.getAnnotations());
}
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/analysis/TestAnalysisRecord.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/analysis/TestAnalysisRecord.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/test/java/com/metamatrix/query/analysis/TestAnalysisRecord.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -24,6 +24,9 @@
import java.util.*;
+import org.teiid.client.plan.Annotation;
+import org.teiid.client.plan.Annotation.Priority;
+
import com.metamatrix.core.util.StringUtil;
import junit.framework.TestCase;
@@ -54,13 +57,13 @@
AnalysisRecord rec = new AnalysisRecord(true, false);
assertTrue(rec.recordAnnotations());
- QueryAnnotation ann1 = new QueryAnnotation("cat", "ann", "res", QueryAnnotation.MEDIUM); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- QueryAnnotation ann2 = new QueryAnnotation("cat2", "ann2", "res2", QueryAnnotation.HIGH); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Annotation ann1 = new Annotation("cat", "ann", "res", Priority.MEDIUM); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Annotation ann2 = new Annotation("cat2", "ann2", "res2", Priority.HIGH); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
rec.addAnnotation(ann1);
rec.addAnnotation(ann2);
- Collection<QueryAnnotation> annotations = rec.getAnnotations();
+ Collection<Annotation> annotations = rec.getAnnotations();
assertEquals(2, annotations.size());
assertTrue(annotations.contains(ann1));
assertTrue(annotations.contains(ann2));
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/TestMaterialization.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/TestMaterialization.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/TestMaterialization.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -29,9 +29,9 @@
import org.junit.Ignore;
import org.junit.Test;
+import org.teiid.client.plan.Annotation;
import com.metamatrix.query.analysis.AnalysisRecord;
-import com.metamatrix.query.analysis.QueryAnnotation;
import com.metamatrix.query.metadata.QueryMetadataInterface;
import com.metamatrix.query.optimizer.TestOptimizer;
import com.metamatrix.query.sql.lang.Command;
@@ -49,10 +49,10 @@
TestOptimizer.helpPlanCommand(command, metadata, getGenericFinder(), analysis, new String[] {"SELECT g_0.e1 FROM MatTable.MatTable AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
- Collection<QueryAnnotation> annotations = analysis.getAnnotations();
+ Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertTrue("Expected one annotation", annotations.size() == 1); //$NON-NLS-1$
- assertEquals("Expected catagory mat view", annotations.iterator().next().getCategory(), QueryAnnotation.MATERIALIZED_VIEW); //$NON-NLS-1$
+ assertEquals("Expected catagory mat view", annotations.iterator().next().getCategory(), Annotation.MATERIALIZED_VIEW); //$NON-NLS-1$
}
@Ignore("we no longer auto detect this case, if we need this logic it will have to be added to the rewriter since it changes select into to an insert")
@@ -66,10 +66,10 @@
TestOptimizer.helpPlanCommand(command, metadata, getGenericFinder(), analysis, new String[] {"SELECT g_0.x FROM MatSrc.MatSrc AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
- Collection<QueryAnnotation> annotations = analysis.getAnnotations();
+ Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertTrue("Expected one annotation", annotations.size() == 1); //$NON-NLS-1$
- assertEquals("Expected catagory mat view", annotations.iterator().next().getCategory(), QueryAnnotation.MATERIALIZED_VIEW); //$NON-NLS-1$
+ assertEquals("Expected catagory mat view", annotations.iterator().next().getCategory(), Annotation.MATERIALIZED_VIEW); //$NON-NLS-1$
}
@Test public void testMaterializedTransformationNoCache() throws Exception {
@@ -82,10 +82,10 @@
TestOptimizer.helpPlanCommand(command, metadata, getGenericFinder(), analysis, new String[] {"SELECT g_0.x FROM MatSrc.MatSrc AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
- Collection<QueryAnnotation> annotations = analysis.getAnnotations();
+ Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertTrue("Expected one annotation", annotations.size() == 1); //$NON-NLS-1$
- assertEquals("Expected catagory mat view", annotations.iterator().next().getCategory(), QueryAnnotation.MATERIALIZED_VIEW); //$NON-NLS-1$
+ assertEquals("Expected catagory mat view", annotations.iterator().next().getCategory(), Annotation.MATERIALIZED_VIEW); //$NON-NLS-1$
}
//related to defect 14423
@@ -99,10 +99,10 @@
TestOptimizer.helpPlanCommand(command, metadata, getGenericFinder(), analysis, new String[] {"SELECT g_0.x FROM MatSrc.MatSrc AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
- Collection<QueryAnnotation> annotations = analysis.getAnnotations();
+ Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertTrue("Expected one annotation", annotations.size() == 1); //$NON-NLS-1$
- assertEquals("Expected catagory mat view", annotations.iterator().next().getCategory(), QueryAnnotation.MATERIALIZED_VIEW); //$NON-NLS-1$
+ assertEquals("Expected catagory mat view", annotations.iterator().next().getCategory(), Annotation.MATERIALIZED_VIEW); //$NON-NLS-1$
}
@Test public void testNoCacheInTransformation() throws Exception {
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/FakeProcessorPlan.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/FakeProcessorPlan.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/FakeProcessorPlan.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -25,7 +25,6 @@
import static org.junit.Assert.*;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -34,8 +34,6 @@
import java.util.Map;
import java.util.StringTokenizer;
-import javax.xml.transform.OutputKeys;
-
import org.junit.Test;
import org.teiid.client.metadata.ParameterInfo;
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -22,7 +22,6 @@
package org.teiid.jboss.deployers;
import java.io.Serializable;
-import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
@@ -70,13 +69,13 @@
import com.metamatrix.api.exception.ComponentNotFoundException;
import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.SessionServiceException;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.dqp.service.BufferService;
import com.metamatrix.dqp.service.SessionService;
+import com.metamatrix.dqp.service.SessionServiceException;
import com.metamatrix.dqp.service.TransactionService;
@ManagementObject(isRuntime=true, componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
@@ -119,8 +118,8 @@
createClientServices();
this.csr.registerClientService(ILogon.class, logon, LogConstants.CTX_SECURITY);
- this.csr.registerClientService(DQP.class, proxyService(DQP.class, this.dqpCore), LogConstants.CTX_DQP);
- this.csr.registerClientService(Admin.class, proxyService(Admin.class, admin), LogConstants.CTX_ADMIN_API);
+ this.csr.registerClientService(DQP.class, proxyService(DQP.class, this.dqpCore, LogConstants.CTX_DQP), LogConstants.CTX_DQP);
+ this.csr.registerClientService(Admin.class, proxyService(Admin.class, admin, LogConstants.CTX_ADMIN_API), LogConstants.CTX_ADMIN_API);
if (this.jdbcSocketConfiguration.isEnabled()) {
this.jdbcSocket = new SocketListener(this.jdbcSocketConfiguration, csr, this.dqpCore.getBufferManager());
@@ -174,21 +173,21 @@
/**
* Creates an proxy to validate the incoming session
*/
- private <T> T proxyService(final Class<T> iface, final T instance) {
+ private <T> T proxyService(final Class<T> iface, final T instance, String context) {
- return iface.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new InvocationHandler() {
+ return iface.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new LogManager.LoggingProxy(instance, context, MessageLevel.TRACE) {
- public Object invoke(Object arg0, Method arg1, Object[] arg2) throws Throwable {
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Throwable exception = null;
try {
sessionService.validateSession(DQPWorkContext.getWorkContext().getSessionId());
- return arg1.invoke(instance, arg2);
+ return super.invoke(proxy, method, args);
} catch (InvocationTargetException e) {
exception = e.getTargetException();
} catch(Throwable t){
exception = t;
}
- throw ExceptionUtil.convertException(arg1, exception);
+ throw ExceptionUtil.convertException(method, exception);
}
}));
}
Modified: trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -54,11 +54,11 @@
import org.teiid.security.Credentials;
import org.teiid.security.SecurityHelper;
-import com.metamatrix.api.exception.security.SessionServiceException;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.core.util.ArgCheck;
import com.metamatrix.dqp.service.SessionService;
+import com.metamatrix.dqp.service.SessionServiceException;
/**
* This class serves as the primary implementation of the Session Service.
@@ -299,7 +299,7 @@
public void setSecurityDomains(String domainNameOrder) {
if (domainNameOrder != null && domainNameOrder.trim().length()>0) {
- LogManager.logDetail(LogConstants.CTX_SECURITY, "Security Enabled: true"); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_SECURITY, "Security Enabled: true"); //$NON-NLS-1$
String[] domainNames = domainNameOrder.split(","); //$NON-NLS-1$
for (String domainName : domainNames) {
@@ -310,7 +310,7 @@
public void setAdminSecurityDomain(String domain) {
this.adminSecurityDomains.add(domain);
- LogManager.logDetail(LogConstants.CTX_SECURITY, "Admin Security Enabled: true"); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_SECURITY, "Admin Security Enabled: true"); //$NON-NLS-1$
}
public void start() {
Modified: trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2010-04-01 22:46:50 UTC (rev 2019)
+++ trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2010-04-02 00:46:43 UTC (rev 2020)
@@ -39,9 +39,11 @@
import com.metamatrix.api.exception.ComponentNotFoundException;
import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.SessionServiceException;
+import com.metamatrix.common.log.LogConstants;
+import com.metamatrix.common.log.LogManager;
import com.metamatrix.core.CoreConstants;
import com.metamatrix.dqp.service.SessionService;
+import com.metamatrix.dqp.service.SessionServiceException;
public class LogonImpl implements ILogon {
@@ -102,6 +104,7 @@
if (id != -1) {
this.service.pingServer(id);
}
+ LogManager.logTrace(LogConstants.CTX_SECURITY, "Ping", id); //$NON-NLS-1$
return ResultsFuture.NULL_FUTURE;
}
14 years, 9 months
teiid SVN: r2019 - in trunk: client/src/main/resources and 3 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-04-01 18:46:50 -0400 (Thu, 01 Apr 2010)
New Revision: 2019
Added:
trunk/client/src/test/java/org/teiid/adminapi/
trunk/client/src/test/java/org/teiid/adminapi/impl/
Removed:
trunk/engine/src/test/java/org/teiid/adminapi/impl/
Modified:
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
trunk/client/src/main/resources/vdb-deployer.xsd
Log:
TEIID-998: making the severity attribute on the "error" element as "required"
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-01 19:04:43 UTC (rev 2018)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-01 22:46:50 UTC (rev 2019)
@@ -205,7 +205,7 @@
@XmlValue
protected String value;
- @XmlAttribute(name = "severity")
+ @XmlAttribute(name = "severity", required = true)
protected String severity;
public ValidationError() {};
Modified: trunk/client/src/main/resources/vdb-deployer.xsd
===================================================================
--- trunk/client/src/main/resources/vdb-deployer.xsd 2010-04-01 19:04:43 UTC (rev 2018)
+++ trunk/client/src/main/resources/vdb-deployer.xsd 2010-04-01 22:46:50 UTC (rev 2019)
@@ -22,7 +22,7 @@
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
- <xs:attribute name="severity">
+ <xs:attribute name="severity" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="ERROR"/>
Copied: trunk/client/src/test/java/org/teiid/adminapi/impl (from rev 2009, trunk/engine/src/test/java/org/teiid/adminapi/impl)
14 years, 9 months
teiid SVN: r2018 - trunk/engine/src/test/java/com/metamatrix/common/buffer/impl.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-01 15:04:43 -0400 (Thu, 01 Apr 2010)
New Revision: 2018
Modified:
trunk/engine/src/test/java/com/metamatrix/common/buffer/impl/TestFileStorageManager.java
Log:
possible fix for windows test failure
Modified: trunk/engine/src/test/java/com/metamatrix/common/buffer/impl/TestFileStorageManager.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/common/buffer/impl/TestFileStorageManager.java 2010-04-01 16:25:20 UTC (rev 2017)
+++ trunk/engine/src/test/java/com/metamatrix/common/buffer/impl/TestFileStorageManager.java 2010-04-01 19:04:43 UTC (rev 2018)
@@ -54,7 +54,7 @@
@Test public void testAddGetBatch1() throws Exception {
StorageManager sm = getStorageManager(null, null, null);
- String tsID = "local,1:0"; //$NON-NLS-1$
+ String tsID = "local1:0"; //$NON-NLS-1$
// Add one batch
FileStore store = sm.createFileStore(tsID);
writeBytes(store);
@@ -64,7 +64,7 @@
@Test public void testCreatesSpillFiles() throws Exception {
FileStorageManager sm = getStorageManager(1024, null, null); // 1KB
- String tsID = "local,1:0"; //$NON-NLS-1$
+ String tsID = "local1:0"; //$NON-NLS-1$
// Add one batch
FileStore store = sm.createFileStore(tsID);
writeBytes(store);
14 years, 9 months
teiid SVN: r2017 - trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-04-01 12:25:20 -0400 (Thu, 01 Apr 2010)
New Revision: 2017
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/ServiceOperation.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapSourceCapabilities.java
Log:
TEIID-861: Soap connector capabilities must extend the XML capabilities.
Modified: trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/ServiceOperation.java
===================================================================
--- trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/ServiceOperation.java 2010-04-01 15:35:54 UTC (rev 2016)
+++ trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/ServiceOperation.java 2010-04-01 16:25:20 UTC (rev 2017)
@@ -111,8 +111,6 @@
sb.append("</tns1:").append(this.name).append(">");
- System.out.println(sb.toString());
-
return new StreamSource(new StringReader(sb.toString()));
}
Modified: trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapSourceCapabilities.java
===================================================================
--- trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapSourceCapabilities.java 2010-04-01 15:35:54 UTC (rev 2016)
+++ trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapSourceCapabilities.java 2010-04-01 16:25:20 UTC (rev 2017)
@@ -22,7 +22,7 @@
package org.teiid.connector.xml.soap;
-import org.teiid.connector.basic.BasicConnectorCapabilities;
+import com.metamatrix.connector.xml.base.XMLCapabilities;
-public class SoapSourceCapabilities extends BasicConnectorCapabilities {
+public class SoapSourceCapabilities extends XMLCapabilities {
}
14 years, 9 months
teiid SVN: r2016 - in trunk/console/src/main: java/org/teiid/rhq/plugin and 1 other directories.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-04-01 11:35:54 -0400 (Thu, 01 Apr 2010)
New Revision: 2016
Modified:
trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
Added Runtime Engine properties plus some general housekeeping
Modified: trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java 2010-04-01 02:11:49 UTC (rev 2015)
+++ trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java 2010-04-01 15:35:54 UTC (rev 2016)
@@ -262,7 +262,7 @@
}
- public String getVDBStatus(String vdbName, int version) {
+ public static String getVDBStatus(String vdbName, int version) {
ManagedComponent mcVdb = null;
try {
@@ -271,11 +271,11 @@
PluginConstants.ComponentType.VDB.TYPE,
PluginConstants.ComponentType.VDB.SUBTYPE), vdbName);
} catch (NamingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ final String msg = "NamingException in getVDBStatus(): " + e.getExplanation(); //$NON-NLS-1$
+ LOG.error(msg, e);
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ final String msg = "Exception in getVDBStatus(): " + e.getMessage(); //$NON-NLS-1$
+ LOG.error(msg, e);
}
return ProfileServiceUtil.getSimpleValue(mcVdb,
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-04-01 02:11:49 UTC (rev 2015)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-04-01 15:35:54 UTC (rev 2016)
@@ -86,17 +86,12 @@
*/
protected ResourceContext<?> resourceContext;
- private String systemKey;
+ protected String name;
- private String name;
-
private String identifier;
protected String componentType;
- // may be null when the component is not a host or vm
- private String port = null;
-
protected boolean isAvailable = false;
private final Log log = LogFactory.getLog(this.getClass());
@@ -147,10 +142,6 @@
this.resourceConfiguration = resourceConfiguration;
}
- public String getSystemKey() {
- return systemKey;
- }
-
public String getComponentName() {
return name;
}
@@ -159,10 +150,6 @@
this.name = componentName;
}
- public String getPort() {
- return port;
- }
-
public String getComponentIdentifier() {
return identifier;
}
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-04-01 02:11:49 UTC (rev 2015)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-04-01 15:35:54 UTC (rev 2016)
@@ -22,15 +22,15 @@
package org.teiid.rhq.plugin;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
-import java.util.Properties;
import java.util.Set;
import javax.naming.NamingException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.RunState;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -99,10 +99,7 @@
} else if (name.equals(Platform.Operations.KILL_SESSION)) {
valueMap.put(Operation.Value.SESSION_ID, configuration.getSimple(
Operation.Value.SESSION_ID).getLongValue());
- } else if (name.equals(Platform.Operations.GET_PROPERTIES)) {
- // String key = ConnectionConstants.IDENTIFIER;
- // valueMap.put(key, getComponentIdentifier());
- }
+ }
}
@@ -166,7 +163,7 @@
} catch (Exception e) {
LOG.error("Failed to obtain measurement [" + name //$NON-NLS-1$
+ "]. Cause: " + e); //$NON-NLS-1$
- // throw(e);
+ throw(e);
}
}
@@ -178,22 +175,5 @@
super.stop();
}
- @Override
- public void updateResourceConfiguration(ConfigurationUpdateReport report) {
- Properties props = System.getProperties();
-
- Iterator<PropertySimple> pluginPropIter = report.getConfiguration()
- .getSimpleProperties().values().iterator();
-
- while (pluginPropIter.hasNext()) {
- PropertySimple pluginProp = pluginPropIter.next();
- props.put(pluginProp.getName(), pluginProp.getStringValue());
- }
-
- // SingletonConnectionManager.getInstance().initialize(props);
- super.updateResourceConfiguration(report);
-
- }
-
}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java 2010-04-01 02:11:49 UTC (rev 2015)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java 2010-04-01 15:35:54 UTC (rev 2016)
@@ -21,14 +21,33 @@
*/
package org.teiid.rhq.plugin;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
+import javax.naming.NamingException;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.plugins.ManagedComponentImpl;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.GenericValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
@@ -40,7 +59,7 @@
/**
* This is the parent node for a Teiid system
*/
-public class PlatformDiscoveryComponent implements ResourceDiscoveryComponent {
+public class PlatformDiscoveryComponent implements ResourceDiscoveryComponent {
private final Log log = LogFactory.getLog(this.getClass());
@@ -58,14 +77,10 @@
Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
ManagedComponent mc = ProfileServiceUtil.getManagedComponent(
- new ComponentType("teiid",
- "dqp"),
+ new ComponentType("teiid", "dqp"),
PluginConstants.ComponentType.Platform.TEIID_RUNTIME_ENGINE);
- Configuration c = new Configuration();
- String managerName = mc.getName();
-
- c.put(new PropertySimple("objectName", managerName));
+ Configuration c = new Configuration();
/**
*
* A discovered resource must have a unique key, that must stay the same
@@ -73,18 +88,100 @@
*/
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
discoveryContext.getResourceType(), // ResourceType
- managerName, // Resource Key
- PluginConstants.ComponentType.Platform.TEIID_ENGINE_RESOURCE_NAME, // Resource Name
+ mc.getName(), // Resource Key
+ PluginConstants.ComponentType.Platform.TEIID_ENGINE_RESOURCE_NAME, // Resource
+ // Name
null, // Version TODO can we get that from discovery ?
PluginConstants.ComponentType.Platform.TEIID_ENGINE_RESOURCE_DESCRIPTION, // Description
- c, // Plugin Config
+ discoveryContext.getDefaultPluginConfiguration(), // Plugin
+ // Config
null // Process info from a process scan
);
+
+ Configuration configuration = detail.getPluginConfiguration();
+
+ getProperties(configuration);
// Add to return values
discoveredResources.add(detail);
- log.info("Discovered Teiid instance: " + managerName);
+ log.info("Discovered Teiid instance: " + mc.getName());
+ detail.setPluginConfiguration(configuration);
return discoveredResources;
}
+
+ /**
+ * @param mc
+ * @param configuration
+ * @throws Exception
+ */
+ private void getProperties(Configuration configuration) {
+
+ // Get all ManagedComponents of type Teiid and subtype dqp
+ Set<ManagedComponent> mcSet = null;
+ try {
+ mcSet = ProfileServiceUtil
+ .getManagedComponents(new org.jboss.managed.api.ComponentType(
+ PluginConstants.ComponentType.Platform.TEIID_TYPE,
+ PluginConstants.ComponentType.Platform.TEIID_SUB_TYPE));
+ } catch (NamingException e) {
+ log.error("NamingException getting components in PlatformDisocovery: " + e.getMessage());
+ } catch (Exception e) {
+ log.error("Exception getting components in PlatformDisocovery: " + e.getMessage());
+ }
+
+ for (ManagedComponent mc : mcSet) {
+ String componentName = (String) mc.getComponentName();
+ if (componentName
+ .equals("RuntimeEngineDeployer")) {
+ Map<String, ManagedProperty> mcMap = mc.getProperties();
+ PropertyMap teiidPropertyMap = new PropertyMap("teiidProperties");
+ configuration.put(teiidPropertyMap);
+ configuration.put(new PropertySimple(PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT,600));
+ setProperties(mcMap, teiidPropertyMap);
+ } else if (componentName
+ .equals("BufferService")) {
+ Map<String, ManagedProperty> mcMap = mc.getProperties();
+ PropertyMap bufferServicePropertyMap = new PropertyMap("bufferServiceProperties");
+ configuration.put(bufferServicePropertyMap);
+ setProperties(mcMap, bufferServicePropertyMap);
+ } else if (componentName
+ .equals("SessionService")) {
+ Map<String, ManagedProperty> mcMap = mc.getProperties();
+ PropertyMap sessionServicePropertyMap = new PropertyMap("sessionServiceProperties");
+ configuration.put(sessionServicePropertyMap);
+ setProperties(mcMap, sessionServicePropertyMap);
+ } else if (componentName
+ .equals("AuthorizationService")) {
+ Map<String, ManagedProperty> mcMap = mc.getProperties();
+ PropertyMap authorizationServicePropertyMap = new PropertyMap("authorizationServiceProperties");
+ configuration.put(authorizationServicePropertyMap);
+ setProperties(mcMap, authorizationServicePropertyMap);
+ } else if (componentName
+ .equals("JdbcSocketConfiguration")) {
+ Map<String, ManagedProperty> mcMap = mc.getProperties();
+ PropertyMap socketConfigurationPropertyMap = new PropertyMap("jdbcSocketConfigurationProperties");
+ configuration.put(socketConfigurationPropertyMap);
+ setProperties(mcMap, socketConfigurationPropertyMap);
+ }
+ }
+ }
+
+ /**
+ * @param mcMap
+ * @param propertyMap
+ */
+ private void setProperties(Map<String, ManagedProperty> mcMap,
+ PropertyMap propertyMap) {
+ for (ManagedProperty mProp : mcMap.values()) {
+ try {
+ String value = ProfileServiceUtil.stringValue(mProp.getValue());
+ PropertySimple prop = new PropertySimple(mProp.getName(), value);
+ propertyMap.put(prop);
+ } catch (Exception e) {
+ log.error("Exception setting properties in PlatformDiscovery: " + e.getMessage());
+ }
+ }
+ }
+
}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-04-01 02:11:49 UTC (rev 2015)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-04-01 15:35:54 UTC (rev 2016)
@@ -28,13 +28,16 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.teiid.rhq.admin.DQPManagementView;
import org.teiid.rhq.comm.ConnectionConstants;
import org.teiid.rhq.plugin.util.PluginConstants;
+import org.teiid.rhq.plugin.util.ProfileServiceUtil;
import org.teiid.rhq.plugin.util.PluginConstants.Operation;
import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.Platform;
import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.VDB;
@@ -47,6 +50,17 @@
public class VDBComponent extends Facet {
private final Log LOG = LogFactory.getLog(VDBComponent.class);
+
+
+ /* (non-Javadoc)
+ * @see org.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.ResourceContext)
+ */
+ @Override
+ public void start(ResourceContext context) {
+ this.setComponentName(context.getPluginConfiguration().getSimpleValue("name", null));
+ super.start(context);
+ }
+
/*
* (non-Javadoc)
*
@@ -54,7 +68,7 @@
*/
@Override
public String getComponentName() {
- return PluginConstants.ComponentType.VDB.NAME;
+ return this.name;
}
@Override
@@ -79,7 +93,21 @@
}
+ /* (non-Javadoc)
+ * @see org.teiid.rhq.plugin.Facet#getAvailability()
+ */
@Override
+ public AvailabilityType getAvailability() {
+ //TODO Remove vdb version after no longer viable in Teiid
+ String status = DQPManagementView.getVDBStatus(this.getComponentName(), 1);
+ if (status.equals("ACTIVE")){
+ return AvailabilityType.UP;
+ }
+
+ return AvailabilityType.DOWN;
+ }
+
+ @Override
protected void setMetricArguments(String name,
Configuration configuration, Map<String, Object> valueMap) {
// Parameter logic for VDB Metrics
@@ -148,7 +176,7 @@
@Override
String getComponentType() {
return PluginConstants.ComponentType.VDB.NAME;
- }
+ }
}
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-04-01 02:11:49 UTC (rev 2015)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-04-01 15:35:54 UTC (rev 2016)
@@ -18,6 +18,231 @@
02110-1301 USA. */
-->
+<!DOCTYPE plugin [
+<!ENTITY datasourceAndConnectionFactoryAdvancedResourceConfigProps '
+ <c:simple-property name="allocation-retry" type="integer" required="false"
+ defaultValue="0">
+ <c:description>
+ The number of times that allocating a connection should be tried before throwing an exception. The default
+ is 0.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="allocation-retry-wait-millis" type="long" required="false" units="milliseconds"
+ defaultValue="5000">
+ <c:description>
+ The time in milliseconds to wait between retrying to allocate a connection. The default is 5000 (5 seconds).
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="background-validation" type="boolean" required="false" defaultValue="false">
+ <c:description>
+ Specify if connections should be validated on a background thread versus being validated
+ prior to use. Background validation is meant to reduce the overall load on the RDBMS system when validating
+ a connection. The default is No.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="background-validation-millis" type="long" required="false" units="milliseconds"
+ defaultValue="0">
+ <c:description>
+ The interval, in milliseconds, at which the ConnectionValidator will run. Set to 0 to disable background
+ validation. The default is 0.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="blocking-timeout-millis" displayName="Blocking Timeout in Milliseconds"
+ units="milliseconds" defaultValue="30000"
+ type="integer" required="false">
+ <c:description>
+ Indicates the maximum time in milliseconds to block while waiting for a connection before throwing
+ an exception. Note that this blocks only while waiting for a permit for a connection, and will never
+ throw an exception if creating a new connection takes an inordinately long time. The default is 30000
+ (30 seconds).
+ </c:description>
+ <c:constraint>
+ <c:integer-constraint minimum="0"/>
+ </c:constraint>
+ </c:simple-property>
+
+ <c:simple-property name="idle-timeout-minutes" type="integer" activationPolicy="immediate"
+ displayName="Idle Timeout" units="minutes" required="false" defaultValue="30">
+ <c:description>
+ The maximum time, in minutes, a connection may be idle before being closed. The default is 30.
+ </c:description>
+ <c:constraint>
+ <c:integer-constraint minimum="0"/>
+ </c:constraint>
+ </c:simple-property>
+
+ <c:simple-property name="isSameRM-override-value" type="boolean" required="false">
+ <c:description>
+ If set, unconditionally sets the boolean return value of javax.transaction.xa.XAResource.isSameRM(XAResource).
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="jmx-invoker-name" required="false">
+ <c:description>
+ The ObjectName of the JMX Invoker MBean associated with this datasource.
+ </c:description>
+ </c:simple-property>
+
+ <c:map-property name="metadata" required="false" description="Metadata properties.">
+ <c:simple-property required="false" name="typeMapping">
+ <c:description>
+ The name of the corresponding type-mapping in conf/standardjbosscmp-jdbc.xml.
+ </c:description>
+ <c:property-options>
+ <c:option name="Cloudscape" value="Cloudscape"/>
+ <c:option name="DB2" value="DB2"/>
+ <c:option name="DB2/400" value="DB2/400"/>
+ <c:option name="Derby" value="Derby"/>
+ <c:option name="Firebird" value="Firebird"/>
+ <c:option name="FirstSQL/J" value="FirstSQL/J"/>
+ <c:option name="Hypersonic SQL" value="Hypersonic SQL"/>
+ <c:option name="InformixDB" value="InformixDB"/>
+ <c:option name="Ingres" value="Ingres"/>
+ <c:option name="InterBase" value="InterBase"/>
+ <c:option name="MaxDB" value="MaxDB"/>
+ <c:option name="McKoi" value="McKoi"/>
+ <c:option name="Mimer SQL" value="Mimer SQL"/>
+ <c:option name="MS SQLSERVER" value="MS SQLSERVER"/>
+ <c:option name="MS SQLSERVER2000" value="MS SQLSERVER2000"/>
+ <c:option name="Oracle7" value="Oracle7"/>
+ <c:option name="Oracle8" value="Oracle8"/>
+ <c:option name="Oracle9i" value="Oracle9i"/>
+ <c:option name="PointBase" value="PointBase"/>
+ <c:option name="PostgreSQL" value="PostgreSQL"/>
+ <c:option name="PostgreSQL 7.2" value="PostgreSQL 7.2"/>
+ <c:option name="PostgreSQL 8.0" value="PostgreSQL 8.0"/>
+ <c:option name="SapDB" value="SapDB"/>
+ <c:option name="SOLID" value="SOLID"/>
+ <c:option name="Sybase" value="Sybase"/>
+ </c:property-options>
+ </c:simple-property>
+ </c:map-property>
+
+ <c:simple-property name="no-tx-separate-pools" type="boolean"
+ displayName="No Tx Separate Pools" required="false">
+ <c:description>Whether or not to use separate pools. The default is Yes.</c:description>
+ <c:property-options>
+ <c:option name="True" value="true"/>
+ <c:option name="False" value="false"/>
+ </c:property-options>
+ </c:simple-property>
+
+ <c:simple-property name="prefill" type="boolean" required="false">
+ <c:description>
+ Whether to attempt to prefill the connection pool to the minimum number of connections. NOTE: Only
+ supporting pools (OnePool) support this feature. A warning can be found in the logs if the pool does not
+ support this. The default is No.
+ </c:description>
+ </c:simple-property>
+
+ <c:map-property name="security-domain" displayName="Security Settings" required="false">
+ <c:description>
+ Security settings for connections in the pool.
+ </c:description>
+
+ <c:simple-property name="securityDeploymentType" type="string"
+ required="false" defaultValue="NONE">
+ <c:description>
+ Indicates whether Subject (from security domain), application-supplied parameters
+ (such as from getConnection(user, pw)), both Subject and app-supplied parameters,
+ or neither Subject nor app-supplied parameters are used to distinguish connections
+ in the pool. The default is "NONE".
+ </c:description>
+ <c:property-options>
+ <c:option name="None" value="NONE"/>
+ <c:option name="Application" value="APPLICATION"/>
+ <c:option name="Domain" value="DOMAIN"/>
+ <c:option name="Domain and Application" value="DOMAIN_AND_APPLICATION"/>
+ </c:property-options>
+ </c:simple-property>
+
+ <c:simple-property name="domain" type="string"
+ required="false">
+ <c:description>
+ The name of the JAAS security manager that will handle authentication (only required if security
+ deployment type is DOMAIN or DOMAIN_AND_APPLICATION). This name correlates to the JAAS login-config.xml
+ descriptor application-policy/name attribute.
+ </c:description>
+ </c:simple-property>
+ </c:map-property>
+
+ <c:simple-property name="statistics-formatter" required="false">
+ <c:description>
+ The fully qualified class name of the class to use for formatting managed connection pool statistics for
+ this datasource. The class must implement the org.jboss.resource.statistic.formatter.StatisticsFormatter.
+ interface. The default is "org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter".
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="type-mapping" displayName="Type Mapping" required="false">
+ <c:description>
+ The name of the corresponding type-mapping in conf/standardjbosscmp-jdbc.xml.
+ </c:description>
+ <c:property-options>
+ <c:option name="Cloudscape" value="Cloudscape"/>
+ <c:option name="DB2" value="DB2"/>
+ <c:option name="DB2/400" value="DB2/400"/>
+ <c:option name="Derby" value="Derby"/>
+ <c:option name="Firebird" value="Firebird"/>
+ <c:option name="FirstSQL/J" value="FirstSQL/J"/>
+ <c:option name="Hypersonic SQL" value="Hypersonic SQL"/>
+ <c:option name="InformixDB" value="InformixDB"/>
+ <c:option name="Ingres" value="Ingres"/>
+ <c:option name="InterBase" value="InterBase"/>
+ <c:option name="MaxDB" value="MaxDB"/>
+ <c:option name="McKoi" value="McKoi"/>
+ <c:option name="Mimer SQL" value="Mimer SQL"/>
+ <c:option name="MS SQLSERVER" value="MS SQLSERVER"/>
+ <c:option name="MS SQLSERVER2000" value="MS SQLSERVER2000"/>
+ <c:option name="Oracle7" value="Oracle7"/>
+ <c:option name="Oracle8" value="Oracle8"/>
+ <c:option name="Oracle9i" value="Oracle9i"/>
+ <c:option name="PointBase" value="PointBase"/>
+ <c:option name="PostgreSQL" value="PostgreSQL"/>
+ <c:option name="PostgreSQL 7.2" value="PostgreSQL 7.2"/>
+ <c:option name="PostgreSQL 8.0" value="PostgreSQL 8.0"/>
+ <c:option name="SapDB" value="SapDB"/>
+ <c:option name="SOLID" value="SOLID"/>
+ <c:option name="Sybase" value="Sybase"/>
+ </c:property-options>
+ </c:simple-property>
+
+ <c:simple-property name="use-java-context"
+ displayName="Use Java Context"
+ type="boolean" defaultValue="true"
+ required="false">
+ <c:description>
+ Indicates whether the JNDI name should be bound under the "java" context,
+ which causes the DataSource to only be accessible from within the JBossAS VM.
+ The default is Yes.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="use-strict-min" type="boolean" required="false">
+ <c:description>
+ Whether idle connections below the min-pool-size should be closed. The default is No.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="validate-on-match" type="boolean" required="false" defaultValue="true">
+ <c:description>
+ The validate-on-match element indicates whether or not connection level validation should be done when a
+ connection factory attempts to match a managed connection for a given set. This is typically exclusive to
+ the use of background validation. The default is Yes.
+ </c:description>
+ </c:simple-property>
+'>
+
+]>
+
+<!--############################################# END OF XML ENTITIES ###############################################-->
+
+
+
<plugin name="TeiidPlugin" displayName="Teiid Plugin" package="org.teiid.rhq.plugin"
version="2.0.0" description="Supports management and monitoring of JBoss Teiid"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin"
@@ -28,7 +253,7 @@
<server name="Data Services" description="JBoss Enterprise Data Services"
class="PlatformComponent" discovery="PlatformDiscoveryComponent"
- singleton="true">
+ singleton="true" >
<runs-inside>
<parent-resource-type name="JBossAS Server"
@@ -179,6 +404,133 @@
</c:constraint>
</c:simple-property>
</c:group>
+ <c:group name="teiidProperties" displayName="Teiid Properties"
+ hiddenByDefault="false">
+ <c:map-property name="teiidProperties" displayName="Runtime Engine Properties"
+ description="Properties for use by the Teiid engine">
+ <c:simple-property name="state" displayName="State"
+ description="State of this Teiid instance" required="false"
+ readOnly="true" />
+ <c:simple-property name="resultSetCacheMaxEntries"
+ displayName="Result Set Cache Max Entries" description="The maximum number of result set cache entries. 0 indicates no limit. (default 1024)"
+ required="false" readOnly="true" />
+ <c:simple-property name="maxRowsFetchSize"
+ displayName="Max Rows Fetch Size"
+ description="The maximum number of result set cache entries. 0 indicates no limit. (default 1024)"
+ required="false" readOnly="true" />
+ <c:simple-property name="codeTablesMaxRows"
+ displayName="Code Tables Max Rows"
+ description="Maximum number of records in all lookup tables (default 200000)"
+ required="false" readOnly="true" />
+ <c:simple-property name="processName"
+ displayName="Process Name" description="Name that uniquely identifies this process"
+ required="false" readOnly="true" />
+ <c:simple-property name="preparedPlanCacheMaxCount"
+ displayName="Prepared Plan Cache Max Count"
+ description="The maximum number of query plans that are cached. Note: this is a memory based cache. (default 250)"
+ required="false" readOnly="true" />
+ <c:simple-property name="maxThreads" displayName="Max Threads"
+ description="Process pool maximum thread count. (default 16) Increase this value if your load includes a large number of XQueries or if the system's available processors is larger than 8"
+ required="false" readOnly="true" />
+ <c:simple-property name="timeSliceInMilli"
+ displayName="Time Slice In Milli"
+ description="Query processor time slice, in milliseconds. (default 2000)"
+ required="false" readOnly="true" />
+ <c:simple-property name="processDebugAllowed"
+ displayName="Process Debug Allowed" description="True if process debug allowed"
+ required="false" readOnly="true" />
+ <c:simple-property name="lobChunkSizeInKB"
+ displayName="Lob Chunk Size In KB"
+ description="The max lob chunk size in KB transferred each time when processing blobs, clobs(100KB default)"
+ required="false" readOnly="true" />
+ <c:simple-property name="codeTablesMaxCount"
+ displayName="Code Tables Max Count"
+ description="The max lob chunk size in KB transferred each time when processing blobs, clobs(100KB default)"
+ required="false" readOnly="true" />
+ <c:simple-property name="resultSetCacheEnabled"
+ displayName="Result Set Cache Enabled"
+ description="Denotes whether or not result set caching is enabled. (default true)"
+ required="false" readOnly="true" type="boolean"/>
+ <c:simple-property name="codeTablesMaxRowsPerTable"
+ displayName="Code Tables Max Rows PerTable"
+ description="Maximum number of records in all lookup tables (default 200000)"
+ required="false" readOnly="true" />
+ <c:simple-property name="activeSessionsCount"
+ displayName="Active Session Count" description="Count of active sessions"
+ required="false" readOnly="true" />
+ </c:map-property>
+ <c:map-property name="bufferServiceProperties" displayName="Buffer Service Properties"
+ description="Properties for use by the Buffer Service">
+ <c:simple-property name="state" displayName="State"
+ description="State of this bean instance" required="false"
+ readOnly="true" />
+ <c:simple-property name="processorBatchSize"
+ displayName="Processor Batch Size" description="The max row count of a batch sent internally within the query processor. Should be <= the connectorBatchSize. (default 256)"
+ required="false" readOnly="true" />
+ <c:simple-property name="connectorBatchSize"
+ displayName="Connector Batch Size"
+ description="The max row count of a batch from a connector. Should be even multiple of processorBatchSize. (default 512)"
+ required="false" readOnly="true" />
+ <c:simple-property name="maxProcessingBatchesColumns"
+ displayName="Max Processing Batches Columns"
+ description="The number of batch columns guarenteed to a processing operation. Set this value lower if the workload typically processes larger numbers of concurrent queries with large intermediate results from operations such as sorting, grouping, etc. (default 128)"
+ required="false" readOnly="true" />
+ <c:simple-property name="maxFileSize"
+ displayName="Max File Size" description="Max file size for buffer files (default 2GB)"
+ required="false" readOnly="true" />
+ <c:simple-property name="maxReserveBatchColumns"
+ displayName="Max Reserve Batch Columns"
+ description="The number of batch columns to allow in memory (default 16384). This value should be set lower or higher depending on the available memory to Teiid in the VM. 16384 is considered a good default for a dedicated 32-bit VM running Teiid with a 1 gig heap."
+ required="false" readOnly="true" />
+ </c:map-property>
+ <c:map-property name="authorizationServiceProperties" displayName="Authorization Service Properties"
+ description="Properties for use by the Authorization Service">
+ <c:simple-property name="state" displayName="State"
+ description="State of this bean instance" required="false"
+ readOnly="true" />
+ </c:map-property>
+ <c:map-property name="jdbcSocketConfigurationProperties" displayName="Jdbc Socket Configuration Properties"
+ description="Properties for use by the Jdbc Socket Configuration">
+ <c:simple-property name="state" displayName="State"
+ description="State of this bean instance" required="false"
+ readOnly="true" />
+ <c:simple-property name="portNumber"
+ displayName="Port Number" description="Port Number"
+ required="false" readOnly="true" />
+ <c:simple-property name="enabled"
+ displayName=" SSL Enabled"
+ description="SSL enabled"
+ required="false" readOnly="true" type="boolean" default="true" />
+ <c:simple-property name="hostName"
+ displayName="Host Name"
+ description="Host Name"
+ required="false" readOnly="true" />
+ <c:simple-property name="maxSocketThreads"
+ displayName="Max Socket Threads" description="Max NIO threads"
+ required="false" readOnly="true" />
+ <c:simple-property name="inputBufferSize"
+ displayName="Input Buffer Size"
+ description="SO_RCVBUF size, 0 indicates that system default should be used (default 0)"
+ required="false" readOnly="true" />
+ <c:simple-property name="outputBufferSize"
+ displayName="Output Buffer Size"
+ description="SO_SNDBUF size, 0 indicates that system default should be used (default 0)"
+ required="false" readOnly="true" />
+ </c:map-property>
+ <c:map-property name="sessionServiceProperties" displayName="Session Service Properties"
+ description="Properties for use by the Session Service">
+ <c:simple-property name="state" displayName="State"
+ description="State of this bean instance" required="false"
+ readOnly="true" />
+ <c:simple-property name="sessionExpirationTimeLimit"
+ displayName="Session Expiration Time Limit" description="Max allowed time before the session is terminated by the system, 0 indicates unlimited (default 0)"
+ required="false" readOnly="true" />
+ <c:simple-property name="sessionMaxLimit"
+ displayName="Session Max Limit"
+ description="Maximum number of sessions allowed by the system (default 5000)"
+ required="false" readOnly="true" />
+ </c:map-property>
+ </c:group>
</resource-configuration>
<service name="Virtual Database (VDB)s"
@@ -251,64 +603,62 @@
</results>
</operation>
- <metric displayName="Status" defaultOn="true" dataType="trait" displayType="summary"
- category="availability" property="status"
- description="The status of this VDB" />
-
+ <metric displayName="Status" defaultOn="true" dataType="trait"
+ displayType="summary" category="availability" property="status"
+ description="The status of this VDB" />
+
+ <metric displayName="Error" defaultOn="true" dataType="trait"
+ displayType="summary" category="availability" property="errormessages"
+ description="The status of this VDB" />
+
<content name="vdb" displayName="VDB Archive" category="deployable"
isCreationType="true">
</content>
-
+
<resource-configuration>
<c:group name="general" displayName="General"
hiddenByDefault="false">
<c:simple-property name="name" type="string"
- description="The Virtual Database Name" required="false"/>
+ description="The Virtual Database Name" required="false" />
<c:simple-property name="version" type="string"
- description="The Virtual Database Version" required="false"/>
+ description="The Virtual Database Version" required="false" />
<c:simple-property name="description" type="string"
- description="The Virtual Database Description" required="false"/>
+ description="The Virtual Database Description" required="false" />
<c:simple-property name="status" type="string"
- description="The Virtual Database Status" required="false" summary="true">
+ description="The Virtual Database Status" required="false"
+ summary="true">
<c:property-options>
- <c:option value="ACTIVE" name="ACTIVE" />
- <c:option value="INACTIVE" name="INACTIVE" default="true"/>
- </c:property-options>
- </c:simple-property>
+ <c:option value="ACTIVE" name="ACTIVE" />
+ <c:option value="INACTIVE" name="INACTIVE" default="true" />
+ </c:property-options>
+ </c:simple-property>
<c:simple-property name="url" type="string"
- description="The Virtual Database URL" required="false"/>
+ description="The Virtual Database URL" required="false" />
</c:group>
- <c:group name="Models" displayName="Models"
- hiddenByDefault="false">
- <c:list-property name="sourceModels" description="The source models for this VDB">
+ <c:group name="Models" displayName="Models" hiddenByDefault="false">
+ <c:list-property name="sourceModels" readOnly="true"
+ description="The source models for this VDB">
<c:map-property name="model">
<c:simple-property name="name" displayName="Name"
- description="Name of the model" required="true" readOnly="true"/>
- <c:simple-property name="sourceName" displayName="Source Name"
- description="Source name for this model" required="false" readOnly="true"/>
- <c:simple-property name="jndiName" displayName="Connector Binding JNDI Name"
- description="JNDI name for this connector binding" required="false"/>
+ description="Name of the model" required="true" readOnly="true" />
+ <c:simple-property name="sourceName"
+ displayName="Source Name" description="Source name for this model"
+ required="false" readOnly="true" />
+ <c:simple-property name="jndiName"
+ displayName="Connector Binding JNDI Name" description="JNDI name for this connector binding"
+ required="false" />
<c:simple-property name="visibility"
- displayName="Visible" description="Visibility of the model"
+ displayName="Visible" description="Visibility of the model"
required="true">
- <c:property-options>
- <c:option value="true" name="true" />
- <c:option value="false" name="false"
- default="true" />
- </c:property-options>
</c:simple-property>
<c:simple-property name="supportsMultiSource"
- displayName="Supports Multi-source?" description="Determines if this model supports multi-source bindings"
- required="true">
- <c:property-options>
- <c:option value="true" name="true" />
- <c:option value="false" name="false"
- default="true" />
- </c:property-options>
- </c:simple-property>
+ displayName="Supports Multi-source?"
+ description="Determines if this model supports multi-source bindings"
+ required="true" default="true" />
</c:map-property>
</c:list-property>
- <c:list-property name="logicalModels" description="The logical models for this VDB">
+ <c:list-property name="logicalModels" readOnly="true"
+ description="The logical models for this VDB">
<c:map-property name="model">
<c:simple-property name="name" displayName="Name"
description="Name of the model" required="true" />
@@ -316,40 +666,22 @@
description="type of logical model" required="true" />
<c:simple-property name="visibility"
displayName="Visible" description="Visbility of the model"
- required="true">
- <c:property-options>
- <c:option value="true" name="true" />
- <c:option value="false" name="false"
- default="true" />
- </c:property-options>
- </c:simple-property>
+ required="true" default="true" />
</c:map-property>
</c:list-property>
</c:group>
- <c:group name="errors" displayName="Errors"
- hiddenByDefault="false" >
- <c:list-property name="errorList" description="VDB Errors" summary="true">
+ <c:group name="errors" displayName="Errors" hiddenByDefault="false">
+ <c:list-property name="errorList" description="VDB Errors"
+ summary="true" readOnly="true">
<c:map-property name="errorMap" summary="true">
<c:simple-property name="severity" displayName="Severity"
- description="Severity" readOnly="true" summary="true"/>
+ description="Severity" readOnly="true" summary="true" />
<c:simple-property name="message" displayName="Message"
- description="Error message" readOnly="true" summary="true"/>
+ description="Error message" readOnly="true" summary="true" />
</c:map-property>
</c:list-property>
</c:group>
</resource-configuration>
-
-
- <!--
- <operation name="getProperties" displayName="View VDB properties"
- description="List the properties of this VDB"> <results>
- <c:list-property name="list"> <c:map-property name="map">
- <c:simple-property name="Name" type="string" description="The name
- of this property" /> <c:simple-property name="Value" type="string"
- description="The value of this property" /> </c:map-property>
- </c:list-property> </results> </operation>
- -->
-
</service>
14 years, 9 months
teiid SVN: r2015 - trunk/engine/src/main/java/com/metamatrix/query/analysis.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-03-31 22:11:49 -0400 (Wed, 31 Mar 2010)
New Revision: 2015
Modified:
trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
Log:
TEIID-1026 logging annotation information if we're at the detail level
Modified: trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-03-31 22:15:05 UTC (rev 2014)
+++ trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-04-01 02:11:49 UTC (rev 2015)
@@ -61,7 +61,7 @@
this.logDebug = recordDebug;
this.recordDebug = recordDebug | LogManager.isMessageToBeRecorded(LogConstants.CTX_QUERY_PLANNER, MessageLevel.TRACE);
- if(recordQueryPlan) {
+ if(this.recordQueryPlan) {
this.annotations = new ArrayList<QueryAnnotation>();
}
14 years, 9 months