teiid SVN: r2171 - in trunk/console/src/main: java/org/teiid/rhq/plugin and 2 other directories.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-05-28 16:54:29 -0400 (Fri, 28 May 2010)
New Revision: 2171
Modified:
trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
TEIID-1099: Changed Long Running Query Limit to use Engine property and change operation calls to use new Engine operation to return all long running query requests.
Modified: trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java 2010-05-28 18:35:50 UTC (rev 2170)
+++ trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java 2010-05-28 20:54:29 UTC (rev 2171)
@@ -2,7 +2,6 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.Calendar;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
@@ -74,9 +73,8 @@
} else {
if (metric
.equals(PluginConstants.ComponentType.Platform.Metrics.LONG_RUNNING_QUERIES)) {
- Integer longRunningQueryLimit = (Integer) valueMap
- .get(PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT);
- Collection<Request> longRunningQueries = getLongRunningQueries(longRunningQueryLimit);
+ Collection<Request> longRunningQueries = new ArrayList<Request>();
+ getRequestCollectionValue(getLongRunningQueries(), longRunningQueries);
resultObject = new Double(longRunningQueries.size());
}
}
@@ -104,9 +102,8 @@
resultObject = new Double(getSessionCount().doubleValue());
} else if (metric
.equals(PluginConstants.ComponentType.VDB.Metrics.LONG_RUNNING_QUERIES)) {
- Integer longRunningQueryLimit = (Integer) valueMap
- .get(PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT);
- Collection<Request> longRunningQueries = getLongRunningQueries(longRunningQueryLimit);
+ Collection<Request> longRunningQueries = new ArrayList<Request>();
+ getRequestCollectionValue(getLongRunningQueries(), longRunningQueries);
resultObject = new Double(longRunningQueries.size());
}
@@ -141,10 +138,8 @@
if (operationName.equals(Platform.Operations.GET_LONGRUNNINGQUERIES)) {
- Integer longRunningValue = (Integer) valueMap
- .get(Operation.Value.LONG_RUNNING_QUERY_LIMIT);
List<String> fieldNameList = operationResult.getFieldNameList();
- resultObject = getLongRunningQueries(longRunningValue);
+ getRequestCollectionValue(getLongRunningQueries(), resultObject);
operationResult.setContent(createReportResultList(fieldNameList,
resultObject.iterator()));
} else if (operationName.equals(Platform.Operations.GET_SESSIONS)) {
@@ -441,8 +436,6 @@
ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
.getValue();
- String modelName = managedObject.getName();
-
// Get any model errors/warnings
MetaValue errors = managedObject.getProperty("errors").getValue();
if (errors != null) {
@@ -454,31 +447,20 @@
return count;
}
- protected Collection<Request> getLongRunningQueries(int longRunningValue) {
+ protected MetaValue getLongRunningQueries() {
MetaValue requestsCollection = null;
- Collection<Request> list = new ArrayList<Request>();
+ MetaValue args = null;
- double longRunningQueryTimeDouble = new Double(longRunningValue);
-
- requestsCollection = getRequests();
-
- getRequestCollectionValue(requestsCollection, list);
-
- Iterator<Request> requestsIter = list.iterator();
- while (requestsIter.hasNext()) {
- Request request = requestsIter.next();
- long startTime = request.getStartTime();
- // Get msec from each, and subtract.
- long runningTime = Calendar.getInstance().getTimeInMillis()
- - startTime;
-
- if (runningTime < longRunningQueryTimeDouble) {
- requestsIter.remove();
- }
+ try {
+ requestsCollection = executeManagedOperation(mc,
+ Platform.Operations.GET_LONGRUNNINGQUERIES, args);
+ } catch (Exception e) {
+ final String msg = "Exception executing operation: " + Platform.Operations.GET_LONGRUNNINGQUERIES; //$NON-NLS-1$
+ LOG.error(msg, e);
}
- return list;
+ return requestsCollection;
}
public static <T> void getRequestCollectionValue(MetaValue pValue,
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-05-28 18:35:50 UTC (rev 2170)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-05-28 20:54:29 UTC (rev 2171)
@@ -109,13 +109,7 @@
protected void setOperationArguments(String name,
Configuration configuration, Map<String, Object> valueMap) {
// Parameter logic for System Operations
- if (name.equals(Platform.Operations.GET_QUERIES)
- || name.equals(Platform.Operations.GET_LONGRUNNINGQUERIES)) {
- Integer long_running_value = getResourceConfiguration().getSimple(
- Operation.Value.LONG_RUNNING_QUERY_LIMIT).getIntegerValue();
- valueMap.put(Operation.Value.LONG_RUNNING_QUERY_LIMIT,
- long_running_value);
- } else if (name.equals(Platform.Operations.KILL_REQUEST)) {
+ if (name.equals(Platform.Operations.KILL_REQUEST)) {
valueMap.put(Operation.Value.REQUEST_ID, configuration.getSimple(
Operation.Value.REQUEST_ID).getLongValue());
valueMap.put(Operation.Value.SESSION_ID, configuration.getSimple(
@@ -144,22 +138,8 @@
LOG.debug("Measurement name = " + name); //$NON-NLS-1$
// Initialize any parameters to be used in the retrieval of
- // metric
- // values
- if (request
- .getName()
- .equals(
- PluginConstants.ComponentType.Platform.Metrics.LONG_RUNNING_QUERIES)) {
- Integer value = getResourceConfiguration()
- .getSimple(
- PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT)
- .getIntegerValue();
- valueMap
- .put(
- PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT,
- value);
- }
-
+ // metric values
+
Object metricReturnObject = view.getMetric(getComponentType(),
this.getComponentIdentifier(), name, valueMap);
@@ -272,21 +252,6 @@
@Override
public Configuration loadResourceConfiguration() {
- // ManagedComponent platform = null;
- // try {
- // platform = ProfileServiceUtil.getManagedComponent(
- // new
- // org.jboss.managed.api.ComponentType(PluginConstants.ComponentType.Platform.TYPE,
- // PluginConstants.ComponentType.Platform.SUBTYPE),
- // PluginConstants.ComponentType.Platform.TEIID_RUNTIME_ENGINE);
- // } catch (NamingException e) {
- // final String msg = "NamingException in loadResourceConfiguration(): " + e.getExplanation(); //$NON-NLS-1$
- // LOG.error(msg, e);
- // } catch (Exception e) {
- // final String msg = "Exception in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
- // LOG.error(msg, e);
- // }
- //
// Get plugin config
Configuration c = resourceContext.getPluginConfiguration();
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-05-28 18:35:50 UTC (rev 2170)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-05-28 20:54:29 UTC (rev 2171)
@@ -70,7 +70,7 @@
public static interface Operations {
public final static String GET_QUERIES = "listQueries"; //$NON-NLS-1$
- public final static String GET_LONGRUNNINGQUERIES = "listLongRunningQueries"; //$NON-NLS-1$
+ public final static String GET_LONGRUNNINGQUERIES = "getLongRunningRequests"; //$NON-NLS-1$
public final static String KILL_REQUEST = "cancelRequest"; //$NON-NLS-1$
public final static String KILL_SESSION = "terminateSession"; //$NON-NLS-1$
public final static String KILL_TRANSACTION = "terminateTransaction"; //$NON-NLS-1$
@@ -100,7 +100,7 @@
public static interface Operations {
public final static String GET_QUERIES = "listQueries"; //$NON-NLS-1$
- public final static String GET_LONGRUNNINGQUERIES = "listLongRunningQueries"; //$NON-NLS-1$
+ public final static String GET_LONGRUNNINGQUERIES = "getLongRunningRequests"; //$NON-NLS-1$
public final static String KILL_REQUEST = "cancelRequest"; //$NON-NLS-1$
public final static String KILL_SESSION = "terminateSession"; //$NON-NLS-1$
public final static String GET_PROPERTIES = "getProperties"; //$NON-NLS-1$
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-28 18:35:50 UTC (rev 2170)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-28 20:54:29 UTC (rev 2171)
@@ -89,7 +89,7 @@
plugin="JBossAS5" />
</runs-inside>
- <operation name="listLongRunningQueries" displayName="View current long running queries"
+ <operation name="getLongRunningRequests" displayName="View current long running queries"
description="List current queries executing against the Teiid System that have surpassed the long running query threshhold">
<results>
<c:list-property name="list">
@@ -254,18 +254,6 @@
description="The number of user connections for a given point in time" />
<resource-configuration>
- <c:group name="general" displayName="General"
- hiddenByDefault="false">
- <c:description>Query Configuration</c:description>
- <c:simple-property name="longRunningQueryLimit"
- type="integer" activationPolicy="immediate" units="seconds"
- default="600" required="true" displayName="Long Running Query limit"
- description="The value (in seconds) to use to determine if a query is to be considered 'long running'.">
- <c:constraint>
- <c:integer-constraint minimum="0" maximum="999999" />
- </c:constraint>
- </c:simple-property>
- </c:group>
<c:group name="teiidProperties" displayName="Runtime Engine Properties"
hiddenByDefault="false">
<c:simple-property name="resultSetCacheMaxEntries"
@@ -316,6 +304,9 @@
<c:simple-property name="activeSessionsCount"
displayName="Active Session Count" description="Count of active sessions"
required="false" readOnly="false" />
+ <c:simple-property name="queryThresholdInSecs"
+ displayName="Long Running Query Threshold" description="Length of time in seconds before a query is considered long running"
+ required="false" readOnly="false" />
</c:group>
<c:group name="bufferServiceProperties" displayName="Buffer Service Properties"
hiddenByDefault="false">
14 years, 7 months
teiid SVN: r2170 - in trunk/console/src/main: resources/META-INF and 1 other directory.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-05-28 14:35:50 -0400 (Fri, 28 May 2010)
New Revision: 2170
Modified:
trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
Updated Translator logic to reflect changes in Teiid and remove create logic since this is no longer allowed via the plugin
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-05-28 14:18:02 UTC (rev 2169)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-05-28 18:35:50 UTC (rev 2170)
@@ -319,11 +319,6 @@
componentType = new ComponentType(
PluginConstants.ComponentType.VDB.TYPE,
PluginConstants.ComponentType.VDB.SUBTYPE);
- } else if (this.getComponentType()
- .equals(PluginConstants.ComponentType.Translator.NAME)) {
- componentType = new ComponentType(
- PluginConstants.ComponentType.Translator.TYPE,
- PluginConstants.ComponentType.Translator.SUBTYPE);
} else {
report.setStatus(ConfigurationUpdateStatus.FAILURE);
report.setErrorMessage("Update not implemented for the component type.");
@@ -496,11 +491,11 @@
@Override
public CreateResourceReport createResource(CreateResourceReport report) {
ResourceType resourceType = report.getResourceType();
- if (resourceType.getName().equals("Translators")) {
- createConfigurationBasedResource(report);
- } else {
+// if (resourceType.getName().equals("Translators")) {
+// createConfigurationBasedResource(report);
+// } else {
createContentBasedResource(report);
- }
+// }
return report;
}
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-05-28 14:18:02 UTC (rev 2169)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-05-28 18:35:50 UTC (rev 2170)
@@ -28,26 +28,19 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.managed.api.ComponentType;
-import org.jboss.managed.api.DeploymentTemplateInfo;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedProperty;
import org.jboss.metatype.api.types.MetaType;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.rhq.core.domain.configuration.Configuration;
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.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.resource.CreateResourceStatus;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.pluginapi.inventory.CreateResourceReport;
import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.teiid.rhq.comm.ConnectionConstants;
@@ -165,28 +158,12 @@
// First get translator specific properties
ManagedProperty translatorProps = translator
- .getProperty("translator-property");
+ .getProperty("property");
getTranslatorValues(translatorProps.getValue(), propMap, list);
// Now get common properties
c.put(new PropertySimple("name", translatorName));
- c.put(new PropertySimple("execution-factory-class",
- ProfileServiceUtil.getSimpleValue(translator,
- "execution-factory-class", String.class)));
- c.put(new PropertySimple("immutable", ProfileServiceUtil
- .getSimpleValue(translator, "immutable", Boolean.class)));
- c.put(new PropertySimple("xa-capable", ProfileServiceUtil
- .getSimpleValue(translator, "xa-capable", Boolean.class)));
- c.put(new PropertySimple("exception-on-max-rows",
- ProfileServiceUtil.getSimpleValue(translator,
- "exception-on-max-rows", Boolean.class)));
- c.put(new PropertySimple("max-result-rows", ProfileServiceUtil
- .getSimpleValue(translator, "max-result-rows",
- Integer.class)));
- c.put(new PropertySimple("template-name", ProfileServiceUtil
- .getSimpleValue(translator, "template-name",
- String.class)));
-
+
return c;
}
@@ -200,7 +177,7 @@
.getInstance().unwrap(pValue);
for (String key : unwrappedvalue.keySet()) {
- map = new PropertyMap("translator-properties");
+ map = new PropertyMap("property");
map.put(new PropertySimple("name", key));
map.put(new PropertySimple("value", unwrappedvalue.get(key)));
map.put(new PropertySimple("description", "Custom property"));
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-28 14:18:02 UTC (rev 2169)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-28 18:35:50 UTC (rev 2170)
@@ -487,7 +487,7 @@
required="false" readOnly="true" />
<c:simple-property name="translatorName"
displayName="Translator Name" description="Name of the translator"
- required="true" />
+ required="false" readOnly="true"/>
<c:simple-property name="jndiName" displayName="Connection JNDI Name"
description="JNDI name for this connection" required="false" />
<c:simple-property name="visibility"
@@ -548,76 +548,16 @@
class="TranslatorComponent" discovery="TranslatorDiscoveryComponent"
createDeletePolicy="both" creationDataType="configuration">
- <plugin-configuration>
- <c:simple-property name="componentType" default="teiid" readOnly="true" />
- <c:simple-property name="componentSubtype" default="translator" readOnly="true" />
- <c:simple-property name="componentName" default="teiid" readOnly="true" />
- <c:simple-property name="template-name" default="translator" readOnly="true" />
- <c:simple-property name="resourceName" default="name">
- <c:description>The name of the Resource configuration property
- whose value should be used as the
- Resource name when creating a new
- Resource of this type.</c:description>
- </c:simple-property>
- </plugin-configuration>
-
<resource-configuration>
- <c:simple-property name="name" displayName="Name" description="Name of the translator" />
- <c:simple-property name="type" displayName="Type" description="Base Translator Type" readOnly="true"/>
+ <c:simple-property name="name" displayName="Name" description="Name of the translator" readOnly="true" required="false"/>
<c:list-property name="translatorList" readOnly="true" required="false"
- displayName="Translator Specific Properties" description="List of translator specific properties">
- <c:map-property name="translator-properties" readOnly="true">
+ displayName="Properties" description="Translator properties">
+ <c:map-property name="properties" readOnly="true">
<c:simple-property name="name" displayName="Name" description="Name of this property" readOnly="true" />
<c:simple-property name="value" displayName="Value" description="Value of this property" readOnly="true"/>
- <!--c:simple-property name="description" displayName="Description" description="Description of this property" readOnly="true"/-->
</c:map-property>
</c:list-property>
- <c:template name="Access" description="Translator for Access">
- <c:simple-property name="type" default="access" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="DB2" description="Translator for DB2">
- <c:simple-property name="type" default="db2" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="Derby" description="Translator for Derby">
- <c:simple-property name="execution-factory-class"
- default="org.teiid.translator.jdbc.derby.DerbyExecutionFactory"
- displayName="execution-factory-class" description="Connector Class" />
- </c:template>
- <c:template name="H2" description="Translator for H2">
- <c:simple-property name="type" default="h2" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="HSQL" description="Translator for HSQL">
- <c:simple-property name="type" default="hsql" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="MySQL" description="Translator for MySQL">
- <c:simple-property name="type" default="mysql" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="MySQL5" description="Translator for MySQL 5">
- <c:simple-property name="type" default="mysql5" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="Oracle" description="Translator for Oracle">
- <c:simple-property name="type" default="oracle" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="SQLServer" description="Translator for SQLServer">
- <c:simple-property name="type" default="sqlserver" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="Sybase" description="Translator for Sybase">
- <c:simple-property name="type" default="sybase" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="LDAP" description="Translator for LDAP">
- <c:simple-property name="type" default="ldap" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="SalesForce" description="Translator for SalesForce">
- <c:simple-property name="type" default="salesforce" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="XML" description="Translator for XML">
- <c:simple-property name="type" default="xml" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
- <c:template name="Loopback" description="Translator for Loopback">
- <c:simple-property name="type" default="loopback" displayName="Type" description="Base Translator Type" readOnly="true"/>
- </c:template>
-
</resource-configuration>
</service>
14 years, 7 months
teiid SVN: r2169 - trunk/console/src/main/java/org/teiid/rhq/plugin.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-05-28 10:18:02 -0400 (Fri, 28 May 2010)
New Revision: 2169
Modified:
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
Log:
Fix compiler errors due to a merge gone wild
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-05-28 13:31:10 UTC (rev 2168)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-05-28 14:18:02 UTC (rev 2169)
@@ -24,6 +24,8 @@
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.deployers.spi.management.ManagementView;
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java 2010-05-28 13:31:10 UTC (rev 2168)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java 2010-05-28 14:18:02 UTC (rev 2169)
@@ -91,13 +91,15 @@
// Add to return values
// First get translator specific properties
ManagedProperty translatorProps = translator.getProperty("property");
+ PropertyList list = new PropertyList("translatorList");
+ PropertyMap propMap = null;
getTranslatorValues(translatorProps.getValue(), propMap, list);
// Now get common properties
- c.put(new PropertySimple("name", translatorName));
- c.put(new PropertySimple("type",ProfileServiceUtil.getSimpleValue(translator,"type", String.class)));
+ configuration.put(new PropertySimple("name", translatorName));
+ configuration.put(new PropertySimple("type",ProfileServiceUtil.getSimpleValue(translator,"type", String.class)));
- detail.setPluginConfiguration(c);
+ detail.setPluginConfiguration(configuration);
// Add to return values
discoveredResources.add(detail);
log.debug("Discovered Teiid Translator: " + translatorName);
14 years, 7 months
teiid SVN: r2168 - in trunk/console/src/main: java/org/teiid/rhq/plugin/util and 1 other directories.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-05-28 09:31:10 -0400 (Fri, 28 May 2010)
New Revision: 2168
Modified:
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/TranslatorComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/util/ProfileServiceUtil.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
Adding update logic for property persistence
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-05-28 04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-05-28 13:31:10 UTC (rev 2168)
@@ -39,6 +39,7 @@
import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedProperty;
import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.rhq.core.domain.configuration.Configuration;
@@ -74,6 +75,7 @@
import org.teiid.rhq.comm.ExecutedResult;
import org.teiid.rhq.plugin.objects.ExecutedOperationResultImpl;
import org.teiid.rhq.plugin.util.DeploymentUtils;
+import org.teiid.rhq.plugin.util.PluginConstants;
import org.teiid.rhq.plugin.util.ProfileServiceUtil;
/**
@@ -169,8 +171,8 @@
public void setResourceConfiguration(Configuration resourceConfiguration) {
this.resourceConfiguration = resourceConfiguration;
}
-
- public String getComponentName() {
+
+ public String componentType() {
return name;
}
@@ -191,7 +193,7 @@
// moved this logic up to the associated implemented class
throw new InvalidPluginConfigurationException(
"Not implemented on component type " + this.getComponentType()
- + " named " + this.getComponentName());
+ + " named " + this.name);
}
@@ -200,7 +202,7 @@
// moved this logic up to the associated implemented class
throw new InvalidPluginConfigurationException(
"Not implemented on component type " + this.getComponentType()
- + " named " + this.getComponentName());
+ + " named " + this.name);
}
@@ -306,12 +308,80 @@
* @see ConfigurationFacet#updateResourceConfiguration(ConfigurationUpdateReport)
*/
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
- // this simulates the plugin taking the new configuration and
- // reconfiguring the managed resource
+
resourceConfiguration = report.getConfiguration().deepCopy();
+
+ Configuration resourceConfig = report.getConfiguration();
+
+ ManagementView managementView = null;
+ ComponentType componentType = null;
+ if (this.getComponentType().equals(PluginConstants.ComponentType.VDB.NAME)) {
+ componentType = new ComponentType(
+ PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE);
+ } else if (this.getComponentType()
+ .equals(PluginConstants.ComponentType.Translator.NAME)) {
+ componentType = new ComponentType(
+ PluginConstants.ComponentType.Translator.TYPE,
+ PluginConstants.ComponentType.Translator.SUBTYPE);
+ } else {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage("Update not implemented for the component type.");
+ }
+
+ ManagedComponent managedComponent = null;
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ try {
+
+ managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), true);
+ managedComponent = managementView.getComponent(this.name, componentType);
+ Map<String, ManagedProperty> managedProperties = managedComponent
+ .getProperties();
+
+ ProfileServiceUtil.convertConfigurationToManagedProperties(
+ managedProperties, resourceConfig, resourceContext
+ .getResourceType());
+
+ try {
+ managementView.updateComponent(managedComponent);
+ } catch (Exception e) {
+ LOG.error("Unable to update component ["
+ + managedComponent.getName() + "] of type "
+ + componentType + ".", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+ } catch (Exception e) {
+ LOG.error("Unable to process update request", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
}
+ /**
+ * @return
+ * @throws Exception
+ */
+ protected Map<String, ManagedProperty> getManagedProperties()
+ throws Exception {
+ return null;
+ }
+
+ /**
+ * @param managedComponent
+ * @throws Exception
+ */
+ protected void updateComponent(ManagedComponent managedComponent)
+ throws Exception {
+ log.trace("Updating " + this.name + " with component "
+ + managedComponent.toString() + "...");
+ ManagementView managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), false);
+ managementView.updateComponent(managedComponent);
+
+ }
+
@Override
public void deleteResource() throws Exception {
@@ -407,7 +477,6 @@
return null;
}
-
protected static Configuration getDefaultPluginConfiguration(
ResourceType resourceType) {
ConfigurationTemplate pluginConfigDefaultTemplate = resourceType
@@ -416,92 +485,94 @@
.createConfiguration()
: new Configuration();
}
-
-
- /* (non-Javadoc)
- * @see org.rhq.core.pluginapi.inventory.CreateChildResourceFacet#createResource(org.rhq.core.pluginapi.inventory.CreateResourceReport)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.rhq.core.pluginapi.inventory.CreateChildResourceFacet#createResource
+ * (org.rhq.core.pluginapi.inventory.CreateResourceReport)
*/
@Override
public CreateResourceReport createResource(CreateResourceReport report) {
ResourceType resourceType = report.getResourceType();
- if (resourceType.getName().equals("Translators")){
+ if (resourceType.getName().equals("Translators")) {
createConfigurationBasedResource(report);
- }else{
+ } else {
createContentBasedResource(report);
}
-
+
return report;
}
-
+
private CreateResourceReport createConfigurationBasedResource(
CreateResourceReport createResourceReport) {
ResourceType resourceType = createResourceReport.getResourceType();
- Configuration defaultPluginConfig =
- getDefaultPluginConfiguration(resourceType);
- Configuration resourceConfig = createResourceReport
- .getResourceConfiguration();
- String resourceName = getResourceName(defaultPluginConfig,
- resourceConfig);
- ComponentType componentType = ProfileServiceUtil
- .getComponentType(resourceType);
- ManagementView managementView = null;;
- try {
- managementView = ProfileServiceUtil.getManagementView(
- ProfileServiceUtil.getProfileService(), true);
- } catch (NamingException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- if (ProfileServiceUtil.isManagedComponent(managementView,
- resourceName, componentType)) {
- createResourceReport.setStatus(CreateResourceStatus.FAILURE);
- createResourceReport.setErrorMessage("A " + resourceType.getName()
- + " named '" + resourceName + "' already exists.");
- return createResourceReport;
- }
+ Configuration defaultPluginConfig = getDefaultPluginConfiguration(resourceType);
+ Configuration resourceConfig = createResourceReport
+ .getResourceConfiguration();
+ String resourceName = getResourceName(defaultPluginConfig,
+ resourceConfig);
+ ComponentType componentType = ProfileServiceUtil
+ .getComponentType(resourceType);
+ ManagementView managementView = null;
+ ;
+ try {
+ managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), true);
+ } catch (NamingException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ if (ProfileServiceUtil.isManagedComponent(managementView, resourceName,
+ componentType)) {
+ createResourceReport.setStatus(CreateResourceStatus.FAILURE);
+ createResourceReport.setErrorMessage("A " + resourceType.getName()
+ + " named '" + resourceName + "' already exists.");
+ return createResourceReport;
+ }
- createResourceReport.setResourceName(resourceName);
- String resourceKey = getResourceKey(resourceType, resourceName);
- createResourceReport.setResourceKey(resourceKey);
+ createResourceReport.setResourceName(resourceName);
+ String resourceKey = getResourceKey(resourceType, resourceName);
+ createResourceReport.setResourceKey(resourceKey);
- PropertySimple templateNameProperty = resourceConfig
- .getSimple(TranslatorComponent.Config.TEMPLATE_NAME);
- String templateName = templateNameProperty.getStringValue();
+ PropertySimple templateNameProperty = resourceConfig
+ .getSimple(TranslatorComponent.Config.TEMPLATE_NAME);
+ String templateName = templateNameProperty.getStringValue();
- DeploymentTemplateInfo template;
- Set templateNamesSet = managementView.getTemplateNames();
+ DeploymentTemplateInfo template;
+ Set templateNamesSet = managementView.getTemplateNames();
+ try {
+ template = managementView.getTemplate(templateName);
+ Map<String, ManagedProperty> managedProperties = template
+ .getProperties();
+
+ ProfileServiceUtil.convertConfigurationToManagedProperties(
+ managedProperties, resourceConfig, resourceType);
+
+ LOG.debug("Applying template [" + templateName
+ + "] to create ManagedComponent of type [" + componentType
+ + "]...");
try {
- template = managementView.getTemplate(templateName);
- Map<String, ManagedProperty> managedProperties = template
- .getProperties();
-
- ProfileServiceUtil.convertConfigurationToManagedProperties(
- managedProperties, resourceConfig, resourceType);
-
- LOG.debug("Applying template [" + templateName
- + "] to create ManagedComponent of type [" + componentType
- + "]...");
- try {
- managementView.applyTemplate(resourceName, template);
- managementView.process();
- createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
- } catch (Exception e) {
- LOG.error("Unable to apply template [" + templateName
- + "] to create ManagedComponent of type "
- + componentType + ".", e);
- createResourceReport.setStatus(CreateResourceStatus.FAILURE);
- createResourceReport.setException(e);
- }
- } catch (NoSuchDeploymentException e) {
- LOG.error("Unable to find template [" + templateName + "].", e);
- createResourceReport.setStatus(CreateResourceStatus.FAILURE);
- createResourceReport.setException(e);
+ managementView.applyTemplate(resourceName, template);
+ managementView.process();
+ createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
} catch (Exception e) {
- LOG.error("Unable to process create request", e);
+ LOG.error("Unable to apply template [" + templateName
+ + "] to create ManagedComponent of type "
+ + componentType + ".", e);
createResourceReport.setStatus(CreateResourceStatus.FAILURE);
createResourceReport.setException(e);
}
+ } catch (NoSuchDeploymentException e) {
+ LOG.error("Unable to find template [" + templateName + "].", e);
+ createResourceReport.setStatus(CreateResourceStatus.FAILURE);
+ createResourceReport.setException(e);
+ } catch (Exception e) {
+ LOG.error("Unable to process create request", e);
+ createResourceReport.setStatus(CreateResourceStatus.FAILURE);
+ createResourceReport.setException(e);
+ }
return createResourceReport;
}
@@ -545,29 +616,35 @@
}
}
-
- private static String getResourceName(Configuration pluginConfig, Configuration resourceConfig)
- {
- PropertySimple resourceNameProp = pluginConfig.getSimple(TranslatorComponent.Config.RESOURCE_NAME);
- if (resourceNameProp == null || resourceNameProp.getStringValue() == null)
- throw new IllegalStateException("Property [" + TranslatorComponent.Config.RESOURCE_NAME
- + "] is not defined in the default plugin configuration.");
- String resourceNamePropName = resourceNameProp.getStringValue();
- PropertySimple propToUseAsResourceName = resourceConfig.getSimple(resourceNamePropName);
- if (propToUseAsResourceName == null)
- throw new IllegalStateException("Property [" + resourceNamePropName
- + "] is not defined in initial Resource configuration.");
- return propToUseAsResourceName.getStringValue();
- }
-
- private String getResourceKey(ResourceType resourceType, String resourceName)
- {
- ComponentType componentType = ProfileServiceUtil.getComponentType(resourceType);
- if (componentType == null)
- throw new IllegalStateException("Unable to map " + resourceType + " to a ComponentType.");
- return componentType.getType() + ":" + componentType.getSubtype() + ":" + resourceName;
- }
+ private static String getResourceName(Configuration pluginConfig,
+ Configuration resourceConfig) {
+ PropertySimple resourceNameProp = pluginConfig
+ .getSimple(TranslatorComponent.Config.RESOURCE_NAME);
+ if (resourceNameProp == null
+ || resourceNameProp.getStringValue() == null)
+ throw new IllegalStateException("Property ["
+ + TranslatorComponent.Config.RESOURCE_NAME
+ + "] is not defined in the default plugin configuration.");
+ String resourceNamePropName = resourceNameProp.getStringValue();
+ PropertySimple propToUseAsResourceName = resourceConfig
+ .getSimple(resourceNamePropName);
+ if (propToUseAsResourceName == null)
+ throw new IllegalStateException("Property [" + resourceNamePropName
+ + "] is not defined in initial Resource configuration.");
+ return propToUseAsResourceName.getStringValue();
+ }
+
+ private String getResourceKey(ResourceType resourceType, String resourceName) {
+ ComponentType componentType = ProfileServiceUtil
+ .getComponentType(resourceType);
+ if (componentType == null)
+ throw new IllegalStateException("Unable to map " + resourceType
+ + " to a ComponentType.");
+ return componentType.getType() + ":" + componentType.getSubtype() + ":"
+ + resourceName;
+ }
+
/**
* Returns an instantiated and loaded versions store access point.
*
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-05-28 04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-05-28 13:31:10 UTC (rev 2168)
@@ -29,24 +29,51 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+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.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.pluginapi.inventory.CreateResourceReport;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.teiid.rhq.admin.DQPManagementView;
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;
/**
*
*/
-public class PlatformComponent extends Facet implements PluginConstants {
+public class PlatformComponent extends Facet {
private final Log LOG = LogFactory.getLog(PlatformComponent.class);
+ String[] PLATFORM_SERVICES_NAMES = { "org.teiid.jboss.deployers.RuntimeEngineDeployer",
+ "org.teiid.services.BufferServiceImpl", "org.teiid.services.SessionServiceImpl", "org.teiid.transport.SocketConfiguration" };
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.
+ * ResourceContext)
+ */
+ @Override
+ public void start(ResourceContext context) {
+ this.setComponentName(context.getPluginConfiguration().getSimpleValue(
+ "name", null));
+ this.resourceConfiguration = context.getPluginConfiguration();
+ super.start(context);
+ }
+
/**
* @see org.teiid.rhq.plugin.Facet#getComponentType()
* @since 7.0
@@ -94,8 +121,8 @@
valueMap.put(Operation.Value.SESSION_ID, configuration.getSimple(
Operation.Value.SESSION_ID).getLongValue());
} else if (name.equals(Platform.Operations.KILL_REQUEST)) {
- valueMap.put(Operation.Value.TRANSACTION_ID, configuration.getSimple(
- Operation.Value.TRANSACTION_ID).getLongValue());
+ valueMap.put(Operation.Value.TRANSACTION_ID, configuration
+ .getSimple(Operation.Value.TRANSACTION_ID).getLongValue());
} else if (name.equals(Platform.Operations.KILL_SESSION)) {
valueMap.put(Operation.Value.SESSION_ID, configuration.getSimple(
Operation.Value.SESSION_ID).getLongValue());
@@ -175,7 +202,6 @@
}
}
-
@Override
public void stop() {
@@ -183,6 +209,139 @@
super.stop();
}
-
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.teiid.rhq.plugin.Facet#updateResourceConfiguration(org.rhq.core.pluginapi
+ * .configuration.ConfigurationUpdateReport)
+ */
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ resourceConfiguration = report.getConfiguration().deepCopy();
+
+ Configuration resourceConfig = report.getConfiguration();
+
+ ManagementView managementView = null;
+ ComponentType componentType = new ComponentType(
+ PluginConstants.ComponentType.Platform.TEIID_TYPE,
+ PluginConstants.ComponentType.Platform.TEIID_SUB_TYPE);
+
+ ManagedComponent managedComponent = null;
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ try {
+
+ managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), true);
+
+ for (String serviceName : PLATFORM_SERVICES_NAMES) {
+
+ managedComponent = managementView.getComponent(serviceName,
+ componentType);
+ Map<String, ManagedProperty> managedProperties = managedComponent
+ .getProperties();
+
+ ProfileServiceUtil.convertConfigurationToManagedProperties(
+ managedProperties, resourceConfig, resourceContext
+ .getResourceType());
+
+ try {
+ managementView.updateComponent(managedComponent);
+ } catch (Exception e) {
+ LOG.error("Unable to update component ["
+ + managedComponent.getName() + "] of type "
+ + componentType + ".", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+ }
+ } catch (Exception e) {
+ LOG.error("Unable to process update request", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.teiid.rhq.plugin.Facet#loadResourceConfiguration()
+ */
+ @Override
+ public Configuration loadResourceConfiguration() {
+
+ // ManagedComponent platform = null;
+ // try {
+ // platform = ProfileServiceUtil.getManagedComponent(
+ // new
+ // org.jboss.managed.api.ComponentType(PluginConstants.ComponentType.Platform.TYPE,
+ // PluginConstants.ComponentType.Platform.SUBTYPE),
+ // PluginConstants.ComponentType.Platform.TEIID_RUNTIME_ENGINE);
+ // } catch (NamingException e) {
+ // final String msg = "NamingException in loadResourceConfiguration(): " + e.getExplanation(); //$NON-NLS-1$
+ // LOG.error(msg, e);
+ // } catch (Exception e) {
+ // final String msg = "Exception in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
+ // LOG.error(msg, e);
+ // }
+ //
+ // Get plugin config
+ Configuration c = resourceContext.getPluginConfiguration();
+
+ getProperties(c);
+
+ return c;
+
+ }
+
+ /**
+ * @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 Platform loadConfiguration(): "
+ + e.getMessage());
+ } catch (Exception e) {
+ LOG
+ .error("Exception getting components in Platform loadConfiguration(): "
+ + e.getMessage());
+ }
+
+ for (ManagedComponent mc : mcSet) {
+ Map<String, ManagedProperty> mcMap = mc.getProperties();
+ setProperties(mcMap, configuration);
+ }
+ }
+
+ /**
+ * @param mcMap
+ * @param configuration
+ */
+ private void setProperties(Map<String, ManagedProperty> mcMap, Configuration configuration) {
+ for (ManagedProperty mProp : mcMap.values()) {
+ try {
+ String value = ProfileServiceUtil.stringValue(mProp.getValue());
+ PropertySimple prop = new PropertySimple(mProp.getName(), value);
+ configuration.put(prop);
+ } catch (Exception e) {
+ LOG
+ .error("Exception setting properties in Platform loadConfiguration(): "
+ + e.getMessage());
+ }
+ }
+ }
+
}
\ 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-05-28 04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java 2010-05-28 13:31:10 UTC (rev 2168)
@@ -21,10 +21,7 @@
*/
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;
@@ -34,19 +31,8 @@
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;
@@ -59,7 +45,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());
@@ -77,10 +63,11 @@
Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
ManagedComponent mc = ProfileServiceUtil.getManagedComponent(
- new ComponentType("teiid", "dqp"),
+ new ComponentType(
+ PluginConstants.ComponentType.Platform.TEIID_TYPE,
+ PluginConstants.ComponentType.Platform.TEIID_SUB_TYPE),
PluginConstants.ComponentType.Platform.TEIID_RUNTIME_ENGINE);
- Configuration c = new Configuration();
/**
*
* A discovered resource must have a unique key, that must stay the same
@@ -97,91 +84,17 @@
// Config
null // Process info from a process scan
);
-
+
Configuration configuration = detail.getPluginConfiguration();
-
- getProperties(configuration);
+ configuration.put(new PropertySimple(
+ PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT, 600));
+ detail.setPluginConfiguration(configuration);
// Add to return values
discoveredResources.add(detail);
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/TranslatorComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-05-28 04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-05-28 13:31:10 UTC (rev 2168)
@@ -26,12 +26,31 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.rhq.core.domain.configuration.Configuration;
+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.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.domain.resource.CreateResourceStatus;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.inventory.CreateResourceReport;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.teiid.rhq.comm.ConnectionConstants;
+import org.teiid.rhq.plugin.util.PluginConstants;
+import org.teiid.rhq.plugin.util.ProfileServiceUtil;
/**
* Component class for the MetaMatrix Host Controller process.
@@ -48,13 +67,27 @@
String RESOURCE_NAME = "resourceName";
}
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.
+ * ResourceContext)
+ */
+ @Override
+ public void start(ResourceContext context) {
+ this.setComponentName(context.getPluginConfiguration().getSimpleValue(
+ "name", null));
+ this.resourceConfiguration=context.getPluginConfiguration();
+ super.start(context);
+ }
+
/**
* @see org.teiid.rhq.plugin.Facet#getComponentType()
* @since 1.0
*/
@Override
String getComponentType() {
- return ConnectionConstants.ComponentType.Resource.Model.TYPE;
+ return PluginConstants.ComponentType.Translator.NAME;
}
/**
@@ -100,6 +133,81 @@
}
+ /* (non-Javadoc)
+ * @see org.teiid.rhq.plugin.Facet#loadResourceConfiguration()
+ */
+ @Override
+ public Configuration loadResourceConfiguration() {
+
+ ManagedComponent translator = null;
+ try {
+ translator = ProfileServiceUtil
+ .getManagedComponent(new ComponentType(
+ PluginConstants.ComponentType.Translator.TYPE,
+ PluginConstants.ComponentType.Translator.SUBTYPE), this.name);
+ } catch (NamingException e) {
+ final String msg = "NamingException in loadResourceConfiguration(): " + e.getExplanation(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ } catch (Exception e) {
+ final String msg = "Exception in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ }
+
+ String translatorName = ProfileServiceUtil.getSimpleValue(
+ translator, "name", String.class);
+
+ Configuration c = resourceConfiguration;
+ PropertyList list = new PropertyList("translatorList");
+ PropertyMap propMap = null;
+ c.put(list);
+
+ // First get translator specific properties
+ ManagedProperty translatorProps = translator
+ .getProperty("translator-property");
+ getTranslatorValues(translatorProps.getValue(), propMap, list);
+
+ // Now get common properties
+ c.put(new PropertySimple("name", translatorName));
+ c.put(new PropertySimple("execution-factory-class",
+ ProfileServiceUtil.getSimpleValue(translator,
+ "execution-factory-class", String.class)));
+ c.put(new PropertySimple("immutable", ProfileServiceUtil
+ .getSimpleValue(translator, "immutable", Boolean.class)));
+ c.put(new PropertySimple("xa-capable", ProfileServiceUtil
+ .getSimpleValue(translator, "xa-capable", Boolean.class)));
+ c.put(new PropertySimple("exception-on-max-rows",
+ ProfileServiceUtil.getSimpleValue(translator,
+ "exception-on-max-rows", Boolean.class)));
+ c.put(new PropertySimple("max-result-rows", ProfileServiceUtil
+ .getSimpleValue(translator, "max-result-rows",
+ Integer.class)));
+ c.put(new PropertySimple("template-name", ProfileServiceUtil
+ .getSimpleValue(translator, "template-name",
+ String.class)));
+
+ return c;
+
+ }
+ public static <T> void getTranslatorValues(MetaValue pValue,
+ PropertyMap map, PropertyList list) {
+ MetaType metaType = pValue.getMetaType();
+ Map<String, T> unwrappedvalue = null;
+ if (metaType.isComposite()) {
+ unwrappedvalue = (Map<String, T>) MetaValueFactory
+ .getInstance().unwrap(pValue);
+ for (String key : unwrappedvalue.keySet()) {
+ map = new PropertyMap("translator-properties");
+ map.put(new PropertySimple("name", key));
+ map.put(new PropertySimple("value", unwrappedvalue.get(key)));
+ map.put(new PropertySimple("description", "Custom property"));
+ list.add(map);
+ }
+ } else {
+ throw new IllegalStateException(pValue + " is not a Composite type");
+ }
+
+ }
+
}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java 2010-05-28 04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java 2010-05-28 13:31:10 UTC (rev 2168)
@@ -65,7 +65,8 @@
for (ManagedComponent translator : translators) {
String translatorKey = translator.getName();
- String translatorName = ProfileServiceUtil.getSimpleValue(translator, "name", String.class);
+ String translatorName = ProfileServiceUtil.getSimpleValue(
+ translator, "name", String.class);
/**
*
* A discovered resource must have a unique key, that must stay the
@@ -81,11 +82,13 @@
null // Process info from a process scan
);
- Configuration c = detail.getPluginConfiguration();
- PropertyList list = new PropertyList("translatorList");
- PropertyMap propMap = null;
- c.put(list);
+ // Get plugin config map for models
+ Configuration configuration = detail.getPluginConfiguration();
+ configuration.put(new PropertySimple("name", translatorName));
+ detail.setPluginConfiguration(configuration);
+
+ // Add to return values
// First get translator specific properties
ManagedProperty translatorProps = translator.getProperty("property");
getTranslatorValues(translatorProps.getValue(), propMap, list);
@@ -103,6 +106,7 @@
return discoveredResources;
}
+
public static <T> void getTranslatorValues(MetaValue pValue,
PropertyMap map, PropertyList list) {
MetaType metaType = pValue.getMetaType();
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-05-28 04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-05-28 13:31:10 UTC (rev 2168)
@@ -24,6 +24,8 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -31,19 +33,25 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.deployers.spi.management.ManagementView;
+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.ManagedObjectImpl;
import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
import org.jboss.metatype.api.values.CollectionValueSupport;
import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.GenericValue;
import org.jboss.metatype.api.values.GenericValueSupport;
import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
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.ConfigurationUpdateStatus;
+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;
@@ -52,7 +60,6 @@
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.domain.resource.ResourceType;
import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.pluginapi.inventory.CreateResourceReport;
@@ -82,21 +89,12 @@
public void start(ResourceContext context) {
this.setComponentName(context.getPluginConfiguration().getSimpleValue(
"name", null));
- this.resourceConfiguration=context.getPluginConfiguration();
+ this.resourceConfiguration = context.getPluginConfiguration();
+ this.componentType = PluginConstants.ComponentType.VDB.NAME;
super.start(context);
}
- /*
- * (non-Javadoc)
- *
- * @see org.teiid.rhq.plugin.Facet#getComponentName()
- */
@Override
- public String getComponentName() {
- return this.name;
- }
-
- @Override
protected void setOperationArguments(String name,
Configuration configuration, Map<String, Object> valueMap) {
// Parameter logic for VDB Operations
@@ -126,8 +124,7 @@
@Override
public AvailabilityType getAvailability() {
// TODO Remove vdb version after no longer viable in Teiid
- String status = DQPManagementView.getVDBStatus(this.getComponentName(),
- 1);
+ String status = DQPManagementView.getVDBStatus(this.name, 1);
if (status.equals("ACTIVE")) {
return AvailabilityType.UP;
}
@@ -232,12 +229,113 @@
* @see ConfigurationFacet#updateResourceConfiguration(ConfigurationUpdateReport)
*/
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
- // this simulates the plugin taking the new configuration and
- // reconfiguring the managed resource
- resourceConfiguration = report.getConfiguration().deepCopy();
+
+ Configuration resourceConfig = report.getConfiguration();
+ resourceConfiguration = resourceConfig.deepCopy();
+
+ // First update simple properties
+ super.updateResourceConfiguration(report);
+
+ // Then update models
+ ManagementView managementView = null;
+ ComponentType componentType = new ComponentType(
+ PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE);
+
+ ManagedComponent managedComponent = null;
+ CollectionValueSupport modelsMetaValue = null;
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ try {
+
+ managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), true);
+ managedComponent = managementView.getComponent(this.name,
+ componentType);
+ ManagedProperty mp = managedComponent.getProperty("models");//$NON-NLS-1$
+ List<ManagedObject> modelsMp = (List<ManagedObject>) MetaValueFactory
+ .getInstance().unwrap(mp.getValue());
+ modelsMetaValue = (CollectionValueSupport) managedComponent
+ .getProperty("models").getValue();
+ GenericValue[] models = (GenericValue[]) modelsMetaValue
+ .getElements();
+ List<Property> multiSourceModelsPropertyList = resourceConfiguration
+ .getList("multiSourceModels").getList();
+ List<Property> singleSourceModelsPropertyList = resourceConfiguration
+ .getList("singleSourceModels").getList();
+ ArrayList<List<Property>> sourceMappingList = new ArrayList<List<Property>>();
+ sourceMappingList.add(singleSourceModelsPropertyList);
+ sourceMappingList.add(multiSourceModelsPropertyList);
+ PropertyMap model = null;
+ Iterator<List<Property>> sourceMappingListIterator = sourceMappingList.iterator();
+ while (sourceMappingListIterator.hasNext()) {
+ List<Property> sourceList = sourceMappingListIterator.next();
+ for (int i = 0; i < sourceList.size(); i++) {
+ model = (PropertyMap) sourceList.get(i);
+ String sourceName = ((PropertySimple) model
+ .get("sourceName")).getStringValue(); //$NON-NLS-1$
+ if (sourceName.equals("See below")) continue; //This is a multisource model which we will handle separately
+ String modelName = ((PropertySimple) model.get("name")) //$NON-NLS-1$
+ .getStringValue();
+ String translatorName = ((PropertySimple) model
+ .get("translatorName")).getStringValue(); //$NON-NLS-1$
+ String dsName = ((PropertySimple) model.get("jndiName")) //$NON-NLS-1$
+ .getStringValue();
+
+ ManagedObject managedModel = null;
+ if (models != null && !modelsMp.isEmpty()) {
+ for (ManagedObject mo : modelsMp) {
+ String name = ProfileServiceUtil.getSimpleValue(mo,
+ "name", String.class); //$NON-NLS-1$
+ if (modelName.equals(name)) {
+ managedModel = mo;
+ }
+ }
+ }
+ ManagedProperty sourceMappings = managedModel
+ .getProperty("sourceMappings");//$NON-NLS-1$
+ if (sourceMappings != null) {
+ List<ManagedObject> mappings = (List<ManagedObject>) MetaValueFactory
+ .getInstance()
+ .unwrap(sourceMappings.getValue());
+ for (ManagedObject mo : mappings) {
+ String sName = ProfileServiceUtil.getSimpleValue(
+ mo, "name", String.class);//$NON-NLS-1$
+ if (sName.equals(sourceName)) {
+
+ ManagedProperty translatorProperty = mo
+ .getProperty("translatorName"); //$NON-NLS-1$
+ translatorProperty.setValue(ProfileServiceUtil
+ .wrap(SimpleMetaType.STRING,
+ translatorName));
+
+ // set the jndi name for the ds.
+ ManagedProperty jndiProperty = mo
+ .getProperty("connectionJndiName"); //$NON-NLS-1$
+ jndiProperty.setValue(ProfileServiceUtil.wrap(
+ SimpleMetaType.STRING, dsName));
+ }
+ }
+ }
+ }
+ }
+
+ try {
+ managementView.updateComponent(managedComponent);
+ } catch (Exception e) {
+ LOG.error("Unable to update component ["
+ + managedComponent.getName() + "] of type "
+ + componentType + ".", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+ } catch (Exception e) {
+ LOG.error("Unable to process update request", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+
}
-
+
@Override
public Configuration loadResourceConfiguration() {
@@ -246,32 +344,42 @@
mcVdb = ProfileServiceUtil.getManagedComponent(
new org.jboss.managed.api.ComponentType(
PluginConstants.ComponentType.VDB.TYPE,
- PluginConstants.ComponentType.VDB.SUBTYPE), this
- .getComponentName());
+ PluginConstants.ComponentType.VDB.SUBTYPE),
+ this.name);
} catch (NamingException e) {
- final String msg = "NamingException in getVDBStatus(): " + e.getExplanation(); //$NON-NLS-1$
+ final String msg = "NamingException in loadResourceConfiguration(): " + e.getExplanation(); //$NON-NLS-1$
LOG.error(msg, e);
} catch (Exception e) {
- final String msg = "Exception in getVDBStatus(): " + e.getMessage(); //$NON-NLS-1$
+ final String msg = "Exception in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
LOG.error(msg, e);
}
+ String vdbName = ProfileServiceUtil.getSimpleValue(mcVdb, "name",
+ String.class);
+ Integer vdbVersion = ProfileServiceUtil.getSimpleValue(mcVdb,
+ "version", Integer.class);
+ String vdbDescription = ProfileServiceUtil.getSimpleValue(mcVdb,
+ "description", String.class);
+ String vdbStatus = ProfileServiceUtil.getSimpleValue(mcVdb, "status",
+ String.class);
+ String vdbURL = ProfileServiceUtil.getSimpleValue(mcVdb, "url",
+ String.class);
+
// Get plugin config map for models
Configuration configuration = resourceContext.getPluginConfiguration();
- // configuration.put(new PropertySimple("name", vdbName));
- // configuration.put(new PropertySimple("version", vdbVersion));
- // configuration
- // .put(new PropertySimple("description", vdbDescription));
- // configuration.put(new PropertySimple("status", vdbStatus));
- // configuration.put(new PropertySimple("url", vdbURL));
+ configuration.put(new PropertySimple("name", vdbName));
+ configuration.put(new PropertySimple("version", vdbVersion));
+ configuration.put(new PropertySimple("description", vdbDescription));
+ configuration.put(new PropertySimple("status", vdbStatus));
+ configuration.put(new PropertySimple("url", vdbURL));
getModels(mcVdb, configuration);
return configuration;
}
-
+
@Override
public CreateResourceReport createResource(
CreateResourceReport createResourceReport) {
@@ -285,18 +393,20 @@
* @param configuration
* @throws Exception
*/
- private void getModels(ManagedComponent mcVdb, Configuration configuration)
- {
+ private void getModels(ManagedComponent mcVdb, Configuration configuration) {
// Get models from VDB
ManagedProperty property = mcVdb.getProperty("models");
+ List<ManagedObject> models = (List<ManagedObject>) MetaValueFactory
+ .getInstance().unwrap(property.getValue());
CollectionValueSupport valueSupport = (CollectionValueSupport) property
.getValue();
MetaValue[] metaValues = valueSupport.getElements();
- PropertyList sourceModelsList = new PropertyList("sourceModels");
+ PropertyList sourceModelsList = new PropertyList("singleSourceModels");
configuration.put(sourceModelsList);
-
- PropertyList multiSourceModelsList = new PropertyList("multisourceModels");
+
+ PropertyList multiSourceModelsList = new PropertyList(
+ "multiSourceModels");
configuration.put(multiSourceModelsList);
PropertyList logicalModelsList = new PropertyList("logicalModels");
@@ -307,44 +417,55 @@
for (MetaValue value : metaValues) {
GenericValueSupport genValueSupport = (GenericValueSupport) value;
- ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport.getValue();
+ ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+ .getValue();
Boolean isSource = Boolean.TRUE;
try {
- isSource = ProfileServiceUtil.booleanValue(managedObject.getProperty("source").getValue());
+ isSource = ProfileServiceUtil.booleanValue(managedObject
+ .getProperty("source").getValue());
} catch (Exception e) {
LOG.error(e.getMessage());
}
Boolean supportMultiSource = Boolean.TRUE;
try {
- supportMultiSource = ProfileServiceUtil.booleanValue(managedObject.getProperty("supportsMultiSourceBindings").getValue());
+ supportMultiSource = ProfileServiceUtil
+ .booleanValue(managedObject.getProperty(
+ "supportsMultiSourceBindings").getValue());
} catch (Exception e) {
LOG.error(e.getMessage());
}
String modelName = managedObject.getName();
- ManagedProperty connectorBinding = managedObject.getProperty("sourceMappings");
+ ManagedProperty connectorBinding = managedObject
+ .getProperty("sourceMappings");
Collection<Map<String, String>> sourceList = new ArrayList<Map<String, String>>();
-
+
getSourceMappingValue(connectorBinding.getValue(), sourceList);
-
- String visibility = ((SimpleValueSupport) managedObject.getProperty("visible").getValue()).getValue().toString();
- String type = ((EnumValueSupport) managedObject.getProperty("modelType").getValue()).getValue().toString();
+ String visibility = ((SimpleValueSupport) managedObject
+ .getProperty("visible").getValue()).getValue().toString();
+ String type = ((EnumValueSupport) managedObject.getProperty(
+ "modelType").getValue()).getValue().toString();
+
// Get any model errors/warnings
MetaValue errors = managedObject.getProperty("errors").getValue();
if (errors != null) {
CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
MetaValue[] errorArray = errorValueSupport.getElements();
-
+
for (MetaValue error : errorArray) {
GenericValueSupport errorGenValueSupport = (GenericValueSupport) error;
-
- ManagedObject errorMo = (ManagedObject) errorGenValueSupport.getValue();
- String severity = ((SimpleValue) errorMo.getProperty("severity").getValue()).getValue().toString();
- String message = ((SimpleValue) errorMo.getProperty("value").getValue()).getValue().toString();
-
+
+ ManagedObject errorMo = (ManagedObject) errorGenValueSupport
+ .getValue();
+ String severity = ((SimpleValue) errorMo.getProperty(
+ "severity").getValue()).getValue().toString();
+ String message = ((SimpleValue) errorMo
+ .getProperty("value").getValue()).getValue()
+ .toString();
+
PropertyMap errorMap = new PropertyMap("errorMap",
new PropertySimple("severity", severity),
new PropertySimple("message", message));
@@ -357,42 +478,43 @@
if (isSource) {
String sourceName = (String) sourceMap.get("name");
String jndiName = (String) sourceMap.get("jndiName");
- String translatorName = (String) sourceMap.get("translatorName");
+ String translatorName = (String) sourceMap
+ .get("translatorName");
PropertyMap multiSourceModel = null;
- PropertyMap model = null;
- if (supportMultiSource){
- //TODO need to loop through multisource models
- multiSourceModel = new PropertyMap("model",
- new PropertySimple("name", modelName),
- new PropertySimple("sourceName", sourceName),
- new PropertySimple("jndiName", jndiName),
- new PropertySimple("translatorName", translatorName));
-
- multiSourceModelsList.add(multiSourceModel);
-
- model = new PropertyMap("model",
- new PropertySimple("name", modelName),
- new PropertySimple("sourceName", "See below"),
- new PropertySimple("jndiName", "See below"),
- new PropertySimple("translatorName", "See below"),
- new PropertySimple("visibility", visibility),
- new PropertySimple("supportsMultiSource",
- true));
- sourceModelsList.add(model);
- }else{
- model = new PropertyMap("model",
+ PropertyMap model = null;
+ if (supportMultiSource) {
+ // TODO need to loop through multisource models
+ multiSourceModel = new PropertyMap("map",
new PropertySimple("name", modelName),
new PropertySimple("sourceName", sourceName),
new PropertySimple("jndiName", jndiName),
- new PropertySimple("translatorName", translatorName),
+ new PropertySimple("translatorName",
+ translatorName));
+
+ multiSourceModelsList.add(multiSourceModel);
+
+ model = new PropertyMap("map", new PropertySimple(
+ "name", modelName), new PropertySimple(
+ "sourceName", "See below"), new PropertySimple(
+ "jndiName", "See below"), new PropertySimple(
+ "translatorName", "See below"),
new PropertySimple("visibility", visibility),
+ new PropertySimple("supportsMultiSource", true));
+ sourceModelsList.add(model);
+ } else {
+ model = new PropertyMap("map", new PropertySimple(
+ "name", modelName), new PropertySimple(
+ "sourceName", sourceName), new PropertySimple(
+ "jndiName", jndiName), new PropertySimple(
+ "translatorName", translatorName),
+ new PropertySimple("visibility", visibility),
new PropertySimple("supportsMultiSource",
supportMultiSource));
- sourceModelsList.add(model);
+ sourceModelsList.add(model);
}
} else {
- PropertyMap model = new PropertyMap("model",
+ PropertyMap model = new PropertyMap("map",
new PropertySimple("name", modelName),
new PropertySimple("type", type),
new PropertySimple("visibility", visibility));
@@ -419,14 +541,17 @@
GenericValueSupport genValue = ((GenericValueSupport) value);
ManagedObject mo = (ManagedObject) genValue.getValue();
String sourceName = mo.getName();
- String jndi = ((SimpleValue) mo.getProperty("connectionJndiName").getValue()).getValue().toString();
- String translatorName = ((SimpleValue) mo.getProperty("translatorName").getValue()).getValue().toString();
+ String jndi = ((SimpleValue) mo.getProperty(
+ "connectionJndiName").getValue()).getValue().toString();
+ String translatorName = ((SimpleValue) mo.getProperty(
+ "translatorName").getValue()).getValue().toString();
map.put("name", sourceName);
map.put("jndiName", jndi);
map.put("translatorName", translatorName);
}
} else {
- throw new IllegalStateException(pValue+ " is not a Collection type");
+ throw new IllegalStateException(pValue
+ + " is not a Collection type");
}
}
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-05-28 04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-05-28 13:31:10 UTC (rev 2168)
@@ -116,10 +116,6 @@
configuration.put(new PropertySimple("status", vdbStatus));
configuration.put(new PropertySimple("url", vdbURL));
- getModels(mcVdb, configuration);
-
- // getProperties(mcVdb, configuration);
-
detail.setPluginConfiguration(configuration);
// Add to return values
@@ -129,170 +125,6 @@
return discoveredResources;
}
-
- /**
- * @param mcVdb
- * @param configuration
- * @throws Exception
- */
- private void getModels(ManagedComponent mcVdb, Configuration configuration)
- throws Exception {
- // Get models from VDB
- ManagedProperty property = mcVdb.getProperty("models");
- CollectionValueSupport valueSupport = (CollectionValueSupport) property
- .getValue();
- MetaValue[] metaValues = valueSupport.getElements();
-
- PropertyList sourceModelsList = new PropertyList("sourceModels");
- configuration.put(sourceModelsList);
-
- PropertyList multiSourceModelsList = new PropertyList("multisourceModels");
- configuration.put(multiSourceModelsList);
-
- PropertyList logicalModelsList = new PropertyList("logicalModels");
- configuration.put(logicalModelsList);
-
- PropertyList errorList = new PropertyList("errorList");
- configuration.put(errorList);
-
- for (MetaValue value : metaValues) {
- GenericValueSupport genValueSupport = (GenericValueSupport) value;
- ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
- .getValue();
-
- Boolean isSource = Boolean.TRUE;
- try {
- isSource = ProfileServiceUtil.booleanValue(managedObject
- .getProperty("source").getValue());
- } catch (Exception e) {
- throw e;
- }
-
- Boolean supportMultiSource = Boolean.TRUE;
- try {
- supportMultiSource = ProfileServiceUtil.booleanValue(managedObject.getProperty("supportsMultiSourceBindings").getValue());
- } catch (Exception e) {
- throw e;
- }
-
- String modelName = managedObject.getName();
- ManagedProperty connectorBinding = managedObject.getProperty("sourceMappings");
- Collection<Map<String, String>> sourceList = new ArrayList<Map<String, String>>();
- getSourceMappingValue(connectorBinding.getValue(), sourceList);
- String visibility = ((SimpleValueSupport) managedObject.getProperty("visible").getValue()).getValue().toString();
- String type = ((EnumValueSupport) managedObject.getProperty("modelType").getValue()).getValue().toString();
-
- // Get any model errors/warnings
- MetaValue errors = managedObject.getProperty("errors").getValue();
- if (errors != null) {
- CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
- MetaValue[] errorArray = errorValueSupport.getElements();
- for (MetaValue error : errorArray) {
- GenericValueSupport errorGenValueSupport = (GenericValueSupport) error;
- ManagedObject errorMo = (ManagedObject) errorGenValueSupport.getValue();
- String severity = ((SimpleValue) errorMo.getProperty("severity").getValue()).getValue().toString();
- String message = ((SimpleValue) errorMo.getProperty("value").getValue()).getValue().toString();
- PropertyMap errorMap = new PropertyMap("errorMap",
- new PropertySimple("severity", severity),
- new PropertySimple("message", message));
- errorList.add(errorMap);
- }
- }
-
- for (Map<String, String> sourceMap : sourceList) {
-
- if (isSource) {
- String sourceName = sourceMap.get("name");
- String jndiName = sourceMap.get("jndiName");
- String translatorName = sourceMap.get("translatorName");
-
- PropertyMap model = new PropertyMap("model",
- new PropertySimple("name", modelName),
- new PropertySimple("sourceName", sourceName),
- new PropertySimple("jndiName", jndiName),
- new PropertySimple("translatorName", translatorName),
- new PropertySimple("visibility", visibility),
- new PropertySimple("supportsMultiSource",supportMultiSource));
-
- model.getSimple("jndiName").setOverride(false);
- sourceModelsList.add(model);
- } else {
- PropertyMap model = new PropertyMap("model",
- new PropertySimple("name", modelName),
- new PropertySimple("type", type),
- new PropertySimple("visibility", visibility));
-
- logicalModelsList.add(model);
- }
- }
- }
- }
-
- /**
- * @param <T>
- * @param pValue
- * @param list
- */
- public static <T> void getSourceMappingValue(MetaValue pValue,
- Collection<Map<String, String>> list) {
- Map<String, String> map = new HashMap<String, String>();
- list.add(map);
- MetaType metaType = pValue.getMetaType();
- if (metaType.isCollection()) {
- for (MetaValue value : ((CollectionValueSupport) pValue)
- .getElements()) {
- GenericValueSupport genValue = ((GenericValueSupport) value);
- ManagedObject mo = (ManagedObject) genValue.getValue();
- String sourceName = mo.getName();
- String jndi = ((SimpleValue) mo.getProperty("connectionJndiName").getValue()).getValue().toString();
- String translatorName = ((SimpleValue) mo.getProperty("translatorName").getValue()).getValue().toString();
- map.put("name", sourceName);
- map.put("jndiName", jndi);
- map.put("translatorName", translatorName);
- }
- } else {
- throw new IllegalStateException(pValue+ " is not a Collection type");
- }
- }
-
- /**
- * @param mc
- * @param configuration
- * @throws Exception
- */
- private void getProperties(ManagedComponent mcVdb,
- Configuration configuration) {
-
- ManagedProperty mp = mcVdb.getProperty("JAXBProperties");
- Collection<Object> list = new ArrayList<Object>();
- getRequestCollectionValue(mp.getValue(), list);
- PropertyMap vdbPropertyMap = new PropertyMap("vdbProperties");
- configuration.put(vdbPropertyMap);
- setProperties(mp, vdbPropertyMap);
-
- }
-
- /**
- * @param mcMap
- * @param propertyMap
- */
- private void setProperties(ManagedProperty mProp, PropertyMap propertyMap) {
- //String value = ProfileServiceUtil.stringValue(mProp.getValue());
- PropertySimple prop = new PropertySimple(mProp.getName(), "test");
- propertyMap.put(prop);
-
- }
- public static <T> void getRequestCollectionValue(MetaValue pValue,
- Collection<Object> list) {
- MetaType metaType = pValue.getMetaType();
- if (metaType.isCollection()) {
- for (MetaValue value : ((CollectionValueSupport) pValue)
- .getElements()) {
- SimpleValueSupport property = (SimpleValueSupport)value;
- list.add(property);
- }
- }
- }
}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/util/ProfileServiceUtil.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/util/ProfileServiceUtil.java 2010-05-28 04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/util/ProfileServiceUtil.java 2010-05-28 13:31:10 UTC (rev 2168)
@@ -24,11 +24,14 @@
import java.io.File;
import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
@@ -42,6 +45,7 @@
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedCommon;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedProperty;
@@ -52,6 +56,7 @@
import org.jboss.metatype.api.values.EnumValue;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
import org.jboss.profileservice.spi.ProfileService;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.Property;
@@ -70,7 +75,6 @@
import org.teiid.rhq.plugin.adapter.api.PropertyAdapterFactory;
import com.sun.istack.NotNull;
-import com.sun.istack.Nullable;
public class ProfileServiceUtil {
@@ -305,6 +309,23 @@
}
return null;
}
+
+ public static <T> T getSimpleValue(ManagedCommon mc, String prop, Class<T> expectedType) {
+ ManagedProperty mp = mc.getProperty(prop);
+ if (mp != null) {
+ MetaType metaType = mp.getMetaType();
+ if (metaType.isSimple()) {
+ SimpleValue simpleValue = (SimpleValue)mp.getValue();
+ return expectedType.cast((simpleValue != null) ? simpleValue.getValue() : null);
+ }
+ else if (metaType.isEnum()) {
+ EnumValue enumValue = (EnumValue)mp.getValue();
+ return expectedType.cast((enumValue != null) ? enumValue.getValue() : null);
+ }
+ throw new IllegalArgumentException(prop+ " is not a simple type"); //$NON-NLS-1$
+ }
+ return null;
+ }
public static Map<String, PropertySimple> getCustomProperties(
Configuration pluginConfig) {
@@ -403,7 +424,7 @@
return;
}
- private static void populateManagedPropertyFromProperty(ManagedProperty managedProperty,
+ public static void populateManagedPropertyFromProperty(ManagedProperty managedProperty,
PropertyDefinition propertyDefinition, Configuration configuration) {
// If the ManagedProperty defines a default value, assume it's more
// definitive than any default value that may
@@ -418,13 +439,15 @@
PropertyAdapter propertyAdapter = null;
if (metaValue != null) {
LOG.trace("Populating existing MetaValue of type "
- + metaValue.getMetaType() + " from RHQ property "
+ + metaValue.getMetaType() + " from Teiid property "
+ propertyDefinition.getName() + " with definition " + propertyDefinition
+ "...");
propertyAdapter = PropertyAdapterFactory
.getPropertyAdapter(metaValue);
+
propertyAdapter.populateMetaValueFromProperty(configuration.getSimple(propertyDefinition.getName()), metaValue,
- propertyDefinition);
+ propertyDefinition);
+ managedProperty.setValue(metaValue);
} else {
MetaType metaType = managedProperty.getMetaType();
if (propertyAdapter == null)
@@ -434,9 +457,10 @@
+ propertyDefinition + " to MetaValue of type " + metaType
+ "...");
metaValue = propertyAdapter.convertToMetaValue(configuration.getSimple(propertyDefinition.getName()),
- propertyDefinition, metaType);
+ propertyDefinition, metaType);
managedProperty.setValue(metaValue);
}
+
}
private static void updateDefaultValueOnPropertyDefinition(
@@ -487,7 +511,7 @@
.getPropertyDefinitions();
if (memberPropDefs.isEmpty())
throw new IllegalStateException(
- "PropertyDefinitionMap doesn't contain any member PropertyDefinitions.");
+ "PropertyDefinitionMap doesn't contain any member PropertyDefinitions."); //$NON-NLS-1$
// NOTE: We assume member prop defs are all of the same type, since
// for MapCompositeMetaTypes, they have to be.
PropertyDefinition mapMemberPropDef = memberPropDefs.values()
@@ -496,7 +520,7 @@
memberMetaType = new MapCompositeMetaType(mapMemberMetaType);
} else {
throw new IllegalStateException(
- "List member PropertyDefinition has unknown type: "
+ "List member PropertyDefinition has unknown type: " //$NON-NLS-1$
+ propDef.getClass().getName());
}
return memberMetaType;
@@ -530,6 +554,59 @@
memberMetaType = SimpleMetaType.resolve(memberClass.getName());
return memberMetaType;
}
+
+ public static SimpleValue wrap(MetaType type, String value) throws Exception {
+ if (type instanceof SimpleMetaType) {
+ SimpleMetaType st = (SimpleMetaType)type;
+
+ if (SimpleMetaType.BIGDECIMAL.equals(st)) {
+ return new SimpleValueSupport(st, new BigDecimal(value));
+ } else if (SimpleMetaType.BIGINTEGER.equals(st)) {
+ return new SimpleValueSupport(st, new BigInteger(value));
+ } else if (SimpleMetaType.BOOLEAN.equals(st)) {
+ return new SimpleValueSupport(st, Boolean.valueOf(value));
+ } else if (SimpleMetaType.BOOLEAN_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Boolean.valueOf(value).booleanValue());
+ } else if (SimpleMetaType.BYTE.equals(st)) {
+ return new SimpleValueSupport(st, new Byte(value.getBytes()[0]));
+ } else if (SimpleMetaType.BYTE_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, value.getBytes()[0]);
+ } else if (SimpleMetaType.CHARACTER.equals(st)) {
+ return new SimpleValueSupport(st, new Character(value.charAt(0)));
+ } else if (SimpleMetaType.CHARACTER_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st,value.charAt(0));
+ } else if (SimpleMetaType.DATE.equals(st)) {
+ try {
+ return new SimpleValueSupport(st, SimpleDateFormat.getInstance().parse(value));
+ } catch (ParseException e) {
+ throw new Exception("Failed to convert value to SimpleValue", e); //$NON-NLS-1$
+ }
+ } else if (SimpleMetaType.DOUBLE.equals(st)) {
+ return new SimpleValueSupport(st, Double.valueOf(value));
+ } else if (SimpleMetaType.DOUBLE_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Double.parseDouble(value));
+ } else if (SimpleMetaType.FLOAT.equals(st)) {
+ return new SimpleValueSupport(st, Float.parseFloat(value));
+ } else if (SimpleMetaType.FLOAT_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Float.valueOf(value));
+ } else if (SimpleMetaType.INTEGER.equals(st)) {
+ return new SimpleValueSupport(st, Integer.valueOf(value));
+ } else if (SimpleMetaType.INTEGER_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Integer.parseInt(value));
+ } else if (SimpleMetaType.LONG.equals(st)) {
+ return new SimpleValueSupport(st, Long.valueOf(value));
+ } else if (SimpleMetaType.LONG_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Long.parseLong(value));
+ } else if (SimpleMetaType.SHORT.equals(st)) {
+ return new SimpleValueSupport(st, Short.valueOf(value));
+ } else if (SimpleMetaType.SHORT_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Short.parseShort(value));
+ } else if (SimpleMetaType.STRING.equals(st)) {
+ return new SimpleValueSupport(st,value);
+ }
+ }
+ throw new Exception("Failed to convert value to SimpleValue"); //$NON-NLS-1$
+ }
}
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-28 04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-28 13:31:10 UTC (rev 2168)
@@ -62,722 +62,7 @@
'>
-<!ENTITY datasourceAndConnectionFactoryOperations '
- <operation name="flush" displayName="Flush"
- description="Flush the connections in the pool"/>
- <operation name="listFormattedSubPoolStatistics" displayName="List Formatted Sub Pool Statistics"
- description="Obtain a formatted sub pool statistics report">
- <parameters>
- <c:simple-property required="false" name="formatClassName"
- defaultValue="org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter">
- <c:description>
- The fully qualified name of the Java class to use to format the the sub pool statistics. The default
- is "org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter".
- </c:description>
- </c:simple-property>
- </parameters>
- <results>
- <c:simple-property name="result" type="longString">
- <c:description>
- A formatted sub pool statistics report.
- </c:description>
- </c:simple-property>
- </results>
- </operation>
-
- <operation name="listStatistics" displayName="List Statistics" description="Obtain a statistics report">
- <results>
- <c:map-property name="result"/>
- </results>
- </operation>
-'>
-
-<!-- TODO: Use one shared XML entity for datasource and connection factory metrics. -->
-<!ENTITY datasourceMetrics '
- <!-- Traits -->
- <metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name"
- defaultOn="true" defaultInterval="60000" dataType="trait" category="performance"
- description="the JNDI name of the connection pool for this datasource"/>
-
- <!-- Numerics -->
- <metric property="availableConnectionCount" measurementType="dynamic" displayType="summary"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
- description="the maximum number of connections that are available"/>
-
- <metric property="connectionCount" measurementType="dynamic" displayType="summary"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
- description="the number of connections that are currently in the pool"/>
-
- <metric property="connectionCreatedCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
- description="the number of connections that have been created since the datasource was last started"/>
-
- <metric property="connectionDestroyedCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
- description="the number of connections that have been destroyed since the datasource was last started"/>
-
- <metric property="inUseConnectionCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
- description="the number of connections that are currently in use"/>
-
- <metric property="local-transaction" displayType="summary"
- defaultOn="true" defaultInterval="60000" dataType="trait" category="performance"/>
-
- <metric property="maxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
- description="the most connections that have been simultaneously in use since this datasource was started"/>
-
- <metric property="maxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
-
- <metric property="minSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
-'>
-
-<!-- NOTE: For Datasource ManagedProperty annotations, see:
- https://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jbos...
- Descriptions of datasource config props can also be culled from the following locations:
- https://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/resources/dtd...
- http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Ad...
- http://www.jboss.org/community/wiki/ConfigDataSources
- http://www.jboss.org/community/wiki/ConfigJCACommon
- -->
-
-<!ENTITY datasourceAndConnectionFactoryConnectionResourceConfigProps '
- <c:simple-property name="min-pool-size"
- displayName="Minimum Pool Size"
- type="integer"
- required="false"
- defaultValue="0">
- <c:description>
- The minimum number of connections the pool should hold. The default is 0.
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-
- <c:simple-property name="max-pool-size"
- displayName="Maximum Pool Size"
- type="integer"
- required="false"
- defaultValue="10">
- <c:description>
- The maximum number of connections the pool should hold. The default is 10.
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-'>
-
-<!ENTITY datasourceConnectionResourceConfigProps '
- <c:simple-property name="jndi-name"
- displayName="JNDI Name"
- description="The global JNDI Name under which to bind the datasource"
- type="string"/>
-
- <c:simple-property name="user-name"
- displayName="Username"
- description="The default username when creating a new connection."
- type="string"
- activationPolicy="immediate"
- required="false"/>
-
- <c:simple-property name="password"
- displayName="Password"
- description="The default password when creating a new connection."
- type="password"
- activationPolicy="immediate"
- required="false"/>
-'>
-
-<!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>
-'>
-
-<!ENTITY datasourceAdvancedResourceConfigProps '
- <c:simple-property name="check-valid-connection-sql" type="longString"
- displayName="Check Valid Connection SQL" required="false">
- <c:description>The SQL statement to use to check the validity of a pool connection.</c:description>
- </c:simple-property>
-
- <c:simple-property required="false" name="connection-definition">
- <c:description>
- The connection definition inside the RAR deployment uniquely identified by the connection factory interface,
- e.g. "javax.sql.DataSource".
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="exception-sorter-class-name" type="string" activationPolicy="immediate"
- displayName="Exception Sorter Class Name" required="false">
- <c:description>
- The fully qualified name of a Java class to use to check if an exception should be broadcast.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="new-connection-sql" type="longString" activationPolicy="immediate"
- displayName="New Connection SQL" required="false">
- <c:description>
- An SQL statement to execute whenever a new connection is added to the pool; this can be used to set the
- connection schema, etc.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="prepared-statement-cache-size" type="integer"
- displayName="Prepared Statement Cache Size" required="false" defaultValue="0">
- <c:description>
- The number of prepared statements per connection to be kept open and reused in subsequent requests. They are
- stored in an LRU cache. Set to 0 to disable the cache. The default is 0.
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-
- <c:simple-property name="query-timeout"
- displayName="Query Timeout"
- type="integer"
- units="seconds"
- required="false">
- <c:description>
- Any configured query timeout in seconds. A value of 0 means no timeout. The default is 0.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="rar-name" required="false">
- <c:description>
- The RAR deployment to associate with the connection manager MBean. e.g. jms-ra.rar or
- myapplication.ear#my.rar for nested rars.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="set-tx-query-timeout"
- displayName="Set Tx Query Timeout"
- type="boolean"
- required="false"
- defaultValue="false">
- <c:description>
- Whether to set the query timeout based on the time remaining until transaction timeout;
- any configured query timeout will be used if there is no transaction. The default is No.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="share-prepared-statements" displayName="Share Prepared Statements"
- type="boolean"
- required="false" defaultValue="false">
- <c:description>
- Should prepared statements be shared? The default is No.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="stale-connection-checker-class-name"
- displayName="Stale Connection Checker Class Name"
- type="string"
- required="false">
- <c:description>
- Fully qualified name of the Java class used to check if a connection has become stale.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="track-statements" type="string"
- displayName="Track Statements" required="false">
- <c:description>
- Whether to check for unclosed Statements and ResultSets when connections are returned to the pool. The
- default is "yes-no-warnings".
- </c:description>
- <c:property-options>
- <c:option name="No" value="no"/>
- <c:option name="Yes" value="yes"/>
- <c:option name="Yes, but no warnings" value="yes-no-warnings" default="true"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="transaction-isolation" required="false"
- description="The Transaction Isolation level. The default setting is to use whichever isolation level is provided by default by the database.">
- <c:property-options>
- <c:option value="TRANSACTION_READ_UNCOMMITTED" name="Read Uncommitted"/>
- <c:option value="TRANSACTION_READ_COMMITTED" default="true" name="Read Committed"/>
- <c:option value="TRANSACTION_REPEATABLE_READ" name="Repeatable Read"/>
- <c:option value="TRANSACTION_SERIALIZABLE" name="Serializable"/>
- <c:option value="TRANSACTION_NONE" name="None"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="url-delimiter" required="false">
- <c:description>
- Specifies the delimiter for URLs in connection-url for HA datasources.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="url-selector-strategy-class-name" required="false">
- <c:description>
- The fully qualified class name of a class that implements the
- org.jboss.resource.adapter.jdbc.URLSelectorStrategy interface.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="use-try-lock" type="long" required="false" defaultValue="0">
- <c:description>
- Any configured timeout, in milliseconds, for internal locks on the resource adapter objects. A value of 0
- means no timeout. The default is 0.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="valid-connection-checker-class-name" type="string"
- displayName="Valid Connection Checker Class Name" required="false">
- <c:description>
- Fully qualified name of the Java class used to validate if a connection is valid.
- </c:description>
- </c:simple-property>
-'>
-
-<!ENTITY nonXaDatasourceConnectionResourceConfigProps '
- <c:simple-property name="driver-class"
- displayName="JDBC Driver Class"
- description="The fully qualified name of the JDBC driver class."
- type="string"
- activationPolicy="immediate"/>
-
- <c:simple-property name="connection-url"
- displayName="Connection URL"
- description="The JDBC driver URL string."
- type="string"
- activationPolicy="immediate"/>
-
- <c:map-property name="connection-properties" required="false"
- description="Arbitrary connection properties that should be passed to the java.sql.Driver.connect(url, props) method."/>
-'>
-
-<!ENTITY nonXaDatasourceOracleTemplateProps '
- <c:simple-property name="driver-class" default="oracle.jdbc.driver.OracleDriver"/>
- <c:simple-property name="connection-url" default="jdbc:oracle:oci:@youroracle-tns-name"/>
- <c:simple-property name="exception-sorter-class-name"
- default="org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter"/>
- <c:simple-property name="check-valid-connection-sql" default="SELECT * FROM DUAL"/>
- <c:simple-property name="type-mapping" default="oracle.jdbc.driver.OracleDriver"/>
- <c:simple-property name="use-try-lock" default="60000"/>
- <c:map-property name="metadata">
- <c:simple-property name="typeMapping" default="Oracle9i"/>
- </c:map-property>
- <c:simple-property name="type-mapping" default="Oracle9i"/>
-'>
-
-<!--
- See:
- https://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jbos...
- http://www.jboss.org/community/wiki/ConfigJCACommon
- -->
-
-<!ENTITY connectionFactoryConnectionResourceConfigProps '
- <c:simple-property required="true" name="jndi-name" displayName="JNDI Name"
- description="The global JNDI name to bind the connection factory under."/>
-
- <c:simple-property required="true" name="rar-name" displayName="RAR Name">
- <c:description>
- The name of the RAR file that contains the definition for the resource we want to provide. For nested RAR
- files, the name would look like myapplication.ear#my.rar.
- </c:description>
- </c:simple-property>
-
- <c:simple-property required="true" name="connection-definition">
- <c:description>
- The connection factory interface class. It should match the connectionfactory-interface in the ra.xml file.
- </c:description>
- </c:simple-property>
-
-'>
-
-
-<!ENTITY connectionFactoryAdvancedResourceConfigProps '
- <c:list-property required="false" name="config-property">
- <c:description>
- Properties to supply to the ManagedConnectionFactory (MCF) MBean service configuration.
- </c:description>
- <c:map-property name="config-property">
- <c:simple-property name="name" description="The name of the configuration property." />
- <c:simple-property name="type" description="The type of the configuration property.">
- <c:property-options>
- <c:option value="java.lang.String" default="true"/>
- <c:option value="java.lang.Boolean"/>
- <c:option value="java.lang.Integer"/>
- <c:option value="java.lang.Double"/>
- <c:option value="java.lang.Byte"/>
- <c:option value="java.lang.Short"/>
- <c:option value="java.lang.Long"/>
- <c:option value="java.lang.Float"/>
- <c:option value="java.lang.Character"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="value" required="false" description="The value of the configuration property." />
- </c:map-property>
- </c:list-property>
-'>
-
-<!ENTITY connectionFactoryMetrics '
- <!-- Traits -->
- <metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name" defaultOn="true"
- defaultInterval="600000" dataType="trait" category="performance"/>
-
- <!-- Numerics -->
- <metric property="availableConnectionCount" measurementType="dynamic" displayType="summary"
- displayName="Available Connection Count" description="Number of available connections."
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
-
- <metric property="connectionCount" measurementType="dynamic" displayType="summary"
- displayName="Connection Count" defaultOn="true" defaultInterval="60000" dataType="measurement"
- category="performance"/>
-
- <metric property="connectionCreatedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Created Count" defaultOn="true" defaultInterval="60000"
- dataType="measurement" category="performance"/>
-
- <metric property="connectionDestroyedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Destroyed Count" defaultOn="true" defaultInterval="60000"
- dataType="measurement" category="performance"/>
-
- <metric property="inUseConnectionCount" measurementType="dynamic" displayType="detail"
- displayName="In Use Connection Count" description="Mumber of connections currently in use."
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
-
- <metric property="maxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
- displayName="Max Connections In Use Count" description="Maximum number of maximum connections that have been in use."
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
-
- <metric property="maxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
-
- <metric property="minSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
-'>
-
-<!-- These are the operations that both Topics and Queues have. -->
-<!ENTITY destinationOperations '
- <operation name="removeAllMessages" displayName="Remove All Messages" description="Remove all messages from the destination."/>
-
- <operation name="start" displayName="Start" description="Start the destination."/>
-
- <operation name="stop" displayName="Stop" description="Stop the destination."/>
-'>
-
-<!ENTITY deploymentResourceConfigProps '
- <c:simple-property type="boolean" required="false" name="blackList"/>
- <c:simple-property type="boolean" required="false" name="cache"/>
- <c:simple-property required="false" name="domain"/>
- <c:simple-property required="false" name="excluded"/>
- <c:simple-property required="false" name="excludedExport"/>
- <c:simple-property required="false" name="exportAll">
- <c:property-options>
- <c:option name="all" value="ALL"/>
- <c:option name="non-empty" value="NON_EMPTY"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property type="boolean" required="false" name="importAll"/>
- <c:simple-property required="false" name="included"/>
- <c:simple-property required="false" name="name"/>
- <c:simple-property required="false" name="parentDomain"/>
- <c:simple-property type="boolean" required="false" name="parentFirst"/>
- <c:simple-property required="false" name="version"/>
-'>
-
-<!--<c:simple-property name="deployDirectory" type="string" required="true" default="deploy"
- description="Path of the directory where the EAR should be deployed (e.g. "deploy" or "farm") - relative to the AS configuration set directory (e.g. /opt/jboss-5.1.0.CR1/server/default)."/>-->
-
-<!ENTITY deploymentContentConfigProps '
- <configuration>
- <c:group name="deployment" displayName="Deployment Options">
- <c:simple-property name="deployExploded" type="boolean" required="true" default="false"
- description="Should the archive be deployed in exploded form (i.e. as a directory)"/>
- </c:group>
- </configuration>
-'>
-
-<!ENTITY webApplicationMetrics '
- <metric property="contextRoot"
- dataType="trait" displayType="summary"
- description="this context root of this WAR - used as a unique path prefix for URLs corresponding to this WAR"/>
-
- <metric property="virtualHosts"
- dataType="trait" displayType="summary"
- description="the virtual hosts to which this WAR is deployed"/>
-'>
-
-<!ENTITY webApplicationContextMetrics '
- <metric property="virtualHost"
- dataType="trait" displayType="summary"
- description="the virtual host with which this context is associated"/>
-
- <!--
- <metric property="responseTime"
- dataType="calltime" defaultOn="false" units="milliseconds" destinationType="URL"
- description="the minimum, maximum, and average response times for requests serviced by this webapp"/>
- -->
-
- <metric property="activeSessions"
- displayName="Currently Active Sessions"
- units="none" description="the number of sessions that are currently active for this WAR" />
-
- <metric property="maxActive" displayName="Maximum Active Sessions"
- units="none" description="the maximum number of sessions that have been active for this WAR" />
-
- <metric property="sessionCounter" displayName="Created Sessions"
- units="none" description="the number of sessions created for this WAR"
- measurementType="trendsup" />
-
- <metric property="expiredSessions" displayName="Expired Sessions"
- units="none" description="the number of expired sessions for this WAR"
- measurementType="trendsup" />
-
- <metric property="rejectedSessions" displayName="Rejected Sessions"
- units="none" description="the number of sessions rejected for this WAR"
- measurementType="trendsup" />
-
- <metric property="sessionAverageAliveTime" displayName="Average Session Alive Time"
- units="seconds" description="the average alive time of sessions for this WAR" />
-
- <metric property="sessionMaxAliveTime" displayName="Max Session Alive Time"
- units="seconds" description="the maximum alive time of sessions for this WAR" />
-
- <metric property="Servlet.minimumResponseTime" displayName="Minimum Response Time"
- units="milliseconds"
- description="the minimum response time for requests serviced by this WAR"/>
-
- <metric property="Servlet.averageResponseTime" displayName="Average Response Time"
- units="milliseconds"
- description="the average response time for requests serviced by this WAR"/>
-
- <metric property="Servlet.maximumResponseTime" displayName="Maximum Response Time"
- units="milliseconds"
- description="the maximum response time for requests serviced by this WAR"/>
-
- <metric property="Servlet.totalResponseTime" displayName="Total Response Time"
- units="milliseconds" measurementType="trendsup"
- description="the total response time for requests serviced by this WAR"/>
-
- <metric property="Servlet.requestCount" displayName="Number of Requests Serviced"
- units="none" description="the number of requests serviced by this WAR"
- measurementType="trendsup" displayType="summary"/>
-
- <metric property="Servlet.errorCount" displayName="Number of Error Responses"
- units="none" description="the number of error responses sent by this WAR"
- measurementType="trendsup" displayType="summary"/>
-'>
-
]>
<!--
@@ -981,132 +266,111 @@
</c:constraint>
</c:simple-property>
</c:group>
- <c:group name="teiidProperties" displayName="Teiid Properties"
+ <c:group name="teiidProperties" displayName="Runtime Engine 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 Milliseconds"
- 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 Per Table"
- 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: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="false" />
+ <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="false" />
+ <c:simple-property name="codeTablesMaxRows"
+ displayName="Code Tables Max Rows"
+ description="Maximum number of records in all lookup tables (default 200000)"
+ required="false" readOnly="false" />
+ <c:simple-property name="processName" displayName="Process Name"
+ description="Name that uniquely identifies this process" required="false"
+ readOnly="false" />
+ <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="false" />
+ <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="false" />
+ <c:simple-property name="timeSliceInMilli"
+ displayName="Time Slice In Milliseconds"
+ description="Query processor time slice, in milliseconds. (default 2000)"
+ required="false" readOnly="false" />
+ <c:simple-property name="processDebugAllowed"
+ displayName="Process Debug Allowed" description="True if process debug allowed"
+ required="false" readOnly="false" />
+ <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="false" />
+ <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="false" />
+ <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="false" type="boolean" />
+ <c:simple-property name="codeTablesMaxRowsPerTable"
+ displayName="Code Tables Max Rows Per Table"
+ description="Maximum number of records in all lookup tables (default 200000)"
+ required="false" readOnly="false" />
+ <c:simple-property name="activeSessionsCount"
+ displayName="Active Session Count" description="Count of active sessions"
+ required="false" readOnly="false" />
</c:group>
+ <c:group name="bufferServiceProperties" displayName="Buffer Service Properties"
+ hiddenByDefault="false">
+ <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="false" />
+ <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="false" />
+ <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="false" />
+ <c:simple-property name="maxFileSize" displayName="Max File Size"
+ description="Max file size for buffer files (default 2GB)"
+ required="false" readOnly="false" />
+ <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="false" />
+ </c:group>
+ <c:group name="jdbcSocketConfigurationProperties"
+ displayName="Jdbc Socket Configuration Properties" hiddenByDefault="false">
+ <c:simple-property name="portNumber" displayName="Port Number"
+ description="Port Number" required="false" readOnly="false" />
+ <c:simple-property name="enabled" displayName=" SSL Enabled"
+ description="SSL enabled" required="false" readOnly="false" type="boolean"
+ default="true" />
+ <c:simple-property name="hostName" displayName="Host Name"
+ description="Host Name" required="false" readOnly="false" />
+ <c:simple-property name="maxSocketThreads"
+ displayName="Max Socket Threads" description="Max NIO threads"
+ required="false" readOnly="false" />
+ <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="false" />
+ <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="false" />
+ </c:group>
+ <c:group name="sessionServiceProperties" displayName="Session Service Properties"
+ hiddenByDefault="false">
+ <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="false" />
+ <c:simple-property name="sessionMaxLimit"
+ displayName="Session Max Limit"
+ description="Maximum number of sessions allowed by the system (default 5000)"
+ required="false" readOnly="false" />
+ </c:group>
</resource-configuration>
<service name="Virtual Database (VDB)s" description="Teiid Data Services Virtual Databases"
@@ -1194,11 +458,13 @@
<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" readOnly="true" />
<c:simple-property name="version" type="string"
- description="The Virtual Database Version" required="false" />
+ description="The Virtual Database Version" required="false"
+ readOnly="true" />
<c:simple-property name="description" type="string"
- description="The Virtual Database Description" required="false" />
+ description="The Virtual Database Description" required="false"
+ readOnly="true" />
<c:simple-property name="status" type="string"
description="The Virtual Database Status" required="false"
summary="true">
@@ -1208,12 +474,12 @@
</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" readOnly="true" />
</c:group>
<c:group name="Models" displayName="Models" hiddenByDefault="false">
- <c:list-property name="sourceModels" readOnly="true"
+ <c:list-property name="singleSourceModels" readOnly="true"
description="The source models for this VDB">
- <c:map-property name="model">
+ <c:map-property name="map" description="Properties for this model">
<c:simple-property name="name" displayName="Name"
description="Name of the model" required="true" readOnly="true" />
<c:simple-property name="sourceName"
@@ -1226,38 +492,40 @@
description="JNDI name for this connection" required="false" />
<c:simple-property name="visibility"
displayName="Visible" description="Visibility of the model"
- required="true" type="boolean">
+ required="true" type="boolean" readOnly="true">
</c:simple-property>
<c:simple-property name="supportsMultiSource"
displayName="Supports Multi-source?"
description="Determines if this model supports multi-source bindings"
- required="true" default="true" type="boolean" />
+ required="true" default="true" type="boolean" readOnly="true"/>
</c:map-property>
</c:list-property>
- <c:list-property name="multisourceModels"
+ <c:list-property name="multiSourceModels"
description="The multi-source model sources for this VDB">
- <c:map-property name="model">
+ <c:map-property name="map" readOnly="false">
<c:simple-property name="name" displayName="Name"
- description="Name of the model" required="true" />
+ description="Name of the model" required="true" readOnly="true" />
<c:simple-property name="sourceName"
- displayName="Source Name" description="Source name for this model" />
- <c:simple-property name="jndiName"
- displayName="Connector Binding JNDI Name" description="JNDI name for this connector binding"
- required="false" />
+ displayName="Source Name" description="Source name for this model" readOnly="true"/>
+ <c:simple-property name="translatorName"
+ displayName="Translator Name" description="Name of the translator"
+ required="true" />
+ <c:simple-property name="jndiName" displayName="Connection JNDI Name"
+ description="JNDI name for this connection" required="false" />
</c:map-property>
</c:list-property>
<c:list-property name="logicalModels" readOnly="true"
description="The logical models for this VDB">
- <c:map-property name="model">
+ <c:map-property name="map">
<c:simple-property name="name" displayName="Name"
- description="Name of the model" required="true" />
+ description="Name of the model" required="true" readOnly="true" />
<c:simple-property name="type" displayName="Type"
- description="type of logical model" required="true" />
+ description="type of logical model" required="true" readOnly="true" />
<c:simple-property name="visibility"
displayName="Visible" description="Visbility of the model"
- required="true" default="true" />
+ required="true" default="true" readOnly="true"/>
</c:map-property>
</c:list-property>
</c:group>
14 years, 7 months
teiid SVN: r2167 - trunk/engine/src/test/java/org/teiid/common/buffer.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-05-28 00:39:38 -0400 (Fri, 28 May 2010)
New Revision: 2167
Modified:
trunk/engine/src/test/java/org/teiid/common/buffer/TestTupleBuffer.java
Log:
TEIID-913 ensuring that even if the batch contents are not added that lob references are still captured
Modified: trunk/engine/src/test/java/org/teiid/common/buffer/TestTupleBuffer.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/common/buffer/TestTupleBuffer.java 2010-05-28 04:34:24 UTC (rev 2166)
+++ trunk/engine/src/test/java/org/teiid/common/buffer/TestTupleBuffer.java 2010-05-28 04:39:38 UTC (rev 2167)
@@ -92,7 +92,7 @@
List<ElementSymbol> schema = Arrays.asList(x);
TupleBuffer tb = new TupleBuffer(new FakeBatchManager(), "x", schema, 32); //$NON-NLS-1$
ClobType c = new ClobType(new SerialClob(new char[0]));
- TupleBatch batch = new TupleBatch(0, new List[] {Arrays.asList(c)});
+ TupleBatch batch = new TupleBatch(1, new List[] {Arrays.asList(c)});
tb.addTupleBatch(batch, false);
assertNotNull(c.getReferenceStreamId());
}
14 years, 7 months
teiid SVN: r2166 - in trunk: build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio and 11 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-05-28 00:34:24 -0400 (Fri, 28 May 2010)
New Revision: 2166
Added:
trunk/build/kits/jboss-container/teiid-examples/portfolio/data/
trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price.txt
trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt
trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt
trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/
trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java
trunk/connectors/translator-file/src/test/resources/file.txt
trunk/connectors/translator-file/src/test/resources/file1.txt
Removed:
trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-def.txt
trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt
trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-text-translator.xml
trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt
trunk/connectors/translator-file/src/test/java/org/teiid/translator/text/
trunk/engine/src/test/java/org/teiid/query/sql/lang/TestJDBCExecutionHelper.java
Modified:
trunk/api/src/main/java/org/teiid/metadata/Datatype.java
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml
trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt
trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-file-ds.xml
trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java
trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestSelectSymbolImpl.java
trunk/test-integration/common/src/test/resources/system/expected/DataTypes.txt
Log:
TEIID-1102 removing the text translator in favor of the file translator - updating dynamic vdb example
Modified: trunk/api/src/main/java/org/teiid/metadata/Datatype.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/Datatype.java 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/api/src/main/java/org/teiid/metadata/Datatype.java 2010-05-28 04:34:24 UTC (rev 2166)
@@ -28,7 +28,8 @@
public class Datatype extends AbstractMetadataRecord {
private static final long serialVersionUID = -7839335802224393230L;
-
+ private static final String OLD_PACKAGE = "com.metamatrix.common."; //$NON-NLS-1$
+
public enum Type {
Basic,
UserDefined,
@@ -185,6 +186,12 @@
* @param string
*/
public void setJavaClassName(String string) {
+ if (string != null) {
+ int index = string.indexOf(OLD_PACKAGE);
+ if (index == 0) {
+ string = "org.teiid.core." + string.substring(OLD_PACKAGE.length()); //$NON-NLS-1$
+ }
+ }
javaClassName = string;
}
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2010-05-28 04:34:24 UTC (rev 2166)
@@ -4,13 +4,12 @@
- portfolio-dynamic-vdb.xml
- ../portfolio/marketdata-file-ds.xml
- ../portfolio/portfolio-ds.xml
- - ../portfolio/marketdata-text-translator.xml
Start the JBoss Container
-Use the simple client example run script i.e.
+Use the simple client example run script e.g.
-$run.sh localhost 31000 dynamicportfolio "select * from product, price where product.symbol=price.symbol"
+$./run.sh localhost 31000 dynamicportfolio "select * from product, (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) price where product.symbol=price.symbol"
That will execute the query against both Derby and the text file using the
connector supplied metadata.
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-dynamic-vdb.xml 2010-05-28 04:34:24 UTC (rev 2166)
@@ -23,11 +23,11 @@
-->
<model name="MarketData">
<!--
- Each of source represents translator and data source reading and writing data. There are pre-defined translators or
- you can create one. They are defined using "-translator.xml" file. Connections define connections
- to physical sources. In JBoss AS they are typically defined using "xxx-ds.xml" files.
+ Each source represents a translator and data source. There are
+ pre-defined translators, or you can create one. ConnectionFactories
+ or DataSources in JBoss AS they are typically defined using "xxx-ds.xml" files.
-->
- <source name="text-connector" translator-name="marketdata-text" connection-jndi-name="java:marketdata-text-connection"/>
+ <source name="text-connector" translator-name="file" connection-jndi-name="java:marketdata-file"/>
</model>
<model name="Accounts">
Modified: trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/README.txt 2010-05-28 04:34:24 UTC (rev 2166)
@@ -9,7 +9,6 @@
Copy the Translators/ConnectionFactories for the example to the "<jboss home>/server/default/deploy" directory.
- marketdata-file-ds.xml
- portfolio-ds.xml
- - marketdata-text-translator.xml
Start the JBoss Container
Copied: trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price.txt (from rev 2160, trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt)
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price.txt (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price.txt 2010-05-28 04:34:24 UTC (rev 2166)
@@ -0,0 +1,11 @@
+SYMBOL,PRICE
+RHT 30.00
+BA,42.75
+MON,78.75
+ORCL,16.54
+SY,24.30
+MSFT,20.60
+IBM,80.89
+DELL,10.75
+HPQ,31.52
+GE,16.45
Added: trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt 2010-05-28 04:34:24 UTC (rev 2166)
@@ -0,0 +1,10 @@
+SYMBOL,PRICE
+MRK,27.20
+DIS,20.53
+MCD,54.55
+DOW,21.80
+GM,3.15
+SBGI,2.19
+COLM,33.89
+COLB,12.64
+BSY,23.81
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-container/teiid-examples/portfolio/data/marketdata-price1.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-def.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-def.txt 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-def.txt 2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,6 +0,0 @@
-MarketData.Price.location = marketdata-price.txt
-MarketData.Price.delimiter = ,
-MarketData.Price.headerLine = 1
-MarketData.Price.skipHeaderLines = 1
-MarketData.Price.columns=SYMBOL,PRICE
-MarketData.Price.types=string,bigdecimal
Modified: trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-file-ds.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-file-ds.xml 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-file-ds.xml 2010-05-28 04:34:24 UTC (rev 2166)
@@ -11,7 +11,7 @@
file mentioned above.
-->
- <config-property name="ParentDirectory" type="java.lang.String">${jboss.server.home.dir}/teiid-examples/portfolio</config-property>
+ <config-property name="ParentDirectory" type="java.lang.String">${jboss.server.home.dir}/teiid-examples/portfolio/data</config-property>
<max-pool-size>20</max-pool-size>
Deleted: trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-price.txt 2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,20 +0,0 @@
-SYMBOL,PRICE
-BA,42.75
-MON,78.75
-ORCL,16.54
-SY,24.30
-MSFT,20.60
-IBM,80.89
-DELL,10.75
-HPQ,31.52
-GE,16.45
-MRK,27.20
-DIS,20.53
-MCD,54.55
-DOW,21.80
-GM,3.15
-JAVA,3.79
-SBGI,2.19
-COLM,33.89
-COLB,12.64
-BSY,23.81
\ No newline at end of file
Deleted: trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-text-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-text-translator.xml 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/portfolio/marketdata-text-translator.xml 2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<translator-factory>
- <translator>
- <name>text</name>
- <execution-factory-class>org.teiid.translator.text.TextExecutionFactory</execution-factory-class>
- <template-name>translator-text-${project.version}</template-name>
- <translator-property name="DescriptorFile" value="file://${jboss.server.home.dir}/teiid-examples/portfolio/marketdata-def.txt"/>
- </translator>
-</translator-factory>
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
===================================================================
(Binary files differ)
Modified: trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.java 2010-05-28 04:34:24 UTC (rev 2166)
@@ -29,6 +29,7 @@
import org.teiid.jdbc.TeiidDataSource;
import org.teiid.jdbc.TeiidStatement;
+@SuppressWarnings("nls")
public class JDBCClient {
public static void main(String[] args) throws Exception {
if (args.length < 4) {
@@ -39,7 +40,7 @@
System.out.println("Executing using the TeiidDriver");
execute(getDriverConnection(args[0], args[1], args[2]), args[3]);
- System.out.println("");
+ System.out.println("-----------------------------------");
System.out.println("Executing using the TeiidDataSource");
// this is showing how to make a Data Source connection.
execute(getDataSourceConnection(args[0], args[1], args[2]), args[3]);
@@ -73,15 +74,14 @@
ResultSetMetaData metadata = results.getMetaData();
int columns = metadata.getColumnCount();
-
- while(results.next()) {
+ System.out.println("Results");
+ for (int row = 1; results.next(); row++) {
+ System.out.println(row + ": ");
for (int i = 0; i < columns; i++) {
System.out.print(results.getString(i+1));
System.out.print(",");
}
- System.out.println("");
}
-
System.out.println("Query Plan");
System.out.println(statement.unwrap(TeiidStatement.class).getPlanDescription());
Copied: trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt (from rev 2160, trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt)
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt 2010-05-28 04:34:24 UTC (rev 2166)
@@ -0,0 +1,11 @@
+JDBCClient.java shows making connections to Teiid in embedded mode through both a Driver
+and a DataSource.
+
+The program expects four arguments <host> <port> <vdb> <sql-command>. There are helper run scripts
+that can be run as follows:
+
+$./run.sh localhost 31000 portfolio "select * from CustomerAccount"
+
+Note that the query is in quotes so that it is understood as a single argument.
+
+See the other examples for deployable .vdb and .xml files to create vdbs.
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-container/teiid-examples/simpleclient/README.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/build/kits/jboss-container/teiid-examples/simpleclient/readme.txt 2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,11 +0,0 @@
-JDBCClient.java shows making connections to Teiid in embedded mode through both a Driver
-and a DataSource.
-
-The program expects four arguments <host> <port> <vdb> <sql-command>. There are helper run scripts
-that can be run as follows:
-
-$run.sh localhost 31000 portfolio "select * from CustomerAccount"
-
-Note that the query is in quotes so that it is understood as a single argument.
-
-See the other examples for deployable .vdb and .xml files to create vdbs.
\ No newline at end of file
Modified: trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
===================================================================
--- trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2010-05-28 04:34:24 UTC (rev 2166)
@@ -73,7 +73,7 @@
@Override
public void execute() throws TranslatorException {
- FileConnection.Util.getFiles((String)command.getArguments().get(0).getArgumentValue().getValue(), fc);
+ files = FileConnection.Util.getFiles((String)command.getArguments().get(0).getArgumentValue().getValue(), fc);
String name = command.getProcedureName();
if (name.equalsIgnoreCase(GETTEXTFILES)) {
isText = true;
@@ -102,7 +102,7 @@
return null;
}
ArrayList<Object> result = new ArrayList<Object>(2);
- final File file = files[index];
+ final File file = files[index++];
FileInputStreamFactory isf = new FileInputStreamFactory(file, encoding);
isf.setLength(file.length());
Object value = null;
Copied: trunk/connectors/translator-file/src/test/java/org/teiid/translator/file (from rev 2160, trunk/connectors/translator-file/src/test/java/org/teiid/translator/text)
Added: trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java
===================================================================
--- trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java 2010-05-28 04:34:24 UTC (rev 2166)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.file;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.Arrays;
+
+import javax.resource.cci.ConnectionFactory;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.teiid.core.util.UnitTestUtil;
+import org.teiid.language.Argument;
+import org.teiid.language.Call;
+import org.teiid.language.Literal;
+import org.teiid.language.Argument.Direction;
+import org.teiid.translator.FileConnection;
+import org.teiid.translator.ProcedureExecution;
+import org.teiid.translator.TypeFacility;
+
+@SuppressWarnings("nls")
+public class TestFileExecutionFactory {
+
+ @Test public void testGetTextFiles() throws Exception {
+ FileExecutionFactory fef = new FileExecutionFactory();
+ ConnectionFactory cf = Mockito.mock(ConnectionFactory.class);
+ FileConnection fc = Mockito.mock(FileConnection.class);
+ Mockito.stub(cf.getConnection()).toReturn(fc);
+ Mockito.stub(fc.getFile("*.txt")).toReturn(new File(UnitTestUtil.getTestDataPath(), "*.txt"));
+ Call call = fef.getLanguageFactory().createCall("getTextFiles", Arrays.asList(new Argument(Direction.IN, new Literal("*.txt", TypeFacility.RUNTIME_TYPES.STRING), TypeFacility.RUNTIME_TYPES.STRING, null)), null);
+ ProcedureExecution pe = fef.createProcedureExecution(call, null, null, cf);
+ pe.execute();
+ int count = 0;
+ while (true) {
+ if (pe.next() == null) {
+ break;
+ }
+ count++;
+ }
+ assertEquals(2, count);
+ }
+
+}
Property changes on: trunk/connectors/translator-file/src/test/java/org/teiid/translator/file/TestFileExecutionFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/connectors/translator-file/src/test/resources/file.txt
===================================================================
Property changes on: trunk/connectors/translator-file/src/test/resources/file.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/connectors/translator-file/src/test/resources/file1.txt
===================================================================
Property changes on: trunk/connectors/translator-file/src/test/resources/file1.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java 2010-05-28 04:34:24 UTC (rev 2166)
@@ -122,7 +122,7 @@
}
}
if (result.isEmpty()) {
- throw new QueryMetadataException(name+TransformationMetadata.NOT_EXISTS_MESSAGE);
+ throw new QueryMetadataException(name.substring(1)+TransformationMetadata.NOT_EXISTS_MESSAGE);
}
return result;
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestSelectSymbolImpl.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestSelectSymbolImpl.java 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestSelectSymbolImpl.java 2010-05-28 04:34:24 UTC (rev 2166)
@@ -22,11 +22,16 @@
package org.teiid.dqp.internal.datamgr.language;
+import java.util.ArrayList;
+import java.util.List;
+
import junit.framework.TestCase;
import org.teiid.core.types.DataTypeManager;
import org.teiid.language.ColumnReference;
import org.teiid.language.DerivedColumn;
+import org.teiid.language.Literal;
+import org.teiid.language.Select;
public class TestSelectSymbolImpl extends TestCase {
@@ -56,5 +61,18 @@
public void testGetExpression() throws Exception {
assertNotNull(example("testName", null).getExpression()); //$NON-NLS-1$
}
+
+ public void testGetColumnDataTypes(){
+ Class<?>[] expectedResults = new Class[2];
+ List<DerivedColumn> symbols = new ArrayList<DerivedColumn>();
+ symbols.add(new DerivedColumn("c1", new Literal("3", DataTypeManager.DefaultDataClasses.STRING))); //$NON-NLS-1$//$NON-NLS-2$
+ expectedResults[0] = DataTypeManager.DefaultDataClasses.STRING;
+ symbols.add(new DerivedColumn("c2", new Literal(new Integer(5), DataTypeManager.DefaultDataClasses.INTEGER))); //$NON-NLS-1$
+ expectedResults[1] = DataTypeManager.DefaultDataClasses.INTEGER;
+ Select query = new Select(symbols, false, null, null, null, null, null);
+ Class<?>[] results = query.getColumnTypes();
+ assertEquals( results[0], expectedResults[0]);
+ assertEquals( results[1], expectedResults[1]);
+ }
}
Deleted: trunk/engine/src/test/java/org/teiid/query/sql/lang/TestJDBCExecutionHelper.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/sql/lang/TestJDBCExecutionHelper.java 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/engine/src/test/java/org/teiid/query/sql/lang/TestJDBCExecutionHelper.java 2010-05-28 04:34:24 UTC (rev 2166)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.query.sql.lang;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.teiid.core.types.DataTypeManager;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Literal;
-import org.teiid.language.Select;
-
-
-public class TestJDBCExecutionHelper extends TestCase{
-
- public TestJDBCExecutionHelper(String name) {
- super(name);
- }
-
- //tests
- public void testGetColumnDataTypes(){
- Class[] expectedResults = new Class[2];
- List symbols = new ArrayList();
- symbols.add(new DerivedColumn("c1", new Literal("3", DataTypeManager.DefaultDataClasses.STRING))); //$NON-NLS-1$//$NON-NLS-2$
- expectedResults[0] = DataTypeManager.DefaultDataClasses.STRING;
- symbols.add(new DerivedColumn("c2", new Literal(new Integer(5), DataTypeManager.DefaultDataClasses.INTEGER))); //$NON-NLS-1$//$NON-NLS-2$
- expectedResults[1] = DataTypeManager.DefaultDataClasses.INTEGER;
- Select query = new Select(symbols, false, null, null, null, null, null);
- Class[] results = query.getColumnTypes();
- assertEquals( results[0], expectedResults[0]);
- assertEquals( results[1], expectedResults[1]);
- }
-
-}
Modified: trunk/test-integration/common/src/test/resources/system/expected/DataTypes.txt
===================================================================
--- trunk/test-integration/common/src/test/resources/system/expected/DataTypes.txt 2010-05-28 04:11:05 UTC (rev 2165)
+++ trunk/test-integration/common/src/test/resources/system/expected/DataTypes.txt 2010-05-28 04:34:24 UTC (rev 2166)
@@ -10,16 +10,16 @@
NOTATION false false NOTATION java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:3dcaf900-e8dc-1e2a-b433-fb67ea35c07e string anySimpleType null
Name false false Name java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:e66c4600-e65b-1e20-8c26-a038c6ed7576 string token null
QName false false QName java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:eeb5d780-e8c3-1e2a-b433-fb67ea35c07e string anySimpleType null
-XMLLiteral false false XMLLiteral com.metamatrix.common.types.XMLType 0 0 No Nulls false false false 0 0 Searchable mmuuid:43f5274e-55e1-1f87-ba1c-eea49143eb32 xml string null
+XMLLiteral false false XMLLiteral org.teiid.core.types.XMLType 0 0 No Nulls false false false 0 0 Searchable mmuuid:43f5274e-55e1-1f87-ba1c-eea49143eb32 xml string null
anyURI false false anyURI java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:6247ec80-e8a4-1e2a-b433-fb67ea35c07e string anySimpleType null
base64Binary false false base64Binary java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:b4c99380-ebc6-1e2a-9319-8eaa9b2276c7 string anySimpleType null
bigdecimal false false bigdecimal java.math.BigDecimal 0 0 No Nulls false false false 0 0 Searchable mmuuid:f2249740-a078-1e26-9b08-d6079ebe1f0d bigdecimal decimal null
biginteger false false biginteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:822b9a40-a066-1e26-9b08-d6079ebe1f0d biginteger decimal null
-blob false false blob com.metamatrix.common.types.BlobType 0 0 No Nulls false false false 0 0 Searchable mmuuid:5a793100-1836-1ed0-ba0f-f2334f5fbf95 blob base64Binary null
+blob false false blob org.teiid.core.types.BlobType 0 0 No Nulls false false false 0 0 Searchable mmuuid:5a793100-1836-1ed0-ba0f-f2334f5fbf95 blob base64Binary null
boolean false false boolean java.lang.Boolean 0 0 No Nulls false false false 0 0 Searchable mmuuid:dc476100-c483-1e24-9b01-c8207cd53eb7 boolean anySimpleType null
byte false false byte java.lang.Byte 0 0 No Nulls false false false 0 0 Searchable mmuuid:26dc1cc0-b9c8-1e21-b812-969c8fc8b016 byte short null
char false false char java.lang.Character 0 0 No Nulls false false false 0 0 Searchable mmuuid:62472700-a064-1e26-9b08-d6079ebe1f0d char string null
-clob false false clob com.metamatrix.common.types.ClobType 0 0 No Nulls false false false 0 0 Searchable mmuuid:559646c0-4941-1ece-b22b-f49159d22ad3 clob string null
+clob false false clob org.teiid.core.types.ClobType 0 0 No Nulls false false false 0 0 Searchable mmuuid:559646c0-4941-1ece-b22b-f49159d22ad3 clob string null
date false false date java.sql.Date 0 0 No Nulls false false false 0 0 Searchable mmuuid:65dcde00-c4ab-1e24-9b01-c8207cd53eb7 date anySimpleType null
dateTime false false dateTime java.sql.Timestamp 0 0 No Nulls false false false 0 0 Searchable mmuuid:5c69dec0-b3ea-1e2a-9a03-beb8638ffd21 timestamp anySimpleType null
decimal false false decimal java.math.BigDecimal 0 0 No Nulls false false false 0 0 Searchable mmuuid:569dfa00-c456-1e24-9b01-c8207cd53eb7 bigdecimal anySimpleType null
14 years, 7 months
teiid SVN: r2165 - in trunk/runtime/src/main: resources/org/teiid/runtime and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-05-28 00:11:05 -0400 (Fri, 28 May 2010)
New Revision: 2165
Modified:
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
Log:
TEIID-1079 adding a check to see if the named translator can be found
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-05-28 04:08:22 UTC (rev 2164)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-05-28 04:11:05 UTC (rev 2165)
@@ -172,19 +172,25 @@
continue;
}
for (String source:model.getSourceNames()) {
- if (this.connectorManagerRepository.getConnectorManager(source) == null) {
+ if (this.connectorManagerRepository.getConnectorManager(source) != null) {
+ continue;
+ }
- Translator translator = VDBDeployer.this.translatorRepository.getTranslatorMetaData(new VDBKey(deployment.getName(), deployment.getVersion()), model.getSourceTranslatorName(source));
- ExecutionFactory ef = map.get(translator);
- if ( ef == null) {
- ef = TranslatorUtil.buildExecutionFactory(translator);
- map.put(translator, ef);
- }
+ String name = model.getSourceTranslatorName(source);
+ Translator translator = VDBDeployer.this.translatorRepository.getTranslatorMetaData(new VDBKey(deployment.getName(), deployment.getVersion()), name);
+ if (translator == null) {
+ throw new DeploymentException(RuntimePlugin.Util.getString("translator_not_found", name)); //$NON-NLS-1$
+ }
+
+ ExecutionFactory ef = map.get(translator);
+ if ( ef == null) {
+ ef = TranslatorUtil.buildExecutionFactory(translator);
+ map.put(translator, ef);
+ }
- ConnectorManager cm = new ConnectorManager(model.getSourceTranslatorName(source), model.getSourceConnectionJndiName(source));
- cm.setExecutionFactory(ef);
- this.connectorManagerRepository.addConnectorManager(source, cm);
- }
+ ConnectorManager cm = new ConnectorManager(name, model.getSourceConnectionJndiName(source));
+ cm.setExecutionFactory(ef);
+ this.connectorManagerRepository.addConnectorManager(source, cm);
}
}
}
@@ -307,11 +313,11 @@
}
return store;
} catch (TranslatorException e) {
- if (exception != null) {
+ if (exception == null) {
exception = e;
}
} catch (IOException e) {
- if (exception != null) {
+ if (exception == null) {
exception = e;
}
}
Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-05-28 04:08:22 UTC (rev 2164)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-05-28 04:11:05 UTC (rev 2165)
@@ -306,3 +306,4 @@
required_property_not_exists=Required property "{0}" has no value. Deployment is incomplete.
name_not_found=Translator property "name" not defined for the deployment "{0}"
translator_type_not_found=The parent translator defined not found in configuration "{0}"
+translator_not_found=Unknown translator "{0}"
14 years, 7 months
teiid SVN: r2164 - in trunk/engine/src/main/java/org/teiid: query/processor and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-05-28 00:08:22 -0400 (Fri, 28 May 2010)
New Revision: 2164
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java
trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
Log:
TEIID-913 ensuring that even if the batch contents are not added that lob references are still captured
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-05-28 04:06:56 UTC (rev 2163)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-05-28 04:08:22 UTC (rev 2164)
@@ -42,9 +42,8 @@
import org.teiid.common.buffer.TupleBatch;
import org.teiid.common.buffer.TupleBuffer;
import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidException;
import org.teiid.core.TeiidProcessingException;
-import org.teiid.core.TeiidException;
-import org.teiid.core.TeiidException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.dqp.DQPPlugin;
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
@@ -61,7 +60,6 @@
import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.processor.BatchCollector;
import org.teiid.query.processor.QueryProcessor;
-import org.teiid.query.processor.BatchCollector.BatchHandler;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.SPParameter;
import org.teiid.query.sql.lang.StoredProcedure;
@@ -354,12 +352,29 @@
this.cid = cacheId;
}
processor = request.processor;
- collector = processor.createBatchCollector();
- collector.setBatchHandler(new BatchHandler() {
- public boolean batchProduced(TupleBatch batch) throws TeiidComponentException {
- return sendResultsIfNeeded(batch);
+ resultsBuffer = processor.createTupleBuffer();
+ collector = new BatchCollector(processor, resultsBuffer) {
+ protected void flushBatchDirect(TupleBatch batch, boolean add) throws TeiidComponentException,TeiidProcessingException {
+ boolean added = false;
+ if (cid != null || resultsBuffer.isLobs()) {
+ super.flushBatchDirect(batch, add);
+ added = true;
+ }
+ doneProducingBatches = batch.getTerminationFlag();
+ if (doneProducingBatches && cid != null) {
+ boolean sessionScope = processor.getContext().isSessionFunctionEvaluated();
+ CachedResults cr = new CachedResults();
+ cr.setCommand(originalCommand);
+ cr.setAnalysisRecord(analysisRecord);
+ cr.setResults(resultsBuffer);
+ dqpCore.getRsCache().put(cid, sessionScope, cr);
+ }
+ add = sendResultsIfNeeded(batch);
+ if (!added) {
+ super.flushBatchDirect(batch, add);
+ }
}
- });
+ };
resultsBuffer = collector.getTupleBuffer();
resultsBuffer.setForwardOnly(isForwardOnly());
analysisRecord = request.analysisRecord;
@@ -381,17 +396,6 @@
* Send results if they have been requested. This should only be called from the processing thread.
*/
protected boolean sendResultsIfNeeded(TupleBatch batch) throws TeiidComponentException {
- if (batch != null) {
- doneProducingBatches = batch.getTerminationFlag();
- if (doneProducingBatches && cid != null) {
- boolean sessionScope = this.processor.getContext().isSessionFunctionEvaluated();
- CachedResults cr = new CachedResults();
- cr.setCommand(originalCommand);
- cr.setAnalysisRecord(analysisRecord);
- cr.setResults(this.resultsBuffer);
- dqpCore.getRsCache().put(cid, sessionScope, cr);
- }
- }
ResultsMessage response = null;
ResultsReceiver<ResultsMessage> receiver = null;
boolean result = true;
Modified: trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java 2010-05-28 04:06:56 UTC (rev 2163)
+++ trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java 2010-05-28 04:08:22 UTC (rev 2164)
@@ -51,12 +51,7 @@
List getOutputElements();
}
- public interface BatchHandler {
- boolean batchProduced(TupleBatch batch) throws TeiidProcessingException, TeiidComponentException;
- }
-
private BatchProducer sourceNode;
- private BatchHandler batchHandler;
private boolean done = false;
private TupleBuffer buffer;
@@ -91,19 +86,16 @@
* Flush the batch by giving it to the buffer manager.
*/
private void flushBatch(TupleBatch batch) throws TeiidComponentException, TeiidProcessingException {
- boolean add = true;
- if (this.batchHandler != null && (batch.getRowCount() > 0 || batch.getTerminationFlag())) {
- add = this.batchHandler.batchProduced(batch);
- }
- // Add batch
- if(batch.getRowCount() > 0 || batch.getTerminationFlag()) {
- buffer.addTupleBatch(batch, add);
- }
+ if (batch.getRowCount() == 0 && !batch.getTerminationFlag()) {
+ return;
+ }
+ flushBatchDirect(batch, true);
}
- public void setBatchHandler(BatchHandler batchHandler) {
- this.batchHandler = batchHandler;
- }
+ @SuppressWarnings("unused")
+ protected void flushBatchDirect(TupleBatch batch, boolean add) throws TeiidComponentException, TeiidProcessingException {
+ buffer.addTupleBatch(batch, add);
+ }
public int getRowCount() {
return buffer.getRowCount();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java 2010-05-28 04:06:56 UTC (rev 2163)
+++ trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java 2010-05-28 04:08:22 UTC (rev 2164)
@@ -54,7 +54,7 @@
*/
public abstract class ProcessorPlan implements Cloneable, BatchProducer {
- private List warnings = null;
+ private List<Exception> warnings = null;
private CommandContext context;
@@ -77,18 +77,18 @@
* the current warnings list. The warnings are in order they were detected.
* @return Current list of warnings, never null
*/
- public List getAndClearWarnings() {
+ public List<Exception> getAndClearWarnings() {
if (warnings == null) {
return null;
}
- List copied = warnings;
+ List<Exception> copied = warnings;
warnings = null;
return copied;
}
protected void addWarning(TeiidException warning) {
if (warnings == null) {
- warnings = new ArrayList(1);
+ warnings = new ArrayList<Exception>(1);
}
warnings.add(warning);
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2010-05-28 04:06:56 UTC (rev 2163)
+++ trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2010-05-28 04:08:22 UTC (rev 2164)
@@ -27,6 +27,7 @@
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.TupleBatch;
+import org.teiid.common.buffer.TupleBuffer;
import org.teiid.common.buffer.BufferManager.BufferReserveMode;
import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.core.TeiidComponentException;
@@ -223,8 +224,12 @@
this.requestCanceled = true;
}
+ public TupleBuffer createTupleBuffer() throws TeiidComponentException {
+ return this.bufferMgr.createTupleBuffer(this.processPlan.getOutputElements(), context.getConnectionID(), TupleSourceType.PROCESSOR);
+ }
+
public BatchCollector createBatchCollector() throws TeiidComponentException {
- return new BatchCollector(this, this.bufferMgr.createTupleBuffer(this.processPlan.getOutputElements(), context.getConnectionID(), TupleSourceType.PROCESSOR));
+ return new BatchCollector(this, createTupleBuffer());
}
public void setNonBlocking(boolean nonBlocking) {
14 years, 7 months