teiid SVN: r4205 - trunk/engine/src/test/java/org/teiid/query/processor.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-06-27 12:29:03 -0400 (Wed, 27 Jun 2012)
New Revision: 4205
Modified:
trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
Log:
TEIID-2077 correcting the reset/close methods
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2012-06-26 15:42:28 UTC (rev 4204)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2012-06-27 16:29:03 UTC (rev 4205)
@@ -2289,7 +2289,7 @@
helpProcess(plan, dataManager, expected);
//three queries - 1 for the outer and 1 each for true/false x 3 runs
- assertEquals(3, dataManager.getQueries().size());
+ assertEquals(9, dataManager.getQueries().size());
}
@Test public void testCorrelatedSubqueryCaching1() throws Exception {
12 years, 6 months
teiid SVN: r4204 - in trunk/engine/src: test/java/org/teiid/query/processor and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-06-26 11:42:28 -0400 (Tue, 26 Jun 2012)
New Revision: 4204
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
Log:
TEIID-2077 correcting the reset/close methods
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java 2012-06-26 15:22:47 UTC (rev 4203)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java 2012-06-26 15:42:28 UTC (rev 4204)
@@ -79,6 +79,14 @@
}
return false;
}
+
+ @Override
+ public void clear() {
+ for (TupleBuffer buffer : values()) {
+ buffer.remove();
+ }
+ super.clear();
+ }
}
public class SubqueryState {
@@ -125,17 +133,17 @@
public void reset() {
for (SubqueryState subQueryState : subqueries.values()) {
subQueryState.plan.reset();
+ subQueryState.close(true);
}
+ cache.clear();
+ smallCache.clear();
+ currentTuples = 0;
}
public void close() {
- for (SubqueryState state : subqueries.values()) {
- state.close(true);
- }
- for (TupleBuffer buffer : cache.values()) {
- buffer.remove();
- }
- cache.clear();
+ reset();
+ commands.clear();
+ subqueries.clear();
}
@Override
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2012-06-26 15:22:47 UTC (rev 4203)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2012-06-26 15:42:28 UTC (rev 4204)
@@ -2286,9 +2286,9 @@
ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached());
// Run query
- doProcess(plan, dataManager, expected, createCommandContext());
+ helpProcess(plan, dataManager, expected);
- //three queries - 1 for the outer and 1 each for true/false
+ //three queries - 1 for the outer and 1 each for true/false x 3 runs
assertEquals(3, dataManager.getQueries().size());
}
12 years, 6 months
teiid SVN: r4203 - in trunk/engine/src: test/java/org/teiid/query/processor and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-06-26 11:22:47 -0400 (Tue, 26 Jun 2012)
New Revision: 4203
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
Log:
TEIID-2077 improving subquery result caching such that the same commands at the same node will share results
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java 2012-06-22 22:16:53 UTC (rev 4202)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java 2012-06-26 15:22:47 UTC (rev 4203)
@@ -41,6 +41,7 @@
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.processor.QueryProcessor;
+import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.SubqueryContainer;
import org.teiid.query.sql.symbol.ContextReference;
import org.teiid.query.sql.symbol.ElementSymbol;
@@ -57,6 +58,29 @@
*/
public class SubqueryAwareEvaluator extends Evaluator {
+ @SuppressWarnings("serial")
+ private final class LRUBufferCache extends LRUCache<List<?>, TupleBuffer> {
+
+ private LRUCache<List<?>, TupleBuffer> spillOver;
+
+ private LRUBufferCache(int maxSize, LRUCache<List<?>, TupleBuffer> spillOver) {
+ super(maxSize);
+ this.spillOver = spillOver;
+ }
+
+ protected boolean removeEldestEntry(Map.Entry<java.util.List<?>,TupleBuffer> eldest) {
+ if (super.removeEldestEntry(eldest)) {
+ if (spillOver != null && eldest.getValue().getRowCount() <= 2) {
+ spillOver.put(eldest.getKey(), eldest.getValue());
+ } else {
+ eldest.getValue().remove();
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
public class SubqueryState {
QueryProcessor processor;
BatchCollector collector;
@@ -81,7 +105,9 @@
//processing state
private Map<String, SubqueryState> subqueries = new HashMap<String, SubqueryState>();
- private LRUCache<List<?>, TupleBuffer> cache = new LRUCache<List<?>, TupleBuffer>(1024);
+ private Map<Command, String> commands = new HashMap<Command, String>(); //TODO: could determine this ahead of time
+ private LRUCache<List<?>, TupleBuffer> smallCache = new LRUBufferCache(1024, null);
+ private LRUCache<List<?>, TupleBuffer> cache = new LRUBufferCache(512, smallCache);
private int maxTuples = BufferManager.DEFAULT_PROCESSOR_BATCH_SIZE << 4;
private int currentTuples = 0;
@@ -120,6 +146,15 @@
String key = ref.getContextSymbol();
SubqueryState state = this.subqueries.get(key);
if (state == null) {
+ String otherKey = commands.get(container.getCommand());
+ if (otherKey != null) {
+ state = this.subqueries.get(otherKey);
+ if (state != null) {
+ key = otherKey;
+ }
+ }
+ }
+ if (state == null) {
state = new SubqueryState();
state.plan = container.getCommand().getProcessorPlan().clone();
if (container.getCommand().getCorrelatedReferences() != null) {
@@ -131,6 +166,7 @@
}
}
this.subqueries.put(key, state);
+ this.commands.put(container.getCommand(), key);
}
SymbolMap correlatedRefs = container.getCommand().getCorrelatedReferences();
VariableContext currentContext = null;
@@ -168,10 +204,13 @@
removeBuffer = false;
this.currentTuples += tb.getRowCount();
while (this.currentTuples > maxTuples && !cache.isEmpty()) {
- //TODO: this should handle empty results better
Iterator<TupleBuffer> i = this.cache.values().iterator();
TupleBuffer buffer = i.next();
- buffer.remove();
+ if (buffer.getRowCount() <= 2) {
+ this.smallCache.put(cacheKey, buffer);
+ } else {
+ buffer.remove();
+ }
this.currentTuples -= buffer.getRowCount();
i.remove();
}
@@ -181,6 +220,9 @@
List<Object> cacheKey = new ArrayList<Object>(refValues);
cacheKey.add(key);
TupleBuffer cachedResult = cache.get(cacheKey);
+ if (cachedResult == null) {
+ cachedResult = smallCache.get(cacheKey);
+ }
if (cachedResult != null) {
state.close(false);
return new TupleSourceValueIterator(cachedResult.createIndexedTupleSource(), 0);
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2012-06-22 22:16:53 UTC (rev 4202)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2012-06-26 15:22:47 UTC (rev 4203)
@@ -2292,6 +2292,23 @@
assertEquals(3, dataManager.getQueries().size());
}
+ @Test public void testCorrelatedSubqueryCaching1() throws Exception {
+ String sql = "Select (select e2 FROM pm2.g1 WHERE pm1.g1.e3 = pm2.g1.e3 limit 1), (select e2 FROM pm2.g1 WHERE pm1.g1.e3 = pm2.g1.e3 limit 1) from pm1.g1 order by e1 limit 1"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList(0, 0)
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached());
+
+ doProcess(plan, dataManager, expected, createCommandContext());
+
+ assertEquals(2, dataManager.getQueries().size());
+ }
+
/**
* There is a bug when the second query in a UNION ALL has a correlated subquery, and both
* the outer and inner query are selecting from the same virtual group, and aliasing them
12 years, 6 months
teiid SVN: r4202 - trunk/engine/src/main/java/org/teiid/query/metadata.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-06-22 18:16:53 -0400 (Fri, 22 Jun 2012)
New Revision: 4202
Modified:
trunk/engine/src/main/java/org/teiid/query/metadata/DDLStringVisitor.java
Log:
TEIID-2083: removing the some verbose stuff, that are not used currently
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/DDLStringVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/DDLStringVisitor.java 2012-06-22 21:11:13 UTC (rev 4201)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/DDLStringVisitor.java 2012-06-22 22:16:53 UTC (rev 4202)
@@ -397,10 +397,6 @@
StringBuilder options = new StringBuilder();
addCommonOptions(options, column);
- if (column.isCaseSensitive()) {
- addOption(options, CASE_SENSITIVE, String.valueOf(column.isCaseSensitive()));
- }
-
if (!column.isSelectable()) {
addOption(options, SELECTABLE, String.valueOf(column.isSelectable()));
}
@@ -410,19 +406,36 @@
addOption(options, UPDATABLE, String.valueOf(column.isUpdatable()));
}
- if (column.isSigned()) {
- addOption(options, SIGNED, String.valueOf(column.isSigned()));
- }
+
if (column.isCurrency()) {
addOption(options, CURRENCY, String.valueOf(column.isCurrency()));
}
+ /* - designer uses this on all non-numeric just verbose, commenting for now
+ // only record if not default
+ if (column.isCaseSensitive() && !column.getDatatype().isCaseSensitive()) {
+ addOption(options, CASE_SENSITIVE, String.valueOf(column.isCaseSensitive()));
+ }
+
+ if (column.isSigned() && !column.getDatatype().isSigned()) {
+ addOption(options, SIGNED, String.valueOf(column.isSigned()));
+ } *
if (column.isFixedLength()) {
addOption(options, FIXED_LENGTH, String.valueOf(column.isFixedLength()));
}
+ // length and octet length should be same. so this should be never be true.
+ if (column.getCharOctetLength() != 0 && column.getLength() != column.getCharOctetLength()) {
+ addOption(options, CHAR_OCTET_LENGTH, column.getCharOctetLength());
+ }
+ // 10 is default assumed
+ if (column.getRadix() != 0 && column.getRadix() != 10) {
+ addOption(options, RADIX, column.getRadix());
+ }
+ */
- if (column.getSearchType() != null) {
+ // by default the search type is default data type search, so avoid it.
+ if (column.getSearchType() != null && !column.getSearchType().equals(column.getDatatype().getSearchType())) {
addOption(options, SEARCHABLE, column.getSearchType().name());
}
@@ -434,21 +447,15 @@
addOption(options, MAX_VALUE, column.getMaximumValue());
}
- if (column.getCharOctetLength() != 0) {
- addOption(options, CHAR_OCTET_LENGTH, column.getCharOctetLength());
- }
-
// only set native type on the foreign tables, on view the data type is type
if (table.isPhysical() && column.getNativeType() != null) {
addOption(options, NATIVE_TYPE, column.getNativeType());
}
- if (column.getRadix() != 0) {
- addOption(options, RADIX, column.getRadix());
- }
if (column.getNullValues() != -1) {
addOption(options, NULL_VALUE_COUNT, column.getNullValues());
}
+
if (column.getDistinctValues() != -1) {
addOption(options, DISTINCT_VALUES, column.getDistinctValues());
}
12 years, 6 months
teiid SVN: r4201 - in trunk: api/src/main/java/org/teiid/language and 6 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-06-22 17:11:13 -0400 (Fri, 22 Jun 2012)
New Revision: 4201
Added:
trunk/engine/src/main/java/org/teiid/query/metadata/DDLConstants.java
trunk/engine/src/main/java/org/teiid/query/metadata/DDLStringVisitor.java
trunk/engine/src/test/java/org/teiid/query/metadata/TestDDLStringVisitor.java
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/Admin.java
trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/api/src/main/java/org/teiid/language/SQLConstants.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/OperationsConstants.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java
Log:
TEIID-2083: Adding a way export the metadata of the vdb's model using DDL. This operation can e invoked through CLI or admin methods.
Modified: trunk/admin/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/Admin.java 2012-06-22 14:46:04 UTC (rev 4200)
+++ trunk/admin/src/main/java/org/teiid/adminapi/Admin.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -24,6 +24,7 @@
import java.io.InputStream;
import java.util.Collection;
+import java.util.EnumSet;
import java.util.Properties;
import java.util.Set;
@@ -32,6 +33,8 @@
public interface Admin {
public enum Cache {PREPARED_PLAN_CACHE, QUERY_SERVICE_RESULT_SET_CACHE};
+
+ public enum SchemaObjectType {TABLES, PROCEDURES, FUNCTIONS};
/**
* Assign a {@link Translator} and Data source to a {@link VDB}'s Model
@@ -292,5 +295,16 @@
* @param jndiName
* @throws AdminException
*/
- void markDataSourceAvailable(String jndiName) throws AdminException;
+ void markDataSourceAvailable(String jndiName) throws AdminException;
+
+ /**
+ * Retrieve the schema of the given model
+ *
+ * @param vdbName
+ * @param vdbVersion
+ * @param modelName
+ * @param EnumSet<SchemaObjectType> Type of schema objects to retrieve, null means ALL the schema object types
+ * @param typeNamePattern RegEx pattern to filter to names of tables, procedures that are being read. Null means no filter.
+ */
+ String getSchema(String vdbName, int vdbVersion, String modelName, EnumSet<SchemaObjectType> allowedTypes, String typeNamePattern) throws AdminException;
}
Modified: trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-06-22 14:46:04 UTC (rev 4200)
+++ trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -22,7 +22,9 @@
package org.teiid.adminapi;
-import static org.jboss.as.controller.client.helpers.ClientConstants.*;
+import static org.jboss.as.controller.client.helpers.ClientConstants.DEPLOYMENT_REMOVE_OPERATION;
+import static org.jboss.as.controller.client.helpers.ClientConstants.DEPLOYMENT_UNDEPLOY_OPERATION;
+import static org.jboss.as.controller.client.helpers.ClientConstants.RESULT;
import java.io.IOException;
import java.io.InputStream;
@@ -32,11 +34,7 @@
import java.util.*;
import java.util.logging.Logger;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.callback.*;
import javax.security.sasl.RealmCallback;
import javax.security.sasl.RealmChoiceCallback;
@@ -49,12 +47,7 @@
import org.jboss.dmr.ModelType;
import org.teiid.adminapi.PropertyDefinition.RestartType;
import org.teiid.adminapi.VDB.ConnectionType;
-import org.teiid.adminapi.impl.AdminObjectImpl;
-import org.teiid.adminapi.impl.MetadataMapper;
-import org.teiid.adminapi.impl.PropertyDefinitionMetadata;
-import org.teiid.adminapi.impl.VDBMetaData;
-import org.teiid.adminapi.impl.VDBMetadataMapper;
-import org.teiid.adminapi.impl.VDBTranslatorMetaData;
+import org.teiid.adminapi.impl.*;
import org.teiid.adminapi.impl.VDBMetadataMapper.RequestMetadataMapper;
import org.teiid.adminapi.impl.VDBMetadataMapper.SessionMetadataMapper;
import org.teiid.adminapi.impl.VDBMetadataMapper.TransactionMetadataMapper;
@@ -1337,6 +1330,50 @@
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70046, e);
}
+ }
+
+ @Override
+ public String getSchema(String vdbName, int vdbVersion,
+ String modelName, EnumSet<SchemaObjectType> allowedTypes,
+ String typeNamePattern) throws AdminException {
+ ModelNode request = null;
+
+ ArrayList<String> params = new ArrayList<String>();
+ params.add("vdb-name");
+ params.add(vdbName);
+ params.add("vdb-version");
+ params.add(String.valueOf(vdbVersion));
+ params.add("model-name");
+ params.add(modelName);
+
+ if (allowedTypes != null) {
+ params.add("entity-type");
+ StringBuilder sb = new StringBuilder();
+ for (SchemaObjectType type:allowedTypes) {
+ if (sb.length() > 0) {
+ sb.append(",");
+ }
+ sb.append(type.name());
+ }
+ params.add(sb.toString());
+ }
+
+ if (typeNamePattern != null) {
+ params.add("entity-pattern");
+ params.add(typeNamePattern);
+ }
+
+ request = buildRequest("teiid", "get-schema", params.toArray(new String[params.size()]));//$NON-NLS-1$ //$NON-NLS-2$
+
+ try {
+ ModelNode outcome = this.connection.execute(request);
+ if (!Util.isSuccess(outcome)) {
+ throw new AdminProcessingException(AdminPlugin.Event.TEIID70045, Util.getFailureDescription(outcome));
+ }
+ return outcome.get(RESULT).asString();
+ } catch (Exception e) {
+ throw new AdminProcessingException(AdminPlugin.Event.TEIID70046, e);
+ }
}
}
}
Modified: trunk/api/src/main/java/org/teiid/language/SQLConstants.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2012-06-22 14:46:04 UTC (rev 4200)
+++ trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -47,6 +47,8 @@
public static final String LPAREN = "("; //$NON-NLS-1$
public static final String RPAREN = ")"; //$NON-NLS-1$
public static final String COLON = ":"; //$NON-NLS-1$
+ public static final String TICK = "'"; //$NON-NLS-1$
+ public static final String SEMICOLON = ";"; //$NON-NLS-1$
}
public interface NonReserved {
Added: trunk/engine/src/main/java/org/teiid/query/metadata/DDLConstants.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/DDLConstants.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/DDLConstants.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -0,0 +1,77 @@
+/*
+ * 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.metadata;
+
+public interface DDLConstants {
+ public static final String JAVA_METHOD = "JAVA_METHOD";//$NON-NLS-1$
+ public static final String JAVA_CLASS = "JAVA_CLASS";//$NON-NLS-1$
+ public static final String DETERMINISM = "DETERMINISM";//$NON-NLS-1$
+ public static final String CATEGORY = "CATEGORY";//$NON-NLS-1$
+ public static final String FUNCTION2 = "FUNCTION";//$NON-NLS-1$
+ public static final String OUT = "OUT";//$NON-NLS-1$
+ public static final String INOUT = "INOUT";//$NON-NLS-1$
+ public static final String IN = "IN";//$NON-NLS-1$
+ public static final String UPDATECOUNT = "UPDATECOUNT";//$NON-NLS-1$
+ public static final String RETURNS = "RETURNS";//$NON-NLS-1$
+ public static final String PROCEDURE2 = "PROCEDURE";//$NON-NLS-1$
+ public static final String FOREIGN = "FOREIGN";//$NON-NLS-1$
+ public static final String VIRTUAL = "VIRTUAL";//$NON-NLS-1$
+ public static final String DISTINCT_VALUES = "DISTINCT_VALUES";//$NON-NLS-1$
+ public static final String NULL_VALUE_COUNT = "NULL_VALUE_COUNT";//$NON-NLS-1$
+ public static final String RADIX = "RADIX";//$NON-NLS-1$
+ public static final String NATIVE_TYPE = "NATIVE_TYPE";//$NON-NLS-1$
+ public static final String CHAR_OCTET_LENGTH = "CHAR_OCTET_LENGTH";//$NON-NLS-1$
+ public static final String MAX_VALUE = "MAX_VALUE"; //$NON-NLS-1$
+ public static final String MIN_VALUE = "MIN_VALUE";//$NON-NLS-1$
+ public static final String SEARCHABLE = "SEARCHABLE";//$NON-NLS-1$
+ public static final String FIXED_LENGTH = "FIXED_LENGTH";//$NON-NLS-1$
+ public static final String CURRENCY = "CURRENCY";//$NON-NLS-1$
+ public static final String SIGNED = "SIGNED";//$NON-NLS-1$
+ public static final String SELECTABLE = "SELECTABLE";//$NON-NLS-1$
+ public static final String CASE_SENSITIVE = "CASE_SENSITIVE";//$NON-NLS-1$
+ public static final String DEFAULT = "DEFAULT";//$NON-NLS-1$
+ public static final String AUTO_INCREMENT = "AUTO_INCREMENT";//$NON-NLS-1$
+ public static final String NOT_NULL = "NOT NULL";//$NON-NLS-1$
+ public static final String REFERENCES = "REFERENCES";//$NON-NLS-1$
+ public static final String FOREIGN_KEY = "FOREIGN KEY";//$NON-NLS-1$
+ public static final String INDEX = "INDEX";//$NON-NLS-1$
+ public static final String UNIQUE = "UNIQUE";//$NON-NLS-1$
+ public static final String PRIMARY_KEY = "PRIMARY KEY";//$NON-NLS-1$
+ public static final String ACCESSPATTERN = "ACCESSPATTERN";//$NON-NLS-1$
+ public static final String NAMEINSOURCE = "NAMEINSOURCE";//$NON-NLS-1$
+ public static final String ANNOTATION = "ANNOTATION";//$NON-NLS-1$
+ public static final String UUID = "UUID";//$NON-NLS-1$
+ public static final String CARDINALITY = "CARDINALITY";//$NON-NLS-1$
+ public static final String UPDATABLE = "UPDATABLE";//$NON-NLS-1$
+ public static final String MATERIALIZED_TABLE = "MATERIALIZED_TABLE";//$NON-NLS-1$
+ public static final String MATERIALIZED = "MATERIALIZED";//$NON-NLS-1$
+ public static final String INSTEAD_OF = "INSTEAD OF";//$NON-NLS-1$
+ public static final String CREATE_TRIGGER_ON = "CREATE TRIGGER ON";//$NON-NLS-1$
+ public static final String DELETE = "DELETE";//$NON-NLS-1$
+ public static final String UPDATE = "UPDATE";//$NON-NLS-1$
+ public static final String INSERT = "INSERT";//$NON-NLS-1$
+ public static final String OPTIONS2 = "OPTIONS";//$NON-NLS-1$
+ public static final String CONSTRAINT = "CONSTRAINT";//$NON-NLS-1$
+ public static final String VIEW = "VIEW";//$NON-NLS-1$
+ public static final String FOREIGN_TABLE = "FOREIGN TABLE";//$NON-NLS-1$
+ public static final String CREATE = "CREATE";//$NON-NLS-1$
+}
Property changes on: trunk/engine/src/main/java/org/teiid/query/metadata/DDLConstants.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/engine/src/main/java/org/teiid/query/metadata/DDLStringVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/DDLStringVisitor.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/DDLStringVisitor.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -0,0 +1,642 @@
+/*
+ * 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.metadata;
+
+import static org.teiid.language.SQLConstants.Tokens.COMMA;
+import static org.teiid.language.SQLConstants.Tokens.LPAREN;
+import static org.teiid.language.SQLConstants.Tokens.RPAREN;
+import static org.teiid.language.SQLConstants.Tokens.SPACE;
+import static org.teiid.language.SQLConstants.Tokens.TICK;
+import static org.teiid.query.metadata.DDLConstants.*;
+
+import java.util.EnumSet;
+import java.util.List;
+
+import org.teiid.adminapi.Admin.SchemaObjectType;
+import org.teiid.language.SQLConstants;
+import org.teiid.metadata.AbstractMetadataRecord;
+import org.teiid.metadata.BaseColumn.NullType;
+import org.teiid.metadata.Column;
+import org.teiid.metadata.ColumnSet;
+import org.teiid.metadata.ForeignKey;
+import org.teiid.metadata.FunctionMethod;
+import org.teiid.metadata.FunctionMethod.Determinism;
+import org.teiid.metadata.FunctionParameter;
+import org.teiid.metadata.KeyRecord;
+import org.teiid.metadata.Procedure;
+import org.teiid.metadata.ProcedureParameter;
+import org.teiid.metadata.ProcedureParameter.Type;
+import org.teiid.metadata.Schema;
+import org.teiid.metadata.Table;
+
+public class DDLStringVisitor {
+ private static final String TAB = "\t"; //$NON-NLS-1$
+ private static final String NEWLINE = "\n";//$NON-NLS-1$
+
+ protected StringBuilder buffer = new StringBuilder();
+ private boolean includeTables = true;
+ private boolean includeProcedures = true;
+ private boolean includeFunctions = true;
+ private String filter;
+
+ public static String getDDLString(Schema schema, EnumSet<SchemaObjectType> types, String regexPattern) {
+ DDLStringVisitor visitor = new DDLStringVisitor(types, regexPattern);
+ visitor.visit(schema);
+ return visitor.toString();
+ }
+
+ public DDLStringVisitor(EnumSet<SchemaObjectType> types, String regexPattern) {
+ if (types != null) {
+ this.includeTables = types.contains(SchemaObjectType.TABLES);
+ this.includeProcedures = types.contains(SchemaObjectType.PROCEDURES);
+ this.includeFunctions = types.contains(SchemaObjectType.FUNCTIONS);
+ }
+ this.filter = regexPattern;
+ }
+
+ private void visit(Schema schema) {
+ boolean first = true;
+
+ if (this.includeTables) {
+ for (Table t: schema.getTables().values()) {
+ if (first) {
+ first = false;
+ }
+ else {
+ buffer.append(NEWLINE);
+ buffer.append(NEWLINE);
+ }
+ visit(t);
+ }
+ }
+
+ if (this.includeProcedures) {
+ for (Procedure p:schema.getProcedures().values()) {
+ if (first) {
+ first = false;
+ }
+ else {
+ buffer.append(NEWLINE);
+ buffer.append(NEWLINE);
+ }
+ visit(p);
+ }
+ }
+
+ if (this.includeFunctions) {
+ for (FunctionMethod f:schema.getFunctions().values()) {
+ if (first) {
+ first = false;
+ }
+ else {
+ buffer.append(NEWLINE);
+ buffer.append(NEWLINE);
+ }
+ visit(f);
+ }
+ }
+ }
+
+ private void visit(Table table) {
+ if (this.filter != null && !table.getName().matches(this.filter)) {
+ return;
+ }
+
+ buffer.append(CREATE).append(SPACE);
+ if (table.isPhysical()) {
+ buffer.append(FOREIGN_TABLE);
+ }
+ else {
+ buffer.append(VIEW);
+ }
+ buffer.append(SPACE);
+ buffer.append(table.getName());
+
+ if (table.getColumns() != null) {
+ buffer.append(SPACE);
+ buffer.append(LPAREN);
+ boolean first = true;
+ for (Column c:table.getColumns()) {
+ if (first) {
+ first = false;
+ }
+ else {
+ buffer.append(COMMA);
+ }
+ visit(c, table);
+ }
+
+ // constraints
+ String contraints = buildContraints(table);
+ if (!contraints.isEmpty()) {
+ buffer.append(NEWLINE).append(TAB);
+ buffer.append(CONSTRAINT);
+ buffer.append(contraints);
+ }
+ buffer.append(NEWLINE);
+ buffer.append(RPAREN);
+ }
+
+ // options
+ String options = buildTableOptions(table);
+ if (!options.isEmpty()) {
+ buffer.append(SPACE).append(OPTIONS2).append(SPACE).append(LPAREN).append(options).append(RPAREN);
+ }
+
+ if (table.isVirtual()) {
+ buffer.append(NEWLINE).append(SQLConstants.Reserved.AS).append(NEWLINE).append(table.getSelectTransformation());
+ }
+ buffer.append(SQLConstants.Tokens.SEMICOLON);
+
+ if (table.isInsertPlanEnabled()) {
+ buildTrigger(table.getName(), INSERT, table.getInsertPlan());
+ }
+
+ if (table.isUpdatePlanEnabled()) {
+ buildTrigger(table.getName(), UPDATE, table.getUpdatePlan());
+ }
+
+ if (table.isDeletePlanEnabled()) {
+ buildTrigger(table.getName(), DELETE, table.getDeletePlan());
+ }
+ }
+
+ private void buildTrigger(String name, String type, String plan) {
+ buffer.append(NEWLINE);
+ buffer.append(NEWLINE);
+ buffer.append(CREATE_TRIGGER_ON).append(SPACE);
+ buffer.append(name).append(SPACE).append(INSTEAD_OF).append(SPACE).append(type).append(SPACE).append(SQLConstants.Reserved.AS).append(NEWLINE);
+ buffer.append(plan);
+ buffer.append(SQLConstants.Tokens.SEMICOLON);
+ }
+
+ private String buildTableOptions(Table table) {
+ StringBuilder options = new StringBuilder();
+ addCommonOptions(options, table);
+
+ if (table.isMaterialized()) {
+ addOption(options, MATERIALIZED, String.valueOf(table.isMaterialized()));
+ if (table.getMaterializedTable() != null) {
+ addOption(options, MATERIALIZED_TABLE, table.getMaterializedTable().getName());
+ }
+ }
+ if (table.supportsUpdate()) {
+ addOption(options, UPDATABLE, String.valueOf(table.supportsUpdate()));
+ }
+ if (table.getCardinality() != -1) {
+ addOption(options, CARDINALITY, table.getCardinality());
+ }
+ if (!table.getProperties().isEmpty()) {
+ for (String key:table.getProperties().keySet()) {
+ addOption(options, key, table.getProperty(key, false));
+ }
+ }
+ return options.toString();
+ }
+
+ private void addCommonOptions(StringBuilder sb, AbstractMetadataRecord record) {
+ if (record.getUUID() != null && !record.getUUID().startsWith("mmuuid:")) { //$NON-NLS-1$
+ addOption(sb, UUID, record.getUUID());
+ }
+ if (record.getAnnotation() != null) {
+ addOption(sb, ANNOTATION, record.getAnnotation());
+ }
+ if (record.getNameInSource() != null && !record.getNameInSource().equals(record.getName())) {
+ addOption(sb, NAMEINSOURCE, record.getNameInSource());
+ }
+ }
+
+ private String buildContraints(Table table) {
+ StringBuilder options = new StringBuilder();
+
+ boolean first = true;
+ for (KeyRecord key:table.getAccessPatterns()) {
+ if (first) {
+ first = false;
+ }
+ else {
+ options.append(COMMA);
+ }
+ options.append(SPACE).append(ACCESSPATTERN);
+ addColumns(options, key.getColumns(), false);
+ }
+
+
+ KeyRecord pk = table.getPrimaryKey();
+ if (pk != null && pk.getColumns().size() > 1) {
+ if (first) {
+ first = false;
+ }
+ else {
+ options.append(COMMA);
+ }
+ options.append(SPACE).append(PRIMARY_KEY);
+ addColumns(options, pk.getColumns(), false);
+ }
+
+ for (KeyRecord key:table.getUniqueKeys()) {
+ if (key != null && key.getColumns().size() > 1) {
+ if (first) {
+ first = false;
+ }
+ else {
+ options.append(COMMA);
+ }
+ options.append(SPACE).append(UNIQUE);
+ addColumns(options, key.getColumns(), false);
+ }
+ }
+
+ for (KeyRecord key:table.getIndexes()) {
+ if (key != null && key.getColumns().size() > 1) {
+ if (first) {
+ first = false;
+ }
+ else {
+ options.append(COMMA);
+ }
+ options.append(SPACE).append(INDEX);
+ addColumns(options, key.getColumns(), false);
+ }
+ }
+
+ for (ForeignKey key:table.getForeignKeys()) {
+ if (first) {
+ first = false;
+ }
+ else {
+ options.append(COMMA);
+ }
+ options.append(SPACE).append(FOREIGN_KEY);
+ addColumns(options, key.getColumns(), false);
+ options.append(SPACE).append(REFERENCES);
+ if (key.getReferenceTableName() != null) {
+ options.append(SPACE).append(key.getReferenceTableName());
+ }
+ options.append(SPACE);
+ addNames(options, key.getReferenceColumns());
+ }
+
+ return options.toString();
+ }
+
+ private void addColumns(StringBuilder options, List<Column> columns, boolean includeType) {
+ options.append(LPAREN);
+ boolean first = true;
+ for (Column c:columns) {
+ if (first) {
+ first = false;
+ }
+ else {
+ options.append(COMMA).append(SPACE);
+ }
+ options.append(c.getName());
+ if (includeType) {
+ options.append(SPACE).append(c.getDatatype().getName());
+ }
+ }
+ options.append(RPAREN);
+ }
+
+ private void addNames(StringBuilder options, List<String> columns) {
+ if (columns != null) {
+ options.append(LPAREN);
+ boolean first = true;
+ for (String c:columns) {
+ if (first) {
+ first = false;
+ }
+ else {
+ options.append(COMMA).append(SPACE);
+ }
+ options.append(c);
+ }
+ options.append(RPAREN);
+ }
+ }
+
+ private void visit(Column column, Table table) {
+ buffer.append(NEWLINE).append(TAB).append(column.getName()).append(SPACE).append(column.getDatatype().getName());
+ if (column.getLength() != 0) {
+ buffer.append(LPAREN).append(column.getLength()).append(RPAREN);
+ }
+ else if (column.getPrecision() != 0){
+ buffer.append(LPAREN).append(column.getPrecision());
+ if (column.getScale() != 0) {
+ buffer.append(COMMA).append(column.getScale());
+ }
+ buffer.append(RPAREN);
+ }
+ if (column.getNullType() != null) {
+ if (column.getNullType() == NullType.No_Nulls) {
+ buffer.append(SPACE).append(NOT_NULL);
+ }
+ }
+
+ if (column.isAutoIncremented()) {
+ buffer.append(SPACE).append(AUTO_INCREMENT);
+ }
+
+ KeyRecord pk = table.getPrimaryKey();
+ if (pk != null && pk.getColumns().size() == 1) {
+ Column c = pk.getColumns().get(0);
+ if (column.equals(c)) {
+ buffer.append(SPACE).append(PRIMARY_KEY);
+ }
+ }
+
+ for (KeyRecord key:table.getUniqueKeys()) {
+ if (key != null && key.getColumns().size() == 1) {
+ Column c = key.getColumns().get(0);
+ if (column.equals(c)) {
+ buffer.append(SPACE).append(UNIQUE);
+ }
+ }
+ }
+
+ for (KeyRecord key:table.getIndexes()) {
+ if (key != null && key.getColumns().size() == 1) {
+ Column c = key.getColumns().get(0);
+ if (column.equals(c)) {
+ buffer.append(SPACE).append(INDEX);
+ }
+ }
+ }
+
+ if (column.getDefaultValue() != null) {
+ buffer.append(SPACE).append(DEFAULT).append(SPACE).append(TICK).append(column.getDefaultValue()).append(TICK);
+ }
+
+ // options
+ String options = buildColumnOptions(column, table);
+ if (!options.isEmpty()) {
+ buffer.append(SPACE).append(OPTIONS2).append(SPACE).append(LPAREN).append(options).append(RPAREN);
+ }
+ }
+
+ private String buildColumnOptions(Column column, Table table) {
+ StringBuilder options = new StringBuilder();
+ addCommonOptions(options, column);
+
+ if (column.isCaseSensitive()) {
+ addOption(options, CASE_SENSITIVE, String.valueOf(column.isCaseSensitive()));
+ }
+
+ if (!column.isSelectable()) {
+ addOption(options, SELECTABLE, String.valueOf(column.isSelectable()));
+ }
+
+ // if table is already updatable, then columns are implicitly updatable.
+ if (table.supportsUpdate() && !column.isUpdatable()) {
+ addOption(options, UPDATABLE, String.valueOf(column.isUpdatable()));
+ }
+
+ if (column.isSigned()) {
+ addOption(options, SIGNED, String.valueOf(column.isSigned()));
+ }
+
+ if (column.isCurrency()) {
+ addOption(options, CURRENCY, String.valueOf(column.isCurrency()));
+ }
+
+ if (column.isFixedLength()) {
+ addOption(options, FIXED_LENGTH, String.valueOf(column.isFixedLength()));
+ }
+
+ if (column.getSearchType() != null) {
+ addOption(options, SEARCHABLE, column.getSearchType().name());
+ }
+
+ if (column.getMinimumValue() != null) {
+ addOption(options, MIN_VALUE, column.getMinimumValue());
+ }
+
+ if (column.getMaximumValue() != null) {
+ addOption(options, MAX_VALUE, column.getMaximumValue());
+ }
+
+ if (column.getCharOctetLength() != 0) {
+ addOption(options, CHAR_OCTET_LENGTH, column.getCharOctetLength());
+ }
+
+ // only set native type on the foreign tables, on view the data type is type
+ if (table.isPhysical() && column.getNativeType() != null) {
+ addOption(options, NATIVE_TYPE, column.getNativeType());
+ }
+
+ if (column.getRadix() != 0) {
+ addOption(options, RADIX, column.getRadix());
+ }
+ if (column.getNullValues() != -1) {
+ addOption(options, NULL_VALUE_COUNT, column.getNullValues());
+ }
+ if (column.getDistinctValues() != -1) {
+ addOption(options, DISTINCT_VALUES, column.getDistinctValues());
+ }
+
+ if (!column.getProperties().isEmpty()) {
+ for (String key:column.getProperties().keySet()) {
+ addOption(options, key, column.getProperty(key, false));
+ }
+ }
+ return options.toString();
+ }
+
+ private void addOption(StringBuilder sb, String key, String value) {
+ if (sb.length() != 0) {
+ sb.append(COMMA).append(SPACE);
+ }
+ sb.append(key).append(SPACE).append(TICK).append(value).append(TICK);
+ }
+
+ private void addOption(StringBuilder sb, String key, int value) {
+ if (sb.length() != 0) {
+ sb.append(COMMA).append(SPACE);
+ }
+ sb.append(key).append(SPACE).append(value);
+ }
+
+ private void visit(Procedure procedure) {
+ if (this.filter != null && !procedure.getName().matches(this.filter)) {
+ return;
+ }
+
+ buffer.append(CREATE).append(SPACE);
+ if (procedure.isVirtual()) {
+ buffer.append(VIRTUAL);
+ }
+ else {
+ buffer.append(FOREIGN);
+ }
+ buffer.append(SPACE).append(PROCEDURE2).append(SPACE).append(procedure.getName());
+ buffer.append(LPAREN);
+
+ boolean first = true;
+ for (ProcedureParameter pp:procedure.getParameters()) {
+ Type type = pp.getType();
+ if (type == Type.In || type == Type.InOut || type == Type.Out) {
+ if (first) {
+ first = false;
+ }
+ else {
+ buffer.append(COMMA).append(SPACE);
+ }
+ visit(pp);
+ }
+ }
+ buffer.append(RPAREN);
+
+ buffer.append(SPACE).append(RETURNS).append(SPACE);
+ buildProcedureReturn(procedure.getResultSet(), procedure.getParameters());
+
+ //options
+ String options = buildProcedureOptions(procedure);
+ if (!options.isEmpty()) {
+ buffer.append(NEWLINE).append(OPTIONS2).append(SPACE).append(LPAREN).append(options).append(RPAREN);
+ }
+ //block
+ if (procedure.isVirtual()) {
+ buffer.append(NEWLINE).append(SQLConstants.Reserved.AS).append(NEWLINE);
+ String plan = procedure.getQueryPlan();
+ buffer.append(plan.substring("CREATE VIRTUAL PROCEDURE BEGIN ".length(), plan.length()-"END".length())); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+
+ private String buildProcedureOptions(Procedure procedure) {
+ StringBuilder options = new StringBuilder();
+ addCommonOptions(options, procedure);
+
+ if (procedure.getUpdateCount() != 1) {
+ addOption(options, UPDATECOUNT, procedure.getUpdateCount());
+ }
+
+ if (!procedure.getProperties().isEmpty()) {
+ for (String key:procedure.getProperties().keySet()) {
+ addOption(options, key, procedure.getProperty(key, false));
+ }
+ }
+
+ return options.toString();
+ }
+
+ private void buildProcedureReturn(ColumnSet<Procedure> resultSet, List<ProcedureParameter> parameters) {
+ if (resultSet != null) {
+ addColumns(buffer, resultSet.getColumns(), true);
+ }
+ else {
+ if (parameters != null) {
+ for (ProcedureParameter pp: parameters) {
+ if (pp.getType().equals(Type.ReturnValue)) {
+ buffer.append(pp.getDatatype().getName());
+ }
+ }
+ }
+ }
+
+ }
+
+ private void visit(ProcedureParameter param) {
+ Type type = param.getType();
+ if (type == Type.In || type == Type.InOut || type == Type.Out) {
+ String typeStr = null;
+ if (type == Type.In) typeStr = IN;
+ if (type == Type.InOut) typeStr = INOUT;
+ if (type == Type.Out) typeStr = OUT;
+ buffer.append(typeStr).append(SPACE).append(param.getName()).append(SPACE).append(param.getDatatype().getName());
+ }
+ }
+
+ private void visit(FunctionMethod function) {
+ if (this.filter != null && !function.getName().matches(this.filter)) {
+ return;
+ }
+ buffer.append(CREATE).append(SPACE);
+ if (function.getPushdown().equals(FunctionMethod.PushDown.MUST_PUSHDOWN)) {
+ buffer.append(FOREIGN);
+ }
+ else {
+ buffer.append(VIRTUAL);
+ }
+ buffer.append(SPACE).append(FUNCTION2).append(SPACE).append(function.getName());
+ buffer.append(LPAREN);
+
+ boolean first = true;
+ for (FunctionParameter fp:function.getInputParameters()) {
+ if (first) {
+ first = false;
+ }
+ else {
+ buffer.append(COMMA).append(SPACE);
+ }
+ visit(fp);
+ }
+ buffer.append(RPAREN);
+
+ buffer.append(SPACE).append(RETURNS).append(SPACE);
+ buffer.append(function.getOutputParameter().getType());
+
+ //options
+ String options = buildFunctionOptions(function);
+ if (!options.isEmpty()) {
+ buffer.append(NEWLINE).append(OPTIONS2).append(SPACE).append(LPAREN).append(options).append(RPAREN);
+ }
+ buffer.append(SQLConstants.Tokens.SEMICOLON);
+ }
+
+ private String buildFunctionOptions(FunctionMethod function) {
+ StringBuilder options = new StringBuilder();
+ addCommonOptions(options, function);
+
+ if (function.getCategory() != null) {
+ addOption(options, CATEGORY, function.getCategory());
+ }
+
+ if (!function.getDeterminism().equals(Determinism.DETERMINISTIC)) {
+ addOption(options, DETERMINISM, function.getDeterminism().name());
+ }
+
+ if (function.getInvocationClass() != null) {
+ addOption(options, JAVA_CLASS, function.getInvocationClass());
+ }
+
+ if (function.getInvocationMethod() != null) {
+ addOption(options, JAVA_METHOD, function.getInvocationMethod());
+ }
+
+ if (!function.getProperties().isEmpty()) {
+ for (String key:function.getProperties().keySet()) {
+ addOption(options, key, function.getProperty(key, false));
+ }
+ }
+
+ return options.toString();
+ }
+
+ private void visit(FunctionParameter param) {
+ buffer.append(param.getName()).append(SPACE).append(param.getType());
+ }
+
+ public String toString() {
+ return buffer.toString();
+ }
+}
Property changes on: trunk/engine/src/main/java/org/teiid/query/metadata/DDLStringVisitor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/engine/src/test/java/org/teiid/query/metadata/TestDDLStringVisitor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/metadata/TestDDLStringVisitor.java (rev 0)
+++ trunk/engine/src/test/java/org/teiid/query/metadata/TestDDLStringVisitor.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -0,0 +1,247 @@
+/*
+ * 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.metadata;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.teiid.metadata.BaseColumn.NullType;
+import org.teiid.metadata.Column;
+import org.teiid.metadata.MetadataFactory;
+import org.teiid.metadata.Schema;
+import org.teiid.metadata.Table;
+import org.teiid.query.parser.ParseException;
+import org.teiid.query.parser.TestDDLParser;
+
+@SuppressWarnings("nls")
+public class TestDDLStringVisitor {
+
+ @Test
+ public void testForeignTable() throws Exception {
+
+ String ddl = "CREATE FOREIGN TABLE G1 (\n" +
+ " e1 integer PRIMARY KEY,\n" +
+ " e2 string(10) UNIQUE,\n" +
+ " e3 date NOT NULL UNIQUE,\n" +
+ " e4 bigdecimal(12,3),\n" +
+ " e5 integer AUTO_INCREMENT INDEX OPTIONS (UUID 'uuid', NAMEINSOURCE 'nis', SELECTABLE 'false'),\n" +
+ " e6 string INDEX DEFAULT 'hello'\n" +
+ ") OPTIONS (ANNOTATION 'Test Table', CARDINALITY '12', FOO 'BAR', UPDATABLE 'true', UUID 'uuid2');";
+
+ MetadataFactory mf = new MetadataFactory("test", 1, "model", TestDDLParser.getDataTypes(), new Properties(), null);
+
+ Table table = mf.addTable("G1");
+ table.setVirtual(false);
+
+ mf.addColumn("e1","integer", table);
+ Column e2 = mf.addColumn("e2","varchar", table);
+ e2.setLength(10);
+
+ Column e3 = mf.addColumn("e3","date", table);
+ e3.setNullType(NullType.No_Nulls);
+
+ Column e4 = mf.addColumn("e4","decimal", table);
+ e4.setPrecision(12);
+ e4.setScale(3);
+
+ Column e5 = mf.addColumn("e5","integer", table);
+ e5.setAutoIncremented(true);
+ e5.setUUID("uuid");
+ e5.setNameInSource("nis");
+ e5.setSelectable(false);
+
+ Column e6 = mf.addColumn("e6","varchar", table);
+ e6.setDefaultValue("hello");
+
+ mf.addPrimaryKey("PK", Arrays.asList("e1"), table);
+ mf.addIndex("UK", false, Arrays.asList("e2"), table);
+ mf.addIndex("UK2", false, Arrays.asList("e3"), table);
+ mf.addIndex("IDX", true, Arrays.asList("e5"), table);
+ mf.addIndex("IDX2", true, Arrays.asList("e6"), table);
+
+ Map<String, String> options = new HashMap<String, String>();
+ options.put("CARDINALITY", "12");
+ options.put("UUID", "uuid2");
+ options.put("UPDATABLE", "true");
+ options.put("FOO", "BAR");
+ options.put("ANNOTATION", "Test Table");
+ table.setProperties(options);
+
+ String metadataDDL = DDLStringVisitor.getDDLString(mf.getSchema(), null, null);
+ assertEquals(ddl, metadataDDL);
+ }
+
+ @Test
+ public void testMultiKeyPK() throws Exception {
+ String ddl = "CREATE FOREIGN TABLE G1( e1 integer, e2 varchar, e3 date CONSTRAINT PRIMARY KEY (e1, e2))";
+ String expected = "CREATE FOREIGN TABLE G1 (\n" +
+ " e1 integer,\n" +
+ " e2 string,\n" +
+ " e3 date\n" +
+ " CONSTRAINT PRIMARY KEY(e1, e2)\n" +
+ ");";
+ helpTest(ddl, expected);
+ }
+
+ @Test
+ public void testConstraints2() throws Exception {
+ String ddl = "CREATE FOREIGN TABLE G1( e1 integer, e2 varchar, e3 date CONSTRAINT " +
+ "ACCESSPATTERN(e1), UNIQUE(e1), ACCESSPATTERN(e2, e3))";
+ String expected = "CREATE FOREIGN TABLE G1 (\n" +
+ " e1 integer UNIQUE,\n" +
+ " e2 string,\n" +
+ " e3 date\n" +
+ " CONSTRAINT ACCESSPATTERN(e1), ACCESSPATTERN(e2, e3)\n" +
+ ");";
+ helpTest(ddl, expected);
+ }
+
+ @Test
+ public void testFK() throws Exception {
+ String ddl = "CREATE FOREIGN TABLE G1(g1e1 integer, g1e2 varchar CONSTRAINT PRIMARY KEY(g1e1, g1e2));\n" +
+ "CREATE FOREIGN TABLE G2( g2e1 integer, g2e2 varchar CONSTRAINT " +
+ "FOREIGN KEY (g2e1, g2e2) REFERENCES G1 (g1e1, g1e2))";
+
+ String expected = "CREATE FOREIGN TABLE G1 (\n" +
+ " g1e1 integer,\n" +
+ " g1e2 string\n" +
+ " CONSTRAINT PRIMARY KEY(g1e1, g1e2)\n" +
+ ");\n" +
+ "\n" +
+ "CREATE FOREIGN TABLE G2 (\n" +
+ " g2e1 integer,\n" +
+ " g2e2 string\n" +
+ " CONSTRAINT FOREIGN KEY(g2e1, g2e2) REFERENCES G1 (g1e1, g1e2)\n" +
+ ");";
+
+ helpTest(ddl, expected);
+ }
+
+ @Test
+ public void testOptionalFK() throws Exception {
+ String ddl = "CREATE FOREIGN TABLE G1(g1e1 integer, g1e2 varchar CONSTRAINT PRIMARY KEY(g1e1, g1e2));\n" +
+ "CREATE FOREIGN TABLE G2( g2e1 integer, g2e2 varchar CONSTRAINT PRIMARY KEY(g2e1, g2e2)," +
+ "FOREIGN KEY (g2e1, g2e2) REFERENCES G1)";
+ String expected = "CREATE FOREIGN TABLE G1 (\n" +
+ " g1e1 integer,\n" +
+ " g1e2 string\n" +
+ " CONSTRAINT PRIMARY KEY(g1e1, g1e2)\n" +
+ ");\n" +
+ "\n" +
+ "CREATE FOREIGN TABLE G2 (\n" +
+ " g2e1 integer,\n" +
+ " g2e2 string\n" +
+ " CONSTRAINT PRIMARY KEY(g2e1, g2e2), FOREIGN KEY(g2e1, g2e2) REFERENCES G1 \n" +
+ ");";
+ helpTest(ddl, expected);
+ }
+
+ @Test
+ public void testMultipleCommands() throws Exception {
+ String ddl = "CREATE VIEW V1 AS SELECT * FROM PM1.G1 " +
+ "CREATE PROCEDURE FOO(P1 integer) RETURNS (e1 integer, e2 varchar) AS SELECT * FROM PM1.G1;";
+ String expected = "CREATE VIEW V1\n" +
+ "AS\n" +
+ "SELECT * FROM PM1.G1;\n" +
+ "\n" +
+ "CREATE VIRTUAL PROCEDURE FOO(IN P1 integer) RETURNS (e1 integer, e2 string)\n" +
+ "AS\n" +
+ "SELECT * FROM PM1.G1;\n";
+ helpTest(ddl, expected);
+
+ }
+
+ @Test
+ public void testView() throws Exception {
+ String ddl = "CREATE View G1( e1 integer, e2 varchar) OPTIONS (CARDINALITY 12) AS select e1, e2 from foo.bar";
+ String expected = "CREATE VIEW G1 (\n" +
+ " e1 integer,\n" +
+ " e2 string\n" +
+ ") OPTIONS (CARDINALITY 12)\n" +
+ "AS\n" +
+ "SELECT e1, e2 FROM foo.bar;";
+ helpTest(ddl, expected);
+ }
+
+ @Test
+ public void testInsteadOfTrigger() throws Exception {
+ String ddl = "CREATE VIEW G1( e1 integer, e2 varchar) AS select * from foo;" +
+ "CREATE TRIGGER ON G1 INSTEAD OF INSERT AS " +
+ "FOR EACH ROW \n" +
+ "BEGIN ATOMIC \n" +
+ "insert into g1 (e1, e2) values (1, 'trig');\n" +
+ "END;";
+
+ String expected = "CREATE VIEW G1 (\n" +
+ " e1 integer,\n" +
+ " e2 string\n" +
+ ")\n" +
+ "AS\n" +
+ "SELECT * FROM foo;\n" +
+ "\n" +
+ "CREATE TRIGGER ON G1 INSTEAD OF INSERT AS\n" +
+ "FOR EACH ROW\n" +
+ "BEGIN ATOMIC\n" +
+ "INSERT INTO g1 (e1, e2) VALUES (1, 'trig');\n" +
+ "END;";
+ helpTest(ddl, expected);
+ }
+
+ @Test
+ public void testSourceProcedure() throws Exception {
+ String ddl = "CREATE FOREIGN PROCEDURE myProc(OUT p1 boolean, p2 varchar, INOUT p3 decimal) " +
+ "RETURNS (r1 varchar, r2 decimal)" +
+ "OPTIONS(RANDOM 'any', UUID 'uuid', NAMEINSOURCE 'nis', ANNOTATION 'desc', UPDATECOUNT '2');";
+
+ String expected = "CREATE FOREIGN PROCEDURE myProc(OUT p1 boolean, IN p2 string, INOUT p3 bigdecimal) RETURNS (r1 string, r2 bigdecimal)\n" +
+ "OPTIONS (UUID 'uuid', ANNOTATION 'desc', NAMEINSOURCE 'nis', UPDATECOUNT 2, RANDOM 'any')";
+ helpTest(ddl, expected);
+ }
+
+ @Test
+ public void testPushdownFunctionNoArgs() throws Exception {
+ String ddl = "CREATE FOREIGN FUNCTION SourceFunc() RETURNS integer OPTIONS (UUID 'hello world')";
+ String expected = "CREATE FOREIGN FUNCTION SourceFunc() RETURNS integer\n" +
+ "OPTIONS (UUID 'hello world');";
+ helpTest(ddl, expected);
+ }
+
+ @Test
+ public void testNonPushdownFunction() throws Exception {
+ String ddl = "CREATE FUNCTION SourceFunc(p1 integer, p2 varchar) RETURNS integer OPTIONS (JAVA_CLASS 'foo', JAVA_MEHTOD 'bar')";
+ String expected = "CREATE VIRTUAL FUNCTION SourceFunc(p1 integer, p2 string) RETURNS integer\n" +
+ "OPTIONS (JAVA_CLASS 'foo', JAVA_MEHTOD 'bar');";
+ helpTest(ddl, expected);
+ }
+
+ private void helpTest(String ddl, String expected) throws ParseException {
+ Schema s = TestDDLParser.helpParse(ddl, "model").getSchema();
+ String metadataDDL = DDLStringVisitor.getDDLString(s, null, null);
+ //System.out.println(metadataDDL);
+ assertEquals(expected, metadataDDL);
+ }
+}
Property changes on: trunk/engine/src/test/java/org/teiid/query/metadata/TestDDLStringVisitor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/OperationsConstants.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/OperationsConstants.java 2012-06-22 14:46:04 UTC (rev 4200)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/OperationsConstants.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -45,4 +45,6 @@
public static final String TIMEOUT_IN_MILLI = "timeout-in-milli";//$NON-NLS-1$
public static final String TRANSLATOR_NAME = "translator-name"; //$NON-NLS-1$
+ public static final String ENTITY_TYPE = "entity-type"; //$NON-NLS-1$
+ public static final String ENTITY_PATTERN = "entity-pattern"; //$NON-NLS-1$
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java 2012-06-22 14:46:04 UTC (rev 4200)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -148,6 +148,7 @@
new ExecuteQuery().register(teiidSubsystem);
new MarkDataSourceAvailable().register(teiidSubsystem);
new ReadRARDescription().register(teiidSubsystem);
+ new GetSchema().register(teiidSubsystem);
}
@Override
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java 2012-06-22 14:46:04 UTC (rev 4200)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -37,11 +37,7 @@
import java.sql.Clob;
import java.sql.SQLException;
import java.sql.SQLXML;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.ResourceBundle;
+import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -60,9 +56,8 @@
import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
-import org.teiid.adminapi.Admin;
-import org.teiid.adminapi.AdminException;
-import org.teiid.adminapi.AdminProcessingException;
+import org.teiid.adminapi.*;
+import org.teiid.adminapi.Admin.SchemaObjectType;
import org.teiid.adminapi.VDB.ConnectionType;
import org.teiid.adminapi.impl.CacheStatisticsMetadata;
import org.teiid.adminapi.impl.RequestMetadata;
@@ -89,6 +84,10 @@
import org.teiid.dqp.internal.process.SessionAwareCache;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.metadata.MetadataStore;
+import org.teiid.metadata.Schema;
+import org.teiid.query.metadata.DDLStringVisitor;
+import org.teiid.query.metadata.TransformationMetadata;
import org.teiid.query.tempdata.TempTableDataManager;
abstract class TeiidOperationHandler extends BaseOperationHandler<DQPCore> {
@@ -866,6 +865,96 @@
}
}
+class GetSchema extends BaseOperationHandler<VDBRepository>{
+
+ protected GetSchema() {
+ super("get-schema"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected VDBRepository getService(OperationContext context, PathAddress pathAddress, ModelNode operation) throws OperationFailedException {
+ ServiceController<?> sc = context.getServiceRegistry(false).getRequiredService(TeiidServiceNames.VDB_REPO);
+ return VDBRepository.class.cast(sc.getValue());
+ }
+
+ @Override
+ protected void executeOperation(OperationContext context, VDBRepository repo, ModelNode operation) throws OperationFailedException {
+ if (!operation.hasDefined(OperationsConstants.VDB_NAME)) {
+ throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.getString(OperationsConstants.VDB_NAME+MISSING)));
+ }
+ if (!operation.hasDefined(OperationsConstants.VDB_VERSION)) {
+ throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.getString(OperationsConstants.VDB_VERSION+MISSING)));
+ }
+ if (!operation.hasDefined(OperationsConstants.MODEL_NAME)) {
+ throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.getString(OperationsConstants.MODEL_NAME+MISSING)));
+ }
+
+ ModelNode result = context.getResult();
+ String vdbName = operation.get(OperationsConstants.VDB_NAME).asString();
+ int vdbVersion = operation.get(OperationsConstants.VDB_VERSION).asInt();
+ String modelName = operation.get(OperationsConstants.MODEL_NAME).asString();
+
+ VDBMetaData vdb = repo.getVDB(vdbName, vdbVersion);
+ if (vdb == null || (vdb.getStatus() != VDB.Status.ACTIVE)) {
+ throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.getString("no_vdb_found", vdbName, vdbVersion))); //$NON-NLS-1$
+ }
+
+ EnumSet<SchemaObjectType> schemaTypes = null;
+ if (vdb.getModel(modelName) == null){
+ throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.getString("no_model_found", vdbName, vdbVersion, modelName))); //$NON-NLS-1$
+ }
+
+ if (operation.hasDefined(OperationsConstants.ENTITY_TYPE)) {
+ String[] types = operation.get(OperationsConstants.ENTITY_TYPE).asString().toUpperCase().split(","); //$NON-NLS-1$
+ if (types.length > 0) {
+ ArrayList<SchemaObjectType> sot = new ArrayList<Admin.SchemaObjectType>();
+ for (int i = 1; i < types.length; i++) {
+ sot.add(SchemaObjectType.valueOf(types[i]));
+ }
+ schemaTypes = EnumSet.of(SchemaObjectType.valueOf(types[0]), sot.toArray(new SchemaObjectType[sot.size()]));
+ }
+ else {
+ schemaTypes = EnumSet.of(SchemaObjectType.valueOf(types[0]));
+ }
+ }
+
+ String regEx = null;
+ if (operation.hasDefined(OperationsConstants.ENTITY_PATTERN)) {
+ regEx = operation.get(OperationsConstants.ENTITY_PATTERN).asString();
+ }
+
+ MetadataStore metadataStore = vdb.getAttachment(TransformationMetadata.class).getMetadataStore();
+ Schema schema = metadataStore.getSchema(modelName);
+ String ddl = DDLStringVisitor.getDDLString(schema, schemaTypes, regEx);
+ result.set(ddl);
+ }
+
+ protected void describeParameters(ModelNode operationNode, ResourceBundle bundle) {
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_NAME, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_NAME, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_NAME, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.VDB_NAME));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_VERSION, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_VERSION, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_VERSION, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.VDB_VERSION));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.MODEL_NAME, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.MODEL_NAME, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.MODEL_NAME, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.MODEL_NAME));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.ENTITY_TYPE, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.ENTITY_TYPE, REQUIRED).set(false);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.ENTITY_TYPE, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.ENTITY_TYPE));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.ENTITY_PATTERN, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.ENTITY_PATTERN, REQUIRED).set(false);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.ENTITY_PATTERN, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.ENTITY_PATTERN));
+
+ ModelNode reply = operationNode.get(REPLY_PROPERTIES);
+ reply.get(TYPE).set(ModelType.STRING);
+ }
+}
+
class ListVDBs extends BaseOperationHandler<VDBRepository>{
protected ListVDBs() {
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-06-22 14:46:04 UTC (rev 4200)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-06-22 21:11:13 UTC (rev 4201)
@@ -186,6 +186,8 @@
TEIID50020= {0} Failed to Pull {1}
TEIID50022={0} timeout pulling {1}
TEIID50078=Translator not found {0}
+no_vdb_found=VDB {0}.{1} not found or VDB is not in ACTIVE status
+no_model_found= VDB {0}.{1} does not have model with name {2}.
remove.reply.describe=remove service
remove.describe=remove service
@@ -215,6 +217,7 @@
rar-name.missing=Parameter "rar-name" is is required.
vdb-description.describe=vdb description
teiid_subsystem.describe=describe the teiid subsystem
+entity-type=Entity Type. Allowed values (ALL, TABLES, PROCEDURES, FUNCTIONS)
# Operation descriptions (alpha layout)
add-anyauthenticated-role.describe=Mark any authenticated to the datarole
@@ -295,6 +298,14 @@
get-vdb.vdb-version.describe=vdb version
get-vdb.reply=vdb
+get-schema.describe=Get the VDB with the given name and version
+get-schema.vdb-name.describe=name of the vdb
+get-schema.vdb-version.describe=vdb version
+get-schema.model-name.describe=model name
+get-schema.entity-type.describe=entity type. Allowed values are [ALL, TABLES, PROCEDURES, FUNCTIONS]. If omitted then ALL is assumed.
+get-schema.entity-pattern.describe=allow only entities that match the given regular expression pattern
+get-schema.reply=schema in the form of DDL
+
list-requests.describe=List of active requests
list-requests.reply=list of requests
Modified: trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
===================================================================
--- trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java 2012-06-22 14:46:04 UTC (rev 4200)
+++ trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -202,10 +202,10 @@
Assert.assertEquals(SUCCESS, result.get(OUTCOME).asString());
List<String> opNames = getList(result);
- assertEquals(39, opNames.size());
+ assertEquals(40, opNames.size());
String[] ops = { "add","add-anyauthenticated-role","add-data-role","assign-datasource",
"cache-statistics","cache-types","cancel-request","change-vdb-connection-type",
- "clear-cache","describe","execute-query","get-plan","get-translator","get-vdb",
+ "clear-cache","describe","execute-query","get-plan","get-schema", "get-translator","get-vdb",
"list-long-running-requests","list-requests","list-requests-per-session",
"list-requests-per-vdb","list-sessions","list-transactions","list-translators",
"list-vdbs","mark-datasource-available","read-attribute",
Modified: trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java 2012-06-22 14:46:04 UTC (rev 4200)
+++ trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java 2012-06-22 21:11:13 UTC (rev 4201)
@@ -454,4 +454,35 @@
conn.close();
return execCount;
}
+
+ @Test
+ public void testDDLExport() throws Exception{
+ String vdbName = "test";
+ String testVDB = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
+ "<vdb name=\"test\" version=\"1\">\n" +
+ " <property name=\"UseConnectorMetadata\" value=\"cached\" />\n" +
+ " <model name=\"loopy\">\n" +
+ " <source name=\"loop\" translator-name=\"loopy\" />\n" +
+ " </model>\n" +
+ "</vdb>";
+
+ Collection<?> vdbs = admin.getVDBs();
+ assertTrue(vdbs.isEmpty());
+
+ JavaArchive jar = getLoopyArchive();
+ admin.deploy("loopy.jar", jar.as(ZipExporter.class).exportAsInputStream());
+
+ // normal load
+ admin.deploy("test-vdb.xml", new ByteArrayInputStream(testVDB.getBytes()));
+ AdminUtil.waitForVDBLoad(admin, vdbName, 1, 3);
+
+ String ddl = admin.getSchema(vdbName, 1, "loopy", null, null);
+
+ String expected = "CREATE FOREIGN TABLE Matadata (\n" +
+ " execCount int OPTIONS (SEARCHABLE 'Searchable')\n" +
+ ");";
+ assertEquals(expected, ddl);
+
+ admin.undeploy("loopy.jar");
+ }
}
12 years, 6 months
teiid SVN: r4200 - in trunk: admin and 31 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-06-22 10:46:04 -0400 (Fri, 22 Jun 2012)
New Revision: 4200
Modified:
trunk/admin/pom.xml
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/pom.xml
trunk/client-jdk15/pom.xml
trunk/client/pom.xml
trunk/common-core/pom.xml
trunk/connectors/connector-file/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-ws/pom.xml
trunk/connectors/pom.xml
trunk/connectors/salesforce-api/pom.xml
trunk/connectors/sandbox/pom.xml
trunk/connectors/sandbox/translator-yahoo/pom.xml
trunk/connectors/translator-file/pom.xml
trunk/connectors/translator-hive/pom.xml
trunk/connectors/translator-jdbc/pom.xml
trunk/connectors/translator-jpa/pom.xml
trunk/connectors/translator-ldap/pom.xml
trunk/connectors/translator-loopback/pom.xml
trunk/connectors/translator-olap/pom.xml
trunk/connectors/translator-salesforce/pom.xml
trunk/connectors/translator-ws/pom.xml
trunk/engine/pom.xml
trunk/hibernate-dialect/pom.xml
trunk/jboss-integration/pom.xml
trunk/metadata/pom.xml
trunk/pom.xml
trunk/runtime/pom.xml
trunk/test-integration/common/pom.xml
trunk/test-integration/db/pom.xml
trunk/test-integration/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: trunk/admin/pom.xml
===================================================================
--- trunk/admin/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/admin/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-admin</artifactId>
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/adminshell/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/api/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/build/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/client/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/client-jdk15/pom.xml
===================================================================
--- trunk/client-jdk15/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/client-jdk15/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client-jdk15</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/common-core/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Modified: trunk/connectors/connector-file/pom.xml
===================================================================
--- trunk/connectors/connector-file/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/connector-file/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/connector-ldap/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/connector-salesforce/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: trunk/connectors/connector-ws/pom.xml
===================================================================
--- trunk/connectors/connector-ws/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/connector-ws/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/connectors/salesforce-api/pom.xml
===================================================================
--- trunk/connectors/salesforce-api/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/salesforce-api/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/sandbox/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: trunk/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Modified: trunk/connectors/translator-file/pom.xml
===================================================================
--- trunk/connectors/translator-file/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/translator-file/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: trunk/connectors/translator-hive/pom.xml
===================================================================
--- trunk/connectors/translator-hive/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/translator-hive/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-hive</artifactId>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/translator-jdbc/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: trunk/connectors/translator-jpa/pom.xml
===================================================================
--- trunk/connectors/translator-jpa/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/translator-jpa/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jpa</artifactId>
Modified: trunk/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/translator-ldap/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Modified: trunk/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/translator-loopback/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: trunk/connectors/translator-olap/pom.xml
===================================================================
--- trunk/connectors/translator-olap/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/translator-olap/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-olap</artifactId>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/translator-salesforce/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Modified: trunk/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-ws/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/connectors/translator-ws/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/engine/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/hibernate-dialect/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/jboss-integration/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-jboss-integration</artifactId>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/metadata/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -10,7 +10,7 @@
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
@@ -37,9 +37,9 @@
<version.junit>4.10</version.junit>
</properties>
<scm>
- <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-parent-8.1.0.Alpha2</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-parent-8.1.0.Alpha2</developerConnection>
- <url>http://anonsvn.jboss.org/repos/teiid/tags/teiid-parent-8.1.0.Alpha2</url>
+ <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/trunk</developerConnection>
+ <url>http://anonsvn.jboss.org/repos/teiid/trunk</url>
</scm>
<licenses>
<license>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/runtime/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-runtime</artifactId>
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/test-integration/common/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-integration-common</artifactId>
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/test-integration/db/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2012-06-22 14:45:50 UTC (rev 4199)
+++ trunk/test-integration/pom.xml 2012-06-22 14:46:04 UTC (rev 4200)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2</version>
+ <version>8.1.0.Alpha3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
12 years, 6 months
teiid SVN: r4199 - tags.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-06-22 10:45:50 -0400 (Fri, 22 Jun 2012)
New Revision: 4199
Added:
tags/teiid-parent-8.1.0.Alpha2/
Log:
[maven-release-plugin] copy for tag teiid-parent-8.1.0.Alpha2
12 years, 6 months
teiid SVN: r4198 - in trunk: admin and 31 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-06-22 10:45:42 -0400 (Fri, 22 Jun 2012)
New Revision: 4198
Modified:
trunk/admin/pom.xml
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/pom.xml
trunk/client-jdk15/pom.xml
trunk/client/pom.xml
trunk/common-core/pom.xml
trunk/connectors/connector-file/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-ws/pom.xml
trunk/connectors/pom.xml
trunk/connectors/salesforce-api/pom.xml
trunk/connectors/sandbox/pom.xml
trunk/connectors/sandbox/translator-yahoo/pom.xml
trunk/connectors/translator-file/pom.xml
trunk/connectors/translator-hive/pom.xml
trunk/connectors/translator-jdbc/pom.xml
trunk/connectors/translator-jpa/pom.xml
trunk/connectors/translator-ldap/pom.xml
trunk/connectors/translator-loopback/pom.xml
trunk/connectors/translator-olap/pom.xml
trunk/connectors/translator-salesforce/pom.xml
trunk/connectors/translator-ws/pom.xml
trunk/engine/pom.xml
trunk/hibernate-dialect/pom.xml
trunk/jboss-integration/pom.xml
trunk/metadata/pom.xml
trunk/pom.xml
trunk/runtime/pom.xml
trunk/test-integration/common/pom.xml
trunk/test-integration/db/pom.xml
trunk/test-integration/pom.xml
Log:
[maven-release-plugin] prepare release teiid-parent-8.1.0.Alpha2
Modified: trunk/admin/pom.xml
===================================================================
--- trunk/admin/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/admin/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-admin</artifactId>
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/adminshell/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/api/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/build/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/client/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/client-jdk15/pom.xml
===================================================================
--- trunk/client-jdk15/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/client-jdk15/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client-jdk15</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/common-core/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Modified: trunk/connectors/connector-file/pom.xml
===================================================================
--- trunk/connectors/connector-file/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/connector-file/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/connector-ldap/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/connector-salesforce/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: trunk/connectors/connector-ws/pom.xml
===================================================================
--- trunk/connectors/connector-ws/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/connector-ws/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/connectors/salesforce-api/pom.xml
===================================================================
--- trunk/connectors/salesforce-api/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/salesforce-api/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/sandbox/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: trunk/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Modified: trunk/connectors/translator-file/pom.xml
===================================================================
--- trunk/connectors/translator-file/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/translator-file/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: trunk/connectors/translator-hive/pom.xml
===================================================================
--- trunk/connectors/translator-hive/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/translator-hive/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-hive</artifactId>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/translator-jdbc/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: trunk/connectors/translator-jpa/pom.xml
===================================================================
--- trunk/connectors/translator-jpa/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/translator-jpa/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jpa</artifactId>
Modified: trunk/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/translator-ldap/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Modified: trunk/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/translator-loopback/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: trunk/connectors/translator-olap/pom.xml
===================================================================
--- trunk/connectors/translator-olap/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/translator-olap/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-olap</artifactId>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/translator-salesforce/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Modified: trunk/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-ws/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/connectors/translator-ws/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/engine/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/hibernate-dialect/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/jboss-integration/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-jboss-integration</artifactId>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/metadata/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -10,7 +10,7 @@
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
@@ -37,9 +37,9 @@
<version.junit>4.10</version.junit>
</properties>
<scm>
- <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/trunk</developerConnection>
- <url>http://anonsvn.jboss.org/repos/teiid/trunk</url>
+ <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-parent-8.1.0.Alpha2</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-parent-8.1.0.Alpha2</developerConnection>
+ <url>http://anonsvn.jboss.org/repos/teiid/tags/teiid-parent-8.1.0.Alpha2</url>
</scm>
<licenses>
<license>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/runtime/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-runtime</artifactId>
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/test-integration/common/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-integration-common</artifactId>
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/test-integration/db/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2012-06-22 13:46:02 UTC (rev 4197)
+++ trunk/test-integration/pom.xml 2012-06-22 14:45:42 UTC (rev 4198)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.1.0.Alpha2-SNAPSHOT</version>
+ <version>8.1.0.Alpha2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
12 years, 6 months
teiid SVN: r4197 - in trunk: build/kits/jboss-as7/bin/scripts and 11 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-06-22 09:46:02 -0400 (Fri, 22 Jun 2012)
New Revision: 4197
Added:
trunk/engine/src/main/resources/META-INF/services/org.teiid.PolicyDecider
Removed:
trunk/engine/src/main/resources/META-INF/services/org.teiid.dqp.internal.process.AuthorizationValidator
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java
trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli
trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html
trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java
Log:
TEIID-2082 opted to use the policydecider as the server instead
Modified: trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -29,6 +29,8 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.xml.XMLConstants;
import javax.xml.stream.XMLInputFactory;
@@ -78,8 +80,7 @@
try {
content.close();
} catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Logger.getLogger(VDBMetadataParser.class.getName()).log(Level.FINE, "Exception closing vdb stream", e);
}
}
return null;
Modified: trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli
===================================================================
--- trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli 2012-06-22 13:46:02 UTC (rev 4197)
@@ -16,7 +16,7 @@
/profile=ha/subsystem=security/security-domain=teiid-security/authentication=classic:add(login-modules=[{"code"=>"org.jboss.security.auth.spi.UsersRolesLoginModule", "flag"=>"required", "module-options"=>[("usersProperties"=>"${jboss.domain.config.dir}/teiid-security-users.properties"), ("rolesProperties"=>"${jboss.domain.config.dir}/teiid-security-roles.properties")]}])
/profile=ha/subsystem=threads/bounded-queue-thread-pool=teiid-async:add(name=teiid-async, max-threads=4, queue-length=100)
-/profile=ha/subsystem=teiid:add(async-thread-pool=teiid-async, distributed-cache-jgroups-stack=udp, resultset-cache-infinispan-container=teiid-cache, authorization-validator-module=org.jboss.teiid)
+/profile=ha/subsystem=teiid:add(async-thread-pool=teiid-async, distributed-cache-jgroups-stack=udp, resultset-cache-infinispan-container=teiid-cache, policy-decider-module=org.jboss.teiid)
/profile=ha/subsystem=teiid/transport=embedded:add()
/profile=ha/subsystem=teiid/transport=jdbc:add(protocol=teiid, socket-binding=teiid-jdbc, ssl-mode=login, authentication-security-domain=teiid-security)
/profile=ha/subsystem=teiid/transport=odbc:add(protocol=pg, socket-binding=teiid-odbc, authentication-security-domain=teiid-security)
Modified: trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html 2012-06-22 13:46:02 UTC (rev 4197)
@@ -46,6 +46,7 @@
<li>FunctionMethod.getFullName returns the proper schema, not category qualified name.
<li>VDB.getUrl has been removed.
<li>VDB.Status now has three states - LOADING, ACTIVE, REMOVED. To check for validity use the isValid method, rather than checking for the VALID state.
+ <li>The standalone and cli configuration files specify a setting for the teiid subsystem policy-decider-module. If a module is not specified, then data roles will not be checked.
<ul>
<h4>from 7.x</h4>
Modified: trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-06-22 13:46:02 UTC (rev 4197)
@@ -278,7 +278,7 @@
<transport name="odbc" protocol="pg" socket-binding="teiid-odbc">
<authentication security-domain="teiid-security"/>
</transport>
- <authorization-validator-module>org.jboss.teiid</authorization-validator-module>
+ <policy-decider-module>org.jboss.teiid</policy-decider-module>
<translator name="jdbc-simple" module="org.jboss.teiid.translator.jdbc"/>
<translator name="jdbc-ansi" module="org.jboss.teiid.translator.jdbc"/>
<translator name="access" module="org.jboss.teiid.translator.jdbc"/>
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -101,6 +101,7 @@
*/
public class BufferFrontedFileStoreCache implements Cache<PhysicalInfo>, StorageManager {
+ private static final long TIMEOUT_NANOS = TimeUnit.SECONDS.toNanos(120);
private static final int DEFAULT_MIN_DEFRAG = 1 << 26;
private static final byte[] HEADER_SKIP_BUFFER = new byte[16];
private static final int EVICTION_SCANS = 2;
@@ -1017,11 +1018,17 @@
}
freedLock.lock();
try {
- next = blocksInuse.getAndSetNextClearBit();
- if (next != EMPTY_ADDRESS) {
- return next;
+ long waitTime = TIMEOUT_NANOS;
+ while (true) {
+ next = blocksInuse.getAndSetNextClearBit();
+ if (next != EMPTY_ADDRESS) {
+ return next;
+ }
+ waitTime = blocksFreed.awaitNanos(waitTime);
+ if (waitTime <= 0) {
+ break;
+ }
}
- blocksFreed.await(120, TimeUnit.SECONDS);
} finally {
freedLock.unlock();
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -34,7 +34,6 @@
*/
public class DefaultAuthorizationValidator implements AuthorizationValidator {
- private boolean enabled = true;
private PolicyDecider policyDecider;
public DefaultAuthorizationValidator() {
@@ -45,7 +44,7 @@
QueryMetadataInterface metadata, CommandContext commandContext,
CommandType commandType) throws QueryValidatorException,
TeiidComponentException {
- if (enabled && policyDecider.validateCommand(commandContext)) {
+ if (policyDecider != null && policyDecider.validateCommand(commandContext)) {
AuthorizationValidationVisitor visitor = new AuthorizationValidationVisitor(this.policyDecider, commandContext);
Request.validateWithVisitor(visitor, metadata, command);
}
@@ -54,7 +53,7 @@
@Override
public boolean hasRole(String roleName, CommandContext commandContext) {
- if (!enabled) {
+ if (policyDecider == null) {
return true;
}
return this.policyDecider.hasRole(roleName, commandContext);
@@ -64,16 +63,4 @@
this.policyDecider = policyDecider;
}
- public PolicyDecider getPolicyDecider() {
- return policyDecider;
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
}
Copied: trunk/engine/src/main/resources/META-INF/services/org.teiid.PolicyDecider (from rev 4196, trunk/engine/src/main/resources/META-INF/services/org.teiid.dqp.internal.process.AuthorizationValidator)
===================================================================
--- trunk/engine/src/main/resources/META-INF/services/org.teiid.PolicyDecider (rev 0)
+++ trunk/engine/src/main/resources/META-INF/services/org.teiid.PolicyDecider 2012-06-22 13:46:02 UTC (rev 4197)
@@ -0,0 +1 @@
+org.teiid.dqp.internal.process.DataRolePolicyDecider
\ No newline at end of file
Deleted: trunk/engine/src/main/resources/META-INF/services/org.teiid.dqp.internal.process.AuthorizationValidator
===================================================================
--- trunk/engine/src/main/resources/META-INF/services/org.teiid.dqp.internal.process.AuthorizationValidator 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/engine/src/main/resources/META-INF/services/org.teiid.dqp.internal.process.AuthorizationValidator 2012-06-22 13:46:02 UTC (rev 4197)
@@ -1 +0,0 @@
-org.teiid.dqp.internal.process.DefaultAuthorizationValidator
\ No newline at end of file
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -242,7 +242,6 @@
serverRequest.initialize(request, BufferManagerFactory.getStandaloneBufferManager(), null, new FakeTransactionService(), null, workContext, prepPlanCache);
serverRequest.setMetadata(capFinder, metadata, null);
DefaultAuthorizationValidator drav = new DefaultAuthorizationValidator();
- drav.setEnabled(false);
serverRequest.setAuthorizationValidator(drav);
serverRequest.processRequest();
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -142,7 +142,6 @@
request.initialize(message, Mockito.mock(BufferManager.class),
new FakeDataManager(), new FakeTransactionService(), TEMP_TABLE_STORE, workContext, null);
DefaultAuthorizationValidator drav = new DefaultAuthorizationValidator();
- drav.setEnabled(false);
request.setAuthorizationValidator(drav);
request.processRequest();
return request;
Modified: trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -91,7 +91,8 @@
// ################################## TEST HELPERS ################################
- private FunctionDescriptor helpCreateDescriptor(String name, Class<?>[] types) {
+ @SuppressWarnings("serial")
+ private FunctionDescriptor helpCreateDescriptor(String name, Class<?>[] types) {
final String fname = name;
final Class<?>[] ftypes = types;
return new FunctionDescriptor() {
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -95,6 +95,7 @@
TEIID50076,
TEIID50077,
TEIID50078,
- TEIID50088
+ TEIID50088,
+ TEIID50089
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -24,6 +24,7 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
@@ -77,7 +78,6 @@
import org.teiid.dqp.internal.process.AuthorizationValidator;
import org.teiid.dqp.internal.process.CachedResults;
import org.teiid.dqp.internal.process.DQPCore;
-import org.teiid.dqp.internal.process.DataRolePolicyDecider;
import org.teiid.dqp.internal.process.DefaultAuthorizationValidator;
import org.teiid.dqp.internal.process.PreparedPlan;
import org.teiid.dqp.internal.process.SessionAwareCache;
@@ -281,14 +281,10 @@
edfsServiceBuilder.addDependency(replicatorAvailable?DependencyType.REQUIRED:DependencyType.OPTIONAL, TeiidServiceNames.OBJECT_REPLICATOR, ObjectReplicator.class, edfs.objectReplicatorInjector);
newControllers.add(edfsServiceBuilder.install());
- PolicyDecider policyDecider;
+ PolicyDecider policyDecider = null;
if (Element.POLICY_DECIDER_MODULE_ELEMENT.isDefined(operation)) {
policyDecider = buildService(PolicyDecider.class, Element.POLICY_DECIDER_MODULE_ELEMENT.asString(operation));
}
- else {
- DataRolePolicyDecider drpd = new DataRolePolicyDecider();
- policyDecider = drpd;
- }
final AuthorizationValidator authValidator;
if (Element.AUTHORIZATION_VALIDATOR_MODULE_ELEMENT.isDefined(operation)) {
@@ -296,12 +292,9 @@
}
else {
DefaultAuthorizationValidator dap = new DefaultAuthorizationValidator();
- dap.setEnabled(false);
+ dap.setPolicyDecider(policyDecider);
authValidator = dap;
}
- if (authValidator instanceof DefaultAuthorizationValidator) {
- ((DefaultAuthorizationValidator)authValidator).setPolicyDecider(policyDecider);
- }
ValueService<AuthorizationValidator> authValidatorService = new ValueService<AuthorizationValidator>(new org.jboss.msc.value.Value<AuthorizationValidator>() {
@Override
@@ -426,12 +419,15 @@
moduleId = ModuleIdentifier.create(moduleName);
module = Module.getCallerModuleLoader().loadModule(moduleId);
} catch (ModuleLoadException e) {
- throw new OperationFailedException(e, new ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50069, moduleName)));
+ throw new OperationFailedException(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50069, moduleName), e);
}
ServiceLoader<T> services = module.loadService(type);
- return services.iterator().next();
+ Iterator<T> iter = services.iterator();
+ if (!iter.hasNext()) {
+ throw new OperationFailedException(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50089, type.getName(), moduleName));
+ }
+ return iter.next();
}
-
private BufferManagerService buildBufferManager(ModelNode node) {
BufferManagerService bufferManger = new BufferManagerService();
Modified: trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -50,13 +50,16 @@
if (buf == null) {
lock.lock();
try {
- write.await(timeout, TimeUnit.MILLISECONDS);
+ long waitTime = TimeUnit.MILLISECONDS.toNanos(timeout);
+ while (buf == null) {
+ waitTime = write.awaitNanos(waitTime);
+ if (waitTime <= 0) {
+ throw new IOException(new TimeoutException());
+ }
+ }
if (index < 0) {
return -1;
}
- if (buf == null) {
- throw new IOException(new TimeoutException());
- }
} catch(InterruptedException e) {
throw new IOException(e);
} finally {
@@ -95,7 +98,7 @@
if (index == -1) {
return;
}
- if (buf != null) {
+ while (buf != null) {
doneReading.await();
}
if (index == -1) {
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-06-22 13:46:02 UTC (rev 4197)
@@ -59,6 +59,7 @@
TEIID50042=error setting state {0}
TEIID50043=Invalid metadata file found at {0}; delete this file and restart server.
TEIID50069=Failed to load module {0}
+TEIID50089=Failed to find any services of type {0} from module {1}
TEIID50007=Failed to load module {1} for translator {2}
TEIID50088=Failed to load module {0} for UDF in VDB {1}.{2}:{3}
TEIID50072=The username "{0}" and/or password and/or payload token could not be authenticated by any membership domain.
Modified: trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java 2012-06-22 01:39:29 UTC (rev 4196)
+++ trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java 2012-06-22 13:46:02 UTC (rev 4197)
@@ -36,6 +36,8 @@
import org.junit.Test;
import org.mockito.Mockito;
import org.mockito.internal.progress.OngoingStubbing;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.dqp.internal.datamgr.ConnectorManager;
@@ -93,6 +95,7 @@
}
private static FakeReusableExecution execution;
+ private static boolean isDisposed;
@Before public void setup() throws DataNotAvailableException, TranslatorException {
execution = Mockito.mock(FakeReusableExecution.class);
@@ -100,6 +103,16 @@
for (int i = 1; i < EXEC_COUNT; i++) {
stubbing.toReturn((List<Object>) Arrays.asList((Object)null)).toReturn(null);
}
+ Mockito.doAnswer(new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) throws Throwable {
+ synchronized (TestExecutionReuse.class) {
+ isDisposed = true;
+ TestExecutionReuse.class.notify();
+ }
+ return null;
+ }
+ }).when(execution).dispose();
}
@BeforeClass public static void oneTimeSetUp() throws Exception {
@@ -160,7 +173,7 @@
@Override
public void onException(Statement stmt, Exception e) {
- result.getResultsReceiver().receiveResults(rowCount);
+ result.getResultsReceiver().exceptionOccurred(e);
}
@Override
@@ -168,6 +181,11 @@
result.getResultsReceiver().receiveResults(rowCount);
}
}, new RequestOptions().continuous(true));
+ synchronized (TestExecutionReuse.class) {
+ while (!isDisposed) {
+ TestExecutionReuse.class.wait();
+ }
+ }
assertEquals(EXEC_COUNT, result.get().intValue());
Mockito.verify(execution, Mockito.times(1)).dispose();
Mockito.verify(execution, Mockito.times(EXEC_COUNT)).execute();
12 years, 6 months
teiid SVN: r4196 - in trunk: build/kits/jboss-as7/standalone/configuration and 6 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-06-21 21:39:29 -0400 (Thu, 21 Jun 2012)
New Revision: 4196
Added:
trunk/engine/src/main/resources/META-INF/
trunk/engine/src/main/resources/META-INF/services/
trunk/engine/src/main/resources/META-INF/services/org.teiid.dqp.internal.process.AuthorizationValidator
Modified:
trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli
trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidator.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestAuthorizationValidationVisitor.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
Log:
TEIID-2082 correcting validation of common table expressions and allowing the config to disable authorization validation
Modified: trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli
===================================================================
--- trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli 2012-06-21 19:07:57 UTC (rev 4195)
+++ trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli 2012-06-22 01:39:29 UTC (rev 4196)
@@ -16,7 +16,7 @@
/profile=ha/subsystem=security/security-domain=teiid-security/authentication=classic:add(login-modules=[{"code"=>"org.jboss.security.auth.spi.UsersRolesLoginModule", "flag"=>"required", "module-options"=>[("usersProperties"=>"${jboss.domain.config.dir}/teiid-security-users.properties"), ("rolesProperties"=>"${jboss.domain.config.dir}/teiid-security-roles.properties")]}])
/profile=ha/subsystem=threads/bounded-queue-thread-pool=teiid-async:add(name=teiid-async, max-threads=4, queue-length=100)
-/profile=ha/subsystem=teiid:add(async-thread-pool=teiid-async, distributed-cache-jgroups-stack=udp, resultset-cache-infinispan-container=teiid-cache)
+/profile=ha/subsystem=teiid:add(async-thread-pool=teiid-async, distributed-cache-jgroups-stack=udp, resultset-cache-infinispan-container=teiid-cache, authorization-validator-module=org.jboss.teiid)
/profile=ha/subsystem=teiid/transport=embedded:add()
/profile=ha/subsystem=teiid/transport=jdbc:add(protocol=teiid, socket-binding=teiid-jdbc, ssl-mode=login, authentication-security-domain=teiid-security)
/profile=ha/subsystem=teiid/transport=odbc:add(protocol=pg, socket-binding=teiid-odbc, authentication-security-domain=teiid-security)
Modified: trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-06-21 19:07:57 UTC (rev 4195)
+++ trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-06-22 01:39:29 UTC (rev 4196)
@@ -278,7 +278,7 @@
<transport name="odbc" protocol="pg" socket-binding="teiid-odbc">
<authentication security-domain="teiid-security"/>
</transport>
-
+ <authorization-validator-module>org.jboss.teiid</authorization-validator-module>
<translator name="jdbc-simple" module="org.jboss.teiid.translator.jdbc"/>
<translator name="jdbc-ansi" module="org.jboss.teiid.translator.jdbc"/>
<translator name="access" module="org.jboss.teiid.translator.jdbc"/>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java 2012-06-21 19:07:57 UTC (rev 4195)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java 2012-06-22 01:39:29 UTC (rev 4196)
@@ -22,17 +22,7 @@
package org.teiid.dqp.internal.process;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import org.teiid.CommandContext;
import org.teiid.PolicyDecider;
@@ -53,17 +43,7 @@
import org.teiid.query.metadata.TempMetadataID;
import org.teiid.query.resolver.util.ResolverUtil;
import org.teiid.query.sql.LanguageObject;
-import org.teiid.query.sql.lang.AlterProcedure;
-import org.teiid.query.sql.lang.AlterTrigger;
-import org.teiid.query.sql.lang.AlterView;
-import org.teiid.query.sql.lang.Create;
-import org.teiid.query.sql.lang.Delete;
-import org.teiid.query.sql.lang.Drop;
-import org.teiid.query.sql.lang.Insert;
-import org.teiid.query.sql.lang.Into;
-import org.teiid.query.sql.lang.Query;
-import org.teiid.query.sql.lang.StoredProcedure;
-import org.teiid.query.sql.lang.Update;
+import org.teiid.query.sql.lang.*;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
@@ -298,7 +278,7 @@
Map<String, LanguageObject> procMap = new LinkedHashMap<String, LanguageObject>();
addToNameMap(((TempMetadataID)metadataID).getOriginalMetadataID(), symbol, procMap);
validateEntitlements(PermissionType.EXECUTE, auditContext, procMap);
- } else if (group.isTempTable()) {
+ } else if (group.isTempTable() && group.isImplicitTempGroupSymbol()) {
validateTemp(actionCode, group, auditContext);
}
continue;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidator.java 2012-06-21 19:07:57 UTC (rev 4195)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidator.java 2012-06-22 01:39:29 UTC (rev 4196)
@@ -63,7 +63,4 @@
*/
boolean hasRole(String roleName, CommandContext commandContext);
- boolean isEnabled();
-
- void setEnabled(boolean enabled);
-}
+}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2012-06-21 19:07:57 UTC (rev 4195)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2012-06-22 01:39:29 UTC (rev 4196)
@@ -100,20 +100,6 @@
this.lobChunkSizeInKB = lobChunkSizeInKB;
}
- /**
- * Determine whether role checking is enabled on the server.
- * @return <code>true</code> if server-side role checking is enabled.
- */
- public boolean getUseDataRoles() {
- return this.authorizationValidator != null && this.authorizationValidator.isEnabled();
- }
-
- public void setUseDataRoles(boolean useEntitlements) {
- if (this.authorizationValidator != null) {
- this.authorizationValidator.setEnabled(useEntitlements);
- }
- }
-
public int getQueryThresholdInSecs() {
return (int)queryThresholdInMilli/1000;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java 2012-06-21 19:07:57 UTC (rev 4195)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java 2012-06-22 01:39:29 UTC (rev 4196)
@@ -68,12 +68,10 @@
return policyDecider;
}
- @Override
public boolean isEnabled() {
return enabled;
}
- @Override
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
Added: trunk/engine/src/main/resources/META-INF/services/org.teiid.dqp.internal.process.AuthorizationValidator
===================================================================
--- trunk/engine/src/main/resources/META-INF/services/org.teiid.dqp.internal.process.AuthorizationValidator (rev 0)
+++ trunk/engine/src/main/resources/META-INF/services/org.teiid.dqp.internal.process.AuthorizationValidator 2012-06-22 01:39:29 UTC (rev 4196)
@@ -0,0 +1 @@
+org.teiid.dqp.internal.process.DefaultAuthorizationValidator
\ No newline at end of file
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestAuthorizationValidationVisitor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestAuthorizationValidationVisitor.java 2012-06-21 19:07:57 UTC (rev 4195)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestAuthorizationValidationVisitor.java 2012-06-22 01:39:29 UTC (rev 4196)
@@ -310,9 +310,12 @@
helpTest("SELECT e1 INTO #temp FROM pm1.g1", RealMetadataFactory.example1Cached(), new String[] {}, RealMetadataFactory.example1VDB(), exampleAuthSvc1()); //$NON-NLS-1$
helpTest("SELECT e1 INTO #temp FROM pm1.g1", RealMetadataFactory.example1Cached(), new String[] {"#temp"}, RealMetadataFactory.example1VDB(), exampleAuthSvc2()); //$NON-NLS-1$
helpTest("SELECT e1 INTO #temp FROM pm1.g1", RealMetadataFactory.example1Cached(), new String[] {}, RealMetadataFactory.example1VDB(), exampleAuthSvc2(), exampleAuthSvc1()); //$NON-NLS-1$
-
}
+ @Test public void testCommonTable() throws Exception {
+ helpTest("WITH X AS (SELECT e1 from pm1.g2) SELECT e1 from x", RealMetadataFactory.example1Cached(), new String[] {}, RealMetadataFactory.example1VDB(), exampleAuthSvc2()); //$NON-NLS-1$
+ }
+
@Test public void testTempTableSelectInto1() throws Exception {
helpTest("SELECT e1, e2 INTO #temp FROM pm1.g1", RealMetadataFactory.example1Cached(), new String[] {"pm1.g1.e2"}, RealMetadataFactory.example1VDB(), exampleAuthSvc1()); //$NON-NLS-1$ //$NON-NLS-2$
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-06-21 19:07:57 UTC (rev 4195)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-06-22 01:39:29 UTC (rev 4196)
@@ -287,22 +287,21 @@
}
else {
DataRolePolicyDecider drpd = new DataRolePolicyDecider();
- drpd.setAllowCreateTemporaryTablesByDefault(true);
- drpd.setAllowFunctionCallsByDefault(true);
policyDecider = drpd;
}
final AuthorizationValidator authValidator;
if (Element.AUTHORIZATION_VALIDATOR_MODULE_ELEMENT.isDefined(operation)) {
authValidator = buildService(AuthorizationValidator.class, Element.AUTHORIZATION_VALIDATOR_MODULE_ELEMENT.asString(operation));
- authValidator.setEnabled(true);
}
else {
DefaultAuthorizationValidator dap = new DefaultAuthorizationValidator();
- dap.setPolicyDecider(policyDecider);
- dap.setEnabled(true);
+ dap.setEnabled(false);
authValidator = dap;
}
+ if (authValidator instanceof DefaultAuthorizationValidator) {
+ ((DefaultAuthorizationValidator)authValidator).setPolicyDecider(policyDecider);
+ }
ValueService<AuthorizationValidator> authValidatorService = new ValueService<AuthorizationValidator>(new org.jboss.msc.value.Value<AuthorizationValidator>() {
@Override
12 years, 6 months