teiid SVN: r3234 - in trunk: build/kits/jboss-container and 7 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-06-08 12:54:23 -0400 (Wed, 08 Jun 2011)
New Revision: 3234
Added:
trunk/engine/src/test/java/org/teiid/query/parser/TestLimitParsing.java
Modified:
trunk/api/src/main/java/org/teiid/language/SQLConstants.java
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/LanguageBridgeFactory.java
trunk/engine/src/main/…
[View More]java/org/teiid/query/sql/visitor/SQLStringVisitor.java
trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestLimitNode.java
Log:
TEIID-1620 adding support for offset/fetch query clauses
Modified: trunk/api/src/main/java/org/teiid/language/SQLConstants.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2011-06-08 16:02:59 UTC (rev 3233)
+++ trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2011-06-08 16:54:23 UTC (rev 3234)
@@ -273,6 +273,7 @@
public static final String NUMERIC = "NUMERIC"; //$NON-NLS-1$
public static final String OBJECT = "OBJECT"; //$NON-NLS-1$
public static final String OF = "OF"; //$NON-NLS-1$
+ public static final String OFFSET = "OFFSET"; //$NON-NLS-1$
public static final String OLD = "OLD"; //$NON-NLS-1$
public static final String ON = "ON"; //$NON-NLS-1$
public static final String ONLY = "ONLY"; //$NON-NLS-1$
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-06-08 16:02:59 UTC (rev 3233)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-06-08 16:54:23 UTC (rev 3234)
@@ -30,6 +30,7 @@
<LI><B>MAKEIND Hint</B> - The MAKEIND hint can be used to indicate that the other side of the join should be made dependent.
<LI><B>ODBC SSL</B> - added support for SSL encrypted ODBC connections.
<LI><B>Reauthentication Statement</B> - SET SESSION AUTHORIZATION can now be used to perform a reauthentication via JDBC or ODBC.
+ <LI><B>ANSI OFFSET/FETCH FIRST</B> - instead of the limit clause, a standard OFFSET and/or FETCH FIRST/NEXT clause can be used to limit results.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
<ul>
@@ -38,6 +39,11 @@
<li>Support for using the FROM clause post item hints MAKEDEP/MAKENOTDEP has been deprecated. Use the pre item comment hint syntax instead, e.g. /*+ MAKEDEP */ tbl
</ul>
+<h4>from 7.4</h4>
+<ul>
+ <li>OFFSET was added as a keyword.
+</ul>
+
<h4>from 7.3</h4>
<ul>
<li>SYS.PROPERTIES has a new column, ClobValue, to get values exceeding the max string length
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2011-06-08 16:02:59 UTC (rev 3233)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2011-06-08 16:54:23 UTC (rev 3234)
@@ -445,7 +445,7 @@
</listitem>
<listitem>
<para>
- <link linkend="limit_clause">[LIMIT [offset,] limit]</link>
+ <link linkend="limit_clause">[(LIMIT ...) | ([OFFSET ...] [FETCH ...])]</link>
</para>
</listitem>
<listitem>
@@ -1032,13 +1032,27 @@
<section id="limit_clause">
<title>LIMIT Clause</title>
<para>
- The LIMIT clause specifies a limit on the number of records returned from the SELECT command. An optional offset (the number of rows to skip) can be specified.
+ The LIMIT clause specifies a limit on the number of records returned from the SELECT command. An optional offset (the number of rows to skip) can be specified. The LIMIT clause can also be specfied using the SQL 2008 OFFSET/FETCH FIRST clauses.
+ If an ORDER BY is also specified, it will be applied before the OFFSET/LIMIT are applied. If an ORDER BY is not specified there is generally no guarantee what subset of rows will be returned.
</para>
<para>
Usage:
<synopsis label="Usage">LIMIT [offset,] limit</synopsis>
+ <synopsis label="Usage">[OFFSET offset ROW|ROWS] [FETCH FIRST|NEXT [limit] ROW|ROWS ONLY</synopsis>
</para>
<itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>The limit/offset expressions must be a non-negative integer or a parameter reference (?). An offset of 0 is ignored. A limit of 0 will return no rows.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The terms FIRST/NEXT are interchangable as well as ROW/ROWS.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
<para>Examples:
</para>
<listitem>
@@ -1047,6 +1061,15 @@
<listitem>
<para>LIMIT 500, 100 - skips 500 records and returns the next 100 records (rows 501-600)</para>
</listitem>
+ <listitem>
+ <para>OFFSET 500 ROWS - skips 500 records</para>
+ </listitem>
+ <listitem>
+ <para>OFFSET 500 ROWS FETCH NEXT 100 ROWS ONLY - skips 500 records and returns the next 100 records (rows 501-600)</para>
+ </listitem>
+ <listitem>
+ <para>FETCH FIRST ROW ONLY - returns only the first record</para>
+ </listitem>
</itemizedlist>
</section>
<section id="into_clause">
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/LanguageBridgeFactory.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/LanguageBridgeFactory.java 2011-06-08 16:02:59 UTC (rev 3233)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/LanguageBridgeFactory.java 2011-06-08 16:54:23 UTC (rev 3234)
@@ -762,7 +762,10 @@
rowOffset = ((Integer)c1.getValue()).intValue();
}
Literal c2 = (Literal)translate(limit.getRowLimit());
- int rowLimit = ((Integer)c2.getValue()).intValue();
+ int rowLimit = Integer.MAX_VALUE;
+ if (c2 != null) {
+ rowLimit = ((Integer)c2.getValue()).intValue();
+ }
return new org.teiid.language.Limit(rowOffset, rowLimit);
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2011-06-08 16:02:59 UTC (rev 3233)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2011-06-08 16:54:23 UTC (rev 3234)
@@ -1706,6 +1706,14 @@
}
public void visit( Limit obj ) {
+ if (obj.getRowLimit() == null) {
+ append(OFFSET);
+ append(SPACE);
+ visitNode(obj.getOffset());
+ append(SPACE);
+ append(ROWS);
+ return;
+ }
append(LIMIT);
if (obj.getOffset() != null) {
append(SPACE);
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-06-08 16:02:59 UTC (rev 3233)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-06-08 16:54:23 UTC (rev 3234)
@@ -213,6 +213,7 @@
| <NOT: "not">
| <NULL: "null">
| <OF: "of">
+| <OFFSET: "offset">
| <OLD: "old">
| <ON: "on">
| <ONLY: "only">
@@ -3157,41 +3158,63 @@
}
}
+Expression intParam(ParseInfo info) :
+{
+ Integer val = null;
+}
+{
+ (val = intVal() | <QMARK>)
+ {
+ if (val == null) {
+ return new Reference(info.referenceCount++);
+ }
+ return new Constant(val, DataTypeManager.DefaultDataClasses.INTEGER);
+ }
+}
+
/**
* <p>Parse an LIMIT clause.</p>
* @return Parsed LIMIT
- * @throws ParseException if parsing failed
+ * @throws ParseException if parsing failed
*/
Limit limit(ParseInfo info) :
{
- Token val = null;
- Token rowLimit = null;
- Token ref = null;
- Expression expr1 = null;
- Expression expr2 = null;
+ Expression limit = null;
+ Expression offset = null;
}
{
- <LIMIT>
- (val=<INTEGERVAL> | <QMARK>)
- [<COMMA> (rowLimit=<INTEGERVAL> | ref=<QMARK>)]
+ ((<LIMIT> offset = intParam(info)
+ [<COMMA> limit = intParam(info)])
{
- if (val == null) {
- expr1 = new Reference(info.referenceCount++);
- } else {
- expr1 = new Constant(Integer.valueOf(val.image), DataTypeManager.DefaultDataClasses.INTEGER);
- }
- if (rowLimit == null && ref == null) {
- return new Limit(null, expr1);
- }
- if (rowLimit == null) {
- expr2 = new Reference(info.referenceCount++);
- } else {
- expr2 = new Constant(Integer.valueOf(rowLimit.image), DataTypeManager.DefaultDataClasses.INTEGER);
- }
- return new Limit(expr1, expr2);
+ if (limit == null) {
+ limit = offset;
+ offset = null;
+ }
}
+ |
+ (<OFFSET> offset = intParam(info) (<ROW>|<ROWS>)
+ [limit = fetchLimit(info)])
+ |
+ (limit = fetchLimit(info)))
+ {
+ return new Limit(offset, limit);
+ }
}
+Expression fetchLimit(ParseInfo info) :
+{
+ Expression limit = null;
+}
+{
+ <FETCH> nonReserved("FIRST", "NEXT") [limit = intParam(info)] (<ROW>|<ROWS>) <ONLY>
+ {
+ if (limit == null) {
+ return new Constant(1, DataTypeManager.DefaultDataClasses.INTEGER);
+ }
+ return limit;
+ }
+}
+
/**
* <p>Parse an OPTION clause.</p>
* @return Parsed OPTION clause
Added: trunk/engine/src/test/java/org/teiid/query/parser/TestLimitParsing.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestLimitParsing.java (rev 0)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestLimitParsing.java 2011-06-08 16:54:23 UTC (rev 3234)
@@ -0,0 +1,145 @@
+/*
+ * 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.parser;
+
+import static org.teiid.query.parser.TestParser.*;
+
+import java.util.Arrays;
+
+import org.junit.Test;
+import org.teiid.query.sql.lang.From;
+import org.teiid.query.sql.lang.Limit;
+import org.teiid.query.sql.lang.Query;
+import org.teiid.query.sql.lang.Select;
+import org.teiid.query.sql.lang.SetQuery;
+import org.teiid.query.sql.lang.UnaryFromClause;
+import org.teiid.query.sql.lang.SetQuery.Operation;
+import org.teiid.query.sql.symbol.AllSymbol;
+import org.teiid.query.sql.symbol.Constant;
+import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.Reference;
+
+public class TestLimitParsing {
+
+ @Test public void testLimit() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setLimit(new Limit(null, new Constant(new Integer(100))));
+ helpTest("Select * from a limit 100", "SELECT * FROM a LIMIT 100", query); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testLimitWithOffset() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setLimit(new Limit(new Constant(new Integer(50)), new Constant(new Integer(100))));
+ helpTest("Select * from a limit 50,100", "SELECT * FROM a LIMIT 50, 100", query); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testLimitWithReferences1() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setLimit(new Limit(new Reference(0), new Constant(new Integer(100))));
+ helpTest("Select * from a limit ?,100", "SELECT * FROM a LIMIT ?, 100", query); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testLimitWithReferences2() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setLimit(new Limit(new Constant(new Integer(50)), new Reference(0)));
+ helpTest("Select * from a limit 50,?", "SELECT * FROM a LIMIT 50, ?", query); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testLimitWithReferences3() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setLimit(new Limit(new Reference(0), new Reference(1)));
+ helpTest("Select * from a limit ?,?", "SELECT * FROM a LIMIT ?, ?", query); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testSetQueryLimit() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ SetQuery setQuery = new SetQuery(Operation.UNION, true, query, query);
+ setQuery.setLimit(new Limit(new Reference(0), new Reference(1)));
+ helpTest("Select * from a union all Select * from a limit ?,?", "SELECT * FROM a UNION ALL SELECT * FROM a LIMIT ?, ?", setQuery); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testOffset() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setLimit(new Limit(new Reference(0), null));
+ helpTest("Select * from a offset ? rows", "SELECT * FROM a OFFSET ? ROWS", query); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testFetchFirst() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setLimit(new Limit(null, new Constant(2)));
+ helpTest("Select * from a fetch first 2 rows only", "SELECT * FROM a LIMIT 2", query); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testFetchFirstRow() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setLimit(new Limit(null, new Constant(1)));
+ helpTest("Select * from a fetch first row only", "SELECT * FROM a LIMIT 1", query); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testOffsetFetch() {
+ Query query = new Query();
+ Select select = new Select(Arrays.asList(new AllSymbol()));
+ From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setLimit(new Limit(new Constant(2), new Constant(5)));
+ helpTest("Select * from a offset 2 rows fetch first 5 rows only", "SELECT * FROM a LIMIT 2, 5", query); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+}
Property changes on: trunk/engine/src/test/java/org/teiid/query/parser/TestLimitParsing.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2011-06-08 16:02:59 UTC (rev 3233)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2011-06-08 16:54:23 UTC (rev 3234)
@@ -61,7 +61,6 @@
import org.teiid.query.sql.lang.IsNullCriteria;
import org.teiid.query.sql.lang.JoinPredicate;
import org.teiid.query.sql.lang.JoinType;
-import org.teiid.query.sql.lang.Limit;
import org.teiid.query.sql.lang.MatchCriteria;
import org.teiid.query.sql.lang.NotCriteria;
import org.teiid.query.sql.lang.OrderBy;
@@ -6434,56 +6433,6 @@
}
}
- @Test public void testLimit() {
- Query query = new Query();
- Select select = new Select(Arrays.asList(new AllSymbol()));
- From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
- query.setSelect(select);
- query.setFrom(from);
- query.setLimit(new Limit(null, new Constant(new Integer(100))));
- helpTest("Select * from a limit 100", "SELECT * FROM a LIMIT 100", query); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Test public void testLimitWithOffset() {
- Query query = new Query();
- Select select = new Select(Arrays.asList(new AllSymbol()));
- From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
- query.setSelect(select);
- query.setFrom(from);
- query.setLimit(new Limit(new Constant(new Integer(50)), new Constant(new Integer(100))));
- helpTest("Select * from a limit 50,100", "SELECT * FROM a LIMIT 50, 100", query); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Test public void testLimitWithReferences1() {
- Query query = new Query();
- Select select = new Select(Arrays.asList(new AllSymbol()));
- From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
- query.setSelect(select);
- query.setFrom(from);
- query.setLimit(new Limit(new Reference(0), new Constant(new Integer(100))));
- helpTest("Select * from a limit ?,100", "SELECT * FROM a LIMIT ?, 100", query); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Test public void testLimitWithReferences2() {
- Query query = new Query();
- Select select = new Select(Arrays.asList(new AllSymbol()));
- From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
- query.setSelect(select);
- query.setFrom(from);
- query.setLimit(new Limit(new Constant(new Integer(50)), new Reference(0)));
- helpTest("Select * from a limit 50,?", "SELECT * FROM a LIMIT 50, ?", query); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Test public void testLimitWithReferences3() {
- Query query = new Query();
- Select select = new Select(Arrays.asList(new AllSymbol()));
- From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
- query.setSelect(select);
- query.setFrom(from);
- query.setLimit(new Limit(new Reference(0), new Reference(1)));
- helpTest("Select * from a limit ?,?", "SELECT * FROM a LIMIT ?, ?", query); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
@Test public void testEmptyOuterJoinCriteria() {
helpException("select a from b left outer join c on ()"); //$NON-NLS-1$
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-06-08 16:02:59 UTC (rev 3233)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-06-08 16:54:23 UTC (rev 3234)
@@ -6740,7 +6740,28 @@
helpProcess(plan, manager, expected);
assertEquals("SELECT g_0.e3 AS c_0, g_0.e2 AS c_1 FROM pm1.g1 AS g_0 ORDER BY c_1", manager.getQueries().iterator().next()); //$NON-NLS-1$
}
+
+ @Test public void testSortWithOffset() {
+ String sql = "select e1 from (select pm1.g1.e1, pm1.g1.e2 from pm1.g1 order by pm1.g1.e1, pm1.g1.e2 offset 4 rows) x"; //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.ROW_OFFSET, true);
+ caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, capFinder);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a"}),
+ };
+ HardcodedDataManager manager = new HardcodedDataManager(RealMetadataFactory.example1Cached());
+ manager.addData("SELECT g1.e1, g1.e2 FROM g1 ORDER BY g1.e1, g1.e2 LIMIT 4, 2147483647", new List[] {Arrays.asList("a", 1)});
+ helpProcess(plan, manager, expected);
+ }
+
@Test public void testCountWithHaving() {
String sql = "select e1, count(*) from pm1.g1 group by e1 having count(*) > 1"; //$NON-NLS-1$
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestLimitNode.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestLimitNode.java 2011-06-08 16:02:59 UTC (rev 3233)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestLimitNode.java 2011-06-08 16:54:23 UTC (rev 3234)
@@ -239,8 +239,8 @@
assertTrue(batch.getTerminationFlag());
}
- static List[] getRows(int rows) {
- List[] data = new List[rows];
+ static List<?>[] getRows(int rows) {
+ List<?>[] data = new List[rows];
for (int i = 0; i < rows; i++) {
data[i] = Arrays.asList(new Object[] {new Integer(i+1)});
}
[View Less]
13 years, 7 months
teiid SVN: r3233 - branches/7.4.x/documentation/reference/src/main/docbook/en-US/content.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-06-08 12:02:59 -0400 (Wed, 08 Jun 2011)
New Revision: 3233
Modified:
branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
Log:
TEIID-1005 adding a doc note about reserved words
Modified: branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
===================================================================
--- branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/sql_support.xml …
[View More]2011-06-08 12:39:43 UTC (rev 3232)
+++ branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2011-06-08 16:02:59 UTC (rev 3233)
@@ -108,6 +108,12 @@
resulting names are unambiguous in the context of the command.
Different forms of qualification can be mixed in the same query.
</para>
+ <section>
+ <title>Reserved Words</title>
+ <para>Teiid's reserved words include the standard SQL 2003 Foundation, SQL/MED, and SQL/XML reserved words, as well as Teiid specific words such as BIGINTEGER, BIGDECIMAL, or MAKEDEP.
+ See the <xref linkend="grammar"/> TOKENS section for all reserved words. They will appear as 'SMALLINT: "smallint"' where the quoted string is the actual lexical form.
+ </para>
+ </section>
</section>
<section>
<title>Expressions</title>
[View Less]
13 years, 7 months
teiid SVN: r3232 - in branches/as7: build and 70 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-06-08 08:39:43 -0400 (Wed, 08 Jun 2011)
New Revision: 3232
Added:
branches/as7/build/assembly/jboss-as7/
branches/as7/build/assembly/jboss-as7/dist.xml
branches/as7/build/kits/jboss-as7/
branches/as7/build/kits/jboss-as7/modules/
branches/as7/build/kits/jboss-as7/modules/org/
branches/as7/build/kits/jboss-as7/modules/org/jboss/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/…
[View More]api/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/api/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/api/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/client/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/client/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/client/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/common-core/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/common-core/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/common-core/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/file/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/file/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/file/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/jdbc/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/jdbc/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/jdbc/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ldap/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ldap/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ldap/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/loopback/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/loopback/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/loopback/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/olap/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/olap/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/olap/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/api/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/api/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/api/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/main/module.xml
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ws/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ws/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ws/main/module.xml
branches/as7/build/kits/jboss-as7/standalone/
branches/as7/build/kits/jboss-as7/standalone/configuration/
branches/as7/build/kits/jboss-as7/standalone/configuration/standalone.xml
branches/as7/build/kits/jboss-as7/standalone/deployments/
branches/as7/build/kits/jboss-as7/standalone/deployments/teiid/
branches/as7/client/src/main/java/org/teiid/adminapi/impl/ModelNodeConstants.java
branches/as7/connectors/connector-file/src/main/rar/META-INF/MANIFEST.MF
branches/as7/connectors/connector-ldap/src/main/rar/META-INF/MANIFEST.MF
branches/as7/connectors/connector-salesforce/src/main/rar/META-INF/MANIFEST.MF
branches/as7/connectors/connector-ws/src/main/rar/META-INF/MANIFEST.MF
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Configuration.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Element.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Namespace.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/OperationsConstants.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/QueryEngineModelHandler.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemDescription.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidXOMSubsystemDescription.java
branches/as7/jboss-integration/src/main/resources/META-INF/
branches/as7/jboss-integration/src/main/resources/META-INF/services/
branches/as7/jboss-integration/src/main/resources/META-INF/services/org.jboss.as.controller.Extension
branches/as7/jboss-integration/src/main/resources/schema/
branches/as7/jboss-integration/src/main/resources/schema/jboss-teiid.xsd
branches/as7/jboss-integration/src/test/java/org/teiid/jboss/
branches/as7/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
branches/as7/jboss-integration/src/test/resources/teiid-model-config.txt
branches/as7/jboss-integration/src/test/resources/teiid-sample-config.xml
Modified:
branches/as7/build/pom.xml
branches/as7/cache-jbosscache/pom.xml
branches/as7/client/pom.xml
branches/as7/client/src/main/java/org/teiid/adminapi/impl/CacheStatisticsMetadataMapper.java
branches/as7/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java
branches/as7/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java
branches/as7/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java
branches/as7/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java
branches/as7/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadataMapper.java
branches/as7/client/src/main/java/org/teiid/jdbc/CancellationTimer.java
branches/as7/connectors/pom.xml
branches/as7/engine/pom.xml
branches/as7/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/TransactionServerImpl.java
branches/as7/engine/src/main/java/org/teiid/dqp/service/TransactionService.java
branches/as7/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java
branches/as7/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java
branches/as7/jboss-integration/pom.xml
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
branches/as7/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
branches/as7/metadata/pom.xml
branches/as7/metadata/src/main/java/org/teiid/core/index/IIndex.java
branches/as7/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexInput.java
branches/as7/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexOutput.java
branches/as7/metadata/src/main/java/org/teiid/internal/core/index/InMemoryIndex.java
branches/as7/metadata/src/main/java/org/teiid/internal/core/index/Index.java
branches/as7/metadata/src/main/java/org/teiid/internal/core/index/VirtualRandomAccessFile.java
branches/as7/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
branches/as7/pom.xml
branches/as7/runtime/pom.xml
branches/as7/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
branches/as7/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java
branches/as7/test-integration/pom.xml
Log:
AS7 migration - module definitions and some configuration code.
Added: branches/as7/build/assembly/jboss-as7/dist.xml
===================================================================
--- branches/as7/build/assembly/jboss-as7/dist.xml (rev 0)
+++ branches/as7/build/assembly/jboss-as7/dist.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,380 @@
+<!--This script builds a JAR for the Embedded Server Installation -->
+<assembly>
+
+ <id>jboss-dist</id>
+
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <baseDirectory>teiid-${version}</baseDirectory>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>target/kits/jboss-as7</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>**/*.sh</include>
+ </includes>
+ <fileMode>755</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/kits/jboss-as7</directory>
+ <outputDirectory>/</outputDirectory>
+ <excludes>
+ <exclude>**/*.sh</exclude>
+ </excludes>
+ <fileMode>0644</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+
+ <fileSet>
+ <directory>../client/src/main/resources</directory>
+ <includes>
+ <include>vdb-deployer.xsd</include>
+ </includes>
+ <outputDirectory>docs/teiid/schema</outputDirectory>
+ <fileMode>0644</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+
+ <!-- We may want to do this if including multiple doc types or languages
+ as the parent directory structure will be copied. However the parent
+ directory permissions still seem wrong.
+ <fileSet>
+ <directory>target/distribution/teiid-${version}-docs</directory>
+ <includes>
+ <include>**/*.pdf</include>
+ </includes>
+ <outputDirectory>teiid-docs</outputDirectory>
+ <fileMode>0644</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet> -->
+
+ </fileSets>
+
+ <files>
+ <file>
+ <source>target/teiid-${version}-docs/admin-guide/en-US/pdf/teiid_admin_guide.pdf</source>
+ <outputDirectory>docs/teiid</outputDirectory>
+ <fileMode>0644</fileMode>
+ </file>
+ <file>
+ <source>target/teiid-${version}-docs/reference/en-US/pdf/teiid_reference.pdf</source>
+ <outputDirectory>docs/teiid</outputDirectory>
+ <fileMode>0644</fileMode>
+ </file>
+ <file>
+ <source>target/teiid-${version}-docs/quick-start-example/en-US/pdf/teiid_quick_start_example.pdf</source>
+ <outputDirectory>docs/teiid</outputDirectory>
+ <fileMode>0644</fileMode>
+ </file>
+ <file>
+ <source>target/teiid-${version}-docs/developer-guide/en-US/pdf/teiid_developer_guide.pdf</source>
+ <outputDirectory>docs/teiid</outputDirectory>
+ <fileMode>0644</fileMode>
+ </file>
+ <file>
+ <source>target/teiid-${version}-docs/client-developers-guide/en-US/pdf/teiid_client_developers_guide.pdf</source>
+ <outputDirectory>docs/teiid</outputDirectory>
+ <fileMode>0644</fileMode>
+ </file>
+ <file>
+ <source>target/teiid-${version}-docs/caching-guide/en-US/pdf/teiid_caching_guide.pdf</source>
+ <outputDirectory>docs/teiid</outputDirectory>
+ <fileMode>0644</fileMode>
+ </file>
+ </files>
+
+
+ <!-- these have external dependent clients like connectors-->
+ <moduleSets>
+
+ <moduleSet>
+ <useAllReactorProjects>true</useAllReactorProjects>
+ <includes>
+ <include>org.jboss.teiid:teiid-common-core</include>
+ </includes>
+ <binaries>
+ <includeDependencies>false</includeDependencies>
+ <unpack>false</unpack>
+ <outputDirectory>modules/org/jboss/teiid/common-core/main</outputDirectory>
+ </binaries>
+ </moduleSet>
+
+ <moduleSet>
+ <useAllReactorProjects>true</useAllReactorProjects>
+ <includes>
+ <include>org.jboss.teiid:teiid-client</include>
+ </includes>
+ <binaries>
+ <includeDependencies>false</includeDependencies>
+ <unpack>false</unpack>
+ <outputDirectory>modules/org/jboss/teiid/client/main</outputDirectory>
+ </binaries>
+ </moduleSet>
+
+ <moduleSet>
+ <useAllReactorProjects>true</useAllReactorProjects>
+ <includes>
+ <include>org.jboss.teiid:teiid-hibernate-dialect</include>
+ </includes>
+ <binaries>
+ <includeDependencies>false</includeDependencies>
+ <unpack>false</unpack>
+ <outputDirectory>modules/org/jboss/teiid/client/main</outputDirectory>
+ </binaries>
+ </moduleSet>
+
+ <!-- These are Teiid internal dependencies; to make JCA work -->
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid:teiid-jboss-integration</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>modules/org/jboss/teiid/main</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+ </moduleSet>
+
+ <!-- These are built in connectors -->
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid.connectors:connector-file:rar</include>
+ <include>org.jboss.teiid.connectors:connector-ldap:rar</include>
+ <include>org.jboss.teiid.connectors:connector-salesforce:rar</include>
+ <include>org.jboss.teiid.connectors:connector-ws:rar</include>
+ </includes>
+
+ <binaries>
+ <outputFileNameMapping>teiid-${module.artifactId}.rar</outputFileNameMapping>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>standalone/deployments/teiid</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+
+ </moduleSet>
+
+ <!-- **************************************************************************
+ These are built in translators
+ **************************************************************************-->
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid.connectors:translator-jdbc</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>modules/org/jboss/teiid/translator/jdbc/main</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+
+ </moduleSet>
+
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid.connectors:translator-loopback/main</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>modules/org/jboss/teiid/translator/loopback/main</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+
+ </moduleSet>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid.connectors:translator-file</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>modules/org/jboss/teiid/translator/file/main</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+
+ </moduleSet>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid.connectors:translator-ldap</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>modules/org/jboss/teiid/translator/ldap/main</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+
+ </moduleSet>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid.connectors:translator-salesforce</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>modules/org/jboss/teiid/translator/salesforce/main</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+
+ </moduleSet>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid.connectors:translator-ws</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>modules/org/jboss/teiid/translator/ws</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+
+ </moduleSet>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid.connectors:translator-olap</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>modules/org/jboss/teiid/translator/olap/main</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+
+ </moduleSet>
+
+ <!-- Include the JOPR plugin
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid:teiid-console</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>false</includeDependencies>
+ <unpack>false</unpack>
+ <outputDirectory>deploy/admin-console.war/plugins</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+
+ </moduleSet>
+ -->
+ </moduleSets>
+</assembly>
Property changes on: branches/as7/build/assembly/jboss-as7/dist.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/api/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/api/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/api/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.api">
+ <resources>
+ <resource-root path="teiid-api-${version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+
+ <dependencies>
+ <module name="org.jboss.teiid.client" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/api/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/client/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/client/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/client/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.client">
+ <resources>
+ <resource-root path="teiid-client-${version}.jar" />
+ <resource-root path="teiid-hibernate-dialect-${version}.jar"/>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="org.jboss.teiid.common-core" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/client/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/common-core/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/common-core/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/common-core/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.common-core">
+ <resources>
+ <resource-root path="teiid-common-core-${version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/common-core/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid">
+ <resources>
+ <resource-root path="teiid-engine-${version}.jar" />
+ <resource-root path="teiid-cache-jbosscache-${version}.jar" />
+ <resource-root path="teiid-jboss-integration-${version}.jar" />
+ <resource-root path="teiid-metadata-${version}.jar" />
+ <resource-root path="teiid-runtime-${version}.jar" />
+ <resource-root path="teiid-engine-${version}.jar" />
+ <resource-root path="teiid-engine-${version}.jar" />
+ <resource-root path="saxon-9.1.0.8.jar" />
+ <resource-root path="saxon-9.1.0.8-dom.jar" />
+ <resource-root path="json-simple-1.1.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+
+ <dependencies>
+ <module name="com.sun.xml.bind"/>
+ <module name="org.jboss.teiid.api" />
+ <module name="javax.api" />
+ <module name="javax.resource.api" />
+ <module name="javax.transaction.api" />
+ <module name="javax.annotation.api" />
+ <module name="org.jboss.as.controller" />
+ <module name="org.jboss.as.naming" />
+ <module name="org.jboss.as.server" />
+ <module name="org.jboss.as.security" />
+ <module name="org.jboss.as.ee" />
+ <module name="org.jboss.as.threads" />
+ <module name="org.jboss.as.transactions" />
+ <module name="org.jboss.common-core" />
+ <module name="org.jboss.integration.jboss-jca-spi" />
+ <module name="org.jboss.integration.jboss-transaction-spi" />
+ <module name="org.jboss.ironjacamar.api" />
+ <module name="org.jboss.ironjacamar.impl" />
+ <module name="org.jboss.ironjacamar.jdbcadapters" />
+ <module name="org.jboss.jandex" />
+ <module name="org.jboss.jts" />
+ <module name="org.jboss.jts.integration" />
+ <module name="org.jboss.logging" />
+ <module name="org.jboss.modules" />
+ <module name="org.jboss.msc" />
+ <module name="org.jboss.netty"/>
+ <module name="org.jboss.staxmapper" />
+ <module name="org.jboss.threads" />
+ <module name="org.jboss.vfs" />
+ <module name="org.picketbox" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/file/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/file/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/file/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.translator.file">
+ <resources>
+ <resource-root path="translator-file-${project.version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+
+ <dependencies>
+ <module name="javax.resource.api"/>
+ <module name="org.apache.commons.logging" />
+ <module name="org.apache.log4j"/>
+ <module name="org.jboss.teiid.common-core" />
+ <module name="org.jboss.teiid.api" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/file/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/jdbc/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/jdbc/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/jdbc/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.translator.jdbc">
+ <resources>
+ <resource-root path="translator-jdbc-${project.version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+
+ <dependencies>
+ <module name="javax.resource.api"/>
+ <module name="org.apache.commons.logging" />
+ <module name="org.apache.log4j"/>
+ <module name="org.jboss.teiid.common-core" />
+ <module name="org.jboss.teiid.api" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/jdbc/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ldap/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ldap/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ldap/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.translator.file">
+ <resources>
+ <resource-root path="translator-file-${project.version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+
+ <dependencies>
+ <module name="javax.resource.api"/>
+ <module name="org.apache.commons.logging" />
+ <module name="org.apache.log4j"/>
+ <module name="org.jboss.teiid.common-core" />
+ <module name="org.jboss.teiid.api" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ldap/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/loopback/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/loopback/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/loopback/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.translator.loopback">
+ <resources>
+ <resource-root path="translator-loopback-${project.version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+
+ <dependencies>
+ <module name="javax.resource.api"/>
+ <module name="org.apache.commons.logging" />
+ <module name="org.apache.log4j"/>
+ <module name="org.jboss.teiid.common-core" />
+ <module name="org.jboss.teiid.api" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/loopback/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/olap/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/olap/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/olap/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.translator.file">
+ <resources>
+ <resource-root path="translator-loopback-${project.version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.resource.api"/>
+ <module name="org.apache.commons.logging" />
+ <module name="org.apache.log4j"/>
+ <module name="org.jboss.teiid.common-core" />
+ <module name="org.jboss.teiid.api" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/olap/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/api/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/api/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/api/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.transalator.salesforce.api">
+ <resources>
+ <resource-root path="salesforce-api-${project.version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/api/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.translator.salesforce">
+ <resources>
+ <resource-root path="translator-salesforce-${project.version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.resource.api"/>
+ <module name="org.apache.commons.logging" />
+ <module name="org.apache.log4j"/>
+ <module name="org.jboss.teiid.common-core" />
+ <module name="org.jboss.teiid.api" />
+ <module name="org.jboss.teiid.transalator.salesforce.api"/>
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/salesforce/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ws/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ws/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ws/main/module.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.translator.ws">
+ <resources>
+ <resource-root path="translator-ws-${project.version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.resource.api"/>
+ <module name="org.apache.commons.logging" />
+ <module name="org.apache.log4j"/>
+ <module name="org.jboss.teiid.common-core" />
+ <module name="org.jboss.teiid.api" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/ws/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/build/kits/jboss-as7/standalone/configuration/standalone.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/standalone/configuration/standalone.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/standalone/configuration/standalone.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,458 @@
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<server name="example"
+ xmlns="urn:jboss:domain:1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:domain:1.0 jboss_7_0.xsd
+ urn:jboss:domain:arquillian:1.0 jboss-arquillian.xsd
+ urn:jboss:domain:connector:1.0 jboss-connector.xsd
+ urn:jboss:domain:datasources:1.0 jboss-datasources.xsd
+ urn:jboss:domain:ejb3:1.0 jboss-ejb3.xsd
+ urn:jboss:domain:ee:1.0 jboss-ee.xsd
+ urn:jboss:domain:jaxrs:1.0 jboss-jaxrs.xsd
+ urn:jboss:domain:jmx:1.0 jboss-jmx.xsd
+ urn:jboss:domain:jpa:1.0 jboss-jpa.xsd
+ urn:jboss:domain:messaging:1.0 jboss-messaging.xsd
+ urn:jboss:domain:naming:1.0 jboss-naming.xsd
+ urn:jboss:domain:osgi:1.0 jboss-osgi.xsd
+ urn:jboss:domain:remoting:1.0 jboss-remoting.xsd
+ urn:jboss:domain:resourceadapters:1.0 jboss-resource-adapters.xsd
+ urn:jboss:domain:sar:1.0 jboss-sar.xsd
+ urn:jboss:domain:teiid:1.0 jboss-teiid.xsd
+ urn:jboss:domain:threads:1.0 jboss-threads.xsd
+ urn:jboss:domain:transactions:1.0 jboss-txn.xsd
+ urn:jboss:domain:web:1.0 jboss-web.xsd
+ urn:jboss:domain:deployment-scanner:1.0 jboss-deployment-scanner.xsd
+ urn:jboss:domain:security:1.0 jboss-security.xsd
+ urn:jboss:domain:webservices:1.0 jboss-webservices.xsd
+ urn:jboss:domain:weld:1.0 jboss-weld.xsd">
+
+ <extensions>
+ <extension module="org.jboss.as.arquillian.service"/>
+ <extension module="org.jboss.as.connector"/>
+ <extension module="org.jboss.as.deployment-scanner"/>
+ <extension module="org.jboss.as.ee"/>
+ <extension module="org.jboss.as.ejb3"/>
+ <extension module="org.jboss.as.jaxrs"/>
+ <extension module="org.jboss.as.jmx"/>
+ <extension module="org.jboss.as.jpa"/>
+ <extension module="org.jboss.as.logging"/>
+ <extension module="org.jboss.as.messaging"/>
+ <extension module="org.jboss.as.naming"/>
+ <extension module="org.jboss.as.osgi"/>
+ <extension module="org.jboss.as.remoting"/>
+ <extension module="org.jboss.as.sar"/>
+ <extension module="org.jboss.as.security"/>
+ <extension module="org.jboss.teiid"/>
+ <extension module="org.jboss.as.threads"/>
+ <extension module="org.jboss.as.transactions"/>
+ <extension module="org.jboss.as.web" />
+ <extension module="org.jboss.as.webservices" />
+ <extension module="org.jboss.as.weld" />
+ </extensions>
+
+ <paths>
+ <path name="absolute" path="tmp"/>
+ <path name="relative" path="relative" relative-to="absolute"/>
+ </paths>
+
+ <management-interfaces>
+ <native-interface interface="default" port="9999"/>
+ <http-interface interface="default" port="9990"/>
+ </management-interfaces>
+
+ <profile name="ignore">
+ <subsystem xmlns="urn:jboss:domain:logging:1.0">
+ <console-handler name="CONSOLE">
+ <level name="INFO"/>
+ <formatter>
+ <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
+ </formatter>
+ </console-handler>
+
+ <periodic-rotating-file-handler name="FILE">
+ <level name="INFO"/>
+ <formatter>
+ <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
+ </formatter>
+ <file relative-to="jboss.server.log.dir" path="server.log"/>
+ <suffix value=".yyyy-MM-dd"/>
+ </periodic-rotating-file-handler>
+
+ <logger category="com.arjuna">
+ <level name="WARN"/>
+ </logger>
+ <logger category="org.apache.tomcat.util.modeler">
+ <level name="WARN"/>
+ </logger>
+ <logger category="sun.rmi">
+ <level name="WARN"/>
+ </logger>
+
+ <root-logger>
+ <level name="INFO"/>
+ <handlers>
+ <handler name="CONSOLE"/>
+ <handler name="FILE"/>
+ </handlers>
+ </root-logger>
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:threads:1.0">
+ <scheduled-thread-pool name="remoting">
+ <max-threads count="10" per-cpu="20"/>
+ <keepalive-time time="10" unit="seconds"/>
+ </scheduled-thread-pool>
+ <bounded-queue-thread-pool name="jca-short-running" blocking="true">
+ <core-threads count="10" per-cpu="20"/>
+ <queue-length count="10" per-cpu="20"/>
+ <max-threads count="10" per-cpu="20"/>
+ <keepalive-time time="10" unit="seconds"/>
+ </bounded-queue-thread-pool>
+ <bounded-queue-thread-pool name="jca-long-running" blocking="true">
+ <core-threads count="10" per-cpu="20"/>
+ <queue-length count="10" per-cpu="20"/>
+ <max-threads count="10" per-cpu="20"/>
+ <keepalive-time time="10" unit="seconds"/>
+ </bounded-queue-thread-pool>
+ <bounded-queue-thread-pool name="ejb3-async" blocking="true">
+ <core-threads count="10" per-cpu="20"/>
+ <queue-length count="10" per-cpu="20"/>
+ <max-threads count="10" per-cpu="20"/>
+ <keepalive-time time="10" unit="seconds"/>
+ </bounded-queue-thread-pool>
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:arquillian:1.0" />
+ <subsystem xmlns="urn:jboss:domain:ee:1.0" />
+ <subsystem xmlns="urn:jboss:domain:ejb3:1.0" />
+ <subsystem xmlns="urn:jboss:domain:naming:1.0" />
+ <subsystem xmlns="urn:jboss:domain:security:1.0">
+ <security-domains>
+ <security-domain name="other">
+ <authentication>
+ <login-module code="UsersRoles" flag="required"/>
+ </authentication>
+ </security-domain>
+ </security-domains>
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:remoting:1.0" thread-pool="remoting"/>
+ <subsystem xmlns="urn:jboss:domain:jmx:1.0">
+ <jmx-connector registry-binding="jmx-connector-registry" server-binding="jmx-connector-server" />
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
+ <subsystem xmlns="urn:jboss:domain:jpa:1.0"/>
+ <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
+ <subsystem xmlns="urn:jboss:domain:transactions:1.0">
+ <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
+ <core-environment socket-binding="txn-socket-process-id"/>
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:connector:1.0">
+ <archive-validation enabled="false" />
+ <bean-validation enabled="false" />
+ <default-workmanager short-running-thread-pool="jca-short-running" long-running-thread-pool="jca-long-running" />
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/H2DS" enabled="true" use-java-context="true" pool-name="H2DS">
+ <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
+ <driver-class>org.h2.Driver</driver-class>
+ <driver>org.h2.Driver#1.2</driver>
+ <pool></pool>
+ <security>
+ <user-name>sa</user-name>
+ <password>sa</password>
+ </security>
+ <validation></validation>
+ <timeout></timeout>
+ <statement></statement>
+ </datasource>
+ </datasources>
+ <drivers>
+ <driver module="com.h2database.h2"/>
+ </drivers>
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:resourceadapters:1.0">
+ <!-- <resource-adapters>
+ <resource-adapter>
+ <archive>ra16out.rar</archive>
+ <connection-definitions>
+ <connection-definition jndi-name="java:/eis/ra16out-raxml"
+ class-name="org.jboss.jca.test.deployers.spec.rars.ra16out.TestManagedConnectionFactory">
+ </connection-definition>
+ </connection-definitions>
+ </resource-adapter>
+ </resource-adapters>-->
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:osgi:1.0" activation="lazy">
+ <configuration pid="org.apache.felix.webconsole.internal.servlet.OsgiManager">
+ <property name="manager.root">jboss-osgi</property>
+ </configuration>
+ <properties>
+ <!--
+ A comma seperated list of module identifiers. Each system module
+ is added as a dependency to the OSGi framework module. The packages
+ from these system modules can be made visible as framework system packages.
+ http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Constants.html#FRAME...
+ -->
+ <property name="org.jboss.osgi.system.modules">
+ org.apache.log4j,
+ org.jboss.as.osgi,
+ </property>
+ <!--
+ Framework environment property identifying extra packages which the system bundle
+ must export from the current execution environment
+ -->
+ <property name="org.osgi.framework.system.packages.extra">
+ org.apache.log4j;version=1.2,
+ org.jboss.as.osgi.service;version=7.0,
+ org.jboss.osgi.spi.capability;version=1.0,
+ org.jboss.osgi.spi.util;version=1.0,
+ org.jboss.osgi.testing;version=1.0,
+ </property>
+ </properties>
+ <modules>
+ <!-- modules registered with the OSGi layer on startup -->
+ <module identifier="org.jboss.as.arquillian.aggregate"/>
+ <module identifier="org.jboss.logging"/>
+ <!-- bundles installed on startup -->
+ <module identifier="org.apache.aries.jmx" start="true"/>
+ <module identifier="org.apache.aries.util"/>
+ <module identifier="org.apache.felix.configadmin" start="true"/>
+ <module identifier="org.jboss.as.osgi.configadmin" start="true"/>
+ <module identifier="org.jboss.osgi.common" start="true"/>
+ <module identifier="org.jboss.osgi.jmx" start="true"/>
+ <module identifier="org.osgi.compendium"/>
+ </modules>
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:messaging:1.0">
+ <!-- Default journal file size is 10Mb, reduced here to 100k for faster first boot -->
+ <journal-file-size>102400</journal-file-size>
+ <journal-min-files>2</journal-min-files>
+ <journal-type>NIO</journal-type>
+ <!-- disable messaging persistence -->
+ <persistence-enabled>false</persistence-enabled>
+
+ <connectors>
+ <in-vm-connector name="in-vm" server-id="0" />
+ <netty-connector name="netty" socket-binding="messaging" />
+ <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
+ <param key="batch-delay" value="50"/>
+ </netty-connector>
+ </connectors>
+
+ <acceptors>
+ <in-vm-acceptor name="in-vm" server-id="0" />
+ <netty-acceptor name="netty" socket-binding="messaging" />
+ <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
+ <param key="batch-delay" value="50"/>
+ <param key="direct-deliver" value="false"/>
+ </netty-acceptor>
+ </acceptors>
+
+ <security-settings>
+ <security-setting match="#">
+ <permission type="createNonDurableQueue" roles="guest"/>
+ <permission type="deleteNonDurableQueue" roles="guest"/>
+ <permission type="consume" roles="guest"/>
+ <permission type="send" roles="guest"/>
+ </security-setting>
+ </security-settings>
+
+ <address-settings>
+ <!--default for catch all-->
+ <address-setting match="#">
+ <dead-letter-address>jms.queue.DLQ</dead-letter-address>
+ <expiry-address>jms.queue.ExpiryQueue</expiry-address>
+ <redelivery-delay>0</redelivery-delay>
+ <max-size-bytes>10485760</max-size-bytes>
+ <message-counter-history-day-limit>10</message-counter-history-day-limit>
+ <address-full-policy>BLOCK</address-full-policy>
+ </address-setting>
+ </address-settings>
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:messaging:jms:1.0">
+ <connection-factory name="InVmConnectionFactory">
+ <connectors>
+ <connector-ref connector-name="in-vm" backup-connector-name="netty"/>
+ </connectors>
+ <entries>
+ <entry name="java:/ConnectionFactory" />
+ </entries>
+ </connection-factory>
+ <connection-factory name="RemoteConnectionFactory">
+ <connectors>
+ <connector-ref connector-name="netty" backup-connector-name="in-vm"/>
+ </connectors>
+ <entries>
+ <entry name="RemoteConnectionFactory" />
+ </entries>
+ </connection-factory>
+ <queue name="testQueue">
+ <entry name="queue/test" />
+ </queue>
+ <topic name="testTopic">
+ <entry name="topic/test" />
+ </topic>
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:web:1.0">
+ <connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/>
+ <virtual-server name="localhost">
+ <alias name="example.com" />
+ </virtual-server>
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:weld:1.0" />
+ <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.0">
+ <deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir" path="deployments" />
+ </subsystem>
+ <subsystem xmlns="urn:jboss:domain:webservices:1.0">
+ <configuration>
+ <webServiceHost>localhost</webServiceHost>
+ <modifySOAPAddress>true</modifySOAPAddress>
+ <!-- <webServiceSecurePort>8443</webServiceSecurePort>
+ <webServicePort>8080</webServicePort> -->
+ </configuration>
+ </subsystem>
+
+ <subsystem xmlns="urn:jboss:domain:teiid:1.0">
+ <session-service>
+ <securityDomains>teiid-security</securityDomains>
+ <adminSecurityDomain>jmx-console</adminSecurityDomain>
+ <sessionMaxLimit>5000</sessionMaxLimit>
+ <sessionExpirationTimeLimit>0</sessionExpirationTimeLimit>
+ </session-service>
+ <buffer-service>
+ <useDisk>true</useDisk>
+ <diskDirectory>${jboss.server.temp.dir}/teiid</diskDirectory>
+ <processorBatchSize>512</processorBatchSize>
+ <connectorBatchSize>1024</connectorBatchSize>
+ <maxReserveBatchColumns>-1</maxReserveBatchColumns>
+ <maxProcessingBatchesColumns>-1</maxProcessingBatchesColumns>
+ <maxFileSize>2048</maxFileSize>
+ <maxBufferSpace>51200</maxBufferSpace>
+ <maxOpenFiles>64</maxOpenFiles>
+ </buffer-service>
+ <cache-factory class="org.teiid.cache.jboss.ClusterableCacheFactory" enabled="true">
+ <cacheManager>java:TeiidCacheManager</cacheManager>
+ <resultsetCacheName>teiid-resultset-cache</resultsetCacheName>
+ </cache-factory>
+ <resultset-cache-config class="org.teiid.cache.CacheConfiguration" enabled="true">
+ <maxEntries>1024</maxEntries>
+ <maxAgeInSeconds>7200</maxAgeInSeconds>
+ <maxStaleness>60</maxStaleness>
+ <type>EXPIRATION</type>
+ <location>resultset</location>
+ </resultset-cache-config>
+ <preparedplan-cache-config class="org.teiid.cache.CacheConfiguration">
+ <maxEntries>512</maxEntries>
+ <maxAgeInSeconds>28800</maxAgeInSeconds>
+ <maxStaleness>0</maxStaleness>
+ </preparedplan-cache-config>
+
+ <runtime-engine jndi-name="teiid/engine-deployer">
+ <maxThreads>64</maxThreads>
+ <maxActivePlans>20</maxActivePlans>
+ <userRequestSourceConcurrency>0</userRequestSourceConcurrency>
+ <timeSliceInMilli>2000</timeSliceInMilli>
+ <maxRowsFetchSize>20480</maxRowsFetchSize>
+ <lobChunkSizeInKB>100</lobChunkSizeInKB>
+ <useDataRoles>true</useDataRoles>
+ <allowCreateTemporaryTablesByDefault>true</allowCreateTemporaryTablesByDefault>
+ <allowFunctionCallsByDefault>true</allowFunctionCallsByDefault>
+ <queryThresholdInSecs>600</queryThresholdInSecs>
+ <maxSourceRows>-1</maxSourceRows>
+ <exceptionOnMaxSourceRows>true</exceptionOnMaxSourceRows>
+ <maxODBCLobSizeAllowed>5242880</maxODBCLobSizeAllowed>
+ <eventDistributorName>teiid/event-distributor</eventDistributorName>
+ <detectingChangeEvents>true</detectingChangeEvents>
+ </runtime-engine>
+
+ <jdbc enabled="true">
+ <maxSocketThreads>0</maxSocketThreads>
+ <inputBufferSize>0</inputBufferSize>
+ <outputBufferSize>0</outputBufferSize>
+ <socket-binding>teiid-jdbc</socket-binding>
+ </jdbc>
+
+ <admin enabled="true">
+ <maxSocketThreads>4</maxSocketThreads>
+ <inputBufferSize>0</inputBufferSize>
+ <outputBufferSize>0</outputBufferSize>
+ <socket-binding>teiid-admin</socket-binding>
+ <ssl>
+ <mode>login</mode>
+ <authenticationMode>anonymous</authenticationMode>
+ </ssl>
+ </admin>
+
+ <odbc enabled="true">
+ <maxSocketThreads>0</maxSocketThreads>
+ <inputBufferSize>0</inputBufferSize>
+ <outputBufferSize>0</outputBufferSize>
+ <socket-binding>teiid-odbc</socket-binding>
+ </odbc>
+ </subsystem>
+ </profile>
+
+ <interfaces>
+ <interface name="default">
+ <inet-address value="127.0.0.1"/>
+ </interface>
+ <interface name="any">
+ <any-address/>
+ </interface>
+ <interface name="complex">
+ <any>
+ <subnet-match value="192.168.0.0/16"/>
+ <public-address/>
+ </any>
+ <not>
+ <site-local-address/>
+ </not>
+ <up/>
+ <multicast/>
+ </interface>
+ </interfaces>
+
+ <socket-binding-group name="standard-sockets" default-interface="default">
+ <socket-binding name="jndi" port="1099"/>
+ <socket-binding name="jmx-connector-registry" port="1090"/>
+ <socket-binding name="jmx-connector-server" port="1091"/>
+ <socket-binding name="http" port="8080"/>
+ <socket-binding name="https" port="8447"/>
+ <socket-binding name="osgi-http" port="8090"/>
+ <socket-binding name="remoting" port="4447"/>
+ <socket-binding name="txn-recovery-environment" port="4712"/>
+ <socket-binding name="txn-status-manager" port="4713"/>
+ <socket-binding name="txn-socket-process-id" port="4714"/>
+ <socket-binding name="messaging" port="5445" />
+ <socket-binding name="messaging-throughput" port="5455"/>
+ <socket-binding name="teiid-jdbc" port="31000"/>
+ <socket-binding name="teiid-admin" port="31443"/>
+ <socket-binding name="teiid-odbc" port="35432"/>
+ </socket-binding-group>
+
+ <system-properties>
+ <property name="foo" value="bar"/>
+ <property name="key" value="value"/>
+ </system-properties>
+</server>
+
Property changes on: branches/as7/build/kits/jboss-as7/standalone/configuration/standalone.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/as7/build/pom.xml
===================================================================
--- branches/as7/build/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/build/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -66,7 +66,7 @@
<configuration>
<descriptors>
<descriptor>assembly/client-jar.xml</descriptor>
- <descriptor>assembly/jboss-container/dist.xml</descriptor>
+ <descriptor>assembly/jboss-as7/dist.xml</descriptor>
<descriptor>assembly/adminshell/adminshell-dist.xml</descriptor>
</descriptors>
</configuration>
@@ -99,7 +99,7 @@
<descriptor>assembly/src.xml</descriptor>
<descriptor>assembly/docs.xml</descriptor>
<descriptor>assembly/client-jar.xml</descriptor>
- <descriptor>assembly/jboss-container/dist.xml</descriptor>
+ <descriptor>assembly/jboss-as7/dist.xml</descriptor>
<descriptor>assembly/adminshell/adminshell-dist.xml</descriptor>
</descriptors>
</configuration>
Modified: branches/as7/cache-jbosscache/pom.xml
===================================================================
--- branches/as7/cache-jbosscache/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/cache-jbosscache/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -25,6 +25,7 @@
<artifactId>teiid-engine</artifactId>
<scope>provided</scope>
</dependency>
+ <!--
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
@@ -34,6 +35,7 @@
<groupId>org.jboss.man</groupId>
<artifactId>jboss-managed</artifactId>
<scope>provided</scope>
- </dependency>
+ </dependency>
+ -->
</dependencies>
</project>
\ No newline at end of file
Modified: branches/as7/client/pom.xml
===================================================================
--- branches/as7/client/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/client/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -20,9 +20,15 @@
<artifactId>teiid-common-core</artifactId>
<type>test-jar</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-dmr</artifactId>
+ </dependency>
+ <!--
<dependency>
<groupId>org.jboss.man</groupId>
<artifactId>jboss-managed</artifactId>
</dependency>
+ -->
</dependencies>
</project>
\ No newline at end of file
Modified: branches/as7/client/src/main/java/org/teiid/adminapi/impl/CacheStatisticsMetadataMapper.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/adminapi/impl/CacheStatisticsMetadataMapper.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/client/src/main/java/org/teiid/adminapi/impl/CacheStatisticsMetadataMapper.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -21,76 +21,38 @@
*/
package org.teiid.adminapi.impl;
-import java.lang.reflect.Type;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
-import org.jboss.metatype.api.types.CompositeMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
-import org.jboss.metatype.spi.values.MetaMapper;
-
-public class CacheStatisticsMetadataMapper extends MetaMapper<CacheStatisticsMetadata> {
+public class CacheStatisticsMetadataMapper {
private static final String HITRATIO = "hitRatio"; //$NON-NLS-1$
private static final String TOTAL_ENTRIES = "totalEntries"; //$NON-NLS-1$
private static final String REQUEST_COUNT = "requestCount"; //$NON-NLS-1$
- private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
- private static final MutableCompositeMetaType metaType;
+
- static {
- metaType = new MutableCompositeMetaType(CacheStatisticsMetadata.class.getName(), "The Cache statistics"); //$NON-NLS-1$
- metaType.addItem(TOTAL_ENTRIES, TOTAL_ENTRIES, SimpleMetaType.INTEGER_PRIMITIVE);
- metaType.addItem(HITRATIO, HITRATIO, SimpleMetaType.DOUBLE_PRIMITIVE);
- metaType.addItem(REQUEST_COUNT, REQUEST_COUNT, SimpleMetaType.INTEGER_PRIMITIVE);
- metaType.freeze();
- }
-
- @Override
- public Type mapToType() {
- return CacheStatisticsMetadata.class;
- }
-
- @Override
- public MetaType getMetaType() {
- return metaType;
- }
-
- @Override
- public MetaValue createMetaValue(MetaType metaType, CacheStatisticsMetadata object) {
+ public static ModelNode wrap(CacheStatisticsMetadata object) {
if (object == null)
return null;
- if (metaType instanceof CompositeMetaType) {
- CompositeMetaType composite = (CompositeMetaType) metaType;
- CompositeValueSupport cache = new CompositeValueSupport(composite);
-
- cache.set(TOTAL_ENTRIES, SimpleValueSupport.wrap(object.getTotalEntries()));
- cache.set(HITRATIO, SimpleValueSupport.wrap(object.getHitRatio()));
- cache.set(REQUEST_COUNT, SimpleValueSupport.wrap(object.getRequestCount()));
-
- return cache;
- }
- throw new IllegalArgumentException("Cannot convert cache statistics " + object); //$NON-NLS-1$
+
+ ModelNode cache = new ModelNode();
+ cache.get(ModelNodeConstants.TYPE).set(ModelType.OBJECT);
+
+ cache.get(TOTAL_ENTRIES).set(object.getTotalEntries());
+ cache.get(HITRATIO).set(object.getHitRatio());
+ cache.get(REQUEST_COUNT).set(object.getRequestCount());
+
+ return cache;
}
- @Override
- public CacheStatisticsMetadata unwrapMetaValue(MetaValue metaValue) {
- if (metaValue == null)
+ public static CacheStatisticsMetadata unwrap(ModelNode node) {
+ if (node == null)
return null;
-
- if (metaValue instanceof CompositeValue) {
- CompositeValue compositeValue = (CompositeValue) metaValue;
- CacheStatisticsMetadata cache = new CacheStatisticsMetadata();
- cache.setTotalEntries((Integer) metaValueFactory.unwrap(compositeValue.get(TOTAL_ENTRIES)));
- cache.setHitRatio((Double) metaValueFactory.unwrap(compositeValue.get(HITRATIO)));
- cache.setRequestCount((Integer) metaValueFactory.unwrap(compositeValue.get(REQUEST_COUNT)));
- return cache;
- }
- throw new IllegalStateException("Unable to unwrap cache statistics " + metaValue); //$NON-NLS-1$
+ CacheStatisticsMetadata cache = new CacheStatisticsMetadata();
+ cache.setTotalEntries(node.get(TOTAL_ENTRIES).asInt());
+ cache.setHitRatio(node.get(HITRATIO).asDouble());
+ cache.setRequestCount(node.get(REQUEST_COUNT).asInt());
+ return cache;
}
}
Modified: branches/as7/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -38,7 +38,7 @@
void clearCache(String cacheType, String vdbName, int version);
Collection<SessionMetadata> getActiveSessions() throws AdminException;
int getActiveSessionsCount() throws AdminException;
- Collection<org.teiid.adminapi.Transaction> getTransactions();
+ Collection<TransactionMetadata> getTransactions();
void terminateTransaction(String xid) throws AdminException ;
void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException;
List<RequestMetadata> getLongRunningRequests();
Added: branches/as7/client/src/main/java/org/teiid/adminapi/impl/ModelNodeConstants.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/adminapi/impl/ModelNodeConstants.java (rev 0)
+++ branches/as7/client/src/main/java/org/teiid/adminapi/impl/ModelNodeConstants.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.adminapi.impl;
+
+
+public class ModelNodeConstants {
+ public static final String TYPE = "type";//$NON-NLS-1$
+ public static final String ATTRIBUTES = "attributes"; //$NON-NLS-1$
+ public static final String DESCRIPTION = "description"; //$NON-NLS-1$
+
+
+}
Property changes on: branches/as7/client/src/main/java/org/teiid/adminapi/impl/ModelNodeConstants.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/as7/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/client/src/main/java/org/teiid/adminapi/impl/RequestMetadataMapper.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -21,24 +21,12 @@
*/
package org.teiid.adminapi.impl;
-import java.lang.reflect.Type;
-
-import org.jboss.metatype.api.types.CompositeMetaType;
-import org.jboss.metatype.api.types.EnumMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.EnumValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
-import org.jboss.metatype.spi.values.MetaMapper;
-import org.teiid.adminapi.Request;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
import org.teiid.adminapi.Request.ProcessingState;
+import org.teiid.adminapi.Request.ThreadState;
-public class RequestMetadataMapper extends MetaMapper<RequestMetadata> {
+public class RequestMetadataMapper {
private static final String TRANSACTION_ID = "transactionId"; //$NON-NLS-1$
private static final String NODE_ID = "nodeId"; //$NON-NLS-1$
private static final String SOURCE_REQUEST = "sourceRequest"; //$NON-NLS-1$
@@ -48,76 +36,44 @@
private static final String EXECUTION_ID = "executionId"; //$NON-NLS-1$
private static final String STATE = "processingState"; //$NON-NLS-1$
private static final String THREAD_STATE = "threadState"; //$NON-NLS-1$
- private static final MutableCompositeMetaType metaType;
- private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
- static {
- metaType = new MutableCompositeMetaType(RequestMetadata.class.getName(), "The Request meta data"); //$NON-NLS-1$
- metaType.addItem(EXECUTION_ID, EXECUTION_ID, SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem(SESSION_ID, SESSION_ID, SimpleMetaType.STRING);
- metaType.addItem(START_TIME, START_TIME, SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem(COMMAND, COMMAND, SimpleMetaType.STRING);
- metaType.addItem(SOURCE_REQUEST, SOURCE_REQUEST, SimpleMetaType.BOOLEAN_PRIMITIVE);
- metaType.addItem(NODE_ID, NODE_ID, SimpleMetaType.INTEGER);
- metaType.addItem(TRANSACTION_ID, TRANSACTION_ID, SimpleMetaType.STRING);
- metaType.addItem(STATE, STATE, new EnumMetaType(Request.ProcessingState.values()));
- metaType.addItem(THREAD_STATE, THREAD_STATE, new EnumMetaType(Request.ThreadState.values()));
- metaType.freeze();
- }
- @Override
- public Type mapToType() {
- return RequestMetadata.class;
- }
-
- @Override
- public MetaType getMetaType() {
- return metaType;
- }
-
- @Override
- public MetaValue createMetaValue(MetaType metaType, RequestMetadata object) {
- if (object == null)
+ public static ModelNode wrap(RequestMetadata object) {
+
+ if (object == null) {
return null;
- if (metaType instanceof CompositeMetaType) {
- CompositeMetaType composite = (CompositeMetaType) metaType;
- CompositeValueSupport request = new CompositeValueSupport(composite);
-
- request.set(EXECUTION_ID, SimpleValueSupport.wrap(object.getExecutionId()));
- request.set(SESSION_ID, SimpleValueSupport.wrap(object.getSessionId()));
- request.set(START_TIME, SimpleValueSupport.wrap(object.getStartTime()));
- request.set(COMMAND, SimpleValueSupport.wrap(object.getCommand()));
- request.set(SOURCE_REQUEST, SimpleValueSupport.wrap(object.sourceRequest()));
- request.set(NODE_ID, SimpleValueSupport.wrap(object.getNodeId()));
- request.set(TRANSACTION_ID,SimpleValueSupport.wrap(object.getTransactionId()));
- EnumMetaType emt = (EnumMetaType)composite.getType(STATE);
- request.set(STATE, new EnumValueSupport(emt, object.getState()));
- request.set(THREAD_STATE, new EnumValueSupport((EnumMetaType)composite.getType(THREAD_STATE), object.getThreadState()));
- return request;
}
- throw new IllegalArgumentException("Cannot convert RequestMetadata " + object); //$NON-NLS-1$
+
+ ModelNode request = new ModelNode();
+ request.get(ModelNodeConstants.TYPE).set(ModelType.OBJECT);
+
+ request.get(EXECUTION_ID).set(object.getExecutionId());
+ request.get(SESSION_ID).set(object.getSessionId());
+ request.get(START_TIME).set(object.getStartTime());
+ request.get(COMMAND).set(object.getCommand());
+ request.get(SOURCE_REQUEST).set(object.sourceRequest());
+ request.get(NODE_ID).set(object.getNodeId());
+ request.get(TRANSACTION_ID).set(object.getTransactionId());
+ request.get(STATE).set(object.getState().name());
+ request.get(THREAD_STATE).set(object.getThreadState().name());
+ return request;
}
- @Override
- public RequestMetadata unwrapMetaValue(MetaValue metaValue) {
- if (metaValue == null)
+ public static RequestMetadata unwrap(ModelNode node) {
+ if (node == null)
return null;
- if (metaValue instanceof CompositeValue) {
- CompositeValue compositeValue = (CompositeValue) metaValue;
-
- RequestMetadata request = new RequestMetadata();
- request.setExecutionId((Long) metaValueFactory.unwrap(compositeValue.get(EXECUTION_ID)));
- request.setSessionId((String) metaValueFactory.unwrap(compositeValue.get(SESSION_ID)));
- request.setStartTime((Long) metaValueFactory.unwrap(compositeValue.get(START_TIME)));
- request.setCommand((String) metaValueFactory.unwrap(compositeValue.get(COMMAND)));
- request.setSourceRequest((Boolean) metaValueFactory.unwrap(compositeValue.get(SOURCE_REQUEST)));
- request.setNodeId((Integer) metaValueFactory.unwrap(compositeValue.get(NODE_ID)));
- request.setTransactionId((String) metaValueFactory.unwrap(compositeValue.get(TRANSACTION_ID)));
- request.setState((ProcessingState) metaValueFactory.unwrap(compositeValue.get(STATE)));
- return request;
- }
- throw new IllegalStateException("Unable to unwrap RequestMetadata " + metaValue); //$NON-NLS-1$
+ RequestMetadata request = new RequestMetadata();
+ request.setExecutionId(node.get(EXECUTION_ID).asLong());
+ request.setSessionId(node.get(SESSION_ID).asString());
+ request.setStartTime(node.get(START_TIME).asLong());
+ request.setCommand(node.get(COMMAND).asString());
+ request.setSourceRequest(node.get(SOURCE_REQUEST).asBoolean());
+ request.setNodeId(node.get(NODE_ID).asInt());
+ request.setTransactionId(node.get(TRANSACTION_ID).asString());
+ request.setState(ProcessingState.valueOf(node.get(STATE).asString()));
+ request.setThreadState(ThreadState.valueOf(node.get(THREAD_STATE).asString()));
+ return request;
}
}
Modified: branches/as7/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/client/src/main/java/org/teiid/adminapi/impl/SessionMetadataMapper.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -21,20 +21,11 @@
*/
package org.teiid.adminapi.impl;
-import java.lang.reflect.Type;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+
-import org.jboss.metatype.api.types.CompositeMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
-import org.jboss.metatype.spi.values.MetaMapper;
-
-public class SessionMetadataMapper extends MetaMapper<SessionMetadata> {
+public class SessionMetadataMapper {
private static final String SECURITY_DOMAIN = "securityDomain"; //$NON-NLS-1$
private static final String VDB_VERSION = "VDBVersion"; //$NON-NLS-1$
private static final String VDB_NAME = "VDBName"; //$NON-NLS-1$
@@ -45,80 +36,45 @@
private static final String CLIENT_HOST_NAME = "clientHostName"; //$NON-NLS-1$
private static final String CREATED_TIME = "createdTime"; //$NON-NLS-1$
private static final String APPLICATION_NAME = "applicationName"; //$NON-NLS-1$
- private static final MutableCompositeMetaType metaType;
- private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
- static {
- metaType = new MutableCompositeMetaType(SessionMetadata.class.getName(), "The Session domain meta data"); //$NON-NLS-1$
- metaType.addItem(APPLICATION_NAME, APPLICATION_NAME, SimpleMetaType.STRING);
- metaType.addItem(CREATED_TIME, CREATED_TIME, SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem(CLIENT_HOST_NAME, CLIENT_HOST_NAME, SimpleMetaType.STRING);
- metaType.addItem(IP_ADDRESS, IP_ADDRESS, SimpleMetaType.STRING);
- metaType.addItem(LAST_PING_TIME, LAST_PING_TIME, SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem(SESSION_ID, SESSION_ID, SimpleMetaType.STRING);
- metaType.addItem(USER_NAME, USER_NAME, SimpleMetaType.STRING);
- metaType.addItem(VDB_NAME, VDB_NAME, SimpleMetaType.STRING);
- metaType.addItem(VDB_VERSION, VDB_VERSION, SimpleMetaType.INTEGER_PRIMITIVE);
- metaType.addItem(SECURITY_DOMAIN, SECURITY_DOMAIN, SimpleMetaType.STRING);
- metaType.freeze();
- }
- @Override
- public Type mapToType() {
- return SessionMetadata.class;
- }
-
- @Override
- public MetaType getMetaType() {
- return metaType;
- }
-
- @Override
- public MetaValue createMetaValue(MetaType metaType, SessionMetadata object) {
- if (object == null)
+ public static ModelNode wrap(SessionMetadata object) {
+ if (object == null) {
return null;
- if (metaType instanceof CompositeMetaType) {
- CompositeMetaType composite = (CompositeMetaType) metaType;
- CompositeValueSupport session = new CompositeValueSupport(composite);
+ }
+ ModelNode session = new ModelNode();
+ session.get(ModelNodeConstants.TYPE).set(ModelType.OBJECT);
- session.set(APPLICATION_NAME, SimpleValueSupport.wrap(object.getApplicationName()));
- session.set(CREATED_TIME, SimpleValueSupport.wrap(object.getCreatedTime()));
- session.set(CLIENT_HOST_NAME, SimpleValueSupport.wrap(object.getClientHostName()));
- session.set(IP_ADDRESS, SimpleValueSupport.wrap(object.getIPAddress()));
- session.set(LAST_PING_TIME, SimpleValueSupport.wrap(object.getLastPingTime()));
- session.set(SESSION_ID, SimpleValueSupport.wrap(object.getSessionId()));
- session.set(USER_NAME, SimpleValueSupport.wrap(object.getUserName()));
- session.set(VDB_NAME,SimpleValueSupport.wrap(object.getVDBName()));
- session.set(VDB_VERSION, SimpleValueSupport.wrap(object.getVDBVersion()));
- session.set(SECURITY_DOMAIN, SimpleValueSupport.wrap(object.getSecurityDomain()));
+ session.get(APPLICATION_NAME).set(object.getApplicationName());
+ session.get(CREATED_TIME).set(object.getCreatedTime());
+ session.get(CLIENT_HOST_NAME).set(object.getClientHostName());
+ session.get(IP_ADDRESS).set(object.getIPAddress());
+ session.get(LAST_PING_TIME).set(object.getLastPingTime());
+ session.get(SESSION_ID).set(object.getSessionId());
+ session.get(USER_NAME).set(object.getUserName());
+ session.get(VDB_NAME).set(object.getVDBName());
+ session.get(VDB_VERSION).set(object.getVDBVersion());
+ session.get(SECURITY_DOMAIN).set(object.getSecurityDomain());
- return session;
- }
- throw new IllegalArgumentException("Cannot convert session " + object); //$NON-NLS-1$
+ return session;
}
- @Override
- public SessionMetadata unwrapMetaValue(MetaValue metaValue) {
- if (metaValue == null)
+ public static SessionMetadata unwrap(ModelNode node) {
+ if (node == null)
return null;
-
- if (metaValue instanceof CompositeValue) {
- CompositeValue compositeValue = (CompositeValue) metaValue;
- SessionMetadata session = new SessionMetadata();
- session.setApplicationName((String) metaValueFactory.unwrap(compositeValue.get(APPLICATION_NAME)));
- session.setCreatedTime((Long) metaValueFactory.unwrap(compositeValue.get(CREATED_TIME)));
- session.setClientHostName((String) metaValueFactory.unwrap(compositeValue.get(CLIENT_HOST_NAME)));
- session.setIPAddress((String) metaValueFactory.unwrap(compositeValue.get(IP_ADDRESS)));
- session.setLastPingTime((Long) metaValueFactory.unwrap(compositeValue.get(LAST_PING_TIME)));
- session.setSessionId((String) metaValueFactory.unwrap(compositeValue.get(SESSION_ID)));
- session.setUserName((String) metaValueFactory.unwrap(compositeValue.get(USER_NAME)));
- session.setVDBName((String) metaValueFactory.unwrap(compositeValue.get(VDB_NAME)));
- session.setVDBVersion((Integer) metaValueFactory.unwrap(compositeValue.get(VDB_VERSION)));
- session.setSecurityDomain((String) metaValueFactory.unwrap(compositeValue.get(SECURITY_DOMAIN)));
- return session;
- }
- throw new IllegalStateException("Unable to unwrap session " + metaValue); //$NON-NLS-1$
+ SessionMetadata session = new SessionMetadata();
+ session.setApplicationName(node.get(APPLICATION_NAME).asString());
+ session.setCreatedTime(node.get(CREATED_TIME).asLong());
+ session.setClientHostName(node.get(CLIENT_HOST_NAME).asString());
+ session.setIPAddress(node.get(IP_ADDRESS).asString());
+ session.setLastPingTime(node.get(LAST_PING_TIME).asLong());
+ session.setSessionId(node.get(SESSION_ID).asString());
+ session.setUserName(node.get(USER_NAME).asString());
+ session.setVDBName(node.get(VDB_NAME).asString());
+ session.setVDBVersion(node.get(VDB_VERSION).asInt());
+ session.setSecurityDomain(node.get(SECURITY_DOMAIN).asString());
+ return session;
}
}
Modified: branches/as7/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/client/src/main/java/org/teiid/adminapi/impl/TransactionMetadataMapper.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -22,79 +22,39 @@
package org.teiid.adminapi.impl;
-import java.lang.reflect.Type;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
-import org.jboss.metatype.api.types.CompositeMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
-import org.jboss.metatype.spi.values.MetaMapper;
-
-public class TransactionMetadataMapper extends MetaMapper<TransactionMetadata> {
+public class TransactionMetadataMapper {
private static final String ID = "id"; //$NON-NLS-1$
private static final String SCOPE = "scope"; //$NON-NLS-1$
private static final String CREATED_TIME = "createdTime"; //$NON-NLS-1$
private static final String ASSOCIATED_SESSION = "associatedSession"; //$NON-NLS-1$
- private static final MutableCompositeMetaType metaType;
- private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
- static {
- metaType = new MutableCompositeMetaType(TransactionMetadata.class.getName(), "The Transaction domain meta data"); //$NON-NLS-1$
- metaType.addItem(ASSOCIATED_SESSION, ASSOCIATED_SESSION, SimpleMetaType.STRING);
- metaType.addItem(CREATED_TIME, CREATED_TIME, SimpleMetaType.LONG_PRIMITIVE);
- metaType.addItem(SCOPE, SCOPE, SimpleMetaType.STRING);
- metaType.addItem(ID, ID, SimpleMetaType.STRING);
- metaType.freeze();
- }
-
- @Override
- public Type mapToType() {
- return TransactionMetadata.class;
- }
-
- @Override
- public MetaType getMetaType() {
- return metaType;
- }
-
- @Override
- public MetaValue createMetaValue(MetaType metaType, TransactionMetadata object) {
+ public static ModelNode wrap(TransactionMetadata object) {
if (object == null)
return null;
- if (metaType instanceof CompositeMetaType) {
- CompositeMetaType composite = (CompositeMetaType) metaType;
- CompositeValueSupport transaction = new CompositeValueSupport(composite);
-
- transaction.set(ASSOCIATED_SESSION, SimpleValueSupport.wrap(object.getAssociatedSession()));
- transaction.set(CREATED_TIME, SimpleValueSupport.wrap(object.getCreatedTime()));
- transaction.set(SCOPE, SimpleValueSupport.wrap(object.getScope()));
- transaction.set(ID, SimpleValueSupport.wrap(object.getId()));
-
- return transaction;
- }
- throw new IllegalArgumentException("Cannot convert TransactionMetadata " + object); //$NON-NLS-1$
+
+ ModelNode transaction = new ModelNode();
+ transaction.get(ModelNodeConstants.TYPE).set(ModelType.OBJECT);
+
+ transaction.get(ASSOCIATED_SESSION).set(object.getAssociatedSession());
+ transaction.get(CREATED_TIME).set(object.getCreatedTime());
+ transaction.get(SCOPE).set(object.getScope());
+ transaction.get(ID).set(object.getId());
+
+ return transaction;
}
- @Override
- public TransactionMetadata unwrapMetaValue(MetaValue metaValue) {
- if (metaValue == null)
+ public static TransactionMetadata unwrap(ModelNode node) {
+ if (node == null)
return null;
- if (metaValue instanceof CompositeValue) {
- CompositeValue compositeValue = (CompositeValue) metaValue;
-
- TransactionMetadata transaction = new TransactionMetadata();
- transaction.setAssociatedSession((String) metaValueFactory.unwrap(compositeValue.get(ASSOCIATED_SESSION)));
- transaction.setCreatedTime((Long) metaValueFactory.unwrap(compositeValue.get(CREATED_TIME)));
- transaction.setScope((String) metaValueFactory.unwrap(compositeValue.get(SCOPE)));
- transaction.setId((String) metaValueFactory.unwrap(compositeValue.get(ID)));
- return transaction;
- }
- throw new IllegalStateException("Unable to unwrap TransactionMetadata " + metaValue); //$NON-NLS-1$
+ TransactionMetadata transaction = new TransactionMetadata();
+ transaction.setAssociatedSession(node.get(ASSOCIATED_SESSION).asString());
+ transaction.setCreatedTime(node.get(CREATED_TIME).asLong());
+ transaction.setScope(node.get(SCOPE).asString());
+ transaction.setId(node.get(ID).asString());
+ return transaction;
}
}
Modified: branches/as7/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadataMapper.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadataMapper.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/client/src/main/java/org/teiid/adminapi/impl/WorkerPoolStatisticsMetadataMapper.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -22,20 +22,10 @@
package org.teiid.adminapi.impl;
-import java.lang.reflect.Type;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
-import org.jboss.metatype.api.types.CompositeMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
-import org.jboss.metatype.spi.values.MetaMapper;
-
-public class WorkerPoolStatisticsMetadataMapper extends MetaMapper<WorkerPoolStatisticsMetadata> {
+public class WorkerPoolStatisticsMetadataMapper {
private static final String MAX_THREADS = "maxThreads"; //$NON-NLS-1$
private static final String HIGHEST_QUEUED = "highestQueued"; //$NON-NLS-1$
private static final String QUEUED = "queued"; //$NON-NLS-1$
@@ -44,73 +34,39 @@
private static final String TOTAL_COMPLETED = "totalCompleted"; //$NON-NLS-1$
private static final String HIGHEST_ACTIVE_THREADS = "highestActiveThreads"; //$NON-NLS-1$
private static final String ACTIVE_THREADS = "activeThreads"; //$NON-NLS-1$
- private static final MutableCompositeMetaType metaType;
- private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
- static {
- metaType = new MutableCompositeMetaType(WorkerPoolStatisticsMetadata.class.getName(), "The Worker Pool statistics"); //$NON-NLS-1$
- metaType.addItem(ACTIVE_THREADS, "ActiveThreads", SimpleMetaType.INTEGER_PRIMITIVE); //$NON-NLS-1$
- metaType.addItem(HIGHEST_ACTIVE_THREADS, "HighestActiveThreads", SimpleMetaType.INTEGER_PRIMITIVE); //$NON-NLS-1$
- metaType.addItem(TOTAL_COMPLETED, "TotalCompleted", SimpleMetaType.LONG_PRIMITIVE); //$NON-NLS-1$
- metaType.addItem(TOTAL_SUBMITTED, "TotalSubmitted", SimpleMetaType.LONG_PRIMITIVE); //$NON-NLS-1$
- metaType.addItem(QUEUE_NAME, "QueueName", SimpleMetaType.STRING); //$NON-NLS-1$
- metaType.addItem(QUEUED, "Queued", SimpleMetaType.INTEGER_PRIMITIVE); //$NON-NLS-1$
- metaType.addItem(HIGHEST_QUEUED, "HighestQueued", SimpleMetaType.INTEGER_PRIMITIVE); //$NON-NLS-1$
- metaType.addItem(MAX_THREADS, "MaxThreads", SimpleMetaType.INTEGER_PRIMITIVE); //$NON-NLS-1$
- metaType.freeze();
- }
- @Override
- public Type mapToType() {
- return WorkerPoolStatisticsMetadata.class;
- }
-
- @Override
- public MetaType getMetaType() {
- return metaType;
- }
-
- @Override
- public MetaValue createMetaValue(MetaType metaType, WorkerPoolStatisticsMetadata object) {
+ public static ModelNode wrap(WorkerPoolStatisticsMetadata object) {
if (object == null)
return null;
- if (metaType instanceof CompositeMetaType) {
- CompositeMetaType composite = (CompositeMetaType) metaType;
- CompositeValueSupport transaction = new CompositeValueSupport(composite);
-
- transaction.set(ACTIVE_THREADS, SimpleValueSupport.wrap(object.getActiveThreads()));
- transaction.set(HIGHEST_ACTIVE_THREADS, SimpleValueSupport.wrap(object.getHighestActiveThreads()));
- transaction.set(TOTAL_COMPLETED, SimpleValueSupport.wrap(object.getTotalCompleted()));
- transaction.set(TOTAL_SUBMITTED, SimpleValueSupport.wrap(object.getTotalSubmitted()));
- transaction.set(QUEUE_NAME, SimpleValueSupport.wrap(object.getQueueName()));
- transaction.set(QUEUED, SimpleValueSupport.wrap(object.getQueued()));
- transaction.set(HIGHEST_QUEUED, SimpleValueSupport.wrap(object.getHighestQueued()));
- transaction.set(MAX_THREADS, SimpleValueSupport.wrap(object.getMaxThreads()));
-
- return transaction;
- }
- throw new IllegalArgumentException("Cannot convert Worker Pool Statistics " + object); //$NON-NLS-1$
+ ModelNode transaction = new ModelNode();
+ transaction.get(ModelNodeConstants.TYPE).set(ModelType.OBJECT);
+
+ transaction.get(ACTIVE_THREADS).set(object.getActiveThreads());
+ transaction.get(HIGHEST_ACTIVE_THREADS).set(object.getHighestActiveThreads());
+ transaction.get(TOTAL_COMPLETED).set(object.getTotalCompleted());
+ transaction.get(TOTAL_SUBMITTED).set(object.getTotalSubmitted());
+ transaction.get(QUEUE_NAME).set(object.getQueueName());
+ transaction.get(QUEUED).set(object.getQueued());
+ transaction.get(HIGHEST_QUEUED).set(object.getHighestQueued());
+ transaction.get(MAX_THREADS).set(object.getMaxThreads());
+
+ return transaction;
}
- @Override
- public WorkerPoolStatisticsMetadata unwrapMetaValue(MetaValue metaValue) {
- if (metaValue == null)
+ public static WorkerPoolStatisticsMetadata unwrapMetaValue(ModelNode node) {
+ if (node == null)
return null;
- if (metaValue instanceof CompositeValue) {
- CompositeValue compositeValue = (CompositeValue) metaValue;
-
- WorkerPoolStatisticsMetadata stats = new WorkerPoolStatisticsMetadata();
- stats.setActiveThreads((Integer) metaValueFactory.unwrap(compositeValue.get(ACTIVE_THREADS)));
- stats.setHighestActiveThreads((Integer) metaValueFactory.unwrap(compositeValue.get(HIGHEST_ACTIVE_THREADS)));
- stats.setTotalCompleted((Long) metaValueFactory.unwrap(compositeValue.get(TOTAL_COMPLETED)));
- stats.setTotalSubmitted((Long) metaValueFactory.unwrap(compositeValue.get(TOTAL_SUBMITTED)));
- stats.setQueueName((String) metaValueFactory.unwrap(compositeValue.get(QUEUE_NAME)));
- stats.setQueued((Integer) metaValueFactory.unwrap(compositeValue.get(QUEUED)));
- stats.setHighestQueued((Integer) metaValueFactory.unwrap(compositeValue.get(HIGHEST_QUEUED)));
- stats.setMaxThreads((Integer) metaValueFactory.unwrap(compositeValue.get(MAX_THREADS)));
- return stats;
- }
- throw new IllegalStateException("Unable to unwrap transaction " + metaValue); //$NON-NLS-1$
+ WorkerPoolStatisticsMetadata stats = new WorkerPoolStatisticsMetadata();
+ stats.setActiveThreads(node.get(ACTIVE_THREADS).asInt());
+ stats.setHighestActiveThreads(node.get(HIGHEST_ACTIVE_THREADS).asInt());
+ stats.setTotalCompleted(node.get(TOTAL_COMPLETED).asLong());
+ stats.setTotalSubmitted(node.get(TOTAL_SUBMITTED).asLong());
+ stats.setQueueName(node.get(QUEUE_NAME).asString());
+ stats.setQueued(node.get(QUEUED).asInt());
+ stats.setHighestQueued(node.get(HIGHEST_QUEUED).asInt());
+ stats.setMaxThreads(node.get(MAX_THREADS).asInt());
+ return stats;
}
}
Modified: branches/as7/client/src/main/java/org/teiid/jdbc/CancellationTimer.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/CancellationTimer.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/CancellationTimer.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -24,14 +24,15 @@
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
-import org.jboss.logging.Logger;
/**
* Specialized timer that actively purges tasks in lg(n) time
*/
public class CancellationTimer {
-
+ private static Logger logger = Logger.getLogger("org.teiid.jdbc"); //$NON-NLS-1$
private static AtomicInteger id = new AtomicInteger();
static abstract class CancelTask implements Runnable, Comparable<CancelTask> {
@@ -101,7 +102,7 @@
try {
task.run();
} catch (Throwable t) {
- Logger.getLogger(CancellationTimer.class).error("Unexpected exception running task", t); //$NON-NLS-1$
+ logger.log(Level.SEVERE, "Unexpected exception running task", t); //$NON-NLS-1$
}
}
Added: branches/as7/connectors/connector-file/src/main/rar/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/connector-file/src/main/rar/META-INF/MANIFEST.MF (rev 0)
+++ branches/as7/connectors/connector-file/src/main/rar/META-INF/MANIFEST.MF 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1 @@
+Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Property changes on: branches/as7/connectors/connector-file/src/main/rar/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/connectors/connector-ldap/src/main/rar/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/connector-ldap/src/main/rar/META-INF/MANIFEST.MF (rev 0)
+++ branches/as7/connectors/connector-ldap/src/main/rar/META-INF/MANIFEST.MF 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1 @@
+Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Property changes on: branches/as7/connectors/connector-ldap/src/main/rar/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/connectors/connector-salesforce/src/main/rar/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/connector-salesforce/src/main/rar/META-INF/MANIFEST.MF (rev 0)
+++ branches/as7/connectors/connector-salesforce/src/main/rar/META-INF/MANIFEST.MF 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1 @@
+Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Property changes on: branches/as7/connectors/connector-salesforce/src/main/rar/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/connectors/connector-ws/src/main/rar/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/connector-ws/src/main/rar/META-INF/MANIFEST.MF (rev 0)
+++ branches/as7/connectors/connector-ws/src/main/rar/META-INF/MANIFEST.MF 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1 @@
+Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Property changes on: branches/as7/connectors/connector-ws/src/main/rar/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/as7/connectors/pom.xml
===================================================================
--- branches/as7/connectors/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/connectors/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -59,7 +59,7 @@
<scope>test</scope>
</dependency>
- <!-- External dependencies -->
+ <!-- External dependencies
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-vfs</artifactId>
@@ -70,6 +70,7 @@
<artifactId>jboss-managed</artifactId>
<scope>test</scope>
</dependency>
+ -->
</dependencies>
Modified: branches/as7/engine/pom.xml
===================================================================
--- branches/as7/engine/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/engine/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -1,70 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid-parent</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Alpha1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-engine</artifactId>
- <name>Engine</name>
- <description>Relational, procedural, and xml core engine.</description>
+ <parent>
+ <artifactId>teiid-parent</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.5.0.Alpha1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-engine</artifactId>
+ <name>Engine</name>
+ <description>Relational, procedural, and xml core engine.</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.4</version>
- <executions>
- <execution>
- <id>javacc</id>
- <goals>
- <goal>javacc</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>javacc</id>
+ <goals>
+ <goal>javacc</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
- <dependencies>
+ <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <type>test-jar</type>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <type>test-jar</type>
+ </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <!--
<dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.jboss.deployers</groupId>
<artifactId>jboss-deployers-vfs-spi</artifactId>
<scope>provided</scope>
@@ -75,23 +82,23 @@
<artifactId>jboss-deployers-vfs</artifactId>
<scope>provided</scope>
</dependency>
+ -->
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ </dependency>
- <dependency>
- <groupId>net.sourceforge.saxon</groupId>
- <artifactId>saxon</artifactId>
- </dependency>
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <classifier>dom</classifier>
+ <artifactId>saxon</artifactId>
+ </dependency>
- <dependency>
- <groupId>net.sourceforge.saxon</groupId>
- <classifier>dom</classifier>
- <artifactId>saxon</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- </dependency>
+ <dependency>
+ <groupId>com.googlecode.json-simple</groupId>
+ <artifactId>json-simple</artifactId>
+ </dependency>
- </dependencies>
+ </dependencies>
</project>
\ No newline at end of file
Modified: branches/as7/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -22,14 +22,8 @@
package org.teiid.cache;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
import org.teiid.dqp.internal.process.SessionAwareCache;
-@ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class CacheConfiguration {
public enum Policy {
@@ -60,7 +54,6 @@
return this.policy;
}
- @ManagementProperty(description="The maximum age of an entry in seconds. -1 indicates no max.")
public int getMaxAgeInSeconds(){
return maxage;
}
@@ -69,7 +62,6 @@
this.maxage = maxage;
}
- @ManagementProperty(description="The maximum staleness in seconds of an entry based upon modifications. -1 indicates no max.")
public int getMaxStaleness() {
return maxStaleness;
}
@@ -78,7 +70,6 @@
this.maxStaleness = maxStaleDataModification;
}
- @ManagementProperty(description="The maximum number of cache entries. -1 indicates no limit. (default 1024)")
public int getMaxEntries() {
return this.maxEntries;
}
@@ -91,8 +82,6 @@
this.policy = Policy.valueOf(type);
}
- @ManagementProperty(description="Name of the configuration", readOnly=true)
- @ManagementObjectID(type="cache")
public String getName() {
return this.name;
}
@@ -101,7 +90,6 @@
this.name = name;
}
- @ManagementProperty(description="location prefix in cache", readOnly=true)
public String getLocation() {
return location;
}
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -21,10 +21,8 @@
*/
package org.teiid.dqp.internal.process;
-import org.jboss.managed.api.annotation.ManagementProperty;
import org.teiid.cache.CacheConfiguration;
import org.teiid.client.RequestMessage;
-import org.teiid.core.util.ApplicationInfo;
import org.teiid.metadata.MetadataRepository;
@@ -60,7 +58,6 @@
private transient AuthorizationValidator authorizationValidator;
private boolean allowFunctionCallsByDefault;
- @ManagementProperty(description="Max active plans (default 20). Increase this value, and max threads, on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts.")
public int getMaxActivePlans() {
return maxActivePlans;
}
@@ -69,10 +66,6 @@
this.maxActivePlans = maxActivePlans;
}
- @ManagementProperty(description="Max source query concurrency per user request (default 0). " +
- "0 indicates use the default calculated value based on max active plans and max threads - approximately 2*(max threads)/(max active plans). " +
- "1 forces serial execution in the processing thread, just as is done for a transactional request. " +
- "Any number greater than 1 limits the maximum number of concurrently executing source requests accordingly.")
public int getUserRequestSourceConcurrency() {
return userRequestSourceConcurrency;
}
@@ -81,7 +74,6 @@
this.userRequestSourceConcurrency = userRequestSourceConcurrency;
}
- @ManagementProperty(description="Process pool maximum thread count. (default 64)")
public int getMaxThreads() {
return maxThreads;
}
@@ -90,7 +82,6 @@
this.maxThreads = maxThreads;
}
- @ManagementProperty(description="Query processor time slice, in milliseconds. (default 2000)")
public int getTimeSliceInMilli() {
return timeSliceInMilli;
}
@@ -99,7 +90,6 @@
this.timeSliceInMilli = timeSliceInMilli;
}
- @ManagementProperty(description="Maximum allowed fetch size, set via JDBC. User requested value ignored above this value. (default 20480)")
public int getMaxRowsFetchSize() {
return maxRowsFetchSize;
}
@@ -108,7 +98,6 @@
this.maxRowsFetchSize = maxRowsFetchSize;
}
- @ManagementProperty(description="The max lob chunk size in KB transferred to the client for xml, blobs, clobs (default 100KB)")
public int getLobChunkSizeInKB() {
return this.lobChunkSizeInKB;
}
@@ -125,7 +114,6 @@
this.resultsetCacheConfig = config;
}
- @ManagementProperty(description="Denotes whether or not result set caching is enabled. (default true)")
public boolean isResultSetCacheEnabled() {
return this.resultsetCacheConfig != null && this.resultsetCacheConfig.isEnabled();
}
@@ -134,7 +122,6 @@
* Determine whether role checking is enabled on the server.
* @return <code>true</code> if server-side role checking is enabled.
*/
- @ManagementProperty(description="Turn on role checking based upon the data roles defined in VDBs. (default true)")
public boolean getUseDataRoles() {
return useDataRoles;
}
@@ -147,7 +134,6 @@
* Whether temporary table usage is enabled by default.
* @return <code>true</code> if temporary table usage is enabled by default.
*/
- @ManagementProperty(description="Sets whether temporary table usage is allowed by default with data roles enabled. If false, the user must have a role that grants creates temporary table rights to use temporary tables. (default true)")
public boolean isAllowCreateTemporaryTablesByDefault() {
return allowCreateTemporaryTablesByDefault;
}
@@ -161,7 +147,6 @@
* Whether functions are callable by default
* @return <code>true</code> if function usage is enabled by default.
*/
- @ManagementProperty(description="Sets whether functions may be called by default with data roles enabled. If false, a specific permission must exist to call the function. (default true)")
public boolean isAllowFunctionCallsByDefault() {
return allowFunctionCallsByDefault;
}
@@ -170,7 +155,6 @@
this.allowFunctionCallsByDefault = allowFunctionCallsDefault;
}
- @ManagementProperty(description="Long running query threshold, after which a alert can be generated by tooling if configured")
public int getQueryThresholdInSecs() {
return queryThresholdInSecs;
}
@@ -178,17 +162,11 @@
public void setQueryThresholdInSecs(int queryThresholdInSecs) {
this.queryThresholdInSecs = queryThresholdInSecs;
}
-
- @ManagementProperty(description="Teiid runtime version", readOnly=true)
- public String getRuntimeVersion() {
- return ApplicationInfo.getInstance().getBuildNumber();
- }
-
+
/**
* Throw exception if there are more rows in the result set than specified in the MaxSourceRows setting.
* @return
*/
- @ManagementProperty(description="Indicates if an exception should be thrown if the specified value for Maximum Source Rows is exceeded; only up to the maximum rows will be consumed.")
public boolean isExceptionOnMaxSourceRows() {
return exceptionOnMaxSourceRows;
}
@@ -201,7 +179,6 @@
* Maximum source set rows to fetch
* @return
*/
- @ManagementProperty(description="Maximum rows allowed from a source query. -1 indicates no limit. (default -1)")
public int getMaxSourceRows() {
return maxSourceRows;
}
@@ -210,7 +187,6 @@
this.maxSourceRows = maxSourceRows;
}
- @ManagementProperty(description="Maximum Lob Size allowed over ODBC (default 5MB)")
public int getMaxODBCLobSizeAllowed() {
return this.maxODBCLobSizeAllowed;
}
@@ -245,7 +221,6 @@
return detectingChangeEvents;
}
- @ManagementProperty(description="Set to true for the engine to detect local change events. Should be disabled if using external change data capture tools. (default true)")
public void setDetectingChangeEvents(boolean detectingChangeEvents) {
this.detectingChangeEvents = detectingChangeEvents;
}
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -42,6 +42,7 @@
import org.teiid.adminapi.Request.ThreadState;
import org.teiid.adminapi.impl.CacheStatisticsMetadata;
import org.teiid.adminapi.impl.RequestMetadata;
+import org.teiid.adminapi.impl.TransactionMetadata;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheFactory;
@@ -614,7 +615,7 @@
}
}
- public Collection<org.teiid.adminapi.Transaction> getTransactions() {
+ public Collection<TransactionMetadata> getTransactions() {
return this.transactionService.getTransactions();
}
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/TransactionServerImpl.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/TransactionServerImpl.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/TransactionServerImpl.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -505,13 +505,13 @@
}
@Override
- public Collection<org.teiid.adminapi.Transaction> getTransactions() {
+ public Collection<TransactionMetadata> getTransactions() {
Set<TransactionContext> txnSet = Collections.newSetFromMap(new IdentityHashMap<TransactionContext, Boolean>());
synchronized (this.transactions) {
txnSet.addAll(this.transactions.threadToTransactionContext.values());
txnSet.addAll(this.transactions.xidToTransactionContext.values());
}
- Collection<org.teiid.adminapi.Transaction> result = new ArrayList<org.teiid.adminapi.Transaction>(txnSet.size());
+ Collection<TransactionMetadata> result = new ArrayList<TransactionMetadata>(txnSet.size());
for (TransactionContext transactionContext : txnSet) {
if (transactionContext.getTransactionType() == Scope.NONE) {
continue;
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/service/TransactionService.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/service/TransactionService.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/service/TransactionService.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -30,6 +30,7 @@
import org.teiid.adminapi.AdminException;
import org.teiid.adminapi.Transaction;
+import org.teiid.adminapi.impl.TransactionMetadata;
import org.teiid.client.xa.XATransactionException;
import org.teiid.client.xa.XidImpl;
@@ -76,7 +77,7 @@
void end(final String threadId, XidImpl xid, int flags, boolean singleTM) throws XATransactionException;
// management methods
- Collection<Transaction> getTransactions();
+ Collection<TransactionMetadata> getTransactions();
void terminateTransaction(String transactionId) throws AdminException;
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -22,43 +22,19 @@
package org.teiid.query.metadata;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
+import java.io.*;
+import java.util.*;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.vfs.VirtualFile;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.core.TeiidComponentException;
-import org.teiid.core.types.BlobImpl;
-import org.teiid.core.types.ClobImpl;
-import org.teiid.core.types.DataTypeManager;
-import org.teiid.core.types.InputStreamFactory;
-import org.teiid.core.types.SQLXMLImpl;
+import org.teiid.core.types.*;
import org.teiid.core.util.ArgCheck;
import org.teiid.core.util.LRUCache;
import org.teiid.core.util.ObjectConverterUtil;
import org.teiid.core.util.StringUtil;
-import org.teiid.metadata.AbstractMetadataRecord;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.ColumnSet;
-import org.teiid.metadata.Datatype;
-import org.teiid.metadata.ForeignKey;
-import org.teiid.metadata.KeyRecord;
-import org.teiid.metadata.Procedure;
-import org.teiid.metadata.ProcedureParameter;
-import org.teiid.metadata.Schema;
-import org.teiid.metadata.Table;
+import org.teiid.metadata.*;
import org.teiid.metadata.BaseColumn.NullType;
import org.teiid.metadata.Column.SearchType;
import org.teiid.metadata.ProcedureParameter.Type;
@@ -93,6 +69,7 @@
private final class VirtualFileInputStreamFactory extends
InputStreamFactory {
private final VirtualFile f;
+ private InputStream is;
private VirtualFileInputStreamFactory(VirtualFile f) {
this.f = f;
@@ -100,22 +77,22 @@
@Override
public InputStream getInputStream() throws IOException {
- return f.openStream();
+ this.is = f.openStream();
+ return is;
}
@Override
public long getLength() {
+ return f.getSize();
+ }
+
+ @Override
+ public void free() {
try {
- return f.getSize();
+ this.is.close();
} catch (IOException e) {
}
- return super.getLength();
}
-
- @Override
- public void free() throws IOException {
- f.close();
- }
}
public static class Resource {
Modified: branches/as7/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -25,13 +25,9 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
+import java.util.*;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.vfs.VirtualFile;
import org.junit.Test;
import org.mockito.Mockito;
import org.teiid.adminapi.Model;
@@ -42,8 +38,6 @@
import org.teiid.metadata.Datatype;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.Table;
-import org.teiid.query.metadata.CompositeMetadataStore;
-import org.teiid.query.metadata.TransformationMetadata;
import org.teiid.query.metadata.TransformationMetadata.Resource;
import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.translator.TranslatorException;
Modified: branches/as7/jboss-integration/pom.xml
===================================================================
--- branches/as7/jboss-integration/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/jboss-integration/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -40,7 +40,54 @@
</dependency>
<dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-controller</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
+ <artifactId>staxmapper</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-dmr</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.msc</groupId>
+ <artifactId>jboss-msc</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.picketbox</groupId>
+ <artifactId>picketbox</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>org.jboss</groupId>
<artifactId>jboss-reflect</artifactId>
<scope>provided</scope>
</dependency>
@@ -75,7 +122,7 @@
<version>2.0.3.SP1</version>
<scope>provided</scope>
</dependency>
- <!-- these for just running profile service remotely -->
+
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-common-core</artifactId>
@@ -89,15 +136,6 @@
<version>5.0.3.GA</version>
<scope>test</scope>
</dependency>
-<!--
- <dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <classifier>client</classifier>
- <version>2.1.1.GA</version>
- <scope>test</scope>
- </dependency>
--->
<dependency>
<groupId>org.jboss.remoting</groupId>
@@ -140,6 +178,7 @@
<version>5.1.0.GA</version>
<scope>test</scope>
</dependency>
+ -->
</dependencies>
Added: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Configuration.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Configuration.java (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Configuration.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.teiid.jboss;
+
+class Configuration {
+ public static final String BUFFER_SERVICE = "buffer-service";//$NON-NLS-1$
+ public static final String RESULTSET_CACHE = "resultset-cache";//$NON-NLS-1$
+ public static final String PREPAREDPLAN_CACHE = "preparedplan-cache";//$NON-NLS-1$
+ public static final String CACHE_FACORY = "distributed-cache-factory";//$NON-NLS-1$
+ public static final String QUERY_ENGINE = "query-engine";//$NON-NLS-1$
+ public static final String JDBC = "jdbc";//$NON-NLS-1$
+ public static final String ODBC = "odbc"; //$NON-NLS-1$
+
+ // Query-ENGINE
+ public static final String JNDI_NAME = "jndi-name"; //$NON-NLS-1$
+ public static final String MAX_THREADS = "maxThreads";//$NON-NLS-1$
+ public static final String MAX_ACTIVE_PLANS = "maxActivePlans";//$NON-NLS-1$
+ public static final String USER_REQUEST_SOURCE_CONCURRENCY = "userRequestSourceConcurrency";//$NON-NLS-1$
+ public static final String TIME_SLICE_IN_MILLI = "timeSliceInMilli";//$NON-NLS-1$
+ public static final String MAX_ROWS_FETCH_SIZE = "maxRowsFetchSize";//$NON-NLS-1$
+ public static final String LOB_CHUNK_SIZE_IN_KB = "lobChunkSizeInKB";//$NON-NLS-1$
+ public static final String USE_DATA_ROLES = "useDataRoles";//$NON-NLS-1$
+ public static final String ALLOW_CREATE_TEMPORY_TABLES_BY_DEFAULT = "allowCreateTemporaryTablesByDefault";//$NON-NLS-1$
+ public static final String ALLOW_FUNCTION_CALLS_BY_DEFAULT = "allowFunctionCallsByDefault";//$NON-NLS-1$
+ public static final String QUERY_THRESHOLD_IN_SECS = "queryThresholdInSecs";//$NON-NLS-1$
+ public static final String MAX_SOURCE_ROWS = "maxSourceRows";//$NON-NLS-1$
+ public static final String EXCEPTION_ON_MAX_SOURCE_ROWS = "exceptionOnMaxSourceRows";//$NON-NLS-1$
+ public static final String MAX_ODBC_LOB_SIZE_ALLOWED = "maxODBCLobSizeAllowed";//$NON-NLS-1$
+ public static final String EVENT_DISTRIBUTOR_NAME = "eventDistributorName";//$NON-NLS-1$
+ public static final String DETECTING_CHANGE_EVENTS = "detectingChangeEvents";//$NON-NLS-1$
+ public static final String JDBC_SECURITY_DOMAIN = "jdbc-security-domain";//$NON-NLS-1$
+ public static final String MAX_SESSIONS_ALLOWED = "max-sessions-allowed";//$NON-NLS-1$
+ public static final String SESSION_EXPIRATION_TIME_LIMIT = "sessions-expiration-timelimit";//$NON-NLS-1$
+ public static final String ALLOW_ENV_FUNCTION = "allow-env-function";//$NON-NLS-1$
+
+ public static final String USE_DISK = "useDisk";//$NON-NLS-1$
+ public static final String DISK_DIRECTORY = "diskDirectory";//$NON-NLS-1$
+ public static final String PROCESSOR_BATCH_SIZE = "processorBatchSize";//$NON-NLS-1$
+ public static final String CONNECTOR_BATCH_SIZE = "connectorBatchSize";//$NON-NLS-1$
+ public static final String MAX_RESERVE_BATCH_COLUMNS = "maxReserveBatchColumns";//$NON-NLS-1$
+ public static final String MAX_PROCESSING_BATCH_COLUMNS = "maxProcessingBatchesColumns";//$NON-NLS-1$
+ public static final String MAX_FILE_SIZE = "maxFileSize";//$NON-NLS-1$
+ public static final String MAX_BUFFER_SPACE = "maxBufferSpace";//$NON-NLS-1$
+ public static final String MAX_OPEN_FILES = "maxOpenFiles";//$NON-NLS-1$
+
+ //cache-config
+ public static final String ENABLED = "enabled";//$NON-NLS-1$
+ public static final String MAX_ENTRIES = "maxEntries";//$NON-NLS-1$
+ public static final String MAX_AGE_IN_SECS = "maxAgeInSeconds";//$NON-NLS-1$
+ public static final String MAX_STALENESS = "maxStaleness";//$NON-NLS-1$
+ public static final String CACHE_TYPE = "type";//$NON-NLS-1$
+ public static final String CACHE_LOCATION= "location";//$NON-NLS-1$
+
+ // cache-factory
+ public static final String CACHE_SERVICE_JNDI_NAME = "cache-service-jndi-name";//$NON-NLS-1$
+ public static final String RESULTSET_CACHE_NAME = "resultsetCacheName";//$NON-NLS-1$
+
+ //socket config
+ public static final String MAX_SOCKET_THREAD_SIZE = "maxSocketThreads";//$NON-NLS-1$
+ public static final String IN_BUFFER_SIZE = "inputBufferSize";//$NON-NLS-1$
+ public static final String OUT_BUFFER_SIZE = "outputBufferSize";//$NON-NLS-1$
+ public static final String SOCKET_BINDING = "socket-binding";//$NON-NLS-1$
+ public static final String SOCKET_ENABLED = "enabled";//$NON-NLS-1$
+ public static final String SSL_MODE = "mode";//$NON-NLS-1$
+ public static final String KEY_STORE_FILE = "keystoreFilename";//$NON-NLS-1$
+ public static final String KEY_STORE_PASSWD = "keystorePassword";//$NON-NLS-1$
+ public static final String KEY_STORE_TYPE = "keystoreType";//$NON-NLS-1$
+ public static final String SSL_PROTOCOL = "sslProtocol";//$NON-NLS-1$
+ public static final String KEY_MANAGEMENT_ALG = "keymanagementAlgorithm";//$NON-NLS-1$
+ public static final String TRUST_FILE = "truststoreFilename";//$NON-NLS-1$
+ public static final String TRUST_PASSWD = "truststorePassword";//$NON-NLS-1$
+ public static final String AUTH_MODE = "authenticationMode";//$NON-NLS-1$
+ public static final String SSL = "ssl";//$NON-NLS-1$
+}
+
+
Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Configuration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Element.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Element.java (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Element.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.teiid.jboss;
+
+import java.util.HashMap;
+import java.util.Map;
+import static org.teiid.jboss.Configuration.*;
+
+enum Element {
+ // must be first
+ UNKNOWN(null),
+ QUERY_ENGINE_ELEMENT(QUERY_ENGINE),
+
+ // Query-ENGINE
+ MAX_THREADS_ELEMENT(MAX_THREADS),
+ MAX_ACTIVE_PLANS_ELEMENT(MAX_ACTIVE_PLANS),
+ USER_REQUEST_SOURCE_CONCURRENCY_ELEMENT(USER_REQUEST_SOURCE_CONCURRENCY),
+ TIME_SLICE_IN_MILLI_ELEMENT(TIME_SLICE_IN_MILLI),
+ MAX_ROWS_FETCH_SIZE_ELEMENT(MAX_ROWS_FETCH_SIZE),
+ LOB_CHUNK_SIZE_IN_KB_ELEMENT(LOB_CHUNK_SIZE_IN_KB),
+ USE_DATA_ROLES_ELEMENT(USE_DATA_ROLES),
+ ALLOW_CREATE_TEMPORY_TABLES_BY_DEFAULT_ELEMENT(ALLOW_CREATE_TEMPORY_TABLES_BY_DEFAULT),
+ ALLOW_FUNCTION_CALLS_BY_DEFAULT_ELEMENT(ALLOW_FUNCTION_CALLS_BY_DEFAULT),
+ QUERY_THRESHOLD_IN_SECS_ELEMENT(QUERY_THRESHOLD_IN_SECS),
+ MAX_SOURCE_ROWS_ELEMENT(MAX_SOURCE_ROWS),
+ EXCEPTION_ON_MAX_SOURCE_ROWS_ELEMENT(EXCEPTION_ON_MAX_SOURCE_ROWS),
+ MAX_ODBC_LOB_SIZE_ALLOWED_ELEMENT(MAX_ODBC_LOB_SIZE_ALLOWED),
+ EVENT_DISTRIBUTOR_NAME_ELEMENT(EVENT_DISTRIBUTOR_NAME),
+ DETECTING_CHANGE_EVENTS_ELEMENT(DETECTING_CHANGE_EVENTS),
+ JDBC_SECURITY_DOMAIN_ELEMENT(JDBC_SECURITY_DOMAIN),
+ MAX_SESSIONS_ALLOWED_ELEMENT(MAX_SESSIONS_ALLOWED),
+ SESSION_EXPIRATION_TIME_LIMIT_ELEMENT(SESSION_EXPIRATION_TIME_LIMIT),
+ ALLOW_ENV_FUNCTION_ELEMENT(ALLOW_ENV_FUNCTION),
+
+ //children
+ BUFFER_SERVICE_ELEMENT(BUFFER_SERVICE),
+ RESULTSET_CACHE_ELEMENT(RESULTSET_CACHE),
+ PREPAREDPLAN_CACHE_ELEMENT(PREPAREDPLAN_CACHE),
+ CACHE_FACORY_ELEMENT(CACHE_FACORY),
+ JDBC_ELEMENT(JDBC),
+ ODBC_ELEMENT(ODBC),
+
+ // buffer manager
+ USE_DISK_ELEMENT(USE_DISK),
+ DISK_DIRECTORY_ELEMENT(DISK_DIRECTORY),
+ PROCESSOR_BATCH_SIZE_ELEMENT(PROCESSOR_BATCH_SIZE),
+ CONNECTOR_BATCH_SIZE_ELEMENT(CONNECTOR_BATCH_SIZE),
+ MAX_RESERVE_BATCH_COLUMNS_ELEMENT(MAX_RESERVE_BATCH_COLUMNS),
+ MAX_PROCESSING_BATCH_COLUMNS_ELEMENT(MAX_PROCESSING_BATCH_COLUMNS),
+ MAX_FILE_SIZE_ELEMENT(MAX_FILE_SIZE),
+ MAX_BUFFER_SPACE_ELEMENT(MAX_BUFFER_SPACE),
+ MAX_OPEN_FILES_ELEMENT(MAX_OPEN_FILES),
+
+ //cache-config
+ ENABLED_ELEMENT(ENABLED),
+ MAX_ENTRIES_ELEMENT(MAX_ENTRIES),
+ MAX_AGE_IN_SECS_ELEMENT(MAX_AGE_IN_SECS),
+ MAX_STALENESS_ELEMENT(MAX_STALENESS),
+ CACHE_TYPE_ELEMENT(CACHE_TYPE),
+ CACHE_LOCATION_ELEMENT(CACHE_LOCATION),
+
+ // cache-factory
+ CACHE_SERVICE_JNDI_NAME_ELEMENT(CACHE_SERVICE_JNDI_NAME),
+ RESULTSET_CACHE_NAME_ELEMENT(RESULTSET_CACHE_NAME),
+
+ //socket config
+ MAX_SOCKET_SIZE_ELEMENT(MAX_SOCKET_THREAD_SIZE),
+ IN_BUFFER_SIZE_ELEMENT(IN_BUFFER_SIZE),
+ OUT_BUFFER_SIZE_ELEMENT(OUT_BUFFER_SIZE),
+ SOCKET_BINDING_ELEMENT(SOCKET_BINDING),
+ SOCKET_ENABLED_ELEMENT(SOCKET_ENABLED),
+ SSL_MODE_ELEMENT(SSL_MODE),
+ KEY_STORE_FILE_ELEMENT(KEY_STORE_FILE),
+ KEY_STORE_PASSWD_ELEMENT(KEY_STORE_PASSWD),
+ KEY_STORE_TYPE_ELEMENT(KEY_STORE_TYPE),
+ SSL_PROTOCOL_ELEMENT(SSL_PROTOCOL),
+ KEY_MANAGEMENT_ALG_ELEMENT(KEY_MANAGEMENT_ALG),
+ TRUST_FILE_ELEMENT(TRUST_FILE),
+ TRUST_PASSWD_ELEMENT(TRUST_PASSWD),
+ AUTH_MODE_ELEMENT(AUTH_MODE),
+ SSL_ELEMENT(SSL);
+
+ private final String name;
+
+ Element(final String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName() {
+ return name;
+ }
+
+ private static final Map<String, Element> elements;
+
+ static {
+ final Map<String, Element> map = new HashMap<String, Element>();
+ for (Element element : values()) {
+ final String name = element.getLocalName();
+ if (name != null) map.put(name, element);
+ }
+ elements = map;
+ }
+
+ public static Element forName(String localName) {
+ final Element element = elements.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+}
+
Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Element.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -21,6 +21,7 @@
*/
package org.teiid.jboss;
+import java.util.Locale;
import java.util.ResourceBundle;
import org.teiid.core.BundleUtil;
@@ -28,7 +29,13 @@
public class IntegrationPlugin {
private static final String PLUGIN_ID = "org.teiid.jboss" ; //$NON-NLS-1$
- private static final String BUNDLE_NAME = PLUGIN_ID + ".i18n"; //$NON-NLS-1$
+ static final String BUNDLE_NAME = PLUGIN_ID + ".i18n"; //$NON-NLS-1$
public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,BUNDLE_NAME,ResourceBundle.getBundle(BUNDLE_NAME));
-
+
+ public static ResourceBundle getResourceBundle(Locale locale) {
+ if (locale == null) {
+ locale = Locale.getDefault();
+ }
+ return ResourceBundle.getBundle(IntegrationPlugin.BUNDLE_NAME, locale);
+ }
}
Added: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Namespace.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Namespace.java (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Namespace.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.teiid.jboss;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum Namespace {
+ // must be first
+ UNKNOWN(null),
+ TEIID_1_0("urn:jboss:domain:teiid:1.0"); //$NON-NLS-1$
+
+ /**
+ * The current namespace version.
+ */
+ public static final Namespace CURRENT = TEIID_1_0;
+
+ private final String uri;
+
+ Namespace(String uri) {
+ this.uri = uri;
+ }
+
+ /**
+ * Get the URI of this namespace.
+ *
+ * @return the URI
+ */
+ public String getUri() {
+ return uri;
+ }
+
+ private static final Map<String, Namespace> namespaces;
+
+ static {
+ final Map<String, Namespace> map = new HashMap<String, Namespace>();
+ for (Namespace namespace : values()) {
+ final String name = namespace.getUri();
+ if (name != null) map.put(name, namespace);
+ }
+ namespaces = map;
+ }
+
+ /**
+ * Converts the specified uri to a {@link Namespace}.
+ * @param uri a namespace uri
+ * @return the matching namespace enum.
+ */
+ public static Namespace forUri(String uri) {
+ final Namespace element = namespaces.get(uri);
+ return element == null ? UNKNOWN : element;
+ }
+}
Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Namespace.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/OperationsConstants.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/OperationsConstants.java (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/OperationsConstants.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.teiid.jboss;
+
+public class OperationsConstants {
+ public static final String SESSION = "session";//$NON-NLS-1$
+ public static final String VDB_NAME = "vdb-name";//$NON-NLS-1$
+ public static final String VDB_VERSION = "vdb-version";//$NON-NLS-1$
+ public static final String EXECUTION_ID = "execution-id";//$NON-NLS-1$
+ public static final String CACHE_TYPE = "cache-type";//$NON-NLS-1$
+ public static final String XID = "xid";//$NON-NLS-1$
+
+ public static final String SOURCE_VDBNAME = "source-vdb-name";//$NON-NLS-1$
+ public static final String SOURCE_VDBVERSION = "source-vdb-version";//$NON-NLS-1$
+ public static final String TARGET_VDBNAME = "target-vdb-name";//$NON-NLS-1$
+ public static final String TARGET_VDBVERSION = "target-vdb-version";//$NON-NLS-1$
+ public static final String SQL_QUERY = "sql-query";//$NON-NLS-1$
+ public static final String TIMEOUT_IN_MILLI = "timeout-in-milli";//$NON-NLS-1$
+
+}
Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/OperationsConstants.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/QueryEngineModelHandler.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/QueryEngineModelHandler.java (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/QueryEngineModelHandler.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,480 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.teiid.jboss;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import org.jboss.as.controller.*;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+import org.jboss.msc.service.ServiceController;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.impl.*;
+import org.teiid.jboss.deployers.RuntimeEngineDeployer;
+
+abstract class QueryEngineModelHandler implements OperationHandler, DescriptionProvider {
+ private static final String DESCRIBE = ".describe"; //$NON-NLS-1$
+
+ private String operationName;
+
+ protected QueryEngineModelHandler(String operationName){
+ this.operationName = operationName;
+ }
+
+ @Override
+ public OperationResult execute(final OperationContext context, final ModelNode operation, final ResultHandler resultHandler) throws OperationFailedException {
+
+ final RuntimeOperationContext runtimeContext = context.getRuntimeContext();
+ if (runtimeContext != null) {
+ runtimeContext.setRuntimeTask(new RuntimeTask() {
+
+ @Override
+ public void execute(RuntimeTaskContext context) throws OperationFailedException {
+ ServiceController<?> sc = context.getServiceRegistry().getRequiredService(RuntimeEngineDeployer.SERVICE_NAME);
+ RuntimeEngineDeployer engine = RuntimeEngineDeployer.class.cast(sc.getValue());
+
+ resultHandler.handleResultFragment(ResultHandler.EMPTY_LOCATION, executeOperation(engine, operation));
+ }});
+ }
+
+ resultHandler.handleResultComplete();
+ return new BasicOperationResult();
+ }
+
+ @Override
+ public ModelNode getModelDescription(final Locale locale) {
+ final ResourceBundle bundle = IntegrationPlugin.getResourceBundle(locale);
+ final ModelNode operation = new ModelNode();
+ operation.get(OPERATION_NAME).set(this.operationName);
+ operation.get(DESCRIPTION).set(bundle.getString(getBundleOperationName()+DESCRIBE));
+ describeParameters(operation, bundle);
+ return operation;
+ }
+
+ protected String getBundleOperationName() {
+ return RuntimeEngineDeployer.class.getSimpleName()+"."+this.operationName; //$NON-NLS-1$
+ }
+
+ protected String getParameterDescription(ResourceBundle bundle, String parmName) {
+ return bundle.getString(RuntimeEngineDeployer.class.getSimpleName()+"."+this.operationName+"."+parmName+DESCRIBE); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ abstract protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException;
+
+ protected void describeParameters(@SuppressWarnings("unused") ModelNode operationNode, @SuppressWarnings("unused")ResourceBundle bundle) {
+ }
+}
+
+class GetRuntimeVersion extends QueryEngineModelHandler{
+ protected GetRuntimeVersion(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException{
+ ModelNode node = new ModelNode();
+ node.set(engine.getRuntimeVersion());
+ return node;
+ }
+}
+
+class GetActiveSessionsCount extends QueryEngineModelHandler{
+ protected GetActiveSessionsCount(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException{
+ ModelNode node = new ModelNode();
+ try {
+ node.set(String.valueOf(engine.getActiveSessionsCount()));
+ } catch (AdminException e) {
+ // TODO: handle exception in model node terms
+ }
+ return node;
+ }
+}
+
+class GetActiveSessions extends QueryEngineModelHandler{
+ protected GetActiveSessions(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException{
+ ModelNode node = new ModelNode();
+ node.get(TYPE).set(ModelType.LIST);
+
+ try {
+ Collection<SessionMetadata> sessions = engine.getActiveSessions();
+ for (SessionMetadata session:sessions) {
+ node.add(SessionMetadataMapper.wrap(session));
+ }
+ } catch (AdminException e) {
+ // TODO: handle exception in model node terms
+ }
+ return node;
+ }
+}
+
+class GetRequestsPerSession extends QueryEngineModelHandler{
+ protected GetRequestsPerSession(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException{
+ ModelNode node = new ModelNode();
+ node.get(TYPE).set(ModelType.LIST);
+
+ List<RequestMetadata> requests = engine.getRequestsForSession(operation.get(OperationsConstants.SESSION).asString());
+ for (RequestMetadata request:requests) {
+ node.add(RequestMetadataMapper.wrap(request));
+ }
+ return node;
+ }
+
+ protected void describeParameters(ModelNode operationNode, ResourceBundle bundle) {
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SESSION, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SESSION, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SESSION, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.SESSION));
+
+ //TODO: define response??
+ }
+}
+
+class GetRequestsPerVDB extends QueryEngineModelHandler{
+ protected GetRequestsPerVDB(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException{
+ ModelNode node = new ModelNode();
+ node.get(TYPE).set(ModelType.LIST);
+
+ try {
+ String vdbName = operation.get(OperationsConstants.VDB_NAME).asString();
+ int vdbVersion = operation.get(OperationsConstants.VDB_VERSION).asInt();
+ List<RequestMetadata> requests = engine.getRequestsUsingVDB(vdbName,vdbVersion);
+ for (RequestMetadata request:requests) {
+ node.add(RequestMetadataMapper.wrap(request));
+ }
+ } catch (AdminException e) {
+ // TODO: handle exception in model node terms
+ }
+ return node;
+ }
+
+ 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.INT);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_VERSION, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_VERSION, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.VDB_VERSION));
+
+ //TODO: define response??
+ }
+}
+
+class GetLongRunningQueries extends QueryEngineModelHandler{
+ protected GetLongRunningQueries(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException{
+ ModelNode node = new ModelNode();
+ node.get(TYPE).set(ModelType.LIST);
+
+ List<RequestMetadata> requests = engine.getLongRunningRequests();
+ for (RequestMetadata request:requests) {
+ node.add(RequestMetadataMapper.wrap(request));
+ }
+ return node;
+ }
+}
+
+class TerminateSession extends QueryEngineModelHandler{
+ protected TerminateSession(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException{
+ ModelNode node = new ModelNode();
+ engine.terminateSession(operation.get(OperationsConstants.SESSION).asString());
+ return node;
+ }
+
+ protected void describeParameters(ModelNode operationNode, ResourceBundle bundle) {
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SESSION, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SESSION, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SESSION, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.SESSION));
+ }
+}
+
+class CancelQuery extends QueryEngineModelHandler{
+ protected CancelQuery(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException{
+ ModelNode node = new ModelNode();
+ try {
+ engine.cancelRequest(operation.get(OperationsConstants.SESSION).asString(), operation.get(OperationsConstants.EXECUTION_ID).asLong());
+ } catch (AdminException e) {
+ // TODO: handle exception in model node terms
+ }
+ return node;
+ }
+
+ protected void describeParameters(ModelNode operationNode, ResourceBundle bundle) {
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SESSION, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SESSION, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SESSION, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.SESSION));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.EXECUTION_ID, TYPE).set(ModelType.LONG);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.EXECUTION_ID, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.EXECUTION_ID, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.EXECUTION_ID));
+ }
+}
+
+class CacheTypes extends QueryEngineModelHandler{
+ protected CacheTypes(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException {
+ ModelNode node = new ModelNode();
+ node.get(TYPE).set(ModelType.LIST);
+ Collection<String> types = engine.getCacheTypes();
+ for (String type:types) {
+ node.add(type);
+ }
+ return node;
+ }
+}
+
+class ClearCache extends QueryEngineModelHandler{
+
+ protected ClearCache(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException {
+ ModelNode node = new ModelNode();
+ String cacheType = operation.get(OperationsConstants.CACHE_TYPE).asString();
+
+ if (operation.get(OperationsConstants.VDB_NAME) != null && operation.get(OperationsConstants.VDB_VERSION) != null) {
+ String vdbName = operation.get(OperationsConstants.VDB_NAME).asString();
+ int vdbVersion = operation.get(OperationsConstants.VDB_VERSION).asInt();
+ engine.clearCache(cacheType, vdbName, vdbVersion);
+ }
+ else {
+ engine.clearCache(cacheType);
+ }
+ return node;
+ }
+
+ protected void describeParameters(ModelNode operationNode, ResourceBundle bundle) {
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.CACHE_TYPE, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.CACHE_TYPE, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.CACHE_TYPE, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.CACHE_TYPE));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_NAME, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_NAME, REQUIRED).set(false);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_NAME, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.VDB_NAME));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_VERSION, TYPE).set(ModelType.INT);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_VERSION, REQUIRED).set(false);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.VDB_VERSION, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.VDB_VERSION));
+
+ }
+}
+
+class CacheStatistics extends QueryEngineModelHandler{
+
+ protected CacheStatistics(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException {
+ String cacheType = operation.get(OperationsConstants.CACHE_TYPE).asString();
+ CacheStatisticsMetadata stats = engine.getCacheStatistics(cacheType);
+ return CacheStatisticsMetadataMapper.wrap(stats);
+ }
+
+ protected void describeParameters(ModelNode operationNode, ResourceBundle bundle) {
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.CACHE_TYPE, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.CACHE_TYPE, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.CACHE_TYPE, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.CACHE_TYPE));
+ }
+}
+
+class WorkerPoolStatistics extends QueryEngineModelHandler{
+
+ protected WorkerPoolStatistics(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException {
+ WorkerPoolStatisticsMetadata stats = engine.getWorkerPoolStatistics();
+ return WorkerPoolStatisticsMetadataMapper.wrap(stats);
+ }
+}
+
+class ActiveTransactions extends QueryEngineModelHandler{
+
+ protected ActiveTransactions(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException {
+ Collection<TransactionMetadata> txns = engine.getTransactions();
+
+ ModelNode node = new ModelNode();
+ node.get(TYPE).set(ModelType.LIST);
+
+ for (TransactionMetadata txn:txns) {
+ node.add(TransactionMetadataMapper.wrap(txn));
+ }
+
+ return node;
+ }
+}
+
+class TerminateTransaction extends QueryEngineModelHandler{
+
+ protected TerminateTransaction(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException {
+ String xid = operation.get(OperationsConstants.XID).asString();
+ try {
+ engine.terminateTransaction(xid);
+ } catch (AdminException e) {
+ // TODO: Handle exception
+ }
+ return new ModelNode();
+ }
+
+ protected void describeParameters(ModelNode operationNode, ResourceBundle bundle) {
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.XID, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.XID, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.XID, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.XID));
+ }
+}
+
+class MergeVDBs extends QueryEngineModelHandler{
+
+ protected MergeVDBs(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException {
+ String sourceVDBName = operation.get(OperationsConstants.SOURCE_VDBNAME).asString();
+ int sourceVDBversion = operation.get(OperationsConstants.SOURCE_VDBVERSION).asInt();
+ String targetVDBName = operation.get(OperationsConstants.TARGET_VDBNAME).asString();
+ int targetVDBversion = operation.get(OperationsConstants.TARGET_VDBVERSION).asInt();
+ try {
+ engine.mergeVDBs(sourceVDBName, sourceVDBversion, targetVDBName, targetVDBversion);
+ } catch (AdminException e) {
+ throw new OperationFailedException(new ModelNode().set(e.getMessage()));
+ }
+ return new ModelNode();
+ }
+
+ protected void describeParameters(ModelNode operationNode, ResourceBundle bundle) {
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SOURCE_VDBNAME, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SOURCE_VDBNAME, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SOURCE_VDBNAME, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.XID));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SOURCE_VDBVERSION, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SOURCE_VDBVERSION, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SOURCE_VDBVERSION, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.XID));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.TARGET_VDBNAME, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.TARGET_VDBNAME, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.TARGET_VDBNAME, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.XID));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.TARGET_VDBVERSION, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.TARGET_VDBVERSION, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.TARGET_VDBVERSION, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.XID));
+ }
+}
+
+class ExecuteQuery extends QueryEngineModelHandler{
+
+ protected ExecuteQuery(String operationName) {
+ super(operationName);
+ }
+ @Override
+ protected ModelNode executeOperation(RuntimeEngineDeployer engine, ModelNode operation) throws OperationFailedException {
+ String vdbName = operation.get(OperationsConstants.VDB_NAME).asString();
+ int vdbVersion = operation.get(OperationsConstants.VDB_VERSION).asInt();
+ String sql = operation.get(OperationsConstants.SQL_QUERY).asString();
+ int timeout = operation.get(OperationsConstants.TIMEOUT_IN_MILLI).asInt();
+ ModelNode node = new ModelNode();
+ try {
+ node.get(TYPE).set(ModelType.LIST);
+
+ List<List> results = engine.executeQuery(vdbName, vdbVersion, sql, timeout);
+ List colNames = results.get(0);
+ for (int rowNum = 1; rowNum < results.size(); rowNum++) {
+
+ List row = results.get(rowNum);
+ ModelNode rowNode = new ModelNode();
+ rowNode.get(TYPE).set(ModelType.OBJECT);
+
+ for (int colNum = 0; colNum < colNames.size(); colNum++) {
+ //TODO: support in native types instead of string here.
+ rowNode.get(ATTRIBUTES, colNames.get(colNum).toString()).set(row.get(colNum).toString());
+ }
+ node.add(rowNode);
+ }
+ } catch (AdminException e) {
+ throw new OperationFailedException(new ModelNode().set(e.getMessage()));
+ }
+ return node;
+ }
+
+ 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.XID));
+
+ 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.XID));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SQL_QUERY, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SQL_QUERY, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.SQL_QUERY, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.XID));
+
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.TIMEOUT_IN_MILLI, TYPE).set(ModelType.STRING);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.TIMEOUT_IN_MILLI, REQUIRED).set(true);
+ operationNode.get(REQUEST_PROPERTIES, OperationsConstants.TIMEOUT_IN_MILLI, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.XID));
+ }
+}
\ No newline at end of file
Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/QueryEngineModelHandler.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,448 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.jboss;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import javax.resource.spi.XATerminator;
+import javax.resource.spi.work.WorkManager;
+import javax.transaction.TransactionManager;
+
+import org.jboss.as.controller.*;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
+import org.jboss.as.controller.operations.common.Util;
+import org.jboss.as.controller.parsing.ExtensionParsingContext;
+import org.jboss.as.controller.registry.ModelNodeRegistration;
+import org.jboss.as.controller.registry.AttributeAccess.Storage;
+import org.jboss.dmr.ModelNode;
+import org.jboss.msc.service.ServiceBuilder;
+import org.jboss.msc.service.ServiceController;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.ServiceTarget;
+import org.jboss.util.threadpool.ThreadPool;
+import org.teiid.cache.CacheConfiguration;
+import org.teiid.cache.CacheFactory;
+import org.teiid.cache.jboss.ClusterableCacheFactory;
+import org.teiid.deployers.VDBRepository;
+import org.teiid.jboss.deployers.RuntimeEngineDeployer;
+import org.teiid.query.function.SystemFunctionManager;
+import org.teiid.services.BufferServiceImpl;
+import org.teiid.services.SessionServiceImpl;
+import org.teiid.transport.ClientServiceRegistry;
+import org.teiid.transport.SSLConfiguration;
+import org.teiid.transport.SocketConfiguration;
+
+public class TeiidExtension implements Extension {
+
+ private static final String ACTIVE_SESSION_COUNT = "active-session-count";
+ private static final String RUNTIME_VERSION = "runtime-version";
+ private static final String REQUESTS_PER_SESSION = "requests-per-session";
+ private static final String ACTIVE_SESSIONS = "active-sessions";
+ private static final String REQUESTS_PER_VDB = "requests-per-vdb";
+ private static final String LONG_RUNNING_QUERIES = "long-running-queries";
+ private static final String TERMINATE_SESSION = "terminate-session";
+ private static final String CANCEL_QUERY = "cancel-query";
+ private static final String CACHE_TYPES = "cache-types";
+ private static final String CLEAR_CACHE = "clear-cache";
+ private static final String CACHE_STATISTICS = "cache-statistics";
+ private static final String WORKERPOOL_STATISTICS = "workerpool-statistics";
+ private static final String ACTIVE_TRANSACTIONS = "active-transactions";
+ private static final String TERMINATE_TRANSACTION = "terminate-transaction";
+ private static final String MERGE_VDBS = "merge-vdbs";
+ private static final String EXECUTE_QUERY = "execute-query";
+
+ public static final String SUBSYSTEM_NAME = "teiid"; //$NON-NLS-1$
+ private static TeiidSubsystemParser parser = new TeiidSubsystemParser();
+ private static TeiidSubsystemDescription teiidSubsystem = new TeiidSubsystemDescription();
+
+ @Override
+ public void initialize(ExtensionContext context) {
+ final SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME);
+
+ registration.registerXMLElementWriter(parser);
+
+ final ModelNodeRegistration subsystem = registration.registerSubsystemModel(teiidSubsystem);
+ subsystem.registerOperationHandler(ModelDescriptionConstants.ADD, subsystemAddOperation, subsystemAddDescription);
+ //subsystem.registerOperationHandler(ModelDescriptionConstants.DESCRIBE, describe, describe, false);
+
+ QueryEngineModelHandler op;
+ subsystem.registerReadOnlyAttribute(RUNTIME_VERSION, new GetRuntimeVersion(RUNTIME_VERSION), Storage.RUNTIME);
+ subsystem.registerReadOnlyAttribute(ACTIVE_SESSION_COUNT, new GetActiveSessionsCount(ACTIVE_SESSION_COUNT), Storage.RUNTIME);
+
+ op = new GetActiveSessions(ACTIVE_SESSIONS);
+ subsystem.registerOperationHandler(ACTIVE_SESSIONS, op, op);
+
+ op = new GetRequestsPerSession(REQUESTS_PER_SESSION);
+ subsystem.registerOperationHandler(REQUESTS_PER_SESSION, op, op);
+
+ op = new GetRequestsPerVDB(REQUESTS_PER_VDB);
+ subsystem.registerOperationHandler(REQUESTS_PER_VDB, op, op);
+
+ op = new GetLongRunningQueries(LONG_RUNNING_QUERIES);
+ subsystem.registerOperationHandler(LONG_RUNNING_QUERIES, op, op);
+
+ op = new TerminateSession(TERMINATE_SESSION);
+ subsystem.registerOperationHandler(TERMINATE_SESSION, op, op);
+
+ op = new CancelQuery(CANCEL_QUERY);
+ subsystem.registerOperationHandler(CANCEL_QUERY, op, op);
+
+ op = new CacheTypes(CACHE_TYPES);
+ subsystem.registerOperationHandler(CACHE_TYPES, op, op);
+
+ op = new ClearCache(CLEAR_CACHE);
+ subsystem.registerOperationHandler(CLEAR_CACHE, op, op);
+
+ op = new CacheStatistics(CACHE_STATISTICS);
+ subsystem.registerOperationHandler(CACHE_STATISTICS, op, op);
+
+ op = new WorkerPoolStatistics(WORKERPOOL_STATISTICS);
+ subsystem.registerOperationHandler(WORKERPOOL_STATISTICS, op, op);
+
+ op = new ActiveTransactions(ACTIVE_TRANSACTIONS);
+ subsystem.registerOperationHandler(ACTIVE_TRANSACTIONS, op, op);
+
+ op = new TerminateTransaction(TERMINATE_TRANSACTION);
+ subsystem.registerOperationHandler(TERMINATE_TRANSACTION, op, op);
+
+ op = new MergeVDBs(MERGE_VDBS);
+ subsystem.registerOperationHandler(MERGE_VDBS, op, op);
+
+ op = new ExecuteQuery(EXECUTE_QUERY);
+ subsystem.registerOperationHandler(EXECUTE_QUERY, op, op);
+ }
+
+ @Override
+ public void initializeParsers(ExtensionParsingContext context) {
+ context.setSubsystemXmlMapping(Namespace.CURRENT.getUri(), parser);
+ }
+
+ static DescriptionProvider subsystemAddDescription = new DescriptionProvider() {
+ @Override
+ public ModelNode getModelDescription(Locale locale) {
+ final ResourceBundle bundle = IntegrationPlugin.getResourceBundle(locale);
+
+ final ModelNode node = new ModelNode();
+ node.get(OPERATION_NAME).set(ADD);
+ node.get(DESCRIPTION).set("susbsystem.add"); //$NON-NLS-1$
+
+ TeiidSubsystemDescription.getQueryEngineDescription(node.get(CHILDREN, Configuration.QUERY_ENGINE), REQUEST_PROPERTIES, bundle);
+ return node;
+ }
+ };
+
+ static ModelAddOperationHandler subsystemAddOperation = new ModelAddOperationHandler() {
+ @Override
+ public OperationResult execute(OperationContext context, final ModelNode operation, ResultHandler resultHandler) throws OperationFailedException {
+ final ModelNode modelNode = context.getSubModel();
+
+ final ModelNode queryEngineNode = operation.require(Configuration.QUERY_ENGINE);
+ modelNode.set(Configuration.QUERY_ENGINE).set(queryEngineNode.clone());
+
+ RuntimeOperationContext runtime = context.getRuntimeContext();
+ if (runtime != null) {
+ RuntimeTask task = new RuntimeTask() {
+ @Override
+ public void execute(RuntimeTaskContext context) throws OperationFailedException {
+
+ VDBRepository vdbRepo = buildVDBRepository(queryEngineNode);
+
+ SessionServiceImpl sessionService = buildSessionService(queryEngineNode);
+ sessionService.setVDBRepository(vdbRepo);
+
+ BufferServiceImpl bufferManager = buildBufferManager(queryEngineNode.get(Configuration.BUFFER_SERVICE));
+ CacheFactory cacheFactory = getCacheFactory(queryEngineNode.get(Configuration.CACHE_FACORY));
+
+ CacheConfiguration resultsetCache = buildCacheConfig(queryEngineNode.get(Configuration.RESULTSET_CACHE));
+ CacheConfiguration preparePlanCache = buildCacheConfig(queryEngineNode.get(Configuration.PREPAREDPLAN_CACHE));
+
+ SocketConfiguration jdbc = buildSocketConfiguration(queryEngineNode.get(Configuration.JDBC));
+ SocketConfiguration odbc = buildSocketConfiguration(queryEngineNode.get(Configuration.ODBC));
+
+ // now build the engine
+ RuntimeEngineDeployer engine = buildRuntimeEngine(queryEngineNode);
+ engine.setJdbcSocketConfiguration(jdbc);
+ engine.setOdbcSocketConfiguration(odbc);
+ engine.setSessionService(sessionService);
+ engine.setBufferService(bufferManager);
+ engine.setVDBRepository(vdbRepo);
+ engine.setCacheFactory(cacheFactory);
+ engine.setResultsetCacheConfig(resultsetCache);
+ engine.setPreparedPlanCacheConfig(preparePlanCache);
+ engine.setSecurityHelper(new JBossSecurityHelper());
+
+ ServiceTarget target = context.getServiceTarget();
+ ServiceBuilder<ClientServiceRegistry> serviceBuilder = target.addService(RuntimeEngineDeployer.SERVICE_NAME, engine);
+
+ serviceBuilder.addDependency(ServiceName.JBOSS.append("connector", "workmanager"), WorkManager.class, engine.workManagerInjector); //$NON-NLS-1$ //$NON-NLS-2$
+ serviceBuilder.addDependency(ServiceName.JBOSS.append("txn", "XATerminator"), XATerminator.class, engine.xaTerminatorInjector); //$NON-NLS-1$ //$NON-NLS-2$
+ serviceBuilder.addDependency(ServiceName.JBOSS.append("txn", "TransactionManager"), TransactionManager.class, engine.txnManagerInjector); //$NON-NLS-1$ //$NON-NLS-2$
+ //TODO: Threads??
+ serviceBuilder.addDependency(ServiceName.JBOSS.append("???", "???"), ThreadPool.class, engine.threadPoolInjector); //$NON-NLS-1$ //$NON-NLS-2$
+
+ serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
+ serviceBuilder.install();
+ }
+
+
+ private RuntimeEngineDeployer buildRuntimeEngine(ModelNode node) {
+ RuntimeEngineDeployer engine = new RuntimeEngineDeployer();
+
+ if (node.get(Configuration.JNDI_NAME) != null) {
+ engine.setJndiName(node.get(Configuration.JNDI_NAME).asString());
+ }
+ if (node.get(Configuration.MAX_THREADS) != null) {
+ engine.setMaxThreads(node.get(Configuration.MAX_THREADS).asInt());
+ }
+ if (node.get(Configuration.MAX_ACTIVE_PLANS) != null) {
+ engine.setMaxActivePlans(node.get(Configuration.MAX_ACTIVE_PLANS).asInt());
+ }
+ if (node.get(Configuration.USER_REQUEST_SOURCE_CONCURRENCY) != null) {
+ engine.setUserRequestSourceConcurrency(node.get(Configuration.USER_REQUEST_SOURCE_CONCURRENCY).asInt());
+ }
+ if (node.get(Configuration.TIME_SLICE_IN_MILLI) != null) {
+ engine.setTimeSliceInMilli(node.get(Configuration.TIME_SLICE_IN_MILLI).asInt());
+ }
+ if (node.get(Configuration.MAX_ROWS_FETCH_SIZE) != null) {
+ engine.setMaxRowsFetchSize(node.get(Configuration.MAX_ROWS_FETCH_SIZE).asInt());
+ }
+ if (node.get(Configuration.LOB_CHUNK_SIZE_IN_KB) != null) {
+ engine.setLobChunkSizeInKB(node.get(Configuration.LOB_CHUNK_SIZE_IN_KB).asInt());
+ }
+ if (node.get(Configuration.USE_DATA_ROLES) != null) {
+ engine.setUseDataRoles(node.get(Configuration.USE_DATA_ROLES).asBoolean());
+ }
+ if (node.get(Configuration.ALLOW_CREATE_TEMPORY_TABLES_BY_DEFAULT) != null) {
+ engine.setAllowCreateTemporaryTablesByDefault(node.get(Configuration.ALLOW_CREATE_TEMPORY_TABLES_BY_DEFAULT).asBoolean());
+ }
+ if (node.get(Configuration.ALLOW_FUNCTION_CALLS_BY_DEFAULT) != null) {
+ engine.setAllowFunctionCallsByDefault(node.get(Configuration.ALLOW_FUNCTION_CALLS_BY_DEFAULT).asBoolean());
+ }
+ if (node.get(Configuration.QUERY_THRESHOLD_IN_SECS) != null) {
+ engine.setQueryThresholdInSecs(node.get(Configuration.QUERY_THRESHOLD_IN_SECS).asInt());
+ }
+ if (node.get(Configuration.MAX_SOURCE_ROWS) != null) {
+ engine.setMaxSourceRows(node.get(Configuration.MAX_SOURCE_ROWS).asInt());
+ }
+ if (node.get(Configuration.EXCEPTION_ON_MAX_SOURCE_ROWS) != null) {
+ engine.setExceptionOnMaxSourceRows(node.get(Configuration.EXCEPTION_ON_MAX_SOURCE_ROWS).asBoolean());
+ }
+ if (node.get(Configuration.MAX_ODBC_LOB_SIZE_ALLOWED) != null) {
+ engine.setMaxODBCLobSizeAllowed(node.get(Configuration.MAX_ODBC_LOB_SIZE_ALLOWED).asInt());
+ }
+ if (node.get(Configuration.EVENT_DISTRIBUTOR_NAME) != null) {
+ engine.setEventDistributorName(node.get(Configuration.EVENT_DISTRIBUTOR_NAME).asString());
+ }
+ if (node.get(Configuration.DETECTING_CHANGE_EVENTS) != null) {
+ engine.setDetectingChangeEvents(node.get(Configuration.DETECTING_CHANGE_EVENTS).asBoolean());
+ }
+ return engine;
+ }
+
+
+ private SessionServiceImpl buildSessionService(ModelNode node) {
+ SessionServiceImpl sessionService = new SessionServiceImpl();
+ if (node.get(Configuration.JDBC_SECURITY_DOMAIN) != null) {
+ sessionService.setSecurityDomains(node.get(Configuration.JDBC_SECURITY_DOMAIN).asString());
+ }
+ if (node.get(Configuration.SESSION_EXPIRATION_TIME_LIMIT) != null) {
+ sessionService.setSessionExpirationTimeLimit(node.get(Configuration.SESSION_EXPIRATION_TIME_LIMIT).asInt());
+ }
+ if (node.get(Configuration.MAX_SESSIONS_ALLOWED) != null) {
+ sessionService.setSessionMaxLimit(node.get(Configuration.MAX_SESSIONS_ALLOWED).asInt());
+ }
+ return sessionService;
+ }
+
+ private VDBRepository buildVDBRepository(ModelNode node) {
+ SystemFunctionManager systemFunctionManager = new SystemFunctionManager();
+ if (node.get(Configuration.ALLOW_ENV_FUNCTION) != null) {
+ systemFunctionManager.setAllowEnvFunction(node.get(Configuration.ALLOW_ENV_FUNCTION).asBoolean());
+ }
+ else {
+ systemFunctionManager.setAllowEnvFunction(false);
+ }
+
+ VDBRepository vdbRepository = new VDBRepository();
+ vdbRepository.setSystemFunctionManager(systemFunctionManager);
+ return vdbRepository;
+ }
+
+ private BufferServiceImpl buildBufferManager(ModelNode node) {
+ BufferServiceImpl bufferManger = new BufferServiceImpl();
+
+ if (node == null) {
+ return bufferManger;
+ }
+
+ if (node.get(Configuration.USE_DISK) != null) {
+ bufferManger.setUseDisk(node.get(Configuration.USE_DISK).asBoolean());
+ }
+ if (node.get(Configuration.DISK_DIRECTORY) != null) {
+ bufferManger.setDiskDirectory(node.get(Configuration.DISK_DIRECTORY).asString());
+ }
+ if (node.get(Configuration.PROCESSOR_BATCH_SIZE) != null) {
+ bufferManger.setProcessorBatchSize(node.get(Configuration.PROCESSOR_BATCH_SIZE).asInt());
+ }
+ if (node.get(Configuration.CONNECTOR_BATCH_SIZE) != null) {
+ bufferManger.setConnectorBatchSize(node.get(Configuration.CONNECTOR_BATCH_SIZE).asInt());
+ }
+ if (node.get(Configuration.MAX_RESERVE_BATCH_COLUMNS) != null) {
+ bufferManger.setMaxReserveBatchColumns(node.get(Configuration.MAX_RESERVE_BATCH_COLUMNS).asInt());
+ }
+ if (node.get(Configuration.MAX_PROCESSING_BATCH_COLUMNS) != null) {
+ bufferManger.setMaxProcessingBatchesColumns(node.get(Configuration.MAX_PROCESSING_BATCH_COLUMNS).asInt());
+ }
+ if (node.get(Configuration.MAX_FILE_SIZE) != null) {
+ bufferManger.setMaxFileSize(node.get(Configuration.MAX_FILE_SIZE).asInt());
+ }
+ if (node.get(Configuration.MAX_BUFFER_SPACE) != null) {
+ bufferManger.setMaxBufferSpace(node.get(Configuration.MAX_BUFFER_SPACE).asInt());
+ }
+ if (node.get(Configuration.MAX_OPEN_FILES) != null) {
+ bufferManger.setMaxOpenFiles(node.get(Configuration.MAX_OPEN_FILES).asInt());
+ }
+ return bufferManger;
+ }
+
+ private CacheFactory getCacheFactory(ModelNode node) {
+ ClusterableCacheFactory cacheFactory = new ClusterableCacheFactory();
+
+ if (node.get(Configuration.ENABLED) != null) {
+ cacheFactory.setEnabled(node.get(Configuration.ENABLED).asBoolean());
+ }
+ else {
+ cacheFactory.setEnabled(true);
+ }
+ if (node.get(Configuration.CACHE_SERVICE_JNDI_NAME) != null) {
+ cacheFactory.setCacheManager(node.get(Configuration.CACHE_SERVICE_JNDI_NAME).asString());
+ }
+ if (node.get(Configuration.RESULTSET_CACHE_NAME) != null) {
+ cacheFactory.setResultsetCacheName(node.get(Configuration.RESULTSET_CACHE_NAME).asString());
+ }
+ return cacheFactory;
+ }
+
+ private CacheConfiguration buildCacheConfig(ModelNode node) {
+ CacheConfiguration cacheConfig = new CacheConfiguration();
+
+ if (node.get(Configuration.ENABLED) != null) {
+ cacheConfig.setEnabled(node.get(Configuration.ENABLED).asBoolean());
+ }
+ if (node.get(Configuration.MAX_ENTRIES) != null) {
+ cacheConfig.setMaxEntries(node.get(Configuration.MAX_ENTRIES).asInt());
+ }
+ if (node.get(Configuration.MAX_AGE_IN_SECS) != null) {
+ cacheConfig.setMaxAgeInSeconds(node.get(Configuration.MAX_AGE_IN_SECS).asInt());
+ }
+ if (node.get(Configuration.MAX_STALENESS) != null) {
+ cacheConfig.setMaxStaleness(node.get(Configuration.MAX_STALENESS).asInt());
+ }
+ if (node.get(Configuration.CACHE_TYPE) != null) {
+ cacheConfig.setType(node.get(Configuration.CACHE_TYPE).asString());
+ }
+ if (node.get(Configuration.CACHE_LOCATION) != null) {
+ cacheConfig.setLocation(node.get(Configuration.CACHE_LOCATION).asString());
+ }
+ return cacheConfig;
+ }
+
+ private SocketConfiguration buildSocketConfiguration(ModelNode node) {
+ SocketConfiguration socket = new SocketConfiguration();
+
+ if (node.get(Configuration.ENABLED) != null) {
+ socket.setEnabled(node.get(Configuration.ENABLED).asBoolean());
+ }
+ if (node.get(Configuration.SOCKET_BINDING) != null) {
+ socket.setBindAddress(node.get(Configuration.SOCKET_BINDING).asString());
+ }
+ if (node.get(Configuration.MAX_SOCKET_THREAD_SIZE) != null) {
+ socket.setMaxSocketThreads(node.get(Configuration.MAX_SOCKET_THREAD_SIZE).asInt());
+ }
+ if (node.get(Configuration.IN_BUFFER_SIZE) != null) {
+ socket.setInputBufferSize(node.get(Configuration.IN_BUFFER_SIZE).asInt());
+ }
+ if (node.get(Configuration.OUT_BUFFER_SIZE) != null) {
+ socket.setOutputBufferSize(node.get(Configuration.OUT_BUFFER_SIZE).asInt());
+ }
+
+ SSLConfiguration ssl = new SSLConfiguration();
+ ssl.setAuthenticationMode(SSLConfiguration.ANONYMOUS);
+
+ if (node.get(Configuration.SSL) != null) {
+ ModelNode sslNode = node.get(Configuration.SSL);
+
+ if (sslNode.get(Configuration.SSL_MODE) != null) {
+ ssl.setMode(sslNode.get(Configuration.SSL_MODE).asString());
+ }
+
+ if (sslNode.get(Configuration.KEY_STORE_FILE) != null) {
+ ssl.setKeystoreFilename(sslNode.get(Configuration.KEY_STORE_FILE).asString());
+ }
+
+ if (sslNode.get(Configuration.KEY_STORE_PASSWD) != null) {
+ ssl.setKeystorePassword(sslNode.get(Configuration.KEY_STORE_PASSWD).asString());
+ }
+
+ if (sslNode.get(Configuration.KEY_STORE_TYPE) != null) {
+ ssl.setKeystoreType(sslNode.get(Configuration.KEY_STORE_TYPE).asString());
+ }
+
+ if (sslNode.get(Configuration.SSL_PROTOCOL) != null) {
+ ssl.setSslProtocol(sslNode.get(Configuration.SSL_PROTOCOL).asString());
+ }
+ if (sslNode.get(Configuration.KEY_MANAGEMENT_ALG) != null) {
+ ssl.setKeymanagementAlgorithm(sslNode.get(Configuration.KEY_MANAGEMENT_ALG).asString());
+ }
+ if (sslNode.get(Configuration.TRUST_FILE) != null) {
+ ssl.setTruststoreFilename(sslNode.get(Configuration.TRUST_FILE).asString());
+ }
+ if (sslNode.get(Configuration.TRUST_PASSWD) != null) {
+ ssl.setTruststorePassword(sslNode.get(Configuration.TRUST_PASSWD).asString());
+ }
+ if (sslNode.get(Configuration.AUTH_MODE) != null) {
+ ssl.setAuthenticationMode(sslNode.get(Configuration.AUTH_MODE).asString());
+ }
+ }
+
+ socket.setSSLConfiguration(ssl);
+ return socket;
+ }
+
+ };
+ runtime.setRuntimeTask(task);
+ }
+
+ // compensating is remove operation
+ final ModelNode address = operation.require(OP_ADDR);
+ BasicOperationResult operationResult = new BasicOperationResult(Util.getResourceRemoveOperation(address));
+ resultHandler.handleResultComplete();
+ return operationResult;
+ }
+
+ };
+
+}
Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemDescription.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemDescription.java (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemDescription.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,209 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.jboss;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+
+public class TeiidSubsystemDescription implements DescriptionProvider {
+ private static final String DESC = ".describe"; //$NON-NLS-1$
+
+ @Override
+ public ModelNode getModelDescription(Locale locale) {
+ final ResourceBundle bundle = IntegrationPlugin.getResourceBundle(locale);
+
+ ModelNode node = new ModelNode();
+ node.get(ModelDescriptionConstants.DESCRIPTION).set("teiid subsystem"); //$NON-NLS-1$
+ node.get(ModelDescriptionConstants.HEAD_COMMENT_ALLOWED).set(true);
+ node.get(ModelDescriptionConstants.TAIL_COMMENT_ALLOWED).set(true);
+ node.get(ModelDescriptionConstants.NAMESPACE).set(Namespace.CURRENT.getUri());
+
+ getQueryEngineDescription(node.get(CHILDREN, Configuration.QUERY_ENGINE), ATTRIBUTES, bundle);
+ return node;
+ }
+
+ static void addAttribute(ModelNode node, String name, String type, String description, ModelType dataType, boolean required, String defaultValue) {
+ node.get(type, name, TYPE).set(dataType);
+ node.get(type, name, DESCRIPTION).set(description);
+ node.get(type, name, REQUIRED).set(required);
+ node.get(type, name, MAX_OCCURS).set(1);
+ if (defaultValue != null) {
+ if (ModelType.INT.equals(dataType)) {
+ node.get(type, name, DEFAULT).set(Integer.parseInt(defaultValue));
+ }
+ else if (ModelType.BOOLEAN.equals(dataType)) {
+ node.get(type, name, DEFAULT).set(Boolean.parseBoolean(defaultValue));
+ }
+ else {
+ node.get(type, name, DEFAULT).set(defaultValue);
+ }
+ }
+ //TODO: add "allowed" values
+ }
+
+ static void getQueryEngineDescription(ModelNode node, String type, ResourceBundle bundle) {
+ addAttribute(node, Configuration.JNDI_NAME, type, bundle.getString(Configuration.JNDI_NAME+DESC), ModelType.STRING, true, "teiid/engine-deployer"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_THREADS, type, bundle.getString(Configuration.MAX_THREADS+DESC), ModelType.INT, false, "64"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_ACTIVE_PLANS, type, bundle.getString(Configuration.MAX_ACTIVE_PLANS+DESC), ModelType.INT, false, "20"); //$NON-NLS-1$
+ addAttribute(node, Configuration.USER_REQUEST_SOURCE_CONCURRENCY, type, bundle.getString(Configuration.USER_REQUEST_SOURCE_CONCURRENCY+DESC), ModelType.INT, false, "0"); //$NON-NLS-1$
+ addAttribute(node, Configuration.TIME_SLICE_IN_MILLI, type, bundle.getString(Configuration.TIME_SLICE_IN_MILLI+DESC), ModelType.INT, false, "2000"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_ROWS_FETCH_SIZE, type, bundle.getString(Configuration.MAX_ROWS_FETCH_SIZE+DESC), ModelType.INT, false, "20480"); //$NON-NLS-1$
+ addAttribute(node, Configuration.LOB_CHUNK_SIZE_IN_KB, type, bundle.getString(Configuration.LOB_CHUNK_SIZE_IN_KB+DESC), ModelType.INT, false, "100"); //$NON-NLS-1$
+ addAttribute(node, Configuration.USE_DATA_ROLES, type, bundle.getString(Configuration.USE_DATA_ROLES+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+ addAttribute(node, Configuration.ALLOW_CREATE_TEMPORY_TABLES_BY_DEFAULT, type, bundle.getString(Configuration.ALLOW_CREATE_TEMPORY_TABLES_BY_DEFAULT+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+ addAttribute(node, Configuration.ALLOW_FUNCTION_CALLS_BY_DEFAULT, type, bundle.getString(Configuration.ALLOW_FUNCTION_CALLS_BY_DEFAULT+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+ addAttribute(node, Configuration.QUERY_THRESHOLD_IN_SECS, type, bundle.getString(Configuration.QUERY_THRESHOLD_IN_SECS+DESC), ModelType.INT, false, "600"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_SOURCE_ROWS, type, bundle.getString(Configuration.MAX_SOURCE_ROWS+DESC), ModelType.INT, false, "-1"); //$NON-NLS-1$
+ addAttribute(node, Configuration.EXCEPTION_ON_MAX_SOURCE_ROWS, type, bundle.getString(Configuration.EXCEPTION_ON_MAX_SOURCE_ROWS+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_ODBC_LOB_SIZE_ALLOWED, type, bundle.getString(Configuration.MAX_ODBC_LOB_SIZE_ALLOWED+DESC), ModelType.INT, false, "5242880"); //$NON-NLS-1$
+ addAttribute(node, Configuration.EVENT_DISTRIBUTOR_NAME, type, bundle.getString(Configuration.EVENT_DISTRIBUTOR_NAME+DESC), ModelType.STRING, false, "teiid/event-distributor"); //$NON-NLS-1$
+ addAttribute(node, Configuration.DETECTING_CHANGE_EVENTS, type, bundle.getString(Configuration.DETECTING_CHANGE_EVENTS+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+
+ //session stuff
+ addAttribute(node, Configuration.JDBC_SECURITY_DOMAIN, type, bundle.getString(Configuration.JDBC_SECURITY_DOMAIN+DESC), ModelType.STRING, false, null);
+ addAttribute(node, Configuration.MAX_SESSIONS_ALLOWED, type, bundle.getString(Configuration.MAX_SESSIONS_ALLOWED+DESC), ModelType.INT, false, "5000"); //$NON-NLS-1$
+ addAttribute(node, Configuration.SESSION_EXPIRATION_TIME_LIMIT, type, bundle.getString(Configuration.SESSION_EXPIRATION_TIME_LIMIT+DESC), ModelType.INT, false, "0"); //$NON-NLS-1$
+
+ addAttribute(node, Configuration.ALLOW_ENV_FUNCTION, type, bundle.getString(Configuration.ALLOW_ENV_FUNCTION+DESC), ModelType.BOOLEAN, false, "false"); //$NON-NLS-1$
+
+ //Buffer Manager stuff
+ ModelNode bufferNode = node.get(CHILDREN, Configuration.BUFFER_SERVICE);
+ bufferNode.get(TYPE).set(ModelType.OBJECT);
+ bufferNode.get(DESCRIPTION).set(bundle.getString(Configuration.BUFFER_SERVICE+DESC));
+ bufferNode.get(REQUIRED).set(false);
+ bufferNode.get(MAX_OCCURS).set(1);
+ bufferNode.get(MIN_OCCURS).set(1);
+ getBufferDescription(bufferNode, type, bundle);
+
+ // result-set-cache
+ ModelNode rsCacheNode = node.get(CHILDREN, Configuration.RESULTSET_CACHE);
+ rsCacheNode.get(TYPE).set(ModelType.OBJECT);
+ rsCacheNode.get(DESCRIPTION).set(bundle.getString(Configuration.RESULTSET_CACHE+DESC));
+ rsCacheNode.get(REQUIRED).set(false);
+ rsCacheNode.get(MAX_OCCURS).set(1);
+ rsCacheNode.get(MIN_OCCURS).set(1);
+ getResultsetCacheDescription(rsCacheNode, type, bundle);
+
+ // preparedplan-set-cache
+ ModelNode preparedPlanCacheNode = node.get(CHILDREN, Configuration.PREPAREDPLAN_CACHE);
+ preparedPlanCacheNode.get(TYPE).set(ModelType.OBJECT);
+ preparedPlanCacheNode.get(DESCRIPTION).set(bundle.getString(Configuration.PREPAREDPLAN_CACHE+DESC));
+ preparedPlanCacheNode.get(REQUIRED).set(false);
+ preparedPlanCacheNode.get(MAX_OCCURS).set(1);
+ preparedPlanCacheNode.get(MIN_OCCURS).set(1);
+ getResultsetCacheDescription(preparedPlanCacheNode, type, bundle);
+
+ //distributed-cache
+ ModelNode distributedCacheNode = node.get(CHILDREN, Configuration.CACHE_FACORY);
+ distributedCacheNode.get(TYPE).set(ModelType.OBJECT);
+ distributedCacheNode.get(DESCRIPTION).set(bundle.getString(Configuration.CACHE_FACORY+DESC));
+ distributedCacheNode.get(REQUIRED).set(false);
+ distributedCacheNode.get(MAX_OCCURS).set(1);
+ distributedCacheNode.get(MIN_OCCURS).set(1);
+ getDistributedCacheDescription(preparedPlanCacheNode, type, bundle);
+
+ //jdbc
+ ModelNode jdbcSocketNode = node.get(CHILDREN, Configuration.JDBC);
+ jdbcSocketNode.get(TYPE).set(ModelType.OBJECT);
+ jdbcSocketNode.get(DESCRIPTION).set(bundle.getString(Configuration.JDBC+DESC));
+ jdbcSocketNode.get(REQUIRED).set(false);
+ jdbcSocketNode.get(MAX_OCCURS).set(1);
+ jdbcSocketNode.get(MIN_OCCURS).set(1);
+ getSocketConfig(jdbcSocketNode, type, bundle);
+
+ //odbc
+ ModelNode odbcSocketNode = node.get(CHILDREN, Configuration.ODBC);
+ odbcSocketNode.get(TYPE).set(ModelType.OBJECT);
+ odbcSocketNode.get(DESCRIPTION).set(bundle.getString(Configuration.ODBC+DESC));
+ odbcSocketNode.get(REQUIRED).set(false);
+ odbcSocketNode.get(MAX_OCCURS).set(1);
+ odbcSocketNode.get(MIN_OCCURS).set(1);
+ getSocketConfig(odbcSocketNode, type, bundle);
+ }
+
+ private static void getDistributedCacheDescription(ModelNode node, String type, ResourceBundle bundle) {
+ addAttribute(node, Configuration.ENABLED, type, bundle.getString(Configuration.ENABLED+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+ addAttribute(node, Configuration.CACHE_SERVICE_JNDI_NAME, type, bundle.getString(Configuration.CACHE_SERVICE_JNDI_NAME+DESC), ModelType.STRING, false, "java:TeiidCacheManager"); //$NON-NLS-1$
+ addAttribute(node, Configuration.RESULTSET_CACHE_NAME, type, bundle.getString(Configuration.RESULTSET_CACHE_NAME+DESC), ModelType.STRING, false, "teiid-resultset-cache"); //$NON-NLS-1$
+ }
+
+ private static void getBufferDescription(ModelNode node, String type, ResourceBundle bundle) {
+ addAttribute(node, Configuration.USE_DISK, type, bundle.getString(Configuration.USE_DISK+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+ addAttribute(node, Configuration.DISK_DIRECTORY, type, bundle.getString(Configuration.DISK_DIRECTORY+DESC), ModelType.STRING, true, null);
+ addAttribute(node, Configuration.PROCESSOR_BATCH_SIZE, type, bundle.getString(Configuration.PROCESSOR_BATCH_SIZE+DESC), ModelType.INT, false, "512"); //$NON-NLS-1$
+ addAttribute(node, Configuration.CONNECTOR_BATCH_SIZE, type, bundle.getString(Configuration.CONNECTOR_BATCH_SIZE+DESC), ModelType.INT, false, "1024"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_RESERVE_BATCH_COLUMNS, type, bundle.getString(Configuration.MAX_RESERVE_BATCH_COLUMNS+DESC), ModelType.INT, false, "-1"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_PROCESSING_BATCH_COLUMNS, type, bundle.getString(Configuration.MAX_PROCESSING_BATCH_COLUMNS+DESC), ModelType.INT, false, "-1"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_FILE_SIZE, type, bundle.getString(Configuration.MAX_FILE_SIZE+DESC), ModelType.INT, false, "2048"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_BUFFER_SPACE, type, bundle.getString(Configuration.MAX_BUFFER_SPACE+DESC), ModelType.INT, false, "51200"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_OPEN_FILES, type, bundle.getString(Configuration.MAX_OPEN_FILES+DESC), ModelType.INT, false, "64"); //$NON-NLS-1$
+ }
+
+ static void getResultsetCacheDescription(ModelNode node, String type, ResourceBundle bundle) {
+ addAttribute(node, Configuration.ENABLED, type, bundle.getString(Configuration.ENABLED+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_ENTRIES, type, bundle.getString(Configuration.MAX_ENTRIES+DESC), ModelType.INT, false, "1024"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_AGE_IN_SECS, type, bundle.getString(Configuration.MAX_AGE_IN_SECS+DESC), ModelType.INT, false, "7200");//$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_STALENESS, type, bundle.getString(Configuration.MAX_STALENESS+DESC), ModelType.INT, false, "60");//$NON-NLS-1$
+ addAttribute(node, Configuration.CACHE_TYPE, type, bundle.getString(Configuration.CACHE_TYPE+DESC), ModelType.STRING, false, "EXPIRATION"); //$NON-NLS-1$
+ addAttribute(node, Configuration.CACHE_LOCATION, type, bundle.getString(Configuration.CACHE_LOCATION+DESC), ModelType.STRING, false, "resultset"); //$NON-NLS-1$
+ }
+
+ static void getPreparedPalnCacheDescription(ModelNode node, String type, ResourceBundle bundle) {
+ addAttribute(node, Configuration.ENABLED, type, bundle.getString(Configuration.ENABLED+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_ENTRIES, type, bundle.getString(Configuration.MAX_ENTRIES+DESC), ModelType.INT, false, "512"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_AGE_IN_SECS, type, bundle.getString(Configuration.MAX_AGE_IN_SECS+DESC), ModelType.INT, false, "28800");//$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_STALENESS, type, bundle.getString(Configuration.MAX_STALENESS+DESC), ModelType.INT, false, "0");//$NON-NLS-1$
+ addAttribute(node, Configuration.CACHE_TYPE, type, bundle.getString(Configuration.CACHE_TYPE+DESC), ModelType.STRING, false, "LRU"); //$NON-NLS-1$
+ addAttribute(node, Configuration.CACHE_LOCATION, type, bundle.getString(Configuration.CACHE_LOCATION+DESC), ModelType.STRING, false, "preparedplan"); //$NON-NLS-1$
+ }
+
+ static void getSocketConfig(ModelNode node, String type, ResourceBundle bundle) {
+ addAttribute(node, Configuration.SOCKET_ENABLED, type, bundle.getString(Configuration.SOCKET_ENABLED+DESC), ModelType.BOOLEAN, false, "true"); //$NON-NLS-1$
+ addAttribute(node, Configuration.MAX_SOCKET_THREAD_SIZE, type, bundle.getString(Configuration.MAX_SOCKET_THREAD_SIZE+DESC), ModelType.INT, false, "0"); //$NON-NLS-1$
+ addAttribute(node, Configuration.IN_BUFFER_SIZE, type, bundle.getString(Configuration.IN_BUFFER_SIZE+DESC), ModelType.INT, false, "0"); //$NON-NLS-1$
+ addAttribute(node, Configuration.OUT_BUFFER_SIZE, type, bundle.getString(Configuration.OUT_BUFFER_SIZE+DESC), ModelType.INT, false, "0"); //$NON-NLS-1$
+ addAttribute(node, Configuration.SOCKET_BINDING, type, bundle.getString(Configuration.SOCKET_BINDING+DESC), ModelType.INT, true, null);
+
+ ModelNode sslNode = node.get(CHILDREN, Configuration.SSL);
+ sslNode.get(TYPE).set(ModelType.OBJECT);
+ sslNode.get(DESCRIPTION).set(bundle.getString(Configuration.SSL+DESC));
+ sslNode.get(REQUIRED).set(false);
+ sslNode.get(MAX_OCCURS).set(1);
+ sslNode.get(MIN_OCCURS).set(0);
+ addAttribute(node, Configuration.SSL_MODE, type, bundle.getString(Configuration.SSL_MODE+DESC), ModelType.STRING, false, "login"); //$NON-NLS-1$
+ addAttribute(node, Configuration.KEY_STORE_FILE, type, bundle.getString(Configuration.KEY_STORE_FILE+DESC), ModelType.STRING, false, null);
+ addAttribute(node, Configuration.KEY_STORE_PASSWD, type, bundle.getString(Configuration.KEY_STORE_PASSWD+DESC), ModelType.STRING, false, null);
+ addAttribute(node, Configuration.KEY_STORE_TYPE, type, bundle.getString(Configuration.KEY_STORE_TYPE+DESC), ModelType.STRING, false, "JKS"); //$NON-NLS-1$
+ addAttribute(node, Configuration.SSL_PROTOCOL, type, bundle.getString(Configuration.SSL_PROTOCOL+DESC), ModelType.BOOLEAN, false, "SSLv3"); //$NON-NLS-1$
+ addAttribute(node, Configuration.KEY_MANAGEMENT_ALG, type, bundle.getString(Configuration.KEY_MANAGEMENT_ALG+DESC), ModelType.STRING, false, "false"); //$NON-NLS-1$
+ addAttribute(node, Configuration.TRUST_FILE, type, bundle.getString(Configuration.TRUST_FILE+DESC), ModelType.STRING, false, null);
+ addAttribute(node, Configuration.TRUST_PASSWD, type, bundle.getString(Configuration.TRUST_PASSWD+DESC), ModelType.STRING, false, null);
+ addAttribute(node, Configuration.AUTH_MODE, type, bundle.getString(Configuration.AUTH_MODE+DESC), ModelType.STRING, false, "anonymous"); //$NON-NLS-1$
+ }
+}
Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemDescription.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,310 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.jboss;
+
+import static org.jboss.as.controller.parsing.ParseUtils.requireNoAttributes;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+import java.util.List;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+
+import org.jboss.as.controller.parsing.ParseUtils;
+import org.jboss.as.controller.persistence.SubsystemMarshallingContext;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+import org.jboss.staxmapper.XMLElementReader;
+import org.jboss.staxmapper.XMLElementWriter;
+import org.jboss.staxmapper.XMLExtendedStreamReader;
+import org.jboss.staxmapper.XMLExtendedStreamWriter;
+
+class TeiidSubsystemParser implements XMLStreamConstants, XMLElementReader<List<ModelNode>>, XMLElementWriter<SubsystemMarshallingContext> {
+
+ @Override
+ public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException {
+ context.startSubsystemElement(Namespace.CURRENT.getUri(), false);
+ writer.writeStartElement(Configuration.QUERY_ENGINE);
+
+ ModelNode node = context.getModelNode();
+ ModelNode teiidRuntime = node.require(Configuration.QUERY_ENGINE);
+ //writeElement(writer, Element.batchSize, teiidRuntime.require("batch-size"));
+
+ //writer.writeEndElement(); // End teiid-runtime element.
+ writer.writeEndElement(); // End of subsystem element
+ }
+
+ private boolean has(ModelNode node, String name) {
+ return node.has(name) && node.get(name).isDefined();
+ }
+
+ private void writeElement(final XMLExtendedStreamWriter writer, final Element element, final ModelNode value)
+ throws XMLStreamException {
+ writer.writeStartElement(element.getLocalName());
+ writer.writeCharacters(value.asString());
+ writer.writeEndElement();
+ }
+
+ @Override
+ public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> list) throws XMLStreamException {
+ final ModelNode address = new ModelNode();
+ address.add(SUBSYSTEM, TeiidExtension.SUBSYSTEM_NAME);
+ address.protect();
+
+ final ModelNode subsystem = new ModelNode();
+ subsystem.get(OP).set(ADD);
+ subsystem.get(OP_ADDR).set(address);
+ list.add(subsystem);
+
+ // no attributes
+ requireNoAttributes(reader);
+
+ // elements
+ while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
+ switch (Namespace.forUri(reader.getNamespaceURI())) {
+ case TEIID_1_0: {
+ Element element = Element.forName(reader.getLocalName());
+ switch (element) {
+ case QUERY_ENGINE_ELEMENT:
+ ModelNode node = parseQueryEngine(reader);
+// node.get(OP).set(ADD);
+// ModelNode nodeAddress = address.clone();
+// nodeAddress.add(Configuration.QUERY_ENGINE, "teiid-query-engine"); // should this be for each instance name? // //$NON-NLS-1$
+// nodeAddress.protect();
+// node.get(OP_ADDR).set(nodeAddress);
+// list.add(node);
+ subsystem.get(Configuration.QUERY_ENGINE).set(node);
+ break;
+ default:
+ throw ParseUtils.unexpectedElement(reader);
+ }
+ break;
+ }
+ default: {
+ throw ParseUtils.unexpectedElement(reader);
+ }
+ }
+ }
+
+
+ }
+
+ private ModelNode parseQueryEngine(XMLExtendedStreamReader reader) throws XMLStreamException {
+ ModelNode node = new ModelNode();
+
+ if (reader.getAttributeCount() > 0) {
+ for(int i=0; i<reader.getAttributeCount(); i++) {
+ String attrName = reader.getAttributeLocalName(i);
+ String attrValue = reader.getAttributeValue(i);
+ node.get(attrName).set(attrValue);
+ }
+ }
+
+ while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
+ Element element = Element.forName(reader.getLocalName());
+ switch (element) {
+ // integers
+ case MAX_THREADS_ELEMENT:
+ case MAX_ACTIVE_PLANS_ELEMENT:
+ case USER_REQUEST_SOURCE_CONCURRENCY_ELEMENT:
+ case TIME_SLICE_IN_MILLI_ELEMENT:
+ case MAX_ROWS_FETCH_SIZE_ELEMENT:
+ case LOB_CHUNK_SIZE_IN_KB_ELEMENT:
+ case QUERY_THRESHOLD_IN_SECS_ELEMENT:
+ case MAX_SOURCE_ROWS_ELEMENT:
+ case MAX_ODBC_LOB_SIZE_ALLOWED_ELEMENT:
+ case MAX_SESSIONS_ALLOWED_ELEMENT:
+ case SESSION_EXPIRATION_TIME_LIMIT_ELEMENT:
+ node.get(reader.getLocalName()).set(Integer.parseInt(reader.getElementText()));
+ break;
+
+ // booleans
+ case USE_DATA_ROLES_ELEMENT:
+ case ALLOW_CREATE_TEMPORY_TABLES_BY_DEFAULT_ELEMENT:
+ case ALLOW_FUNCTION_CALLS_BY_DEFAULT_ELEMENT:
+ case EXCEPTION_ON_MAX_SOURCE_ROWS_ELEMENT:
+ case DETECTING_CHANGE_EVENTS_ELEMENT:
+ case ALLOW_ENV_FUNCTION_ELEMENT:
+ node.get(reader.getLocalName()).set(Boolean.parseBoolean(reader.getElementText()));
+ break;
+
+ //Strings
+ case EVENT_DISTRIBUTOR_NAME_ELEMENT:
+ case JDBC_SECURITY_DOMAIN_ELEMENT:
+
+ // complex types
+ case BUFFER_SERVICE_ELEMENT:
+ node.get(reader.getLocalName()).set(parseBufferConfiguration(reader));
+ break;
+ case RESULTSET_CACHE_ELEMENT:
+ node.get(reader.getLocalName()).set(parseCacheConfiguration(reader));
+ break;
+ case PREPAREDPLAN_CACHE_ELEMENT:
+ node.get(reader.getLocalName()).set(parseCacheConfiguration(reader));
+ break;
+ case CACHE_FACORY_ELEMENT:
+ node.get(reader.getLocalName()).set(parseCacheFacoryConfiguration(reader));
+ break;
+ case JDBC_ELEMENT:
+ node.get(reader.getLocalName()).set(parseSocketConfiguration(reader));
+ break;
+ case ODBC_ELEMENT:
+ node.get(reader.getLocalName()).set(parseSocketConfiguration(reader));
+ break;
+
+ default:
+ throw ParseUtils.unexpectedElement(reader);
+ }
+ }
+ return node;
+ }
+
+ private ModelNode parseBufferConfiguration(XMLExtendedStreamReader reader) throws XMLStreamException {
+ ModelNode node = new ModelNode();
+ while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
+ Element element = Element.forName(reader.getLocalName());
+ switch (element) {
+ case USE_DISK_ELEMENT:
+ node.get(reader.getLocalName()).set(Boolean.parseBoolean(reader.getElementText()));
+ break;
+ case DISK_DIRECTORY_ELEMENT:
+ node.get(reader.getLocalName()).set(reader.getElementText());
+ break;
+ case PROCESSOR_BATCH_SIZE_ELEMENT:
+ case CONNECTOR_BATCH_SIZE_ELEMENT:
+ case MAX_RESERVE_BATCH_COLUMNS_ELEMENT:
+ case MAX_PROCESSING_BATCH_COLUMNS_ELEMENT:
+ case MAX_FILE_SIZE_ELEMENT:
+ case MAX_BUFFER_SPACE_ELEMENT:
+ case MAX_OPEN_FILES_ELEMENT:
+ node.get(reader.getLocalName()).set(Integer.parseInt(reader.getElementText()));
+ break;
+ default:
+ throw ParseUtils.unexpectedElement(reader);
+ }
+ }
+ return node;
+ }
+
+ private ModelNode parseCacheConfiguration(XMLExtendedStreamReader reader) throws XMLStreamException {
+ ModelNode node = new ModelNode();
+
+ if (reader.getAttributeCount() > 0) {
+ for(int i=0; i<reader.getAttributeCount(); i++) {
+ String attrName = reader.getAttributeLocalName(i);
+ String attrValue = reader.getAttributeValue(i);
+ node.get(attrName).set(Boolean.parseBoolean(attrValue));
+ }
+ }
+
+ while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
+ Element element = Element.forName(reader.getLocalName());
+ switch (element) {
+ case MAX_ENTRIES_ELEMENT:
+ case MAX_AGE_IN_SECS_ELEMENT:
+ case MAX_STALENESS_ELEMENT:
+ node.get(reader.getLocalName()).set(Integer.parseInt(reader.getElementText()));
+ break;
+ case CACHE_TYPE_ELEMENT:
+ case CACHE_LOCATION_ELEMENT:
+ node.get(reader.getLocalName()).set(reader.getElementText());
+ break;
+ default:
+ throw ParseUtils.unexpectedElement(reader);
+ }
+ }
+ return node;
+ }
+
+ private ModelNode parseCacheFacoryConfiguration(XMLExtendedStreamReader reader) throws XMLStreamException {
+ ModelNode node = new ModelNode();
+
+ while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
+ Element element = Element.forName(reader.getLocalName());
+ switch (element) {
+ case CACHE_SERVICE_JNDI_NAME_ELEMENT:
+ case RESULTSET_CACHE_NAME_ELEMENT:
+ node.get(reader.getLocalName()).set(reader.getElementText());
+ break;
+ default:
+ throw ParseUtils.unexpectedElement(reader);
+ }
+ }
+ return node;
+ }
+
+ private ModelNode parseSocketConfiguration(XMLExtendedStreamReader reader) throws XMLStreamException {
+ ModelNode node = new ModelNode();
+
+ if (reader.getAttributeCount() > 0) {
+ for(int i=0; i<reader.getAttributeCount(); i++) {
+ String attrName = reader.getAttributeLocalName(i);
+ String attrValue = reader.getAttributeValue(i);
+ node.get(attrName).set(Boolean.parseBoolean(attrValue));
+ }
+ }
+
+ while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
+ Element element = Element.forName(reader.getLocalName());
+ switch (element) {
+ case MAX_SOCKET_SIZE_ELEMENT:
+ case IN_BUFFER_SIZE_ELEMENT:
+ case OUT_BUFFER_SIZE_ELEMENT:
+ node.get(reader.getLocalName()).set(Integer.parseInt(reader.getElementText()));
+ break;
+ case SOCKET_BINDING_ELEMENT:
+ node.get(reader.getLocalName()).set(reader.getElementText());
+ break;
+ case SSL_ELEMENT:
+ node.get(reader.getLocalName()).set(parseSSLConfiguration(reader));
+ break;
+ default:
+ throw ParseUtils.unexpectedElement(reader);
+ }
+ }
+ return node;
+ }
+
+ private ModelNode parseSSLConfiguration(XMLExtendedStreamReader reader) throws XMLStreamException {
+ ModelNode node = new ModelNode();
+
+ while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
+ Element element = Element.forName(reader.getLocalName());
+ switch (element) {
+ case SSL_MODE_ELEMENT:
+ case KEY_STORE_FILE_ELEMENT:
+ case KEY_STORE_PASSWD_ELEMENT:
+ case KEY_STORE_TYPE_ELEMENT:
+ case SSL_PROTOCOL_ELEMENT:
+ case TRUST_FILE_ELEMENT:
+ case TRUST_PASSWD_ELEMENT:
+ case AUTH_MODE_ELEMENT:
+ case KEY_MANAGEMENT_ALG_ELEMENT:
+ node.get(reader.getLocalName()).set(reader.getElementText());
+ break;
+ default:
+ throw ParseUtils.unexpectedElement(reader);
+ }
+ }
+ return node;
+ }
+}
Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidXOMSubsystemDescription.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidXOMSubsystemDescription.java (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidXOMSubsystemDescription.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,332 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.jboss;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ATTRIBUTES;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CHILDREN;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DEFAULT;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIPTION;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MAX_OCCURS;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MIN_OCCURS;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUIRED;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.TYPE;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+import org.teiid.core.TeiidRuntimeException;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+import com.sun.xml.xsom.XSAnnotation;
+import com.sun.xml.xsom.XSAttributeDecl;
+import com.sun.xml.xsom.XSAttributeUse;
+import com.sun.xml.xsom.XSComplexType;
+import com.sun.xml.xsom.XSContentType;
+import com.sun.xml.xsom.XSElementDecl;
+import com.sun.xml.xsom.XSFacet;
+import com.sun.xml.xsom.XSModelGroup;
+import com.sun.xml.xsom.XSParticle;
+import com.sun.xml.xsom.XSRestrictionSimpleType;
+import com.sun.xml.xsom.XSSchema;
+import com.sun.xml.xsom.XSSchemaSet;
+import com.sun.xml.xsom.XSSimpleType;
+import com.sun.xml.xsom.XSTerm;
+import com.sun.xml.xsom.parser.AnnotationContext;
+import com.sun.xml.xsom.parser.AnnotationParser;
+import com.sun.xml.xsom.parser.AnnotationParserFactory;
+import com.sun.xml.xsom.parser.XSOMParser;
+
+/**
+ * Lot of XSD parsing code is from http://it.toolbox.com/blogs/enterprise-web-solutions/parsing-an-xsd-schem...
+ */
+public class TeiidXOMSubsystemDescription implements DescriptionProvider {
+
+
+ @Override
+ public ModelNode getModelDescription(Locale locale) {
+
+ ModelNode node = new ModelNode();
+ node.get(ModelDescriptionConstants.DESCRIPTION).set("teiid subsystem"); //$NON-NLS-1$
+ node.get(ModelDescriptionConstants.HEAD_COMMENT_ALLOWED).set(true);
+ node.get(ModelDescriptionConstants.TAIL_COMMENT_ALLOWED).set(true);
+ node.get(ModelDescriptionConstants.NAMESPACE).set(Namespace.CURRENT.getUri());
+
+ try {
+ XSOMParser parser = new XSOMParser();
+ URL xsdURL = Thread.currentThread().getContextClassLoader().getResource("schema/jboss-teiid.xsd"); //$NON-NLS-1$
+ parser.setAnnotationParser(new AnnotationFactory());
+ parser.parse(xsdURL);
+ XSSchemaSet schemaSet = parser.getResult();
+ if (schemaSet == null) {
+ throw new TeiidRuntimeException("No Schema parsed");
+ }
+ XSSchema xsSchema = schemaSet.getSchema(1);
+ Iterator<XSElementDecl> it = xsSchema.iterateElementDecls();
+ while (it.hasNext()) {
+ XSElementDecl element = it.next();
+ parseElement(null, element, node, false);
+ }
+ } catch (SAXException e) {
+ throw new TeiidRuntimeException(e);
+ }
+
+ return node;
+ }
+
+ public void describeNode(ModelNode node, String type, String name, String description, String dataType, String defaultValue,
+ SimpleTypeRestriction restriction, boolean required) {
+ node.get(type, name, TYPE).set(getModelType(dataType));
+ node.get(type, name, DESCRIPTION).set(description);
+ node.get(type, name, REQUIRED).set(required);
+ node.get(type, name, MAX_OCCURS).set(1);
+ if (defaultValue != null) {
+ node.get(type, name, DEFAULT).set(defaultValue);
+ }
+
+ if (restriction.enumeration != null) {
+ //TODO:
+ //node.get(type, name, "allowed").set(Arrays.asList(restriction.enumeration));
+ }
+ }
+
+
+
+ private void parseElement(XSParticle p, XSElementDecl element, ModelNode node, boolean addChild) {
+ if (element.getType().isComplexType()) {
+ if (addChild) {
+ ModelNode childNode = node.get(CHILDREN, element.getName());
+ childNode.get(TYPE).set(ModelType.OBJECT);
+ childNode.get(DESCRIPTION).set(getDescription(element));
+ childNode.get(REQUIRED).set(false);
+ childNode.get(MAX_OCCURS).set(p.getMaxOccurs());
+ childNode.get(MIN_OCCURS).set(p.getMinOccurs());
+ parseComplexType(element, childNode);
+ }
+ else {
+ parseComplexType(element, node);
+ }
+ }
+ else {
+ String defaultValue = null;
+ if (element.getDefaultValue() != null) {
+ defaultValue = element.getDefaultValue().value;
+ }
+ boolean required = false;
+ XSParticle particle = ((XSContentType)element.getType()).asParticle();
+ if (particle != null) {
+ if (particle.getMinOccurs() != 0) {
+ required = true;
+ }
+ }
+ describeNode(node, ATTRIBUTES, element.getName(), getDescription(element), element.getType().getName(), defaultValue, getRestrictions(element.getType().asSimpleType()), required);
+
+ }
+ }
+
+ private void parseComplexType(XSElementDecl element, ModelNode node) {
+ XSComplexType type = element.getType().asComplexType();
+ Iterator<? extends XSAttributeUse> attrIter = type.iterateAttributeUses();
+ while(attrIter.hasNext()) {
+ XSAttributeDecl attr = attrIter.next().getDecl();
+ String defaultValue = null;
+ if (attr.getDefaultValue() != null) {
+ defaultValue = attr.getDefaultValue().value;
+ }
+ describeNode(node, ATTRIBUTES, attr.getName(), attr.getName(), attr.getType().getName(), defaultValue, getRestrictions(attr.getType().asSimpleType()), true);
+ }
+
+ XSContentType contentType = type.getContentType();
+ XSParticle particle = contentType.asParticle();
+ if (particle != null) {
+ XSTerm term = particle.getTerm();
+ if (term.isModelGroup()) {
+ XSModelGroup xsModelGroup = term.asModelGroup();
+ XSParticle[] particles = xsModelGroup.getChildren();
+ for (XSParticle p : particles) {
+ XSTerm pterm = p.getTerm();
+ if (pterm.isElementDecl()) {
+ parseElement(p, pterm.asElementDecl(), node, true);
+ }
+ }
+ }
+ }
+ }
+
+ private ModelType getModelType(String type) {
+ if (type == null) {
+ return ModelType.STRING;
+ }
+ if (type.equals("int")) { //$NON-NLS-1$
+ return ModelType.INT;
+ }
+ else if (type.equals("boolean")) { //$NON-NLS-1$
+ return ModelType.BOOLEAN;
+ }
+ return ModelType.STRING;
+ }
+
+ private String getDescription(XSElementDecl element) {
+ String description = element.getName();
+ XSAnnotation annotation = element.getAnnotation();
+ if (annotation != null) {
+ description = (String)annotation.getAnnotation();
+ }
+ return description;
+ }
+
+
+ private class AnnotationFactory implements AnnotationParserFactory{
+ @Override
+ public AnnotationParser create() {
+ return new XsdAnnotationParser();
+ }
+ }
+
+ private class XsdAnnotationParser extends AnnotationParser {
+ private StringBuilder documentation = new StringBuilder();
+ @Override
+ public ContentHandler getContentHandler(AnnotationContext context, String parentElementName, ErrorHandler handler, EntityResolver resolver) {
+ return new ContentHandler(){
+ private boolean parsingDocumentation = false;
+ @Override
+ public void characters(char[] ch, int start, int length) throws SAXException {
+ if(parsingDocumentation){
+ documentation.append(ch,start,length);
+ }
+ }
+ @Override
+ public void endElement(String uri, String localName, String name)
+ throws SAXException {
+ if(localName.equals("documentation")){ //$NON-NLS-1$
+ parsingDocumentation = false;
+ }
+ }
+ @Override
+ public void startElement(String uri, String localName,String name,
+ Attributes atts) throws SAXException {
+ if(localName.equals("documentation")){ //$NON-NLS-1$
+ parsingDocumentation = true;
+ }
+ }
+ @Override
+ public void endDocument() throws SAXException {
+ }
+ @Override
+ public void endPrefixMapping(String prefix) throws SAXException {
+ }
+ @Override
+ public void ignorableWhitespace(char[] ch, int start, int length)
+ throws SAXException {
+ }
+ @Override
+ public void processingInstruction(String target, String data)
+ throws SAXException {
+ }
+ @Override
+ public void setDocumentLocator(Locator locator) {
+ }
+ @Override
+ public void skippedEntity(String name) throws SAXException {
+ }
+ @Override
+ public void startDocument() throws SAXException {
+ }
+ @Override
+ public void startPrefixMapping(String prefix, String uri) throws SAXException {
+ }
+ };
+ }
+ @Override
+ public Object getResult(Object existing) {
+ return documentation.toString().trim();
+ }
+ }
+
+ public class SimpleTypeRestriction{
+ public String[] enumeration = null;
+ public String maxValue = null;
+ public String minValue = null;
+ public String length = null;
+ public String maxLength = null;
+ public String minLength = null;
+ public String pattern = null;
+ public String totalDigits = null;
+ }
+
+ private SimpleTypeRestriction getRestrictions(XSSimpleType xsSimpleType){
+ SimpleTypeRestriction t = new SimpleTypeRestriction();
+ XSRestrictionSimpleType restriction = xsSimpleType.asRestriction();
+ if(restriction != null){
+ List<String> enumeration = new ArrayList<String>();
+ Iterator<? extends XSFacet> i = restriction.getDeclaredFacets().iterator();
+ while(i.hasNext()){
+ XSFacet facet = i.next();
+ if(facet.getName().equals(XSFacet.FACET_ENUMERATION)){
+ enumeration.add(facet.getValue().value);
+ }
+ if(facet.getName().equals(XSFacet.FACET_MAXINCLUSIVE)){
+ t.maxValue = facet.getValue().value;
+ }
+ if(facet.getName().equals(XSFacet.FACET_MININCLUSIVE)){
+ t.minValue = facet.getValue().value;
+ }
+ if(facet.getName().equals(XSFacet.FACET_MAXEXCLUSIVE)){
+ t.maxValue = String.valueOf(Integer.parseInt(facet.getValue().value) - 1);
+ }
+ if(facet.getName().equals(XSFacet.FACET_MINEXCLUSIVE)){
+ t.minValue = String.valueOf(Integer.parseInt(facet.getValue().value) + 1);
+ }
+ if(facet.getName().equals(XSFacet.FACET_LENGTH)){
+ t.length = facet.getValue().value;
+ }
+ if(facet.getName().equals(XSFacet.FACET_MAXLENGTH)){
+ t.maxLength = facet.getValue().value;
+ }
+ if(facet.getName().equals(XSFacet.FACET_MINLENGTH)){
+ t.minLength = facet.getValue().value;
+ }
+ if(facet.getName().equals(XSFacet.FACET_PATTERN)){
+ t.pattern = facet.getValue().value;
+ }
+ if(facet.getName().equals(XSFacet.FACET_TOTALDIGITS)){
+ t.totalDigits = facet.getValue().value;
+ }
+ }
+ if(enumeration.size() > 0){
+ t.enumeration = enumeration.toArray(new String[]{});
+ }
+ }
+ return t;
+ }
+}
Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidXOMSubsystemDescription.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -29,14 +29,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.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
+import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -48,28 +41,18 @@
import javax.security.auth.login.LoginException;
import javax.transaction.TransactionManager;
-import org.jboss.managed.api.ManagedOperation.Impact;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementParameter;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.msc.service.Service;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.StartContext;
+import org.jboss.msc.service.StopContext;
+import org.jboss.msc.value.InjectedValue;
import org.jboss.util.naming.Util;
-import org.teiid.adminapi.Admin;
+import org.jboss.util.threadpool.ThreadPool;
import org.teiid.adminapi.AdminComponentException;
import org.teiid.adminapi.AdminException;
import org.teiid.adminapi.AdminProcessingException;
import org.teiid.adminapi.Admin.Cache;
-import org.teiid.adminapi.impl.CacheStatisticsMetadata;
-import org.teiid.adminapi.impl.DQPManagement;
-import org.teiid.adminapi.impl.RequestMetadata;
-import org.teiid.adminapi.impl.SessionMetadata;
-import org.teiid.adminapi.impl.VDBMetaData;
-import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
-import org.teiid.adminapi.jboss.AdminProvider;
+import org.teiid.adminapi.impl.*;
import org.teiid.cache.CacheFactory;
import org.teiid.client.DQP;
import org.teiid.client.RequestMessage;
@@ -82,15 +65,12 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
+import org.teiid.core.util.ApplicationInfo;
import org.teiid.core.util.LRUCache;
import org.teiid.deployers.VDBLifeCycleListener;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
-import org.teiid.dqp.internal.process.DQPConfiguration;
-import org.teiid.dqp.internal.process.DQPCore;
-import org.teiid.dqp.internal.process.DQPWorkContext;
-import org.teiid.dqp.internal.process.DataTierManagerImpl;
-import org.teiid.dqp.internal.process.TransactionServerImpl;
+import org.teiid.dqp.internal.process.*;
import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.SessionService;
import org.teiid.dqp.service.SessionServiceException;
@@ -102,14 +82,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.metadata.AbstractMetadataRecord;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.ColumnStats;
-import org.teiid.metadata.MetadataRepository;
-import org.teiid.metadata.Procedure;
-import org.teiid.metadata.Schema;
-import org.teiid.metadata.Table;
-import org.teiid.metadata.TableStats;
+import org.teiid.metadata.*;
import org.teiid.metadata.Table.TriggerEvent;
import org.teiid.net.TeiidURL;
import org.teiid.query.QueryPlugin;
@@ -118,41 +91,40 @@
import org.teiid.query.processor.DdlPlan;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.security.SecurityHelper;
-import org.teiid.transport.ClientServiceRegistry;
-import org.teiid.transport.ClientServiceRegistryImpl;
-import org.teiid.transport.LogonImpl;
-import org.teiid.transport.ODBCSocketListener;
-import org.teiid.transport.SocketConfiguration;
-import org.teiid.transport.SocketListener;
+import org.teiid.transport.*;
import org.teiid.vdb.runtime.VDBKey;
-@ManagementObject(name="RuntimeEngineDeployer", isRuntime=true, componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
-public class RuntimeEngineDeployer extends DQPConfiguration implements DQPManagement, Serializable , ClientServiceRegistry, EventDistributor, EventDistributorFactory {
+public class RuntimeEngineDeployer extends DQPConfiguration implements DQPManagement, Serializable , ClientServiceRegistry, EventDistributor, EventDistributorFactory, Service<ClientServiceRegistry> {
private static final long serialVersionUID = -4676205340262775388L;
+ public static final ServiceName SERVICE_NAME = ServiceName.JBOSS.append("teiid", "runtime"); //$NON-NLS-1$ //$NON-NLS-2$
private transient SocketConfiguration jdbcSocketConfiguration;
- private transient SocketConfiguration adminSocketConfiguration;
private transient SocketConfiguration odbcSocketConfiguration;
private transient SocketListener jdbcSocket;
- private transient SocketListener adminSocket;
private transient SocketListener odbcSocket;
private transient TransactionServerImpl transactionServerImpl = new TransactionServerImpl();
private transient DQPCore dqpCore = new DQPCore();
private transient SessionService sessionService;
private transient ILogon logon;
- private transient Admin admin;
private transient ClientServiceRegistryImpl csr = new ClientServiceRegistryImpl();
private transient VDBRepository vdbRepository;
private transient VDBStatusChecker vdbStatusChecker;
- private transient ProfileService profileService;
private transient String jndiName;
private String eventDistributorName;
private transient EventDistributor eventDistributor;
+ private ThreadPool theadPool;
+ // TODO: remove public?
+ public final InjectedValue<WorkManager> workManagerInjector = new InjectedValue<WorkManager>();
+ public final InjectedValue<XATerminator> xaTerminatorInjector = new InjectedValue<XATerminator>();
+ public final InjectedValue<TransactionManager> txnManagerInjector = new InjectedValue<TransactionManager>();
+ public final InjectedValue<ThreadPool> threadPoolInjector = new InjectedValue<ThreadPool>();
+
+
public RuntimeEngineDeployer() {
// TODO: this does not belong here
LogManager.setLogListener(new Log4jListener());
@@ -169,7 +141,12 @@
return this.csr.getSecurityHelper();
}
- public void start() {
+ @Override
+ public void start(StartContext context) {
+ setWorkManager(this.workManagerInjector.getValue());
+ setXATerminator(xaTerminatorInjector.getValue());
+ setTransactionManager(txnManagerInjector.getValue());
+
dqpCore.setTransactionService((TransactionService)LogManager.createLoggingProxy(LogConstants.CTX_TXN_LOG, transactionServerImpl, new Class[] {TransactionService.class}, MessageLevel.DETAIL));
if (this.eventDistributorName != null) {
@@ -181,6 +158,7 @@
LogManager.logDetail(LogConstants.CTX_RUNTIME, ne, IntegrationPlugin.Util.getString("jndi_failed", new Date(System.currentTimeMillis()).toString())); //$NON-NLS-1$
}
}
+ this.vdbStatusChecker = new VDBStatusChecker(this.vdbRepository, this.theadPool);
this.dqpCore.start(this);
this.dqpCore.getDataTierManager().setEventDistributor(this.eventDistributor);
// create the necessary services
@@ -204,8 +182,6 @@
this.csr.registerClientService(ILogon.class, logon, LogConstants.CTX_SECURITY);
DQP dqpProxy = proxyService(DQP.class, this.dqpCore, LogConstants.CTX_DQP);
this.csr.registerClientService(DQP.class, dqpProxy, LogConstants.CTX_DQP);
- Admin adminProxy = proxyService(Admin.class, admin, LogConstants.CTX_ADMIN_API);
- this.csr.registerClientService(Admin.class, adminProxy, LogConstants.CTX_ADMIN_API);
ClientServiceRegistryImpl jdbcCsr = new ClientServiceRegistryImpl();
jdbcCsr.registerClientService(ILogon.class, logon, LogConstants.CTX_SECURITY);
@@ -218,17 +194,6 @@
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("socket_not_enabled", "jdbc connections")); //$NON-NLS-1$ //$NON-NLS-2$
}
- ClientServiceRegistryImpl adminCsr = new ClientServiceRegistryImpl(Type.Admin);
- adminCsr.registerClientService(ILogon.class, logon, LogConstants.CTX_SECURITY);
- adminCsr.registerClientService(Admin.class, adminProxy, LogConstants.CTX_ADMIN_API);
-
- if (this.adminSocketConfiguration.getEnabled()) {
- this.adminSocket = new SocketListener(this.adminSocketConfiguration, adminCsr, this.dqpCore.getBufferManager(), offset);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("socket_enabled","Teiid Admin", (this.adminSocketConfiguration.getSSLConfiguration().isSslEnabled()?"mms://":"mm://")+this.adminSocketConfiguration.getHostAddress().getHostName()+":"+(this.adminSocketConfiguration.getPortNumber()+offset))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- } else {
- LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("socket_not_enabled", "admin connections")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
if (this.odbcSocketConfiguration.getEnabled()) {
this.vdbRepository.odbcEnabled();
this.odbcSocket = new ODBCSocketListener(this.odbcSocketConfiguration, this.dqpCore.getBufferManager(), offset, getMaxODBCLobSizeAllowed());
@@ -282,8 +247,14 @@
}
});
}
+
+ @Override
+ public ClientServiceRegistry getValue() throws IllegalStateException, IllegalArgumentException {
+ return this;
+ }
- public void stop() {
+ @Override
+ public void stop(StopContext context) {
if (jndiName != null) {
final InitialContext ic ;
try {
@@ -305,11 +276,6 @@
this.jdbcSocket = null;
}
- if (this.adminSocket != null) {
- this.adminSocket.stop();
- this.adminSocket = null;
- }
-
if (this.odbcSocket != null) {
this.odbcSocket.stop();
this.odbcSocket = null;
@@ -319,15 +285,6 @@
private void createClientServices() {
this.logon = new LogonImpl(this.sessionService, "teiid-cluster"); //$NON-NLS-1$
- if (profileService != null) {
- this.admin = AdminProvider.getLocal(profileService, vdbStatusChecker);
- } else {
- try {
- this.admin = AdminProvider.getLocal(vdbStatusChecker);
- } catch (AdminComponentException e) {
- throw new TeiidRuntimeException(e.getCause());
- }
- }
}
/**
@@ -356,10 +313,6 @@
this.jdbcSocketConfiguration = socketConfig;
}
- public void setAdminSocketConfiguration(SocketConfiguration socketConfig) {
- this.adminSocketConfiguration = socketConfig;
- }
-
public void setOdbcSocketConfiguration(SocketConfiguration socketConfig) {
this.odbcSocketConfiguration = socketConfig;
}
@@ -393,26 +346,20 @@
this.vdbRepository = repo;
}
- public void setVDBStatusChecker(VDBStatusChecker vdbStatusChecker) {
- this.vdbStatusChecker = vdbStatusChecker;
+ public void setThreadPool(ThreadPool threadPool) {
+ this.threadPool = threadPool;
}
- public void setProfileService(final ProfileService profileService) {
- this.profileService = profileService ;
- }
-
public void setJndiName(final String jndiName) {
this.jndiName = jndiName ;
}
@Override
- @ManagementOperation(description="Requests for perticular session", impact=Impact.ReadOnly,params={@ManagementParameter(name="sessionId",description="The session Identifier")})
public List<RequestMetadata> getRequestsForSession(String sessionId) {
return this.dqpCore.getRequestsForSession(sessionId);
}
@Override
- @ManagementOperation(description="Requests using a certain VDB", impact=Impact.ReadOnly,params={@ManagementParameter(name="vdbName",description="VDB Name"), @ManagementParameter(name="vdbVersion",description="VDB Version")})
public List<RequestMetadata> getRequestsUsingVDB(String vdbName, int vdbVersion) throws AdminException {
List<RequestMetadata> requests = new ArrayList<RequestMetadata>();
try {
@@ -430,32 +377,26 @@
@Override
- @ManagementOperation(description="Active requests", impact=Impact.ReadOnly)
public List<RequestMetadata> getRequests() {
return this.dqpCore.getRequests();
}
@Override
- @ManagementOperation(description="Long running requests", impact=Impact.ReadOnly)
public List<RequestMetadata> getLongRunningRequests() {
return this.dqpCore.getLongRunningRequests();
}
-
@Override
- @ManagementOperation(description="Get thread statistics worker pool", impact=Impact.ReadOnly,params={@ManagementParameter(name="identifier",description="Get thread statistics worker pool")})
public WorkerPoolStatisticsMetadata getWorkerPoolStatistics(){
return this.dqpCore.getWorkerPoolStatistics();
}
@Override
- @ManagementOperation(description="Terminate a Session",params={@ManagementParameter(name="terminateeId",description="The session to be terminated")})
public void terminateSession(String terminateeId) {
this.sessionService.terminateSession(terminateeId, DQPWorkContext.getWorkContext().getSessionId());
}
@Override
- @ManagementOperation(description="Cancel a Request",params={@ManagementParameter(name="sessionId",description="The session Identifier"), @ManagementParameter(name="executionId",description="The Execution Identifier")})
public boolean cancelRequest(String sessionId, long executionId) throws AdminException {
try {
return this.dqpCore.cancelRequest(sessionId, executionId);
@@ -465,31 +406,26 @@
}
@Override
- @ManagementOperation(description="Get Cache types in the system", impact=Impact.ReadOnly)
public Collection<String> getCacheTypes(){
return this.dqpCore.getCacheTypes();
}
@Override
- @ManagementOperation(description="Clear the caches in the system", impact=Impact.ReadOnly)
public void clearCache(String cacheType) {
this.dqpCore.clearCache(cacheType);
}
@Override
- @ManagementOperation(description="Clear the caches in the system for a VDB", params={@ManagementParameter(name="cacheType",description="Type of Cache"), @ManagementParameter(name="vdbName",description="VDB Name"),@ManagementParameter(name="version",description="VDB Version")}, impact=Impact.ReadOnly)
public void clearCache(String cacheType, String vdbName, int version) {
this.dqpCore.clearCache(cacheType, vdbName, version);
}
@Override
- @ManagementOperation(description="Get the cache statistics", impact=Impact.ReadOnly)
public CacheStatisticsMetadata getCacheStatistics(String cacheType) {
return this.dqpCore.getCacheStatistics(cacheType);
}
@Override
- @ManagementOperation(description="Active sessions", impact=Impact.ReadOnly)
public Collection<SessionMetadata> getActiveSessions() throws AdminException {
try {
return this.sessionService.getActiveSessions();
@@ -499,7 +435,6 @@
}
@Override
- @ManagementProperty(description="Active session count", use={ViewUse.STATISTIC}, readOnly=true)
public int getActiveSessionsCount() throws AdminException{
try {
return this.sessionService.getActiveSessionsCount();
@@ -509,19 +444,16 @@
}
@Override
- @ManagementOperation(description="Active Transactions", impact=Impact.ReadOnly)
- public Collection<org.teiid.adminapi.Transaction> getTransactions() {
+ public Collection<TransactionMetadata> getTransactions() {
return this.dqpCore.getTransactions();
}
@Override
- @ManagementOperation(description="Terminate the transaction", impact=Impact.ReadOnly)
public void terminateTransaction(String xid) throws AdminException {
this.dqpCore.terminateTransaction(xid);
}
@Override
- @ManagementOperation(description="Merge Two VDBs",params={@ManagementParameter(name="sourceVDBName"),@ManagementParameter(name="sourceVDBName"), @ManagementParameter(name="targetVDBName"), @ManagementParameter(name="targetVDBVersion")})
public void mergeVDBs(String sourceVDBName, int sourceVDBVersion,
String targetVDBName, int targetVDBVersion) throws AdminException {
this.vdbRepository.mergeVDBs(sourceVDBName, sourceVDBVersion, targetVDBName, targetVDBVersion);
@@ -532,7 +464,6 @@
}
@Override
- @ManagementOperation(description="Execute a sql query", params={@ManagementParameter(name="vdbName"),@ManagementParameter(name="vdbVersion"), @ManagementParameter(name="command"), @ManagementParameter(name="timoutInMilli")})
public List<List> executeQuery(final String vdbName, final int version, final String command, final long timoutInMilli) throws AdminException {
Properties properties = new Properties();
properties.setProperty(TeiidURL.JDBC.VDB_NAME, vdbName);
@@ -809,4 +740,9 @@
public MetadataRepository getMetadataRepository() {
return this.vdbRepository.getMetadataRepository();
}
+
+ public String getRuntimeVersion() {
+ return ApplicationInfo.getInstance().getBuildNumber();
+ }
+
}
Added: branches/as7/jboss-integration/src/main/resources/META-INF/services/org.jboss.as.controller.Extension
===================================================================
--- branches/as7/jboss-integration/src/main/resources/META-INF/services/org.jboss.as.controller.Extension (rev 0)
+++ branches/as7/jboss-integration/src/main/resources/META-INF/services/org.jboss.as.controller.Extension 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,25 @@
+#
+# JBoss, Home of Professional Open Source.
+# Copyright 2010, Red Hat, Inc., and individual contributors
+# as indicated by the @author tags. See the copyright.txt file in the
+# distribution for a full listing of individual contributors.
+#
+# This 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 software 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 software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+org.teiid.jboss.TeiidExtension
+
+
Modified: branches/as7/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- branches/as7/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-06-08 12:39:43 UTC (rev 3232)
@@ -48,3 +48,133 @@
admin_executing=JOPR admin {0} is executing command {1}
DQPCore.unable_to_process_event=Unable to process event.
+
+
+# subsystem description
+buffer-service.describe=Buffer Manager Configuration
+resultset-cache.describe=Configuration for result set caching. There will be 2 caches with these settings. One cache holds results that are specific to sessions. The other cache holds vdb scoped results and can be replicated
+preparedplan-cache.describe=PreparedPlan Cache Configuration
+distributed-cache-factory.describe=Distributed Cache Configuration
+query-engine.describe=Teiid Query Engine Configuration
+jdbc.describe=Remote JDBC Access Configuration
+admin.describe=Remote Admin Access Configuration
+odbc.describe=ODBC Access Configuration
+
+#Query-ENGINE
+jndi-name.describe=JNDI name of the Teiid Query Engine
+maxThreads.describe=Process pool maximum thread count. (default 64)
+maxActivePlans.describe=Max active plans (default 20). Increase this value on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts.
+userRequestSourceConcurrency.describe=Max source query concurrency per user request (default 0). \
+ 0 indicates use the default calculated value based on max active plans and max threads - approximately 2*(max threads)/(max active plans). \
+ 1 forces serial execution in the processing thread, just as is done for a transactional request. \
+ Any number greater than 1 limits the maximum number of concurrently executing source requests accordingly.
+timeSliceInMilli.describe=Query processor time slice, in milliseconds. (default 2000)
+maxRowsFetchSize.describe=Maximum allowed fetch size, set via JDBC. User requested value ignored above this value. (default 20480)
+lobChunkSizeInKB.describe=The max lob chunk size in KB transferred each time when processing blobs, clobs (100KB default)
+useDataRoles.describe=Turn on role checking based upon the data roles defined in VDBs. (default true)
+allowCreateTemporaryTablesByDefault.describe=Sets whether temporary table usage is allowed by default with data roles enabled. If false, the user must have a role that grants creates temporary table rights to use temporary tables. (default true)
+allowFunctionCallsByDefault.describe=Sets whether functions may be called by default with data roles enabled. If false, a specific permission must exist to call the function. (default true)
+queryThresholdInSecs.describe=Long running query threshold, after which a alert can be generated by tooling if configured
+maxSourceRows.describe=Maximum rows allowed from a source query. -1 indicates no limit. (default -1)
+exceptionOnMaxSourceRows.describe=Indicates if an exception should be thrown if the specified value for Maximum Source Rows is exceeded; only up to the maximum rows will be consumed. (default true)
+maxODBCLobSizeAllowed.describe=Maximum size of lob allowed through ODBC connection in bytes (default 5MB)
+eventDistributorName.describe=The JNDI name of the Teiid Event Distributor
+detectingChangeEvents.describe=Set to true for the engine to detect local change events. Should be disabled if using external change data capture tools. (default true)
+jdbc-security-domain.describe=Comma separated list of domains to be used to login into Teiid using JDBC connection
+admin-security-domain.describe=security domain to be used with Admin API (please do not change this, as this should be same as profile service)
+max-sessions-allowed.describe=Maximum number of sessions allowed by the system (default 5000)
+sessions-expiration-timelimit.describe=Max allowed time before the session is terminated by the system, 0 indicates unlimited (default 0)
+allow-env-function=Allow the execution of ENV function. (default false)
+
+#buffer-manager
+useDisk.describe=Use disk for buffer management
+diskDirectory.describe=Directory location for the buffer files
+processorBatchSize.describe=The max row count of a batch sent internally within the query processor. Should be <= the connectorBatchSize. (default 512)
+connectorBatchSize.describe=The max row count of a batch from a connector. Should be even multiple of processorBatchSize. (default 1024)
+maxReserveBatchColumns.describe=The number of batch columns to allow in buffer memory. -1 means to automatically calculate a value (default -1). See the admin guide for more.
+maxProcessingBatchesColumns.describe=The number of batch columns guaranteed to a processing operation. -1 means to automatically calculate a value (default -1). See the admin guide for more.
+maxFileSize.describe= Max File size in MB (default 2GB)
+maxBufferSpace.describe=Max storage space, in MB, to be used for buffer files (default 50G)
+maxOpenFiles.describe=Max open buffer files (default 64)
+
+#cache-config
+enabled.describe=enabled
+maxEntries.describe=Max Entries allowed
+maxAgeInSeconds.describe=Max age in seconds
+maxStaleness.describe=Max staleness in seconds. Modifications are based upon data updates -1 indicates no max. (default 60 - 1 minute)
+type.describe=Allowed values are LRU, EXPIRATION. \
+ Setting this value to LRU will cause cache hint TTL values \
+ to be ignored. (default EXPIRATION)
+location.describe=location
+
+#cache-factory
+cache-service-jndi-name.describe=cache service for the distributed cache
+resultsetCacheName.describe=resultset cache node name
+
+#socket config
+maxSocketThreads.describe=Max number of threads dedicated to initial request processing. \
+ Zero indicates the system default of max available processors. (default 0) \
+ Setting this value above the max available processors is not recommended.
+inputBufferSize.describe=SO_RCVBUF size, 0 indicates that system default should be used (default 0)
+outputBufferSize.describe=SO_SNDBUF size, 0 indicates that system default should be used (default 0)
+socket-binding.describe=Socket binding for the profile
+enabled.describe=enabled
+mode.describe=can be one of disabled, login, or enabled \
+ disabled = no transport or message level security will be used; \
+ login = only the login traffic will be encrypted at a message level \
+ using 128 bit AES with an ephemerial DH key exchange. \
+ No other config values are needed in this mode; \
+ enabled = traffic will be secured using this configuration.
+keystoreFilename.describe=Keystore File Name
+keystorePassword.describe=Keystore password
+keystoreType.describe=Keystore type
+sslProtocol.describe=SSL protocol used
+keymanagementAlgorithm.describe=Use key management algorithm
+truststoreFilename.describe=Truststore Name
+truststorePassword.describe=Truststore Password
+authenticationMode.describe=Authentication Mode (1-way, 2-way, anonymous)
+ssl.describe=SSL
+
+
+
+# Add
+susbsystem.add = Add the Teiid Subsystem
+
+#engine managed operations
+RuntimeEngineDeployer.active-sessions.describe=List of all the current active sessions in the Teiid subsystem.
+RuntimeEngineDeployer.requests-per-session.describe=Current active requests in progress in the query engine for a given session identifier
+RuntimeEngineDeployer.requests-per-session.session.describe=The session Identifier
+RuntimeEngineDeployer.requests-per-vdb.describe=Current active requests in progress in the query engine for a given VDB name and its version.
+RuntimeEngineDeployer.requests-per-vdb.vdb_name.describe=VDB Name
+RuntimeEngineDeployer.requests-per-vdb.vdb_version.describe=VDB Version
+RuntimeEngineDeployer.long-running-queries.describe=Long running queries that exceeded the threshold set by the 'queryThresholdInSecs' configuration property.
+RuntimeEngineDeployer.terminate-session.describe=Terminate the session
+RuntimeEngineDeployer.terminate-session.session.describe=The session Identifier of session to be terminated
+RuntimeEngineDeployer.cancel-query.describe=Cancel the execution of the actively running query
+RuntimeEngineDeployer.cancel-query.session.describe=The session Identifier of the user
+RuntimeEngineDeployer.cancel-query.execution-id.describe=The Execution Identifier of the query
+RuntimeEngineDeployer.cache-types.describe=List the available cache types
+
+RuntimeEngineDeployer.clear-cache.describe=Clear the caches in the system of the given type
+RuntimeEngineDeployer.clear-cache.cache-type.describe=cache type to be cleared. (PREPARED_PLAN_CACHE, QUERY_SERVICE_RESULT_SET_CACHE)
+RuntimeEngineDeployer.clear-cache.vdb-name.describe=VDB name
+RuntimeEngineDeployer.clear-cache.vdb_version.describe=VDB version
+RuntimeEngineDeployer.cache-statistics.describe=Get the cache statistics for the given cache type
+RuntimeEngineDeployer.cache-statistics.cache-type.describe=cache type (PREPARED_PLAN_CACHE, QUERY_SERVICE_RESULT_SET_CACHE)
+
+RuntimeEngineDeployer.workerpool-statistics.describe=Get thread statistics worker pool
+RuntimeEngineDeployer.active-transactions.describe=Active Transactions in the Query Engine
+
+RuntimeEngineDeployer.terminate-transaction.describe=Terminate the XA transaction
+RuntimeEngineDeployer.terminate-transaction.xid.describe=xid identifier of the XA transaction
+RuntimeEngineDeployer.merge-vdbs.describe=Merge Two VDBs
+RuntimeEngineDeployer.merge-vdbs.source-vdb-name.describe=Source VDB name
+RuntimeEngineDeployer.merge-vdbs.source-vdb-version.describe=Source VDB version number
+RuntimeEngineDeployer.merge-vdbs.target-vdb-name.describe=Target VDB name
+RuntimeEngineDeployer.merge-vdbs.target-vdb-version.describe=Target VDB version number
+
+RuntimeEngineDeployer.execute-query.describe=Execute a sql query
+RuntimeEngineDeployer.execute-query.vdb-name.describe=vdb name
+RuntimeEngineDeployer.execute-query.vdb-version.describe=vdb version
+RuntimeEngineDeployer.execute-query.sql-query.describe=sql query to execute
+RuntimeEngineDeployer.execute-query.timeout-in-milli.describe=timeout
Added: branches/as7/jboss-integration/src/main/resources/schema/jboss-teiid.xsd
===================================================================
--- branches/as7/jboss-integration/src/main/resources/schema/jboss-teiid.xsd (rev 0)
+++ branches/as7/jboss-integration/src/main/resources/schema/jboss-teiid.xsd 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,364 @@
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This 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 software 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 software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:domain:teiid:1.0"
+ xmlns="urn:jboss:domain:teiid:1.0"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <!-- The naming subsystem root element -->
+ <xs:element name="subsystem" type="teiidType" />
+
+ <xs:complexType name="teiidType">
+ <xs:sequence>
+ <xs:element name="query-engine" type="runtime-engine-type" maxOccurs="1" minOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Main Teiid runtime engine configuration</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="buffer-service-type">
+ <xs:sequence>
+ <xs:element name="useDisk" type="xs:string" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Use disk for buffer management</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="diskDirectory" type="xs:string" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Directory location for the buffer files</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="processorBatchSize" type="xs:int" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>The max row count of a batch sent internally within the query processor. Should be <= the connectorBatchSize. (default 512)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="connectorBatchSize" type="xs:int" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation> The max row count of a batch from a connector. Should be even multiple of processorBatchSize. (default 1024) </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxReserveBatchColumns" type="xs:int" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation> The number of batch columns to allow in buffer memory. -1 means to automatically calculate a value (default -1). See the admin guide for more. </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxProcessingBatchesColumns" type="xs:int" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>The number of batch columns guaranteed to a processing operation. -1 means to automatically calculate a value (default -1).See the admin guide for more.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxFileSize" type="xs:int" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Max File size in MB (default 2GB)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxBufferSpace" type="xs:int" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Max storage space, in MB, to be used for buffer files (default 50G) </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxOpenFiles" type="xs:int" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Max open buffer files (default 64)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="cache-factory-type">
+ <xs:sequence>
+ <xs:element name="cache-service-jndi-name" type="xs:string" minOccurs="1" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>JNDI Name of the Cache manager</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="resultsetCacheName" type="xs:string" minOccurs="1" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Name of the resultset cache name</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="enabled" type="xs:boolean" />
+ </xs:complexType>
+ <xs:complexType name="cache-config">
+ <xs:sequence>
+ <xs:element name="maxEntries" type="xs:string" minOccurs="0" maxOccurs="1" default="1024">
+ <xs:annotation>
+ <xs:documentation>Max Entries allowed (default 1024)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxAgeInSeconds" type="xs:int" minOccurs="0" maxOccurs="1" default="7200">
+ <xs:annotation>
+ <xs:documentation>Max age in seconds (default 7200 - 2 hours)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxStaleness" type="xs:int" minOccurs="0" maxOccurs="1" default="-1">
+ <xs:annotation>
+ <xs:documentation>Max staleness in seconds. Modifications are based upon data updates -1 indicates no max. (default 60 - 1 minute)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="type" minOccurs="0" maxOccurs="1" default="LRU">
+ <xs:annotation>
+ <xs:documentation>Allowed values are LRU, EXPIRATION. Setting this value to LRU will cause cache hint TTL values to be ignored. (default EXPIRATION)</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="LRU" />
+ <xs:enumeration value="EXPIRATION" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="location" type="xs:string" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>location</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="enabled" type="xs:boolean" default="true"/>
+ </xs:complexType>
+ <xs:complexType name="runtime-engine-type">
+ <xs:sequence>
+ <xs:element name="maxThreads" type="xs:int" minOccurs="0" maxOccurs="1" default="64">
+ <xs:annotation>
+ <xs:documentation>Process pool maximum thread count. (default 64)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxActivePlans" type="xs:int" minOccurs="0" maxOccurs="1" default="20">
+ <xs:annotation>
+ <xs:documentation>Max active plans (default 20). Increase this value on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="userRequestSourceConcurrency" type="xs:int" minOccurs="0" maxOccurs="1" default="0">
+ <xs:annotation>
+ <xs:documentation> Max source query concurrency per user request (default 0).
+ 0 indicates use the default calculated value based on max active plans and max threads - approximately 2*(max threads)/(max active plans).
+ 1 forces serial execution in the processing thread, just as is done for a transactional request.
+ Any number greater than 1 limits the maximum number of concurrently executing source requests accordingly.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="timeSliceInMilli" type="xs:int" minOccurs="0" maxOccurs="1" default="2000">
+ <xs:annotation>
+ <xs:documentation>Query processor time slice, in milliseconds. (default 2000)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxRowsFetchSize" type="xs:int" minOccurs="0" maxOccurs="1" default="20480">
+ <xs:annotation>
+ <xs:documentation>Maximum allowed fetch size, set via JDBC. User requested value ignored above this value. (default 20480)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="lobChunkSizeInKB" type="xs:int" minOccurs="0" maxOccurs="1" default="100">
+ <xs:annotation>
+ <xs:documentation>The max lob chunk size in KB transferred each time when processing blobs, clobs (100KB default)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="useDataRoles" type="xs:boolean" minOccurs="0" maxOccurs="1" default="true">
+ <xs:annotation>
+ <xs:documentation>Turn on role checking based upon the data roles defined in VDBs. (default true)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="allowCreateTemporaryTablesByDefault" type="xs:boolean" minOccurs="0" maxOccurs="1" default="true">
+ <xs:annotation>
+ <xs:documentation>Sets whether temporary table usage is allowed by default with data roles enabled. If false, the user must have a role that grants creates temporary table rights to use temporary tables. (default true)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="allowFunctionCallsByDefault" type="xs:boolean" minOccurs="0" maxOccurs="1" default="true">
+ <xs:annotation>
+ <xs:documentation>Sets whether functions may be called by default with data roles enabled. If false, a specific permission must exist to call the function. (default true)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="queryThresholdInSecs" type="xs:int" minOccurs="0" maxOccurs="1" default="600">
+ <xs:annotation>
+ <xs:documentation>Long running query threshold, after which a alert can be generated by tooling if configured (600 secs)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxSourceRows" type="xs:int" minOccurs="0" maxOccurs="1" default="-1">
+ <xs:annotation>
+ <xs:documentation>Maximum rows allowed from a source query. -1 indicates no limit. (default -1)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="exceptionOnMaxSourceRows" type="xs:boolean" minOccurs="0" maxOccurs="1" default="true">
+ <xs:annotation>
+ <xs:documentation>Indicates if an exception should be thrown if the specified value for Maximum Source Rows is exceeded; only up to the maximum rows will be consumed. (default true)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxODBCLobSizeAllowed" type="xs:int" minOccurs="0" maxOccurs="1" default="5242880">
+ <xs:annotation>
+ <xs:documentation>Maximum size of lob allowed through ODBC connection in bytes (default 5MB)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="eventDistributorName" type="xs:string" minOccurs="1" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>The JNDI name of the Teiid Event Distributor</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="detectingChangeEvents" type="xs:boolean" minOccurs="0" maxOccurs="1" default="true">
+ <xs:annotation>
+ <xs:documentation>Set to true for the engine to detect local change events. Should be disabled if using external change data capture tools. (default true)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="jdbc-security-domain" type="xs:string" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Comma separated list of domains to be used to login into Teiid using JDBC connection</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="admin-security-domain" type="xs:string" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Security domain to be used with Admin API</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="max-sessions-allowed" type="xs:int" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Maximum number of sessions allowed by the system (default 5000)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sessions-expiration-timelimit" type="xs:int" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Max allowed time before the session is terminated by the system, 0 indicates unlimited (default 0)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="allow-env-function" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false">
+ <xs:annotation>
+ <xs:documentation>Allow execution of ENV function (default false)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="buffer-service" type="buffer-service-type" maxOccurs="1" minOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Buffer manager information</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="distributed-cache-factory" type="cache-factory-type" maxOccurs="1" minOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Cache Factory</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="resultset-cache" type="cache-config" maxOccurs="1" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Configuration for result set caching.
+ There will be 2 caches with these settings.
+ One cache holds results that are specific to sessions.
+ The other cache holds vdb scoped results and can
+ be replicated.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="preparedplan-cache" type="cache-config" maxOccurs="1" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Configuration for prepared plan caching. (local memory only)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="jdbc" type="socket-config" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>jdbc port confguration</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="odbc" type="socket-config" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>odbc port configuration</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="jndi-name" type="xs:string" />
+ </xs:complexType>
+
+ <xs:complexType name="socket-config">
+ <xs:sequence>
+ <xs:element name="maxSocketThreads" type="xs:int" minOccurs="0" maxOccurs="1" default="0">
+ <xs:annotation>
+ <xs:documentation>Max number of threads dedicated to initial request processing.
+ Zero indicates the system default of max available processors. (default 0)
+ Setting this value above the max available processors is not recommended.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="inputBufferSize" type="xs:int" minOccurs="0" maxOccurs="1" default="0">
+ <xs:annotation>
+ <xs:documentation>SO_RCVBUF size, 0 indicates that system default should be used (default 0) </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="outputBufferSize" type="xs:int" minOccurs="0" maxOccurs="1" default="0">
+ <xs:annotation>
+ <xs:documentation>SO_SNDBUF size, 0 indicates that system default should be used (default 0)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="socket-binding" type="xs:string" minOccurs="1" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>Port binding name</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ssl" type="ssl-config" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>SSL Configuration</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="enabled" type="xs:boolean" default="true"/>
+ </xs:complexType>
+
+ <xs:complexType name="ssl-config">
+ <xs:sequence>
+ <xs:element name="mode" minOccurs="1" maxOccurs="1" default="disabled">
+ <xs:annotation>
+ <xs:documentation>can be one of disabled, login, or enabled
+ disabled = no transport or message level security will be used
+ login = only the login traffic will be encrypted at a message level
+ using 128 bit AES with an ephemerial DH key exchange.
+ No other config values are needed in this mode
+ enabled = traffic will be secured using this configuration</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="login" />
+ <xs:enumeration value="enabled" />
+ <xs:enumeration value="disabled" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="keystoreFilename" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="keystorePassword" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="keystoreType" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="sslProtocol" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="keymanagementAlgorithm" type="xs:boolean" minOccurs="0" maxOccurs="1" />
+ <xs:element name="truststoreFilename" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="truststorePassword" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="authenticationMode" minOccurs="0" maxOccurs="1" default="anonymous">
+ <xs:annotation>
+ <xs:documentation>1-way, 2-way, anonymous</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="1-way" />
+ <xs:enumeration value="2-way" />
+ <xs:enumeration value="anonymous" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
Property changes on: branches/as7/jboss-integration/src/main/resources/schema/jboss-teiid.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
===================================================================
--- branches/as7/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java (rev 0)
+++ branches/as7/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,280 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.jboss;
+
+import static junit.framework.Assert.assertEquals;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+import static org.junit.Assert.fail;
+
+import java.io.*;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import junit.framework.Assert;
+
+import org.jboss.as.controller.*;
+import org.jboss.as.controller.client.OperationBuilder;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.controller.descriptions.common.CommonProviders;
+import org.jboss.as.controller.operations.global.GlobalOperationHandlers;
+import org.jboss.as.controller.persistence.ConfigurationPersistenceException;
+import org.jboss.as.controller.persistence.ConfigurationPersister;
+import org.jboss.as.controller.persistence.SubsystemMarshallingContext;
+import org.jboss.as.controller.registry.ModelNodeRegistration;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+import org.jboss.dmr.Property;
+import org.jboss.staxmapper.XMLElementWriter;
+import org.jboss.staxmapper.XMLMapper;
+import org.junit.Before;
+import org.junit.Test;
+import org.teiid.core.util.ObjectConverterUtil;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+@SuppressWarnings("nls")
+public class TestTeiidConfiguration {
+ static ModelNode profileAddress = new ModelNode();
+ static {
+ profileAddress.add("profile", "test");
+ }
+
+ @Test
+ public void testValidateSchema() throws Exception {
+ InputStream content = Thread.currentThread().getContextClassLoader().getResourceAsStream("teiid-sample-config.xml");
+ URL xsdURL = Thread.currentThread().getContextClassLoader().getResource("schema/jboss-teiid.xsd");
+
+ SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ Schema schema = factory.newSchema(xsdURL);
+
+ Validator validator = schema.newValidator();
+ Source source = new StreamSource(content);
+ validator.setErrorHandler(new ErrorHandler() {
+
+ @Override
+ public void warning(SAXParseException exception) throws SAXException {
+ fail(exception.getMessage());
+ }
+
+ @Override
+ public void fatalError(SAXParseException exception) throws SAXException {
+ fail(exception.getMessage());
+ }
+
+ @Override
+ public void error(SAXParseException exception) throws SAXException {
+ fail(exception.getMessage());
+ }
+ });
+
+ validator.validate(source);
+
+ }
+
+ @Test
+ public void testTeiidConfiguration() throws Exception {
+ List<ModelNode> updates = createSubSystem(ObjectConverterUtil.convertToString(new FileReader("src/test/resources/teiid-sample-config.xml")));
+ assertEquals(1, updates.size());
+ for (ModelNode update : updates) {
+ try {
+ controller.executeForResult(update);
+ } catch (OperationFailedException e) {
+ throw new RuntimeException(e.getFailureDescription().toString());
+ }
+ }
+
+ ModelNode subsystem = model.require("profile").require("test").require("subsystem").require("teiid");
+ ModelNode bufferService = subsystem.require("buffer-service");
+ assertEquals(9, bufferService.keys().size());
+ assertEquals("true", bufferService.require("useDisk").asString());
+ }
+
+
+ private ModelNode model;
+ private TestController controller;
+ @Before
+ public void setup() throws Exception {
+ model = new ModelNode();
+ controller = new TestController();
+ model.get("profile", "test", "subsystem");
+
+ final ModelNodeRegistration testProfileRegistration = controller.getRegistry().registerSubModel(PathElement.pathElement("profile", "*"), new DescriptionProvider() {
+
+ @Override
+ public ModelNode getModelDescription(Locale locale) {
+ ModelNode node = new ModelNode();
+ node.get(DESCRIPTION).set("A named set of subsystem configs");
+ node.get(ATTRIBUTES, NAME, TYPE).set(ModelType.STRING);
+ node.get(ATTRIBUTES, NAME, DESCRIPTION).set("The name of the profile");
+ node.get(ATTRIBUTES, NAME, REQUIRED).set(true);
+ node.get(ATTRIBUTES, NAME, MIN_LENGTH).set(1);
+ node.get(CHILDREN, SUBSYSTEM, DESCRIPTION).set("The subsystems that make up the profile");
+ node.get(CHILDREN, SUBSYSTEM, MIN_OCCURS).set(1);
+ node.get(CHILDREN, SUBSYSTEM, MODEL_DESCRIPTION);
+ return node;
+ }
+ });
+
+ TestNewExtensionContext context = new TestNewExtensionContext(testProfileRegistration);
+ TeiidExtension extension = new TeiidExtension();
+ extension.initialize(context);
+ Assert.assertNotNull(context.createdRegistration);
+
+ }
+
+ static List<ModelNode> createSubSystem(String xmlContent) throws XMLStreamException {
+
+ final Reader reader = new StringReader(xmlContent);
+ XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(reader);
+
+ XMLMapper xmlMapper = XMLMapper.Factory.create();
+ xmlMapper.registerRootElement(new QName(Namespace.CURRENT.getUri(), "subsystem") , new TeiidSubsystemParser());
+
+ List<ModelNode> updates = new ArrayList<ModelNode>();
+ xmlMapper.parseDocument(updates, xmlReader);
+
+ // Process subsystems
+ for(final ModelNode update : updates) {
+ // Process relative subsystem path address
+ final ModelNode subsystemAddress = profileAddress.clone();
+ for(final Property path : update.get(OP_ADDR).asPropertyList()) {
+ subsystemAddress.add(path.getName(), path.getValue().asString());
+ }
+ update.get(OP_ADDR).set(subsystemAddress);
+ }
+
+ return updates;
+ }
+
+ static class TestNewExtensionContext implements ExtensionContext {
+ final ModelNodeRegistration testProfileRegistration;
+ ModelNodeRegistration createdRegistration;
+
+ TestNewExtensionContext(ModelNodeRegistration testProfileRegistration) {
+ this.testProfileRegistration = testProfileRegistration;
+ }
+
+ @Override
+ public SubsystemRegistration registerSubsystem(final String name) throws IllegalArgumentException {
+ return new SubsystemRegistration() {
+ @Override
+ public ModelNodeRegistration registerSubsystemModel(final DescriptionProvider descriptionProvider) {
+ if (descriptionProvider == null) {
+ throw new IllegalArgumentException("descriptionProvider is null");
+ }
+ createdRegistration = testProfileRegistration.registerSubModel(PathElement.pathElement("subsystem", name), descriptionProvider);
+ Assert.assertEquals("teiid", name);
+ return createdRegistration;
+ }
+
+ @Override
+ public ModelNodeRegistration registerDeploymentModel(final DescriptionProvider descriptionProvider) {
+ throw new IllegalStateException("Not implemented");
+ }
+
+ @Override
+ public void registerXMLElementWriter(XMLElementWriter<SubsystemMarshallingContext> writer) {
+ Assert.assertNotNull(writer);
+ }
+ };
+ }
+ }
+
+ class TestController extends BasicModelController {
+
+ protected TestController() {
+ super(model, new ConfigurationPersister() {
+ @Override
+ public void store(ModelNode model) throws ConfigurationPersistenceException {
+ }
+ @Override
+ public void marshallAsXml(ModelNode model, OutputStream output) throws ConfigurationPersistenceException {
+ }
+ @Override
+ public List<ModelNode> load() throws ConfigurationPersistenceException {
+ return null;
+ }
+ @Override
+ public void successfulBoot() throws ConfigurationPersistenceException {
+ }
+ @Override
+ public String snapshot() {
+ return null;
+ }
+ @Override
+ public SnapshotInfo listSnapshots() {
+ return NULL_SNAPSHOT_INFO;
+ }
+ @Override
+ public void deleteSnapshot(String name) {
+ }
+ }, new DescriptionProvider() {
+ @Override
+ public ModelNode getModelDescription(Locale locale) {
+ ModelNode node = new ModelNode();
+ node.get(DESCRIPTION).set("The root node of the test management API");
+ node.get(CHILDREN, PROFILE, DESCRIPTION).set("A list of profiles");
+ node.get(CHILDREN, PROFILE, MIN_OCCURS).set(1);
+ node.get(CHILDREN, PROFILE, MODEL_DESCRIPTION);
+ return node;
+ }
+ });
+
+ getRegistry().registerOperationHandler(READ_RESOURCE_DESCRIPTION_OPERATION, GlobalOperationHandlers.READ_RESOURCE_DESCRIPTION, CommonProviders.READ_RESOURCE_DESCRIPTION_PROVIDER, true);
+ }
+
+ @Override
+ protected ModelNodeRegistration getRegistry() {
+ return super.getRegistry();
+ }
+
+ /**
+ * Override to get the actual result from the response.
+ */
+ public ModelNode executeForResult(ModelNode operation) throws OperationFailedException {
+ ModelNode rsp = super.execute(OperationBuilder.Factory.create(operation).build());
+ if (FAILED.equals(rsp.get(OUTCOME).asString())) {
+ throw new OperationFailedException(rsp.get(FAILURE_DESCRIPTION));
+ }
+ return rsp.get(RESULT);
+ }
+ }
+
+ @Test
+ public void testSubSystemDescription() throws IOException {
+ TeiidSubsystemDescription tsd = new TeiidSubsystemDescription();
+ assertEquals(ObjectConverterUtil.convertToString(new FileReader("src/test/resources/teiid-model-config.txt")), tsd.getModelDescription(null).toString());
+ }
+}
Property changes on: branches/as7/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/test/resources/teiid-model-config.txt
===================================================================
--- branches/as7/jboss-integration/src/test/resources/teiid-model-config.txt (rev 0)
+++ branches/as7/jboss-integration/src/test/resources/teiid-model-config.txt 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,678 @@
+{
+ "description" => "teiid subsystem",
+ "head-comment-allowed" => true,
+ "tail-comment-allowed" => true,
+ "namespace" => "urn:jboss:domain:teiid:1.0",
+ "children" => {"query-engine" => {
+ "attributes" => {
+ "jndi-name" => {
+ "type" => STRING,
+ "description" => "JNDI name of the Teiid Query Engine",
+ "required" => true,
+ "max-occurs" => 1,
+ "default" => "teiid/engine-deployer"
+ },
+ "maxThreads" => {
+ "type" => INT,
+ "description" => "Process pool maximum thread count. (default 64)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 64
+ },
+ "maxActivePlans" => {
+ "type" => INT,
+ "description" => "Max active plans (default 20). Increase this value on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts.",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 20
+ },
+ "userRequestSourceConcurrency" => {
+ "type" => INT,
+ "description" => "Max source query concurrency per user request (default 0). 0 indicates use the default calculated value based on max active plans and max threads - approximately 2*(max threads)/(max active plans). ",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "timeSliceInMilli" => {
+ "type" => INT,
+ "description" => "Query processor time slice, in milliseconds. (default 2000)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 2000
+ },
+ "maxRowsFetchSize" => {
+ "type" => INT,
+ "description" => "Maximum allowed fetch size, set via JDBC. User requested value ignored above this value. (default 20480)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 20480
+ },
+ "lobChunkSizeInKB" => {
+ "type" => INT,
+ "description" => "The max lob chunk size in KB transferred each time when processing blobs, clobs (100KB default)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 100
+ },
+ "useDataRoles" => {
+ "type" => BOOLEAN,
+ "description" => "Turn on role checking based upon the data roles defined in VDBs. (default true)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "allowCreateTemporaryTablesByDefault" => {
+ "type" => BOOLEAN,
+ "description" => "Sets whether temporary table usage is allowed by default with data roles enabled. If false, the user must have a role that grants creates temporary table rights to use temporary tables. (default true)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "allowFunctionCallsByDefault" => {
+ "type" => BOOLEAN,
+ "description" => "Sets whether functions may be called by default with data roles enabled. If false, a specific permission must exist to call the function. (default true)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "queryThresholdInSecs" => {
+ "type" => INT,
+ "description" => "Long running query threshold, after which a alert can be generated by tooling if configured",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 600
+ },
+ "maxSourceRows" => {
+ "type" => INT,
+ "description" => "Maximum rows allowed from a source query. -1 indicates no limit. (default -1)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => -1
+ },
+ "exceptionOnMaxSourceRows" => {
+ "type" => BOOLEAN,
+ "description" => "Indicates if an exception should be thrown if the specified value for Maximum Source Rows is exceeded; only up to the maximum rows will be consumed. (default true)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "maxODBCLobSizeAllowed" => {
+ "type" => INT,
+ "description" => "Maximum size of lob allowed through ODBC connection in bytes (default 5MB)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 5242880
+ },
+ "eventDistributorName" => {
+ "type" => STRING,
+ "description" => "The JNDI name of the Teiid Event Distributor",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "teiid/event-distributor"
+ },
+ "detectingChangeEvents" => {
+ "type" => BOOLEAN,
+ "description" => "Set to true for the engine to detect local change events. Should be disabled if using external change data capture tools. (default true)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "jdbc-security-domain" => {
+ "type" => STRING,
+ "description" => "Comma separated list of domains to be used to login into Teiid using JDBC connection",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "admin-security-domain" => {
+ "type" => STRING,
+ "description" => "security domain to be used with Admin API (please do not change this, as this should be same as profile service)",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "max-sessions-allowed" => {
+ "type" => INT,
+ "description" => "Maximum number of sessions allowed by the system (default 5000)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 5000
+ },
+ "sessions-expiration-timelimit" => {
+ "type" => INT,
+ "description" => "Max allowed time before the session is terminated by the system, 0 indicates unlimited (default 0)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "allow-env-function" => {
+ "type" => BOOLEAN,
+ "description" => "Allow the execution of ENV function. (default false)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => false
+ }
+ },
+ "children" => {
+ "buffer-service" => {
+ "type" => OBJECT,
+ "description" => "Buffer Manager Configuration",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 1,
+ "attributes" => {
+ "useDisk" => {
+ "type" => BOOLEAN,
+ "description" => "Use disk for buffer management",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "diskDirectory" => {
+ "type" => STRING,
+ "description" => "Directory location for the buffer files",
+ "required" => true,
+ "max-occurs" => 1
+ },
+ "processorBatchSize" => {
+ "type" => INT,
+ "description" => "The max row count of a batch sent internally within the query processor. Should be <= the connectorBatchSize. (default 512)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 512
+ },
+ "connectorBatchSize" => {
+ "type" => INT,
+ "description" => "The max row count of a batch from a connector. Should be even multiple of processorBatchSize. (default 1024)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 1024
+ },
+ "maxReserveBatchColumns" => {
+ "type" => INT,
+ "description" => "The number of batch columns to allow in buffer memory. -1 means to automatically calculate a value (default -1). See the admin guide for more.",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => -1
+ },
+ "maxProcessingBatchesColumns" => {
+ "type" => INT,
+ "description" => "The number of batch columns guaranteed to a processing operation. -1 means to automatically calculate a value (default -1). See the admin guide for more.",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => -1
+ },
+ "maxFileSize" => {
+ "type" => INT,
+ "description" => "Max File size in MB (default 2GB)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 2048
+ },
+ "maxBufferSpace" => {
+ "type" => INT,
+ "description" => "Max storage space, in MB, to be used for buffer files (default 50G)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 51200
+ },
+ "maxOpenFiles" => {
+ "type" => INT,
+ "description" => "Max open buffer files (default 64)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 64
+ }
+ }
+ },
+ "resultset-cache" => {
+ "type" => OBJECT,
+ "description" => "Configuration for result set caching. There will be 2 caches with these settings. One cache holds results that are specific to sessions. The other cache holds vdb scoped results and can be replicated",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 1,
+ "attributes" => {
+ "enabled" => {
+ "type" => BOOLEAN,
+ "description" => "enabled",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "maxEntries" => {
+ "type" => INT,
+ "description" => "Max Entries allowed",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 1024
+ },
+ "maxAgeInSeconds" => {
+ "type" => INT,
+ "description" => "Max age in seconds",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 7200
+ },
+ "maxStaleness" => {
+ "type" => INT,
+ "description" => "Max staleness in seconds. Modifications are based upon data updates -1 indicates no max. (default 60 - 1 minute)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 60
+ },
+ "type" => {
+ "type" => STRING,
+ "description" => "Allowed values are LRU, EXPIRATION. ",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "EXPIRATION"
+ },
+ "location" => {
+ "type" => STRING,
+ "description" => "location",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "resultset"
+ }
+ }
+ },
+ "preparedplan-cache" => {
+ "type" => OBJECT,
+ "description" => "PreparedPlan Cache Configuration",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 1,
+ "attributes" => {
+ "enabled" => {
+ "type" => BOOLEAN,
+ "description" => "enabled",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "maxEntries" => {
+ "type" => INT,
+ "description" => "Max Entries allowed",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 1024
+ },
+ "maxAgeInSeconds" => {
+ "type" => INT,
+ "description" => "Max age in seconds",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 7200
+ },
+ "maxStaleness" => {
+ "type" => INT,
+ "description" => "Max staleness in seconds. Modifications are based upon data updates -1 indicates no max. (default 60 - 1 minute)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 60
+ },
+ "type" => {
+ "type" => STRING,
+ "description" => "Allowed values are LRU, EXPIRATION. ",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "EXPIRATION"
+ },
+ "location" => {
+ "type" => STRING,
+ "description" => "location",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "resultset"
+ },
+ "cache-service-jndi-name" => {
+ "type" => STRING,
+ "description" => "cache service for the distributed cache",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "java:TeiidCacheManager"
+ },
+ "resultsetCacheName" => {
+ "type" => STRING,
+ "description" => "resultset cache node name",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "teiid-resultset-cache"
+ }
+ }
+ },
+ "distributed-cache-factory" => {
+ "type" => OBJECT,
+ "description" => "Distributed Cache Configuration",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 1
+ },
+ "jdbc" => {
+ "type" => OBJECT,
+ "description" => "Remote JDBC Access Configuration ",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 1,
+ "attributes" => {
+ "enabled" => {
+ "type" => BOOLEAN,
+ "description" => "enabled",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "maxSocketThreads" => {
+ "type" => INT,
+ "description" => "Max number of threads dedicated to initial request processing. Zero indicates the system default of max available processors. (default 0) Setting this value above the max available processors is not recommended.",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "inputBufferSize" => {
+ "type" => INT,
+ "description" => "SO_RCVBUF size, 0 indicates that system default should be used (default 0)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "outputBufferSize" => {
+ "type" => INT,
+ "description" => "SO_SNDBUF size, 0 indicates that system default should be used (default 0)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "socket-binding" => {
+ "type" => INT,
+ "description" => "Socket binding for the profile",
+ "required" => true,
+ "max-occurs" => 1
+ },
+ "mode" => {
+ "type" => STRING,
+ "description" => "can be one of disabled, login, or enabled disabled = no transport or message level security will be used; login = only the login traffic will be encrypted at a message level using 128 bit AES with an ephemerial DH key exchange. No other config values are needed in this mode; enabled = traffic will be secured using this configuration.",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "login"
+ },
+ "keystoreFilename" => {
+ "type" => STRING,
+ "description" => "Keystore File Name",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "keystorePassword" => {
+ "type" => STRING,
+ "description" => "Keystore password",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "keystoreType" => {
+ "type" => STRING,
+ "description" => "Keystore type",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "JKS"
+ },
+ "sslProtocol" => {
+ "type" => BOOLEAN,
+ "description" => "SSL protocol used",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => false
+ },
+ "keymanagementAlgorithm" => {
+ "type" => STRING,
+ "description" => "Use key management algorithm",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "false"
+ },
+ "truststoreFilename" => {
+ "type" => STRING,
+ "description" => "Truststore Name",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "truststorePassword" => {
+ "type" => STRING,
+ "description" => "Truststore Password",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "authenticationMode" => {
+ "type" => STRING,
+ "description" => "Authentication Mode (1-way, 2-way, anonymous)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "anonymous"
+ }
+ },
+ "children" => {"ssl" => {
+ "type" => OBJECT,
+ "description" => "SSL",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 0
+ }}
+ },
+ "admin" => {
+ "type" => OBJECT,
+ "description" => "Remote Admin Access Configuration",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 1,
+ "attributes" => {
+ "enabled" => {
+ "type" => BOOLEAN,
+ "description" => "enabled",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "maxSocketThreads" => {
+ "type" => INT,
+ "description" => "Max number of threads dedicated to initial request processing. Zero indicates the system default of max available processors. (default 0) Setting this value above the max available processors is not recommended.",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "inputBufferSize" => {
+ "type" => INT,
+ "description" => "SO_RCVBUF size, 0 indicates that system default should be used (default 0)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "outputBufferSize" => {
+ "type" => INT,
+ "description" => "SO_SNDBUF size, 0 indicates that system default should be used (default 0)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "socket-binding" => {
+ "type" => INT,
+ "description" => "Socket binding for the profile",
+ "required" => true,
+ "max-occurs" => 1
+ },
+ "mode" => {
+ "type" => STRING,
+ "description" => "can be one of disabled, login, or enabled disabled = no transport or message level security will be used; login = only the login traffic will be encrypted at a message level using 128 bit AES with an ephemerial DH key exchange. No other config values are needed in this mode; enabled = traffic will be secured using this configuration.",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "login"
+ },
+ "keystoreFilename" => {
+ "type" => STRING,
+ "description" => "Keystore File Name",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "keystorePassword" => {
+ "type" => STRING,
+ "description" => "Keystore password",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "keystoreType" => {
+ "type" => STRING,
+ "description" => "Keystore type",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "JKS"
+ },
+ "sslProtocol" => {
+ "type" => BOOLEAN,
+ "description" => "SSL protocol used",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => false
+ },
+ "keymanagementAlgorithm" => {
+ "type" => STRING,
+ "description" => "Use key management algorithm",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "false"
+ },
+ "truststoreFilename" => {
+ "type" => STRING,
+ "description" => "Truststore Name",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "truststorePassword" => {
+ "type" => STRING,
+ "description" => "Truststore Password",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "authenticationMode" => {
+ "type" => STRING,
+ "description" => "Authentication Mode (1-way, 2-way, anonymous)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "anonymous"
+ }
+ },
+ "children" => {"ssl" => {
+ "type" => OBJECT,
+ "description" => "SSL",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 0
+ }}
+ },
+ "odbc" => {
+ "type" => OBJECT,
+ "description" => "ODBC Access Configuration",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 1,
+ "attributes" => {
+ "enabled" => {
+ "type" => BOOLEAN,
+ "description" => "enabled",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => true
+ },
+ "maxSocketThreads" => {
+ "type" => INT,
+ "description" => "Max number of threads dedicated to initial request processing. Zero indicates the system default of max available processors. (default 0) Setting this value above the max available processors is not recommended.",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "inputBufferSize" => {
+ "type" => INT,
+ "description" => "SO_RCVBUF size, 0 indicates that system default should be used (default 0)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "outputBufferSize" => {
+ "type" => INT,
+ "description" => "SO_SNDBUF size, 0 indicates that system default should be used (default 0)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => 0
+ },
+ "socket-binding" => {
+ "type" => INT,
+ "description" => "Socket binding for the profile",
+ "required" => true,
+ "max-occurs" => 1
+ },
+ "mode" => {
+ "type" => STRING,
+ "description" => "can be one of disabled, login, or enabled disabled = no transport or message level security will be used; login = only the login traffic will be encrypted at a message level using 128 bit AES with an ephemerial DH key exchange. No other config values are needed in this mode; enabled = traffic will be secured using this configuration.",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "login"
+ },
+ "keystoreFilename" => {
+ "type" => STRING,
+ "description" => "Keystore File Name",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "keystorePassword" => {
+ "type" => STRING,
+ "description" => "Keystore password",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "keystoreType" => {
+ "type" => STRING,
+ "description" => "Keystore type",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "JKS"
+ },
+ "sslProtocol" => {
+ "type" => BOOLEAN,
+ "description" => "SSL protocol used",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => false
+ },
+ "keymanagementAlgorithm" => {
+ "type" => STRING,
+ "description" => "Use key management algorithm",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "false"
+ },
+ "truststoreFilename" => {
+ "type" => STRING,
+ "description" => "Truststore Name",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "truststorePassword" => {
+ "type" => STRING,
+ "description" => "Truststore Password",
+ "required" => false,
+ "max-occurs" => 1
+ },
+ "authenticationMode" => {
+ "type" => STRING,
+ "description" => "Authentication Mode (1-way, 2-way, anonymous)",
+ "required" => false,
+ "max-occurs" => 1,
+ "default" => "anonymous"
+ }
+ },
+ "children" => {"ssl" => {
+ "type" => OBJECT,
+ "description" => "SSL",
+ "required" => false,
+ "max-occurs" => 1,
+ "min-occurs" => 0
+ }}
+ }
+ }
+ }}
+}
\ No newline at end of file
Property changes on: branches/as7/jboss-integration/src/test/resources/teiid-model-config.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/as7/jboss-integration/src/test/resources/teiid-sample-config.xml
===================================================================
--- branches/as7/jboss-integration/src/test/resources/teiid-sample-config.xml (rev 0)
+++ branches/as7/jboss-integration/src/test/resources/teiid-sample-config.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -0,0 +1,82 @@
+<subsystem xmlns="urn:jboss:domain:teiid:1.0">
+ <query-engine jndi-name="teiid/engine-deployer">
+ <maxThreads>64</maxThreads>
+ <maxActivePlans>20</maxActivePlans>
+ <userRequestSourceConcurrency>0</userRequestSourceConcurrency>
+ <timeSliceInMilli>2000</timeSliceInMilli>
+ <maxRowsFetchSize>20480</maxRowsFetchSize>
+ <lobChunkSizeInKB>100</lobChunkSizeInKB>
+ <useDataRoles>true</useDataRoles>
+ <allowCreateTemporaryTablesByDefault>true</allowCreateTemporaryTablesByDefault>
+ <allowFunctionCallsByDefault>true</allowFunctionCallsByDefault>
+ <queryThresholdInSecs>600</queryThresholdInSecs>
+ <maxSourceRows>-1</maxSourceRows>
+ <exceptionOnMaxSourceRows>true</exceptionOnMaxSourceRows>
+ <maxODBCLobSizeAllowed>5242880</maxODBCLobSizeAllowed>
+ <eventDistributorName>teiid/event-distributor</eventDistributorName>
+ <detectingChangeEvents>true</detectingChangeEvents>
+
+ <jdbc-security-domain>teiid-security</jdbc-security-domain>
+ <admin-security-domain>jmx-console</admin-security-domain>
+ <max-sessions-allowed>5000</max-sessions-allowed>
+ <sessions-expiration-timelimit>0</sessions-expiration-timelimit>
+ <allow-env-function>false</allow-env-function>
+
+ <buffer-service>
+ <useDisk>true</useDisk>
+ <diskDirectory>${jboss.server.temp.dir}/teiid</diskDirectory>
+ <processorBatchSize>512</processorBatchSize>
+ <connectorBatchSize>1024</connectorBatchSize>
+ <maxReserveBatchColumns>-1</maxReserveBatchColumns>
+ <maxProcessingBatchesColumns>-1</maxProcessingBatchesColumns>
+ <maxFileSize>2048</maxFileSize>
+ <maxBufferSpace>51200</maxBufferSpace>
+ <maxOpenFiles>64</maxOpenFiles>
+ </buffer-service>
+
+ <distributed-cache-factory enabled="true">
+ <cache-service-jndi-name>java:TeiidCacheManager</cache-service-jndi-name>
+ <resultsetCacheName>teiid-resultset-cache</resultsetCacheName>
+ </distributed-cache-factory>
+
+ <resultset-cache enabled="true">
+ <maxEntries>1024</maxEntries>
+ <maxAgeInSeconds>7200</maxAgeInSeconds>
+ <maxStaleness>60</maxStaleness>
+ <type>EXPIRATION</type>
+ <location>resultset</location>
+ </resultset-cache>
+
+ <preparedplan-cache>
+ <maxEntries>512</maxEntries>
+ <maxAgeInSeconds>28800</maxAgeInSeconds>
+ <maxStaleness>0</maxStaleness>
+ </preparedplan-cache>
+
+ <jdbc enabled="true">
+ <maxSocketThreads>0</maxSocketThreads>
+ <inputBufferSize>0</inputBufferSize>
+ <outputBufferSize>0</outputBufferSize>
+ <socket-binding>teiid-jdbc</socket-binding>
+ </jdbc>
+
+ <admin enabled="true">
+ <maxSocketThreads>4</maxSocketThreads>
+ <inputBufferSize>0</inputBufferSize>
+ <outputBufferSize>0</outputBufferSize>
+ <socket-binding>teiid-admin</socket-binding>
+ <ssl>
+ <mode>login</mode>
+ <authenticationMode>anonymous</authenticationMode>
+ </ssl>
+ </admin>
+
+ <odbc enabled="true">
+ <maxSocketThreads>0</maxSocketThreads>
+ <inputBufferSize>0</inputBufferSize>
+ <outputBufferSize>0</outputBufferSize>
+ <socket-binding>teiid-odbc</socket-binding>
+ </odbc>
+ </query-engine>
+
+</subsystem>
\ No newline at end of file
Property changes on: branches/as7/jboss-integration/src/test/resources/teiid-sample-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/as7/metadata/pom.xml
===================================================================
--- branches/as7/metadata/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/metadata/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -52,17 +52,23 @@
<artifactId>connector-api</artifactId>
<scope>provided</scope>
</dependency>
-
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-vfs</artifactId>
<scope>provided</scope>
+ </dependency>
+ <!--
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.man</groupId>
<artifactId>jboss-managed</artifactId>
</dependency>
+ -->
</dependencies>
Modified: branches/as7/metadata/src/main/java/org/teiid/core/index/IIndex.java
===================================================================
--- branches/as7/metadata/src/main/java/org/teiid/core/index/IIndex.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/metadata/src/main/java/org/teiid/core/index/IIndex.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -13,7 +13,7 @@
import java.io.IOException;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.vfs.VirtualFile;
/**
* An IIndex is the interface used to generate an index file, and to make queries on
Modified: branches/as7/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexInput.java
===================================================================
--- branches/as7/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexInput.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexInput.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -16,7 +16,7 @@
import java.util.ArrayList;
import java.util.HashMap;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.vfs.VirtualFile;
import org.teiid.core.index.IDocument;
import org.teiid.core.index.IEntryResult;
import org.teiid.core.index.IQueryResult;
Modified: branches/as7/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexOutput.java
===================================================================
--- branches/as7/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexOutput.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/metadata/src/main/java/org/teiid/internal/core/index/BlocksIndexOutput.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -14,7 +14,7 @@
import java.io.IOException;
import java.io.RandomAccessFile;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.vfs.VirtualFile;
/**
* A blocksIndexOutput is used to save an index in a file with the given structure:<br>
Modified: branches/as7/metadata/src/main/java/org/teiid/internal/core/index/InMemoryIndex.java
===================================================================
--- branches/as7/metadata/src/main/java/org/teiid/internal/core/index/InMemoryIndex.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/metadata/src/main/java/org/teiid/internal/core/index/InMemoryIndex.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -16,7 +16,7 @@
import java.util.Arrays;
import java.util.List;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.vfs.VirtualFile;
import org.teiid.core.index.IDocument;
import org.teiid.core.index.IIndex;
Modified: branches/as7/metadata/src/main/java/org/teiid/internal/core/index/Index.java
===================================================================
--- branches/as7/metadata/src/main/java/org/teiid/internal/core/index/Index.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/metadata/src/main/java/org/teiid/internal/core/index/Index.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -15,12 +15,8 @@
import java.util.HashMap;
import java.util.Map;
-import org.jboss.virtual.VirtualFile;
-import org.teiid.core.index.IDocument;
-import org.teiid.core.index.IEntryResult;
-import org.teiid.core.index.IIndex;
-import org.teiid.core.index.IIndexer;
-import org.teiid.core.index.IQueryResult;
+import org.jboss.vfs.VirtualFile;
+import org.teiid.core.index.*;
/**
@@ -460,12 +456,7 @@
public void dispose() {
close();
- try {
- if( !indexFile.delete() ) {
- indexFile.delete(1000);
- }
- } catch (IOException e) {
- }
+ indexFile.delete();
}
/**
@@ -479,10 +470,7 @@
public String toString() {
String str = this.toString;
if (str == null) str = super.toString();
- try {
- str += "(length: "+ getIndexFile().getSize() +")"; //$NON-NLS-1$ //$NON-NLS-2$
- } catch (IOException e) {
- }
+ str += "(length: "+ getIndexFile().getSize() +")"; //$NON-NLS-1$ //$NON-NLS-2$
return str;
}
Modified: branches/as7/metadata/src/main/java/org/teiid/internal/core/index/VirtualRandomAccessFile.java
===================================================================
--- branches/as7/metadata/src/main/java/org/teiid/internal/core/index/VirtualRandomAccessFile.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/metadata/src/main/java/org/teiid/internal/core/index/VirtualRandomAccessFile.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -24,7 +24,7 @@
import java.io.File;
import java.io.IOException;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.vfs.VirtualFile;
import org.teiid.core.util.ObjectConverterUtil;
Modified: branches/as7/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
===================================================================
--- branches/as7/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -25,21 +25,11 @@
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.plugins.context.zip.ZipEntryContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VirtualFileFilter;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.api.exception.query.QueryMetadataException;
@@ -50,18 +40,7 @@
import org.teiid.core.util.ArgCheck;
import org.teiid.core.util.StringUtil;
import org.teiid.internal.core.index.Index;
-import org.teiid.metadata.AbstractMetadataRecord;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.ColumnSet;
-import org.teiid.metadata.Datatype;
-import org.teiid.metadata.ForeignKey;
-import org.teiid.metadata.KeyRecord;
-import org.teiid.metadata.MetadataStore;
-import org.teiid.metadata.Procedure;
-import org.teiid.metadata.ProcedureParameter;
-import org.teiid.metadata.Schema;
-import org.teiid.metadata.Table;
-import org.teiid.metadata.VdbConstants;
+import org.teiid.metadata.*;
import org.teiid.query.metadata.TransformationMetadata;
import org.teiid.query.metadata.TransformationMetadata.Resource;
@@ -93,10 +72,7 @@
* @throws URISyntaxException
*/
public IndexMetadataFactory(URL url) throws IOException, URISyntaxException {
- VFS.init();
- ZipEntryContext context = new ZipEntryContext(url);
- VirtualFileHandler vfh = context.getRoot();
- VirtualFile vdb = new VirtualFile(vfh);
+ VirtualFile vdb = VFS.getChild(url.toURI());
List<VirtualFile> children = vdb.getChildrenRecursively(new VirtualFileFilter() {
@Override
public boolean accepts(VirtualFile file) {
Modified: branches/as7/pom.xml
===================================================================
--- branches/as7/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -10,6 +10,7 @@
<properties>
<ant.version>1.7.0</ant.version>
<site.url>http://www.jboss.org/teiid</site.url>
+ <jbossas-version>7.0.0.Beta4-SNAPSHOT</jbossas-version>
</properties>
<scm>
<connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/trunk</connection>
@@ -357,6 +358,60 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.17.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-controller</artifactId>
+ <version>${jbossas-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>staxmapper</artifactId>
+ <version>1.0.0.Beta4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-dmr</artifactId>
+ <version>1.0.0.Beta5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.msc</groupId>
+ <artifactId>jboss-msc</artifactId>
+ <version>1.0.0.Beta8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <version>3.0.0.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.picketbox</groupId>
+ <artifactId>picketbox</artifactId>
+ <version>4.0.0.Beta3</version>
+ </dependency>
+ <!--
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
@@ -388,55 +443,8 @@
<artifactId>jboss-managed</artifactId>
<version>2.1.0.SP1</version>
<scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-metatype</artifactId>
- <version>2.1.0.SP1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.integration</groupId>
- <artifactId>jboss-profileservice-spi</artifactId>
- <version>5.1.0.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>2.1.2.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-connector</artifactId>
- <version>5.1.0.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</artifactId>
- <version>2.0.2.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.remoting</groupId>
- <artifactId>jboss-remoting</artifactId>
- <version>2.5.1</version>
- <scope>provided</scope>
- </dependency>
+ </dependency>
+ -->
<dependency>
<groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
@@ -463,6 +471,17 @@
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <version>2.2</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
</dependencyManagement>
<modules>
Modified: branches/as7/runtime/pom.xml
===================================================================
--- branches/as7/runtime/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/runtime/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -60,18 +60,24 @@
</dependency>
<dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>javax.resource</groupId>
<artifactId>connector-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
<artifactId>jboss-vfs</artifactId>
<scope>provided</scope>
</dependency>
@@ -89,6 +95,7 @@
<groupId>org.jboss.integration</groupId>
<artifactId>jboss-profileservice-spi</artifactId>
<scope>provided</scope>
- </dependency>
+ </dependency>
+ -->
</dependencies>
</project>
\ No newline at end of file
Modified: branches/as7/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -40,6 +40,10 @@
private VDBRepository vdbRepository;
private ThreadPool threadPool;
+ public VDBStatusChecker(VDBRepository vdbRepository, ThreadPool threadPool) {
+ this.vdbRepository = vdbRepository;
+ this.threadPool = threadPool;
+ }
public void translatorAdded(String translatorName) {
resourceAdded(translatorName, true);
}
@@ -62,10 +66,6 @@
resourceremoved(dataSourceName, false);
}
- public void setVDBRepository(VDBRepository repo) {
- this.vdbRepository = repo;
- }
-
public void resourceAdded(String resourceName, boolean translator) {
for (VDBMetaData vdb:this.vdbRepository.getVDBs()) {
if (vdb.getStatus() == VDB.Status.ACTIVE || vdb.isPreview()) {
@@ -169,8 +169,4 @@
}
return null;
}
-
- public void setThreadPool(ThreadPool threadPool) {
- this.threadPool = threadPool;
- }
}
Modified: branches/as7/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -84,7 +84,6 @@
private Map<String, SessionMetadata> sessionCache = new ConcurrentHashMap<String, SessionMetadata>();
private Timer sessionMonitor = new Timer("SessionMonitor", true); //$NON-NLS-1$
private LinkedList<String> securityDomains = new LinkedList<String>();
- private LinkedList<String> adminSecurityDomains = new LinkedList<String>();
// -----------------------------------------------------------------------------------
@@ -345,11 +344,6 @@
}
}
- public void setAdminSecurityDomain(String domain) {
- this.adminSecurityDomains.add(domain);
- LogManager.logInfo(LogConstants.CTX_SECURITY, "Admin Security Enabled: true"); //$NON-NLS-1$
- }
-
public void start() {
this.sessionMonitor.schedule(new TimerTask() {
@Override
Modified: branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java 2011-06-08 12:39:43 UTC (rev 3232)
@@ -29,7 +29,7 @@
public interface ClientServiceRegistry {
public enum Type {
- ODBC, JDBC, Admin
+ ODBC, JDBC
}
<T> T getClientService(Class<T> iface) throws ComponentNotFoundException;
Modified: branches/as7/test-integration/pom.xml
===================================================================
--- branches/as7/test-integration/pom.xml 2011-06-07 21:36:58 UTC (rev 3231)
+++ branches/as7/test-integration/pom.xml 2011-06-08 12:39:43 UTC (rev 3232)
@@ -85,7 +85,7 @@
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</dependency>
-
+ <!--
<dependency>
<groupId>org.jboss.deployers</groupId>
<artifactId>jboss-deployers-vfs-spi</artifactId>
@@ -97,7 +97,7 @@
<artifactId>jboss-deployers-vfs</artifactId>
<scope>provided</scope>
</dependency>
-
+ -->
</dependencies>
<modules>
[View Less]
13 years, 7 months
teiid SVN: r3231 - in branches/7.4.x: build/kits/jboss-container/deploy/teiid and 12 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-06-07 17:36:58 -0400 (Tue, 07 Jun 2011)
New Revision: 3231
Added:
branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl/SizeUtility.java
branches/7.4.x/engine/src/test/java/org/teiid/common/buffer/impl/TestSizeUtility.java
Removed:
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/NodeTestUtil.java
Modified:
branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
branches/7.4.x/build/kits/jboss-…
[View More]container/teiid-releasenotes.html
branches/7.4.x/console/src/main/resources/META-INF/rhq-plugin.xml
branches/7.4.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml
branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java
branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
branches/7.4.x/engine/src/test/java/org/teiid/common/buffer/BufferManagerFactory.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestSortNode.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestUnionAllNode.java
branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
branches/7.4.x/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java
branches/7.4.x/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java
Log:
TEIID-1624 exposed the reserved/processing memory settings as kb. updated the admin guide. also fixed a type issue with aggregate order by processing
Modified: branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-06-07 21:36:58 UTC (rev 3231)
@@ -25,15 +25,15 @@
<!-- The max row count of a batch from a connector. Should be even multiple of processorBatchSize. (default 1024) -->
<property name="connectorBatchSize">1024</property>
<!--
- The number of batch columns to allow in buffer memory. -1 means to automatically calculate a value (default -1).
+ The approximate amount of buffer memory in kilobytes allowable for a single processing operation (sort, grouping, etc.) regardless of existing memory commitments. -1 means to automatically calculate a value (default -1).
See the admin guide for more.
-->
- <property name="maxReserveBatchColumns">-1</property>
+ <property name="maxReserveKb">-1</property>
<!--
- The number of batch columns guaranteed to a processing operation. -1 means to automatically calculate a value (default -1).
+ The approximate amount of memory in kilobytes allowed to be held by the buffer manager. -1 means to automatically calculate a value (default -1).
See the admin guide for more.
-->
- <property name="maxProcessingBatchesColumns">-1</property>
+ <property name="maxProcessingKb">-1</property>
<!-- Max File size in MB (default 2GB)-->
<property name="maxFileSize">2048</property>
<!-- Max storage space, in MB, to be used for buffer files (default 50G) -->
Modified: branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-06-07 21:36:58 UTC (rev 3231)
@@ -130,6 +130,12 @@
See the <a href="teiid-docs/teiid_admin_guide.pdf">Admin Guide</a> for more on configuration and installation.
+<h4>from 7.4</h4>
+<ul>
+ <LI>The configuration for authorization has been moved off of the RuntimeEngineDeployer bean and onto separate AuthorizationValidator and PolicyDecider beans.
+ <LI>The configuration for the buffer manager has been simplified to refer to memory sizes in KB, rather than batch columns.
+</ul>
+
<h4>from 7.3</h4>
<ul>
<LI>The default value for the JDBC dynamic vdb importer setting importer.useFullSchemaName is now true, which matches the expected behavior from the documentation.
Modified: branches/7.4.x/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- branches/7.4.x/console/src/main/resources/META-INF/rhq-plugin.xml 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/console/src/main/resources/META-INF/rhq-plugin.xml 2011-06-07 21:36:58 UTC (rev 3231)
@@ -387,16 +387,16 @@
displayName="Connector Batch Size"
description="The max row count of a batch from a connector. Should be even multiple of processorBatchSize. (default 1024)"
required="false" readOnly="false" />
- <c:simple-property name="BufferService.maxProcessingBatchesColumns"
- displayName="Max Processing Batches Columns"
- description="The number of batch columns guarenteed to a processing operation. Set this value lower if the workload typically processes larger numbers of concurrent queries with large intermediate results from operations such as sorting, grouping, etc. (default 128)"
+ <c:simple-property name="BufferService.maxProcessingKb"
+ displayName="Max Processing Memory"
+ description="The approximate amount of buffer memory in kilobytes allowable for a single processing operation (sort, grouping, etc.) regardless of existing memory commitments. -1 means to automatically calculate a value (default -1)."
required="false" readOnly="false" />
<c:simple-property name="BufferService.maxFileSize" displayName="Max File Size"
description="Max file size for buffer files (default 2GB)"
required="false" readOnly="false" />
- <c:simple-property name="BufferService.maxReserveBatchColumns"
- displayName="Max Reserve Batch Columns"
- description="The number of batch columns to allow in memory (default 16384). This value should be set lower or higher depending on the available memory to Teiid in the VM. 16384 is considered a good default for a dedicated 32-bit VM running Teiid with a 1 gig heap."
+ <c:simple-property name="BufferService.maxReserveKb"
+ displayName="Max Reserve Memory"
+ description="The approximate amount of memory in kilobytes allowed to be held by the buffer manager. -1 means to automatically calculate a value (default -1)."
required="false" readOnly="false" />
</c:group>
<c:group name="JdbcSocketConfiguration" displayName="Jdbc Socket Configuration Properties" hiddenByDefault="false">
Modified: branches/7.4.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml
===================================================================
--- branches/7.4.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml 2011-06-07 21:36:58 UTC (rev 3231)
@@ -18,12 +18,10 @@
accessing the Teiid server simultaneously.
</para>
<para>
- The <code>maxReserveBatchColumns</code>
- setting determines the total size of batches that can be held by the BufferManager in memory.
- This number does not include persistent batches held by soft (such as
+ The <code>maxReserveKb</code>
+ setting determines the total size in kilobytes of batches that can be held by the BufferManager in memory.
+ This number does not account for persistent batches held by soft (such as
index pages) or weak references.
- The value is treated internally as an approximation of bytes using the conversion
- <code>maxReserveBatchColumns</code> * <code>processorBatchSize</code> * (64bytes per column value).
The default value of -1 will auto-calculate a typical max based upon the max heap available to the VM.
The auto-calculated value assumes a 64bit architecture and will limit buffer usage to 50% of the first
gigabyte of memory beyond the first 300 megabytes (which are assumed for use by the AS and other Teiid purposes)
@@ -39,22 +37,21 @@
</para>
<note>
<para>Memory consumption can be significantly more or less than the nominal target
- depending upon actual column values and whether value caching is enabled. Large strings, bigintegers, bigdecimals, or values typed as object can exceed their default size estimate.
- If an out of memory errors occur, then set a lower the maxReserveBatchColumns value.
+ depending upon actual column values and whether value caching is enabled. Large non built-in type objects can exceed their default size estimate.
+ If an out of memory errors occur, then set a lower the maxReserveKb value. Also note that source lob values are held by memory references that are not cleared when a batch is persisted.
+ With heavy lob usage you should ensure that buffers of other memory associated with lob references are appropiately sized.
</para>
</note>
<para>
- The <code>maxProcessingBatchesColumns</code>
- setting determines the total size of batches that can be used by active plans regardless of the memory held based on <code>maxReserveBatchColumns</code>.
- The value is treated internally as an approximation of bytes using the conversion
- <code>maxProcessingBatchesColumns</code> * <code>processorBatchSize</code> * (64bytes per column value).
+ The <code>maxProcessingKb</code>
+ setting determines the total size in kilobytes of batches that can be used by active plans regardless of the memory held based on <code>maxReserveKb</code>.
The default value of -1 will auto-calculate a typical max based upon the max heap available to the VM and max active plans.
The auto-calculated value assumes a 64bit architecture and will limit processing batch usage to 10% of memory
beyond the first 300 megabytes (which are assumed for use by the AS and other Teiid purposes).
</para>
<para>
- In systems where large intermediate results are normal (scrolling cursors or sorting over millions of rows) you can consider increasing the <code>maxProcessingBatchColumns</code> and decreasing
- the <code>maxReserveBatchColumns</code> so that each request has access to an effectively smaller buffer space.
+ In systems where large intermediate results are normal (scrolling cursors or sorting over millions of rows) you can consider increasing the <code>maxProcessingKb</code> and decreasing
+ the <code>maxReserveKb</code> so that each request has access to an effectively smaller buffer space.
</para>
<para>
Each intermediate result buffer, temporary LOB, and temporary table
Modified: branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BufferManager.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BufferManager.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -67,8 +67,8 @@
public static int DEFAULT_CONNECTOR_BATCH_SIZE = 1024;
public static int DEFAULT_PROCESSOR_BATCH_SIZE = 512;
- public static int DEFAULT_MAX_PROCESSING_BATCHES = -1;
- public static int DEFAULT_RESERVE_BUFFERS = -1;
+ public static int DEFAULT_MAX_PROCESSING_KB = -1;
+ public static int DEFAULT_RESERVE_BUFFER_KB = -1;
/**
* Get the batch size to use during query processing.
Modified: branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -156,6 +156,10 @@
this.types = types;
}
+ public String[] getDataTypes() {
+ return types;
+ }
+
public boolean containsRow(int row) {
return rowOffset <= row && getEndRow() >= row;
}
Modified: branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -365,4 +365,8 @@
return prefersMemory;
}
+ public String[] getTypes() {
+ return types;
+ }
+
}
Modified: branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -33,6 +33,7 @@
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
@@ -64,6 +65,7 @@
import org.teiid.dqp.internal.process.DQPConfiguration;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
import org.teiid.query.QueryPlugin;
import org.teiid.query.processor.relational.ListNestedSortComparator;
import org.teiid.query.sql.symbol.Expression;
@@ -87,25 +89,24 @@
*/
public class BufferManagerImpl implements BufferManager, StorageManager {
- public static final double KB_PER_VALUE = 64d/1024;
private static final int IO_BUFFER_SIZE = 1 << 14;
private static final int COMPACTION_THRESHOLD = 1 << 25; //start checking at 32 megs
private final class BatchManagerImpl implements BatchManager {
private final String id;
- private final int columnCount;
private volatile FileStore store;
private Map<Long, long[]> physicalMapping = new ConcurrentHashMap<Long, long[]>();
private ReadWriteLock compactionLock = new ReentrantReadWriteLock();
private AtomicLong unusedSpace = new AtomicLong();
private int[] lobIndexes;
+ private SizeUtility sizeUtility;
- private BatchManagerImpl(String newID, int columnCount, int[] lobIndexes) {
+ private BatchManagerImpl(String newID, int[] lobIndexes) {
this.id = newID;
- this.columnCount = columnCount;
this.store = createFileStore(id);
this.store.setCleanupReference(this);
this.lobIndexes = lobIndexes;
+ this.sizeUtility = new SizeUtility();
}
public FileStore createStorage(String prefix) {
@@ -185,7 +186,7 @@
ManagedBatchImpl removeBatch(int row) {
ManagedBatchImpl result = batches.remove(row);
if (result != null) {
- activeBatchColumnCount -= result.batchManager.columnCount;
+ activeBatchKB -= result.sizeEstimate;
}
return result;
}
@@ -200,17 +201,19 @@
private BatchManagerImpl batchManager;
private long id;
private LobManager lobManager;
+ private int sizeEstimate;
public ManagedBatchImpl(TupleBatch batch, BatchManagerImpl manager, boolean softCache) {
this.softCache = softCache;
id = batchAdded.incrementAndGet();
- LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Add batch to BufferManager", id); //$NON-NLS-1$
this.activeBatch = batch;
this.beginRow = batch.getBeginRow();
this.batchManager = manager;
if (this.batchManager.lobIndexes != null) {
this.lobManager = new LobManager();
}
+ sizeEstimate = (int) Math.max(1, manager.sizeUtility.getBatchSize(batch) / 1024);
+ LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Add batch to BufferManager", id, "with size estimate", sizeEstimate); //$NON-NLS-1$ //$NON-NLS-2$
}
@Override
@@ -225,7 +228,7 @@
if (batch == null) {
return; //already removed
}
- activeBatchColumnCount += batchManager.columnCount;
+ activeBatchKB += sizeEstimate;
TupleBufferInfo tbi = null;
if (update) {
tbi = activeBatches.remove(batchManager.id);
@@ -287,6 +290,7 @@
try {
this.batchManager.compactionLock.readLock().lock();
long[] info = batchManager.physicalMapping.get(this.id);
+ Assertion.isNotNull(info, "Invalid batch " + id); //$NON-NLS-1$
ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(batchManager.store.createInputStream(info[0]), IO_BUFFER_SIZE));
batch = new TupleBatch();
batch.setDataTypes(types);
@@ -341,7 +345,7 @@
}
if (softCache) {
this.batchReference = new SoftReference<TupleBatch>(batch);
- } else {
+ } else if (useWeakReferences) {
this.batchReference = new WeakReference<TupleBatch>(batch);
}
}
@@ -385,22 +389,21 @@
private int connectorBatchSize = BufferManager.DEFAULT_CONNECTOR_BATCH_SIZE;
private int processorBatchSize = BufferManager.DEFAULT_PROCESSOR_BATCH_SIZE;
//set to acceptable defaults for testing
- private int maxProcessingBatches = 128;
- private int maxReserveBatchColumns = 16384;
- private int maxProcessingKB;
- private int maxReserveBatchKB;
+ private int maxProcessingKB = 1 << 11;
+ private Integer maxProcessingKBOrig;
+ private int maxReserveKB = 1 << 25;
private volatile int reserveBatchKB;
private int maxActivePlans = DQPConfiguration.DEFAULT_MAX_ACTIVE_PLANS; //used as a hint to set the reserveBatchKB
+ private boolean useWeakReferences = true;
private ReentrantLock lock = new ReentrantLock(true);
private Condition batchesFreed = lock.newCondition();
- private volatile int activeBatchColumnCount = 0;
+ private volatile int activeBatchKB = 0;
private Map<String, TupleBufferInfo> activeBatches = new LinkedHashMap<String, TupleBufferInfo>();
private Map<String, TupleReference> tupleBufferMap = new ConcurrentHashMap<String, TupleReference>();
private ReferenceQueue<TupleBuffer> tupleBufferQueue = new ReferenceQueue<TupleBuffer>();
-
private StorageManager diskMgr;
private AtomicLong tsId = new AtomicLong();
@@ -431,10 +434,6 @@
return maxProcessingKB;
}
- public void setMaxProcessingBatchColumns(int maxProcessingBatches) {
- this.maxProcessingBatches = maxProcessingBatches;
- }
-
/**
* Get processor batch size
* @return Number of rows in a processor batch
@@ -480,17 +479,19 @@
TupleSourceType tupleSourceType) {
final String newID = String.valueOf(this.tsId.getAndIncrement());
int[] lobIndexes = LobManager.getLobIndexes(elements);
- BatchManager batchManager = new BatchManagerImpl(newID, elements.size(), lobIndexes);
+ BatchManager batchManager = new BatchManagerImpl(newID, lobIndexes);
TupleBuffer tupleBuffer = new TupleBuffer(batchManager, newID, elements, lobIndexes, getProcessorBatchSize());
- LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, "Creating TupleBuffer:", newID, "of type ", tupleSourceType); //$NON-NLS-1$ //$NON-NLS-2$
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, "Creating TupleBuffer:", newID, elements, Arrays.toString(tupleBuffer.getTypes()), "of type", tupleSourceType); //$NON-NLS-1$ //$NON-NLS-2$
+ }
return tupleBuffer;
}
public STree createSTree(final List elements, String groupName, int keyLength) {
String newID = String.valueOf(this.tsId.getAndIncrement());
int[] lobIndexes = LobManager.getLobIndexes(elements);
- BatchManager bm = new BatchManagerImpl(newID, elements.size(), lobIndexes);
- BatchManager keyManager = new BatchManagerImpl(String.valueOf(this.tsId.getAndIncrement()), keyLength, null);
+ BatchManager bm = new BatchManagerImpl(newID, lobIndexes);
+ BatchManager keyManager = new BatchManagerImpl(String.valueOf(this.tsId.getAndIncrement()), null);
int[] compareIndexes = new int[keyLength];
for (int i = 1; i < compareIndexes.length; i++) {
compareIndexes[i] = i;
@@ -509,27 +510,35 @@
this.maxActivePlans = maxActivePlans;
}
+ public void setMaxProcessingKB(int maxProcessingKB) {
+ this.maxProcessingKB = maxProcessingKB;
+ }
+
+ public void setMaxReserveKB(int maxReserveBatchKB) {
+ this.maxReserveKB = maxReserveBatchKB;
+ }
+
@Override
public void initialize() throws TeiidComponentException {
int maxMemory = (int)Math.min(Runtime.getRuntime().maxMemory() / 1024, Integer.MAX_VALUE);
maxMemory -= 300 * 1024; //assume 300 megs of overhead for the AS/system stuff
- if (maxReserveBatchColumns < 0) {
- this.maxReserveBatchKB = 0;
+ if (maxReserveKB < 0) {
+ this.maxReserveKB = 0;
int one_gig = 1024 * 1024;
if (maxMemory > one_gig) {
//assume 75% of the memory over the first gig
- this.maxReserveBatchKB += (int)Math.max(0, (maxMemory - one_gig) * .75);
+ this.maxReserveKB += (int)Math.max(0, (maxMemory - one_gig) * .75);
}
- this.maxReserveBatchKB += Math.max(0, Math.min(one_gig, maxMemory) * .5);
- } else {
- this.maxReserveBatchKB = Math.max(0, (int)Math.min(maxReserveBatchColumns * KB_PER_VALUE * processorBatchSize, Integer.MAX_VALUE));
+ this.maxReserveKB += Math.max(0, Math.min(one_gig, maxMemory) * .5);
}
- this.reserveBatchKB = this.maxReserveBatchKB;
- if (this.maxProcessingBatches < 0) {
- this.maxProcessingKB = Math.max((int)Math.min(128 * KB_PER_VALUE * processorBatchSize, Integer.MAX_VALUE), (int)(.1 * maxMemory)/maxActivePlans);
- } else {
- this.maxProcessingKB = Math.max(0, (int)Math.min(Math.ceil(maxProcessingBatches * KB_PER_VALUE * processorBatchSize), Integer.MAX_VALUE));
+ this.reserveBatchKB = this.maxReserveKB;
+ if (this.maxProcessingKBOrig == null) {
+ //store the config value so that we can be reinitialized (this is not a clean approach)
+ this.maxProcessingKBOrig = this.maxProcessingKB;
}
+ if (this.maxProcessingKBOrig < 0) {
+ this.maxProcessingKB = Math.max(Math.min(8 * processorBatchSize, Integer.MAX_VALUE), (int)(.1 * maxMemory)/maxActivePlans);
+ }
}
@Override
@@ -537,6 +546,9 @@
if (count < 1) {
return;
}
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.TRACE)) {
+ LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Releasing buffer space", count); //$NON-NLS-1$
+ }
lock.lock();
try {
this.reserveBatchKB += count;
@@ -548,11 +560,14 @@
@Override
public int reserveBuffers(int count, BufferReserveMode mode) {
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.TRACE)) {
+ LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Reserving buffer space", count, mode); //$NON-NLS-1$
+ }
lock.lock();
try {
if (mode == BufferReserveMode.WAIT) {
//don't wait for more than is available
- int waitCount = Math.min(count, this.maxReserveBatchKB);
+ int waitCount = Math.min(count, this.maxReserveKB);
while (waitCount > 0 && waitCount > this.reserveBatchKB) {
try {
batchesFreed.await(100, TimeUnit.MILLISECONDS);
@@ -576,13 +591,13 @@
}
void persistBatchReferences() {
- if (activeBatchColumnCount == 0 || activeBatchColumnCount <= reserveBatchKB) {
- int memoryCount = activeBatchColumnCount + maxReserveBatchColumns - reserveBatchKB;
+ if (activeBatchKB == 0 || activeBatchKB <= reserveBatchKB) {
+ int memoryCount = activeBatchKB + maxReserveKB - reserveBatchKB;
if (DataTypeManager.isValueCacheEnabled()) {
- if (memoryCount < maxReserveBatchColumns / 8) {
+ if (memoryCount < maxReserveKB / 8) {
DataTypeManager.setValueCacheEnabled(false);
}
- } else if (memoryCount > maxReserveBatchColumns / 4) {
+ } else if (memoryCount > maxReserveKB / 4) {
DataTypeManager.setValueCacheEnabled(true);
}
return;
@@ -590,7 +605,7 @@
while (true) {
ManagedBatchImpl mb = null;
synchronized (activeBatches) {
- if (activeBatchColumnCount == 0 || activeBatchColumnCount * 5 < reserveBatchKB * 4) {
+ if (activeBatchKB == 0 || activeBatchKB < reserveBatchKB * .8) {
break;
}
Iterator<TupleBufferInfo> iter = activeBatches.values().iterator();
@@ -624,43 +639,12 @@
//this includes alignment, row/array, and reference overhead
for (Expression element : elements) {
Class<?> type = element.getType();
- if (type == DataTypeManager.DefaultDataClasses.STRING) {
- total += isValueCacheEnabled?100:256; //assumes an "average" string length of approximately 100 chars
- } else if (type == DataTypeManager.DefaultDataClasses.DATE
- || type == DataTypeManager.DefaultDataClasses.TIME
- || type == DataTypeManager.DefaultDataClasses.TIMESTAMP) {
- total += isValueCacheEnabled?20:28;
- } else if (type == DataTypeManager.DefaultDataClasses.LONG
- || type == DataTypeManager.DefaultDataClasses.DOUBLE) {
- total += isValueCacheEnabled?12:16;
- } else if (type == DataTypeManager.DefaultDataClasses.INTEGER
- || type == DataTypeManager.DefaultDataClasses.FLOAT) {
- total += isValueCacheEnabled?6:12;
- } else if (type == DataTypeManager.DefaultDataClasses.CHAR
- || type == DataTypeManager.DefaultDataClasses.SHORT) {
- total += isValueCacheEnabled?4:10;
- } else if (type == DataTypeManager.DefaultDataClasses.OBJECT) {
- total += 1024;
- } else if (type == DataTypeManager.DefaultDataClasses.NULL) {
- //it's free
- } else if (type == DataTypeManager.DefaultDataClasses.BYTE) {
- total += 2; //always value cached
- } else if (type == DataTypeManager.DefaultDataClasses.BOOLEAN) {
- total += 1; //always value cached
- } else {
- total += 512; //assumes buffer overhead in the case of lobs
- //however the account for lobs is misleading as the lob
- //references are not actually removed from memory
- }
+ total += SizeUtility.getSize(isValueCacheEnabled, type);
}
total += 8*elements.size() + 36; // column list / row overhead
total *= processorBatchSize;
return Math.max(1, total / 1024);
}
-
- public void setMaxReserveBatchColumns(int maxReserve) {
- this.maxReserveBatchColumns = maxReserve;
- }
public void shutdown() {
}
@@ -698,4 +682,9 @@
id = referent.getId();
}
}
+
+ public void setUseWeakReferences(boolean useWeakReferences) {
+ this.useWeakReferences = useWeakReferences;
+ }
+
}
Added: branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl/SizeUtility.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl/SizeUtility.java (rev 0)
+++ branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl/SizeUtility.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -0,0 +1,205 @@
+/*
+ * 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.common.buffer.impl;
+
+import java.lang.reflect.Array;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import org.teiid.common.buffer.TupleBatch;
+import org.teiid.core.types.DataTypeManager;
+
+
+/**
+ * Utility methods to determine the size of Java objects, particularly with
+ * respect to the Teiid runtime types.
+ *
+ * The sizes are loosely based on expected heap size and are generally optimistic.
+ * Actual object allocation efficiency can be quite poor.
+ */
+public final class SizeUtility {
+ public static final int REFERENCE_SIZE = 8;
+
+ private long bigIntegerEstimate;
+ private long bigDecimalEstimate;
+
+ public SizeUtility() {
+ boolean isValueCacheEnabled = DataTypeManager.isValueCacheEnabled();
+ bigIntegerEstimate = getSize(isValueCacheEnabled, DataTypeManager.DefaultDataClasses.BIG_INTEGER);
+ bigDecimalEstimate = getSize(isValueCacheEnabled, DataTypeManager.DefaultDataClasses.BIG_DECIMAL);
+ }
+
+ public long getBatchSize(TupleBatch data) {
+ return getBatchSize(DataTypeManager.isValueCacheEnabled(), data);
+ }
+
+ private long getBatchSize(boolean accountForValueCache, TupleBatch data) {
+ int colLength = data.getDataTypes().length;
+ int rowLength = data.getRowCount();
+
+ // Array overhead for row array
+ long size = 16 + alignMemory(rowLength * REFERENCE_SIZE);
+ // array overhead for all the columns ( 8 object overhead + 4 ref + 4 int)
+ size += (rowLength * (48 + alignMemory(colLength * REFERENCE_SIZE)));
+ for (int col = 0; col < colLength; col++) {
+ Class<?> type = DataTypeManager.getDataTypeClass(data.getDataTypes()[col]);
+
+ if (type == DataTypeManager.DefaultDataClasses.STRING
+ || type == DataTypeManager.DefaultDataClasses.OBJECT
+ || type == DataTypeManager.DefaultDataClasses.BIG_INTEGER
+ || type == DataTypeManager.DefaultDataClasses.BIG_DECIMAL) {
+ int estRow = 0;
+ for (int row = 0; row < rowLength; row++) {
+ boolean updateEst = row == estRow;
+ size += getSize(data.getTuples().get(row).get(col), updateEst, accountForValueCache);
+ if (updateEst) {
+ estRow = estRow * 2 + 1;
+ }
+ }
+ } else {
+ size += getSize(accountForValueCache, type) * rowLength;
+ }
+ }
+ return size;
+ }
+
+ static int getSize(boolean isValueCacheEnabled,
+ Class<?> type) {
+ if (type == DataTypeManager.DefaultDataClasses.STRING) {
+ return isValueCacheEnabled?100:256; //assumes an "average" string length of approximately 100 chars
+ } else if (type == DataTypeManager.DefaultDataClasses.DATE
+ || type == DataTypeManager.DefaultDataClasses.TIME
+ || type == DataTypeManager.DefaultDataClasses.TIMESTAMP) {
+ return isValueCacheEnabled?20:28;
+ } else if (type == DataTypeManager.DefaultDataClasses.LONG
+ || type == DataTypeManager.DefaultDataClasses.DOUBLE) {
+ return isValueCacheEnabled?12:16;
+ } else if (type == DataTypeManager.DefaultDataClasses.INTEGER
+ || type == DataTypeManager.DefaultDataClasses.FLOAT) {
+ return isValueCacheEnabled?6:12;
+ } else if (type == DataTypeManager.DefaultDataClasses.CHAR
+ || type == DataTypeManager.DefaultDataClasses.SHORT) {
+ return isValueCacheEnabled?4:10;
+ } else if (type == DataTypeManager.DefaultDataClasses.OBJECT) {
+ return 1024;
+ } else if (type == DataTypeManager.DefaultDataClasses.NULL) {
+ return 0; //it's free
+ } else if (type == DataTypeManager.DefaultDataClasses.BYTE
+ || type == DataTypeManager.DefaultDataClasses.BOOLEAN) {
+ return 1; //should always be value cached, but there's a small chance it's not
+ } else if (type == DataTypeManager.DefaultDataClasses.BIG_INTEGER){
+ return isValueCacheEnabled?75:100;
+ } else if (type == DataTypeManager.DefaultDataClasses.BIG_DECIMAL) {
+ return isValueCacheEnabled?150:200;
+ }
+ return 512; //assumes buffer overhead in the case of lobs
+ //however the account for lobs is misleading as the lob
+ //references are not actually removed from memory
+ }
+
+ /**
+ * Get size of object
+ * @return Size in bytes
+ */
+ protected long getSize(Object obj, boolean updateEstimate, boolean accountForValueCache) {
+ if(obj == null) {
+ return 0;
+ }
+
+ Class<?> type = DataTypeManager.determineDataTypeClass(obj);
+ if(type == DataTypeManager.DefaultDataClasses.STRING) {
+ int length = ((String)obj).length();
+ if (length > 0) {
+ return alignMemory(40 + (2 * length));
+ }
+ return 40;
+ } else if(obj instanceof Iterable<?>) {
+ Iterable<?> i = (Iterable<?>)obj;
+ long total = 16;
+ for (Object object : i) {
+ total += getSize(object, true, false) + REFERENCE_SIZE;
+ }
+ return total;
+ } else if(type == DataTypeManager.DefaultDataClasses.BIG_DECIMAL) {
+ if (!updateEstimate) {
+ return bigDecimalEstimate;
+ }
+ int bitLength = ((BigDecimal)obj).unscaledValue().bitLength();
+ //TODO: this does not account for the possibility of a cached string
+ long result = 88 + alignMemory(4 + (bitLength >> 3));
+ if (updateEstimate) {
+ bigDecimalEstimate = (bigDecimalEstimate + result)/2;
+ }
+ return result;
+ } else if(type == DataTypeManager.DefaultDataClasses.BIG_INTEGER) {
+ if (!updateEstimate) {
+ return bigIntegerEstimate;
+ }
+ int bitLength = ((BigInteger)obj).bitLength();
+ long result = 40 + alignMemory(4 + (bitLength >> 3));
+ if (updateEstimate) {
+ bigIntegerEstimate = (bigIntegerEstimate + result)/2;
+ }
+ return result;
+ } else if(obj.getClass().isArray()) {
+ Class<?> componentType = obj.getClass().getComponentType();
+ if (!componentType.isPrimitive()) {
+ Object[] rows = (Object[]) obj;
+ long total = 16 + alignMemory(rows.length * REFERENCE_SIZE); // Array overhead
+ for(int i=0; i<rows.length; i++) {
+ total += getSize(rows[i], true, false);
+ }
+ return total;
+ }
+ int length = Array.getLength(obj);
+ int primitiveSize = 8;
+ if (componentType == boolean.class) {
+ primitiveSize = 4;
+ } else if (componentType == byte.class) {
+ primitiveSize = 1;
+ } else if (componentType == short.class) {
+ primitiveSize = 2;
+ } else if (componentType == int.class || componentType == float.class) {
+ primitiveSize = 4;
+ }
+ return alignMemory(length * primitiveSize) + 16;
+ }
+ return getSize(accountForValueCache, type);
+ }
+
+ /**
+ * Most current VMs have memory alignment that places objects into heap space that is a multiple of 8 Bytes.
+ * This utility method helps with calculating the aligned size of an object.
+ * @param numBytes
+ * @return
+ * @since 4.2
+ */
+ private static long alignMemory(long numBytes) {
+ long remainder = numBytes % 8;
+ if (remainder != 0) {
+ numBytes += (8 - remainder);
+ }
+ return numBytes;
+ }
+
+}
\ No newline at end of file
Property changes on: branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl/SizeUtility.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -218,7 +218,7 @@
OrderByItem item = iterator.next();
orderIndecies[iterator.previousIndex()] = collectExpression(item.getSymbol());
element = new ElementSymbol(String.valueOf(iterator.previousIndex()));
- element.setType(inputType);
+ element.setType(item.getSymbol().getType());
schema.add(element);
OrderByItem newItem = item.clone();
newItem.setSymbol(element);
@@ -286,7 +286,7 @@
@Override
protected List updateTuple(List tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
int columns = collectedExpressions.size();
- List exprTuple = new ArrayList(columns);
+ List<Object> exprTuple = new ArrayList<Object>(columns);
for(int col = 0; col<columns; col++) {
// The following call may throw BlockedException, but all state to this point
// is saved in class variables so we can start over on building this tuple
@@ -335,7 +335,7 @@
} else if(! sameGroup(currentGroupTuple, lastRow)) {
// Close old group
- List row = new ArrayList(functions.length);
+ List<Object> row = new ArrayList<Object>(functions.length);
for(int i=0; i<functions.length; i++) {
row.add( functions[i].getResult() );
functions[i].reset();
Modified: branches/7.4.x/engine/src/test/java/org/teiid/common/buffer/BufferManagerFactory.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/common/buffer/BufferManagerFactory.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/test/java/org/teiid/common/buffer/BufferManagerFactory.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -58,16 +58,35 @@
}
public static BufferManagerImpl createBufferManager() {
- BufferManagerImpl bufferMgr = new BufferManagerImpl();
- try {
- bufferMgr.initialize();
+ return initBufferManager(new BufferManagerImpl());
+ }
+
+ public static BufferManagerImpl getTestBufferManager(long bytesAvailable, int procBatchSize, int connectorBatchSize) {
+ BufferManagerImpl bufferManager = new BufferManagerImpl();
+ bufferManager.setProcessorBatchSize(procBatchSize);
+ bufferManager.setConnectorBatchSize(connectorBatchSize);
+ bufferManager.setMaxProcessingKB((int) (bytesAvailable/1024));
+ bufferManager.setMaxReserveKB((int) (bytesAvailable/1024));
+ return initBufferManager(bufferManager);
+ }
+
+ public static BufferManagerImpl getTestBufferManager(long bytesAvailable, int procBatchSize) {
+ BufferManagerImpl bufferManager = new BufferManagerImpl();
+ bufferManager.setProcessorBatchSize(procBatchSize);
+ bufferManager.setMaxProcessingKB((int) (bytesAvailable/1024));
+ bufferManager.setMaxReserveKB((int) (bytesAvailable/1024));
+ return initBufferManager(bufferManager);
+ }
+
+ public static BufferManagerImpl initBufferManager(BufferManagerImpl bufferManager) {
+ try {
+ bufferManager.initialize();
} catch (TeiidComponentException e) {
throw new RuntimeException(e);
}
-
- // Add unmanaged memory storage manager
- bufferMgr.setStorageManager(new MemoryStorageManager());
- return bufferMgr;
+
+ bufferManager.setStorageManager(new MemoryStorageManager());
+ return bufferManager;
}
}
Added: branches/7.4.x/engine/src/test/java/org/teiid/common/buffer/impl/TestSizeUtility.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/common/buffer/impl/TestSizeUtility.java (rev 0)
+++ branches/7.4.x/engine/src/test/java/org/teiid/common/buffer/impl/TestSizeUtility.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -0,0 +1,185 @@
+/*
+ * 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.common.buffer.impl;
+
+import static org.junit.Assert.*;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Test;
+import org.teiid.common.buffer.TupleBatch;
+
+public class TestSizeUtility {
+
+ public void helpTestGetStaticSize(Object obj, long expectedSize) {
+ helpTestGetSize(obj, expectedSize);
+ }
+
+ public void helpTestGetSize(Object obj, long expectedSize) {
+ long actualSize = new SizeUtility().getSize(obj, true, false);
+ assertEquals("Got unexpected size: ", expectedSize, actualSize); //$NON-NLS-1$
+ }
+
+ @Test public void testGetSizeChar() {
+ helpTestGetStaticSize(new Character('a'), 10);
+ }
+
+ @Test public void testGetSizeBoolean() {
+ helpTestGetStaticSize(Boolean.TRUE, 1);
+ }
+
+ @Test public void testGetSizeByte() {
+ helpTestGetStaticSize(new Byte((byte)0), 1);
+ }
+
+ @Test public void testGetSizeShort() {
+ helpTestGetStaticSize(new Short((short)0), 10);
+ }
+
+ @Test public void testGetSizeInteger() {
+ helpTestGetStaticSize(new Integer(0), 12);
+ }
+
+ @Test public void testGetSizeLong() {
+ helpTestGetStaticSize(new Long(0l), 16);
+ }
+
+ @Test public void testGetSizeFloat() {
+ helpTestGetStaticSize(new Float(0), 12);
+ }
+
+ @Test public void testGetSizeDouble() {
+ helpTestGetStaticSize(new Double(0), 16);
+ }
+
+ @Test public void testGetSizeTimestamp() {
+ helpTestGetStaticSize(new Timestamp(12301803), 28);
+ }
+
+ @Test public void testGetSizeDate() {
+ helpTestGetStaticSize(new Date(12301803), 28);
+ }
+
+ @Test public void testGetSizeTime() {
+ helpTestGetStaticSize(new Time(12301803), 28);
+ }
+
+ @Test public void testGetSizeEmptyString() {
+ helpTestGetSize("", 40); //$NON-NLS-1$
+ }
+
+ @Test public void testGetSizeShortString() {
+ helpTestGetSize("abcdefghij", 64); //$NON-NLS-1$
+ }
+
+ public void XtestGetSizeLongString() {
+ // There is no clear way of figuring out the actual size of a string that is created
+ // from a StringBuffer because the buffer can sometimes be twice as big as the actual length of the string
+ // Since the data comin from the connector is not created this way, this test is an inaccurate setup
+ int size = 10000;
+ StringBuffer str = new StringBuffer();
+ for(int i=0; i<size; i++) {
+ str.append("a"); //$NON-NLS-1$
+ }
+ helpTestGetSize(str.toString(), size+3);
+ }
+
+ @Test public void testGetSizeRow1() {
+ List<Object> row = new ArrayList<Object>(1);
+ row.add(new Integer(0));
+ helpTestGetStaticSize(row, 36);
+ }
+
+ @Test public void testGetSizeRow2() {
+ List<Object> row = new ArrayList<Object>(4);
+ row.add(new Integer(0));
+ row.add(new Integer(101));
+ row.add(Boolean.TRUE);
+ row.add(new Double(1091203.00));
+ helpTestGetStaticSize(row, 89);
+ }
+
+ @Test public void testGetSizeRows1() {
+ helpTestGetStaticSize(new List[] { }, 16);
+ }
+
+ @Test public void testGetSizeRows2() {
+ List<Object> row1 = new ArrayList<Object>(2);
+ row1.add(new Integer(0));
+ row1.add(new Integer(100));
+
+ List<Object> row2 = new ArrayList<Object>(2);
+ row2.add(new Integer(0));
+ row2.add(new Integer(100));
+
+ helpTestGetStaticSize(new List[] { row1, row2 }, 144);
+ }
+
+ @Test public void testGetSizeBigInteger() {
+ BigInteger b = BigInteger.ONE;
+
+ helpTestGetStaticSize(b, 48);
+ }
+
+ @Test public void testGetSizeBigDecimal() {
+ BigDecimal bd = new BigDecimal("1.0"); //$NON-NLS-1$
+
+ helpTestGetStaticSize(bd, 96);
+ }
+
+ @Test public void testGetSizeByteArray() {
+ byte[] bytes = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+ helpTestGetSize(bytes, 32);
+ }
+
+ @Test public void testResultSet() {
+ List<?>[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), "a", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), "a", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), "a", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), "a", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), "a", new Integer(3) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), "a", new Integer(3) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), "a", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), "a", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), "a", new Integer(3) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), "b", new Integer(2) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.FALSE, new Double(0.0), "c", new Integer(1) }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ String[] types = {"string", "integer", "boolean", "double", "string", "integer"}; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ //$NON-NLS-5$//$NON-NLS-6$
+
+ TupleBatch tb = new TupleBatch(1, expected);
+ tb.setDataTypes(types);
+ long actualSize = new SizeUtility().getBatchSize(tb);
+ assertEquals("Got unexpected size: ", 2667, actualSize); //$NON-NLS-1$
+ }
+
+}
\ No newline at end of file
Property changes on: branches/7.4.x/engine/src/test/java/org/teiid/common/buffer/impl/TestSizeUtility.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -31,6 +31,8 @@
import java.util.List;
import org.junit.Test;
+import org.teiid.common.buffer.BufferManagerFactory;
+import org.teiid.common.buffer.impl.BufferManagerImpl;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.TestAggregatePushdown;
import org.teiid.query.optimizer.TestOptimizer;
@@ -38,6 +40,7 @@
import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.unittest.RealMetadataFactory;
+import org.teiid.query.util.CommandContext;
import org.teiid.translator.SourceSystemFunctions;
@SuppressWarnings({"nls", "unchecked"})
@@ -372,5 +375,29 @@
// Run query
helpProcess(plan, dataManager, expected);
}
+
+ @Test public void testArrayAggOrderByPersistence() throws Exception {
+ // Create query
+ String sql = "SELECT array_agg(e2 order by e1) from pm1.g1 group by e3"; //$NON-NLS-1$
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList((Object)new Integer[] {1, 0, 0, 2}),
+ Arrays.asList((Object)new Integer[] {3, 1}),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached());
+ CommandContext cc = TestProcessor.createCommandContext();
+ BufferManagerImpl impl = BufferManagerFactory.getTestBufferManager(0, 2);
+ impl.setUseWeakReferences(false);
+ cc.setBufferManager(impl);
+ // Run query
+ helpProcess(plan, cc, dataManager, expected);
+ }
+
}
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -320,7 +320,7 @@
List record = ts.nextTuple();
//handle xml
- if(record.size() == 1){
+ if(record.size() == 1 && expectedResults[i].size() == 1){
Object cellValue = record.get(0);
if(cellValue instanceof XMLType){
XMLType id = (XMLType)cellValue;
@@ -329,6 +329,9 @@
compareDocuments((String)expectedResults[i].get(0), actualDoc);
continue;
}
+ } else if (cellValue instanceof Object[]) {
+ assertArrayEquals((Object[])expectedResults[i].get(0), (Object[])cellValue);
+ continue;
}
}
Deleted: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/NodeTestUtil.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/NodeTestUtil.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/NodeTestUtil.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.query.processor.relational;
-
-import org.teiid.common.buffer.BufferManager;
-import org.teiid.common.buffer.StorageManager;
-import org.teiid.common.buffer.impl.BufferManagerImpl;
-import org.teiid.common.buffer.impl.MemoryStorageManager;
-import org.teiid.core.TeiidComponentException;
-
-/**
- * @since 4.2
- */
-public class NodeTestUtil {
-
- static BufferManager getTestBufferManager(long bytesAvailable, int procBatchSize, int connectorBatchSize) {
- BufferManagerImpl bufferManager = new BufferManagerImpl();
- bufferManager.setProcessorBatchSize(procBatchSize);
- bufferManager.setConnectorBatchSize(connectorBatchSize);
- bufferManager.setMaxProcessingBatchColumns((int)(bytesAvailable/procBatchSize/BufferManagerImpl.KB_PER_VALUE/1024));
- bufferManager.setMaxReserveBatchColumns((int)(bytesAvailable/procBatchSize/BufferManagerImpl.KB_PER_VALUE/1024));
- // Get the properties for BufferManager
- return createBufferManager(bufferManager);
- }
-
- static BufferManager getTestBufferManager(long bytesAvailable, int procBatchSize) {
- BufferManagerImpl bufferManager = new BufferManagerImpl();
- bufferManager.setProcessorBatchSize(procBatchSize);
- bufferManager.setMaxProcessingBatchColumns((int)(bytesAvailable/procBatchSize/BufferManagerImpl.KB_PER_VALUE/1024));
- bufferManager.setMaxReserveBatchColumns((int)(bytesAvailable/procBatchSize/BufferManagerImpl.KB_PER_VALUE/1024));
- // Get the properties for BufferManager
- return createBufferManager(bufferManager);
- }
-
- static BufferManager createBufferManager(BufferManagerImpl bufferManager) {
- try {
- bufferManager.initialize();
- } catch (TeiidComponentException e) {
- throw new RuntimeException(e);
- }
-
- // Add storage managers
-
- bufferManager.setStorageManager(createFakeDatabaseStorageManager());
- return bufferManager;
- }
-
-
- private static StorageManager createFakeDatabaseStorageManager() {
- return new MemoryStorageManager();
- }
-
-}
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -53,7 +53,7 @@
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.query.util.CommandContext;
-
+@SuppressWarnings("unchecked")
public class TestGroupingNode {
public static FakeTupleSource createTupleSource1() {
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -34,6 +34,7 @@
import org.junit.Test;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.common.buffer.TupleBatch;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
@@ -231,7 +232,7 @@
}
public void helpTestJoinDirect(List[] expectedResults, int batchSize, int processingBytes) throws TeiidComponentException, TeiidProcessingException {
- BufferManager mgr = NodeTestUtil.getTestBufferManager(processingBytes, batchSize);
+ BufferManager mgr = BufferManagerFactory.getTestBufferManager(processingBytes, batchSize);
CommandContext context = new CommandContext("pid", "test", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
join.addChild(leftNode);
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -32,6 +32,7 @@
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.common.buffer.TupleBatch;
import org.teiid.common.buffer.TupleSource;
import org.teiid.core.TeiidComponentException;
@@ -80,7 +81,7 @@
CommandContext context = new CommandContext();
context.setProcessorID("processorID"); //$NON-NLS-1$
- BufferManager bm = NodeTestUtil.getTestBufferManager(tupleBatchSize, tupleBatchSize);
+ BufferManager bm = BufferManagerFactory.getTestBufferManager(tupleBatchSize, tupleBatchSize);
ProcessorDataManager dataManager = new FakePDM(tupleBatchSize);
child.initialize(context, bm, dataManager);
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestSortNode.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestSortNode.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestSortNode.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -52,7 +52,7 @@
public static final int BATCH_SIZE = 100;
private void helpTestSort(List elements, List[] data, List sortElements, List sortTypes, List[] expected, Mode mode) throws TeiidComponentException, TeiidProcessingException {
- BufferManager mgr = NodeTestUtil.getTestBufferManager(100, BATCH_SIZE, BATCH_SIZE);
+ BufferManager mgr = BufferManagerFactory.getTestBufferManager(100, BATCH_SIZE, BATCH_SIZE);
CommandContext context = new CommandContext ("pid", "test", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
BlockingFakeRelationalNode dataNode = new BlockingFakeRelationalNode(2, data);
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestUnionAllNode.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestUnionAllNode.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestUnionAllNode.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -31,6 +31,7 @@
import org.junit.Test;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.common.buffer.TupleBatch;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
@@ -45,7 +46,7 @@
public class TestUnionAllNode {
public void helpTestUnion(RelationalNode[] children, RelationalNode union, List[] expected) throws TeiidComponentException, TeiidProcessingException {
- BufferManager mgr = NodeTestUtil.getTestBufferManager(1, 2);
+ BufferManager mgr = BufferManagerFactory.getTestBufferManager(1, 2);
CommandContext context = new CommandContext("pid", "test", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
FakeDataManager fdm = new FakeDataManager();
for(int i=0; i<children.length; i++) {
Modified: branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -312,10 +312,10 @@
String transformation = "SELECT t1.OID as oid, t1.Name as proname, (SELECT (CASE WHEN count(pp.Type)>0 THEN true else false END) as x FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName and pp.Type='ResultSet') as proretset, " + //$NON-NLS-1$
"CASE WHEN (SELECT count(dt.oid) FROM ProcedureParams pp, matpg_datatype dt WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type IN ('ReturnValue', 'ResultSet') AND dt.Name = pp.DataType) IS NULL THEN (select oid from pg_type WHERE typname = 'void') WHEN (SELECT count(dt.oid) FROM ProcedureParams pp, matpg_datatype dt WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type = 'ResultSet' AND dt.Name = pp.DataType) IS NOT NULL THEN (select oid from pg_type WHERE typname = 'record') ELSE (SELECT dt.oid FROM ProcedureParams pp, matpg_datatype dt WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type = 'ReturnValue' AND dt.Name = pp.DataType) END as prorettype, " + //$NON-NLS-1$
"convert((SELECT count(*) FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type IN ('In', 'InOut')), short) as pronargs, " + //$NON-NLS-1$
- "(select "+textAggStmt("y.oid","y.type, y.position" )+" FROM ("+paramTable("'ResultSet','ReturnValue', 'Out'")+") as y) as proargtypes, " +//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "(select "+textAggStmt("y.name", "y.type, y.position")+" FROM (SELECT pp.Name as name, pp.position as position, pp.Type as type FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type NOT IN ('ReturnValue' )) as y) as proargnames, " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "(select case WHEN count(distinct(y.type)) = 1 THEN null ELSE "+textAggStmt("CASE WHEN (y.type ='In') THEN 'i' WHEN (y.type = 'Out') THEN 'o' WHEN (y.type = 'InOut') THEN 'b' WHEN (y.type = 'ResultSet') THEN 't' END", "y.type,y.position")+" END FROM (SELECT pp.Type as type, pp.Position as position FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type NOT IN ('ReturnValue')) as y) as proargmodes, " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "(select case WHEN count(distinct(y.oid)) = 1 THEN null ELSE "+textAggStmt("y.oid", "y.type, y.position")+" END FROM ("+paramTable("'ReturnValue'")+") as y) as proallargtypes, " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "(select "+arrayAgg("y.oid","y.type, y.position" )+" FROM ("+paramTable("'ResultSet','ReturnValue', 'Out'")+") as y) as proargtypes, " +//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ "(select "+arrayAgg("y.name", "y.type, y.position")+" FROM (SELECT pp.Name as name, pp.position as position, pp.Type as type FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type NOT IN ('ReturnValue' )) as y) as proargnames, " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "(select case WHEN count(distinct(y.type)) = 1 THEN null ELSE "+arrayAgg("CASE WHEN (y.type ='In') THEN 'i' WHEN (y.type = 'Out') THEN 'o' WHEN (y.type = 'InOut') THEN 'b' WHEN (y.type = 'ResultSet') THEN 't' END", "y.type,y.position")+" END FROM (SELECT pp.Type as type, pp.Position as position FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type NOT IN ('ReturnValue')) as y) as proargmodes, " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "(select case WHEN count(distinct(y.oid)) = 1 THEN null ELSE "+arrayAgg("y.oid", "y.type, y.position")+" END FROM ("+paramTable("'ReturnValue'")+") as y) as proallargtypes, " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
"(SELECT OID FROM SYS.Schemas WHERE Name = t1.SchemaName) as pronamespace " + //$NON-NLS-1$
"FROM SYS.Procedures as t1";//$NON-NLS-1$
@@ -330,7 +330,7 @@
}
- private String textAggStmt(String select, String orderby) {
+ private String arrayAgg(String select, String orderby) {
return "array_agg("+select+" ORDER BY "+orderby+")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
Modified: branches/7.4.x/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -62,8 +62,8 @@
private int connectorBatchSize = BufferManager.DEFAULT_CONNECTOR_BATCH_SIZE;
private int maxOpenFiles = FileStorageManager.DEFAULT_MAX_OPEN_FILES;
private long maxFileSize = FileStorageManager.DEFAULT_MAX_FILESIZE; // 2GB
- private int maxProcessingBatchesColumns = BufferManager.DEFAULT_MAX_PROCESSING_BATCHES;
- private int maxReserveBatchColumns = BufferManager.DEFAULT_RESERVE_BUFFERS;
+ private int maxProcessingKb = BufferManager.DEFAULT_MAX_PROCESSING_KB;
+ private int maxReserveKb = BufferManager.DEFAULT_RESERVE_BUFFER_KB;
private long maxBufferSpace = FileStorageManager.DEFAULT_MAX_BUFFERSPACE;
private FileStorageManager fsm;
@@ -86,8 +86,8 @@
this.bufferMgr = new BufferManagerImpl();
this.bufferMgr.setConnectorBatchSize(Integer.valueOf(connectorBatchSize));
this.bufferMgr.setProcessorBatchSize(Integer.valueOf(processorBatchSize));
- this.bufferMgr.setMaxReserveBatchColumns(this.maxReserveBatchColumns);
- this.bufferMgr.setMaxProcessingBatchColumns(this.maxProcessingBatchesColumns);
+ this.bufferMgr.setMaxReserveKB(this.maxReserveKb);
+ this.bufferMgr.setMaxProcessingKB(this.maxProcessingKb);
this.bufferMgr.initialize();
@@ -167,14 +167,6 @@
this.maxFileSize = maxFileSize;
}
- public void setMaxReserveBatchColumns(int value) {
- this.maxReserveBatchColumns = value;
- }
-
- public void setMaxProcessingBatchesColumns(int value) {
- this.maxProcessingBatchesColumns = value;
- }
-
@ManagementProperty(description="Max file size, in MB, for buffer files (default 2GB)")
public long getMaxFileSize() {
return maxFileSize;
@@ -185,20 +177,24 @@
this.maxOpenFiles = maxOpenFiles;
}
- @ManagementProperty(description="The number of batch columns guarenteed to a processing operation. Set this value lower if the workload typically" +
- "processes larger numbers of concurrent queries with large intermediate results from operations such as sorting, " +
- "grouping, etc. (default 128)")
- public int getMaxProcessingBatchesColumns() {
- return maxProcessingBatchesColumns;
+ @ManagementProperty(description="The approximate amount of buffer memory in kilobytes allowable for a single processing operation (sort, grouping, etc.) regardless of existing memory commitments. -1 means to automatically calculate a value (default -1).")
+ public int getMaxProcessingKb() {
+ return maxProcessingKb;
}
- @ManagementProperty(description="The number of batch columns to allow in memory (default 16384). " +
- "This value should be set lower or higher depending on the available memory to Teiid in the VM. " +
- "16384 is considered a good default for a dedicated 32-bit VM running Teiid with a 1 gig heap.")
- public int getMaxReserveBatchColumns() {
- return maxReserveBatchColumns;
+ @ManagementProperty(description="The approximate amount of memory in kilobytes allowed to be held by the buffer manager. -1 means to automatically calculate a value (default -1)")
+ public int getMaxReservedKb() {
+ return maxReserveKb;
}
+ public void setMaxProcessingKb(int maxProcessingKb) {
+ this.maxProcessingKb = maxProcessingKb;
+ }
+
+ public void setMaxReserveKb(int maxReserveKb) {
+ this.maxReserveKb = maxReserveKb;
+ }
+
@ManagementProperty(description="Max file storage space, in MB, to be used for buffer files (default 50G)")
public long getMaxBufferSpace() {
return maxBufferSpace;
Modified: branches/7.4.x/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java
===================================================================
--- branches/7.4.x/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java 2011-06-07 21:36:50 UTC (rev 3230)
+++ branches/7.4.x/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java 2011-06-07 21:36:58 UTC (rev 3231)
@@ -91,7 +91,7 @@
svc.start();
BufferManager mgr = svc.getBufferManager();
- assertEquals(16261, mgr.getSchemaSize(schema));
+ assertEquals(13141, mgr.getSchemaSize(schema));
}
}
[View Less]
13 years, 7 months
teiid SVN: r3230 - in branches/7.1.1.CP2/engine/src: test/java/org/teiid/query/optimizer and 1 other directory.
by teiid-commits@lists.jboss.org
Author: mdrillin
Date: 2011-06-07 17:36:50 -0400 (Tue, 07 Jun 2011)
New Revision: 3230
Modified:
branches/7.1.1.CP2/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
branches/7.1.1.CP2/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
Log:
TEIID-1622 - Fixes issue with optimization of optional JOIN when used with UNION ALL
Modified: branches/7.1.1.CP2/engine/src/main/java/org/teiid/query/optimizer/relational/rules/…
[View More]RuleRemoveOptionalJoins.java
===================================================================
--- branches/7.1.1.CP2/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2011-06-07 21:19:41 UTC (rev 3229)
+++ branches/7.1.1.CP2/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2011-06-07 21:36:50 UTC (rev 3230)
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Set;
@@ -50,6 +51,7 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.util.CommandContext;
@@ -72,7 +74,7 @@
TeiidComponentException {
try {
- removeOptionalJoinNodes(plan, metadata, capFinder, null);
+ removeOptionalJoinNodes(plan, metadata, capFinder, null, null);
} catch (QueryResolverException e) {
throw new TeiidComponentException(e);
}
@@ -85,13 +87,22 @@
*/
private boolean removeOptionalJoinNodes(PlanNode node,
QueryMetadataInterface metadata,
- CapabilitiesFinder capFinder, Set<ElementSymbol> elements) throws QueryPlannerException,
+ CapabilitiesFinder capFinder, Set<ElementSymbol> elements, List<Integer> indexes) throws QueryPlannerException,
QueryMetadataException,
TeiidComponentException, QueryResolverException {
if (node.getChildCount() == 0) {
return false;
}
+ if (indexes != null && node.getParent() != null && node.getParent().getType() == NodeConstants.Types.SET_OP && node.getParent().getFirstChild() != node) {
+ elements = new HashSet<ElementSymbol>();
+ List columns = (List)node.getProperty(NodeConstants.Info.PROJECT_COLS);
+ for (int i : indexes) {
+ SingleElementSymbol column = (SingleElementSymbol) columns.get(i);
+ ElementCollectorVisitor.getElements(column, elements);
+ }
+ }
+
boolean isRoot = false;
switch (node.getType()) {
@@ -138,15 +149,21 @@
case NodeConstants.Types.SOURCE:
{
if (elements == null) {
+ indexes = null;
break;
}
SymbolMap symbolMap = (SymbolMap)node.getProperty(NodeConstants.Info.SYMBOL_MAP);
Set convertedElements = new HashSet();
+ indexes = new LinkedList<Integer>();
+ List<ElementSymbol> keys = symbolMap.getKeys();
+ List<Expression> values = symbolMap.getValues();
for (ElementSymbol element : elements) {
- Expression convertedExpression = symbolMap.getMappedExpression(element);
- if (convertedExpression != null) {
+ int index = keys.indexOf(element);
+ if (index >= 0) {
+ Expression convertedExpression = values.get(index);
+ indexes.add(index);
ElementCollectorVisitor.getElements(convertedExpression, convertedElements);
- }
+ }
}
elements = convertedElements;
isRoot = true;
@@ -170,6 +187,14 @@
break;
}
case NodeConstants.Types.SET_OP:
+ {
+ if (!node.hasBooleanProperty(NodeConstants.Info.USE_ALL)) {
+ //allow project nodes to be seen as roots
+ elements = null;
+ indexes = null;
+ }
+ break;
+ }
case NodeConstants.Types.DUP_REMOVE:
{
//allow project nodes to be seen as roots
@@ -182,7 +207,7 @@
if (isRoot) {
boolean optionalRemoved = false;
do {
- optionalRemoved = removeOptionalJoinNodes(node.getFirstChild(), metadata, capFinder, elements);
+ optionalRemoved = removeOptionalJoinNodes(node.getFirstChild(), metadata, capFinder, elements, indexes);
} while (optionalRemoved);
return false;
}
@@ -191,7 +216,7 @@
Iterator iter = node.getChildren().iterator();
while (node.getChildCount() >= 1 && iter.hasNext()) {
- if (removeOptionalJoinNodes((PlanNode)iter.next(), metadata, capFinder, elements)) {
+ if (removeOptionalJoinNodes((PlanNode)iter.next(), metadata, capFinder, elements, indexes)) {
return true;
}
}
Modified: branches/7.1.1.CP2/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
===================================================================
--- branches/7.1.1.CP2/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java 2011-06-07 21:19:41 UTC (rev 3229)
+++ branches/7.1.1.CP2/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java 2011-06-07 21:36:50 UTC (rev 3230)
@@ -311,7 +311,7 @@
}
/**
- * Union should prevent the removal from happening
+ * Union all should not prevent the removal from happening
*/
@Test public void testOptionalJoinWithUnion() {
ProcessorPlan plan = TestOptimizer.helpPlan("select pm1.g2.e4 from /* optional */ pm1.g1 inner join pm1.g2 on pm1.g1.e1 = pm1.g2.e1 union all select convert(pm1.g2.e2, double) from /* optional */ pm1.g1 inner join pm1.g2 on pm1.g1.e1 = pm1.g2.e1", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
@@ -335,6 +335,31 @@
});
}
+ /**
+ * The first branch should have the join removed, but not the second branch
+ */
+ @Test public void testOptionalJoinWithUnion1() {
+ ProcessorPlan plan = TestOptimizer.helpPlan("select e4 from (select e4, e2 from (select pm1.g2.e4, pm1.g1.e2 from /* optional */ pm1.g1 inner join pm1.g2 on pm1.g1.e1 = pm1.g2.e1) as x union all select e4, e2 from (select convert(pm2.g1.e2, double) as e4, pm2.g2.e2 from /* optional */ pm2.g1 inner join pm2.g2 on pm2.g1.e1 = pm2.g2.e1) as x) as y", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
+ new String[] {"SELECT pm1.g2.e4 FROM pm1.g2", "SELECT g_0.e2 FROM pm2.g1 AS g_0, pm2.g2 AS g_1 WHERE g_0.e1 = g_1.e1"} ); //$NON-NLS-1$ //$NON-NLS-2$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 2, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // Join
+ 0, // MergeJoin
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 1 // UnionAll
+ });
+ }
+
@Test public void testOptionalJoinWithCompoundCriteria() {
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT length(z) FROM /* optional */ pm1.g1 inner join (select e2 as y, e3 || 'x' as z from pm1.g1 ORDER BY z) AS x on pm1.g1.e2=x.y and concat(x.y, x.z) = '1'", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
new String[] {"SELECT e3 FROM pm1.g1"} ); //$NON-NLS-1$
[View Less]
13 years, 7 months
teiid SVN: r3229 - branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-06-07 17:19:41 -0400 (Tue, 07 Jun 2011)
New Revision: 3229
Modified:
branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
Log:
TEIID-1622 adding the unit test from 7.1.1
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java 2011-06-07 …
[View More]19:53:58 UTC (rev 3228)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java 2011-06-07 21:19:41 UTC (rev 3229)
@@ -347,7 +347,7 @@
}
/**
- * Union should prevent the removal from happening
+ * Union all should not prevent the removal from happening
*/
@Test public void testOptionalJoinWithUnion() {
ProcessorPlan plan = TestOptimizer.helpPlan("select pm1.g2.e4 from /* optional */ pm1.g1 inner join pm1.g2 on pm1.g1.e1 = pm1.g2.e1 union all select convert(pm1.g2.e2, double) from /* optional */ pm1.g1 inner join pm1.g2 on pm1.g1.e1 = pm1.g2.e1", RealMetadataFactory.example1Cached(), //$NON-NLS-1$
@@ -371,6 +371,31 @@
});
}
+ /**
+ * The first branch should have the join removed, but not the second branch
+ */
+ @Test public void testOptionalJoinWithUnion1() {
+ ProcessorPlan plan = TestOptimizer.helpPlan("select e4 from (select e4, e2 from (select pm1.g2.e4, pm1.g1.e2 from /* optional */ pm1.g1 inner join pm1.g2 on pm1.g1.e1 = pm1.g2.e1) as x union all select e4, e2 from (select convert(pm2.g1.e2, double) as e4, pm2.g2.e2 from /* optional */ pm2.g1 inner join pm2.g2 on pm2.g1.e1 = pm2.g2.e1) as x) as y", RealMetadataFactory.example1Cached(), //$NON-NLS-1$
+ new String[] {"SELECT pm1.g2.e4 FROM pm1.g2", "SELECT g_0.e2 FROM pm2.g1 AS g_0, pm2.g2 AS g_1 WHERE g_0.e1 = g_1.e1"} ); //$NON-NLS-1$ //$NON-NLS-2$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 2, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // Join
+ 0, // MergeJoin
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 1 // UnionAll
+ });
+ }
+
@Test public void testOptionalJoinWithCompoundCriteria() {
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT length(z) FROM /* optional */ pm1.g1 inner join (select e2 as y, e3 || 'x' as z from pm1.g1 ORDER BY z) AS x on pm1.g1.e2=x.y and concat(x.y, x.z) = '1'", RealMetadataFactory.example1Cached(), //$NON-NLS-1$
new String[] {"SELECT e3 FROM pm1.g1"} ); //$NON-NLS-1$
[View Less]
13 years, 7 months
teiid SVN: r3226 - branches/7.1.1.CP2/runtime/src/main/java/org/teiid/deployers.
by teiid-commits@lists.jboss.org
Author: mdrillin
Date: 2011-06-07 15:52:27 -0400 (Tue, 07 Jun 2011)
New Revision: 3226
Modified:
branches/7.1.1.CP2/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
Log:
TEIID-1623 - Resolves issue with ODBC precision and scale data for numeric and string types.
Modified: branches/7.1.1.CP2/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
===================================================================
--- branches/7.1.1.CP2/runtime/src/main/…
[View More]java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-06-07 01:21:33 UTC (rev 3225)
+++ branches/7.1.1.CP2/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-06-07 19:52:27 UTC (rev 3226)
@@ -148,7 +148,8 @@
"pt.oid as atttypid," + //$NON-NLS-1$
"pt.typlen as attlen, " + //$NON-NLS-1$
"convert(t1.Position, short) as attnum, " + //$NON-NLS-1$
- "t1.Length as atttypmod, " + //$NON-NLS-1$
+ "(CASE WHEN (t1.DataType = 'bigdecimal' OR t1.DataType = 'biginteger' OR t1.DataType = 'float' OR t1.DataType='double') THEN (4+(65536*t1.Precision)+t1.Scale) " + //$NON-NLS-1$
+ "ELSE (4+t1.Length) END) as atttypmod, " + //$NON-NLS-1$
"CASE WHEN (t1.NullType = 'No Nulls') THEN true ELSE false END as attnotnull, " + //$NON-NLS-1$
"false as attisdropped, " + //$NON-NLS-1$
"false as atthasdef " + //$NON-NLS-1$
[View Less]
13 years, 7 months
teiid SVN: r3225 - in branches/7.4.x: build/kits/jboss-container and 7 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-06-06 21:21:33 -0400 (Mon, 06 Jun 2011)
New Revision: 3225
Added:
branches/7.4.x/api/src/main/java/org/teiid/PolicyDecider.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRolePolicyDecider.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java
Removed:
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRoleAuthorizationValidator.java
Modified:
branches/…
[View More]7.4.x/api/src/main/java/org/teiid/CommandContext.java
branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
branches/7.4.x/client/src/main/java/org/teiid/adminapi/DataPolicy.java
branches/7.4.x/documentation/developer-guide/src/main/docbook/en-US/content/security.xml
branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/dataroles.xml
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidator.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
branches/7.4.x/engine/src/main/java/org/teiid/query/util/CommandContext.java
branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestAuthorizationValidationVisitor.java
branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
Log:
TEIID-1607 adding the ability to make authorization checks pluggable
Modified: branches/7.4.x/api/src/main/java/org/teiid/CommandContext.java
===================================================================
--- branches/7.4.x/api/src/main/java/org/teiid/CommandContext.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/api/src/main/java/org/teiid/CommandContext.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -23,12 +23,15 @@
package org.teiid;
import java.io.Serializable;
+import java.util.Map;
import java.util.Properties;
import java.util.TimeZone;
import javax.security.auth.Subject;
+import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.Session;
+import org.teiid.adminapi.VDB;
/**
* Context information for the currently executing command.
@@ -117,5 +120,17 @@
* @return
*/
String getRequestId();
+
+ /**
+ * Get the user's data policies, never null
+ * @return
+ */
+ Map<String, DataPolicy> getAllowedDataPolicies();
+
+ /**
+ * Get the current vdb
+ * @return
+ */
+ VDB getVdb();
}
Added: branches/7.4.x/api/src/main/java/org/teiid/PolicyDecider.java
===================================================================
--- branches/7.4.x/api/src/main/java/org/teiid/PolicyDecider.java (rev 0)
+++ branches/7.4.x/api/src/main/java/org/teiid/PolicyDecider.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -0,0 +1,79 @@
+/*
+ * 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;
+
+import java.util.Set;
+
+import org.teiid.adminapi.DataPolicy.Context;
+import org.teiid.adminapi.DataPolicy.PermissionType;
+
+/**
+ * A policy decider that reports authorization decisions for further action.
+ * A decider may be called many times for a single user command. Typically there will be 1 call for every
+ * command/subquery/temp table access/function call.
+ */
+public interface PolicyDecider {
+
+ /**
+ * Called by the system hasRole function to determine role membership.
+ * @param roleName
+ * @param context
+ * @return true if the user has the given role name, otherwise false
+ */
+ boolean hasRole(String roleName, CommandContext context);
+
+ /**
+ * Returns the set of resources not allowed to be accessed by the current user.
+ * Resource names are given based upon the FQNs (NOTE these are non-SQL names - identifiers are not quoted).
+ * @param action
+ * @param resources
+ * @param context in which the action is performed.
+ * For example you can have a context of {@link Context#UPDATE} for a {@link PermissionType#READ} for columns used in an UPDATE condition.
+ * @param commandContext
+ * @return the set of inaccessible resources, never null
+ */
+ Set<String> getInaccessibleResources(PermissionType action,
+ Set<String> resources, Context context,
+ CommandContext commandContext);
+
+ /**
+ * Checks if the given temp table is accessible. Typically as long as temp tables can be created, all operations are allowed.
+ * Resource names are given based upon the FQNs (NOTE these are non-SQL names - identifiers are not quoted).
+ * @param action
+ * @param resource
+ * @param context in which the action is performed.
+ * For example you can have a context of {@link Context#UPDATE} for a {@link PermissionType#READ} for columns used in an UPDATE condition.
+ * @param commandContext
+ * @return true if the access is allowed, otherwise false
+ */
+ boolean isTempAccessable(PermissionType action, String resource,
+ Context context, CommandContext commandContext);
+
+ /**
+ * Determines if an authorization check should proceed
+ * @param commandContext
+ * @return
+ */
+ boolean validateCommand(CommandContext commandContext);
+
+}
Property changes on: branches/7.4.x/api/src/main/java/org/teiid/PolicyDecider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-06-07 01:21:33 UTC (rev 3225)
@@ -101,7 +101,7 @@
<property name="cacheFactory"><inject bean="CacheFactory"/></property>
<property name="resultsetCacheConfig"><inject bean="ResultsetCacheConfig"/></property>
<property name="preparedPlanCacheConfig"><inject bean="PreparedPlanCacheConfig"/></property>
-
+ <property name="authorizationValidator"><inject bean="AuthorizationValidator"/></property>
<!-- Process pool maximum thread count. (default 64) -->
<property name="maxThreads">64</property>
<!-- Max active plans (default 20). Increase this value on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts. -->
@@ -117,12 +117,6 @@
<property name="maxRowsFetchSize">20480</property>
<!-- The max lob chunk size in KB transferred each time when processing blobs, clobs (100KB default) -->
<property name="lobChunkSizeInKB">100</property>
- <!-- Turn on role checking based upon the data roles defined in VDBs. (default true) -->
- <property name="useDataRoles">true</property>
- <!-- Sets whether temporary table usage is allowed by default with data roles enabled. If false, the user must have a role that grants creates temporary table rights to use temporary tables. (default true) -->
- <property name="allowCreateTemporaryTablesByDefault">true</property>
- <!-- Sets whether functions may be called by default with data roles enabled. If false, a specific permission must exist to call the function. (default true) -->
- <property name="allowFunctionCallsByDefault">true</property>
<!-- Long running query threshold, after which a alert can be generated by tooling if configured-->
<property name="queryThresholdInSecs">600</property>
<!-- Maximum rows allowed from a source query. -1 indicates no limit. (default -1)-->
@@ -136,6 +130,24 @@
<!-- Set to true for the engine to detect local change events. Should be disabled if using external change data capture tools. (default true) -->
<property name="detectingChangeEvents">true</property>
</bean>
+
+ <!-- An authorization validator that by default uses data role information stored in VDBs -->
+ <bean name="AuthorizationValidator" class="org.teiid.dqp.internal.process.DefaultAuthorizationValidator">
+ <!-- Turn on authorization checking (default true) -->
+ <property name="enabled">true</property>
+ <!-- The policy decider to use. (default AuthorizationValidator).
+ This instance may be changed to another org.teiid.PolicyDecider if needed.
+ -->
+ <property name="policyDecider"><inject bean="PolicyDecider"/></property>
+ </bean>
+
+ <!-- A policy decider that uses data role information stored in VDBs -->
+ <bean name="PolicyDecider" class="org.teiid.dqp.internal.process.DataRolePolicyDecider">
+ <!-- Sets whether temporary table usage is allowed by default with data roles enabled. If false, the user must have a role that grants creates temporary table rights to use temporary tables. (default true) -->
+ <property name="allowCreateTemporaryTablesByDefault">true</property>
+ <!-- Sets whether functions may be called by default with data roles enabled. If false, a specific permission must exist to call the function. (default true) -->
+ <property name="allowFunctionCallsByDefault">true</property>
+ </bean>
<!-- JDBC Socket connection properties (SSL see below) -->
<bean name="JdbcSocketConfiguration" class="org.teiid.transport.SocketConfiguration">
Modified: branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-06-07 01:21:33 UTC (rev 3225)
@@ -58,7 +58,8 @@
<LI><B>Runtime Updates of Metadata</B> - ALTER statements have been added to change view/procedure/INSTEAD OF trigger (update procedure) definitions. A CREATE TRIGGER statement is also available to add an INSTEAD OF trigger (update procedures) to views.
System procedures were added to set extension metadata and stat values. By default all effects of metadata updates happen only on running vdbs across the cluster. To make the changes persistent see the Developers Guide Runtime Updates section.
<LI><B>ODBC SSL</B> - added support for SSL encrypted ODBC connections.
- <LI><B>Reauthentication Statement</B> - SET SESSION AUTHORIZATION can now be used to perform a reauthentication via JDBC or ODBC.
+ <LI><B>Reauthentication Statement</B> - SET SESSION AUTHORIZATION can now be used to perform a reauthentication via JDBC or ODBC.
+ <LI><B>Pluggable Authorization</B> - an alternative PolicyDecider can be defined in the teiid-jboss-beans.xml file to customize authorization decisions.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
Modified: branches/7.4.x/client/src/main/java/org/teiid/adminapi/DataPolicy.java
===================================================================
--- branches/7.4.x/client/src/main/java/org/teiid/adminapi/DataPolicy.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/client/src/main/java/org/teiid/adminapi/DataPolicy.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -25,8 +25,20 @@
public interface DataPolicy {
- public enum PermissionType {CREATE, READ, UPDATE, DELETE, ALTER, EXECUTE};
+ public enum Context {
+ CREATE,
+ DROP,
+ QUERY,
+ INSERT,
+ UPDATE,
+ DELETE,
+ FUNCTION,
+ ALTER,
+ STORED_PROCEDURE;
+ }
+ public enum PermissionType {CREATE, READ, UPDATE, DELETE, ALTER, EXECUTE, DROP};
+
/**
* Get the Name of the Data Policy
* @return
Modified: branches/7.4.x/documentation/developer-guide/src/main/docbook/en-US/content/security.xml
===================================================================
--- branches/7.4.x/documentation/developer-guide/src/main/docbook/en-US/content/security.xml 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/documentation/developer-guide/src/main/docbook/en-US/content/security.xml 2011-06-07 01:21:33 UTC (rev 3225)
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="custom_login_modules">
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
+%CustomDTD;
+]>
+<chapter>
+<title>Custom Security</title>
+<section id="custom_login_modules">
<title>Login Modules</title>
<para>The Teiid system provides a range of built-in and extensible security features to enable the
secure access of data. For details about how to configure the available security features check out
@@ -92,4 +97,27 @@
<para>If you are extending one of the built-in LoginModules, refer to
<ulink url="http://community.jboss.org/docs/DOC-9466"/>.</para>
</section>
+</section>
+<section>
+ <title>Custom Authorization</title>
+ <para>In situations where Teiid's built-in role mechanism is not sufficient, a custom
+ <code>org.teiid.PolicyDecider</code> can be installed via the &jboss-beans; configuration file under the "AuthorizationValidator" bean.
+ <example>
+ <title>Example Configuration Snippet</title>
+ <programlisting role="XML" language="XML"><![CDATA[
+ <bean name="AuthorizationValidator" class="org.teiid.dqp.internal.process.DefaultAuthorizationValidator">
+ <property name="enabled">true</property>
+ <property name="policyDecider"><inject bean="PolicyDecider"/></property>
+ </bean>
+
+ <bean name="PolicyDecider" class="com.company.CustomPolicyDecider">
+ <property name="someProperty">some value</property>
+ </bean>]]>
+ </programlisting>
+ </example>
+ Your custom <code>PolicyDecider</code> should be installed in a jar that is made available to the same classloader as Teiid, typically the profile lib directory.
+ A <code>PolicyDecider</code> may be consulted many times for a single user command, but it is only called to make decisions based upon resources that
+ appear in user queries. Any further access of resources through views or stored procedures, just as with data roles, is not checked against a <code>PolicyDecider.</code>
+ </para>
+</section>
</chapter>
\ No newline at end of file
Modified: branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/dataroles.xml
===================================================================
--- branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/dataroles.xml 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/dataroles.xml 2011-06-07 01:21:33 UTC (rev 3225)
@@ -168,4 +168,8 @@
<para>The <code>hasRole</code> system function will return true if the current user has the given data role.
The <code>hasRole</code> function can be used in procedure or view definitions to allow for a more dynamic application of security - which allows for things such as value masking or row level security.</para>
</section>
+ <section>
+ <title>Customizing</title>
+ <para>See the Developer's Guide Custom Security Chapter for details on using an alternative authorization scheme.</para>
+ </section>
</chapter>
\ No newline at end of file
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -28,16 +28,17 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.teiid.CommandContext;
+import org.teiid.PolicyDecider;
import org.teiid.adminapi.DataPolicy;
+import org.teiid.adminapi.DataPolicy.Context;
import org.teiid.adminapi.DataPolicy.PermissionType;
-import org.teiid.adminapi.impl.DataPolicyMetadata;
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.core.CoreConstants;
import org.teiid.core.TeiidComponentException;
@@ -74,44 +75,19 @@
public class AuthorizationValidationVisitor extends AbstractValidationVisitor {
- public enum Context {
- CREATE,
- DROP,
- QUERY,
- INSERT,
- UPDATE,
- DELETE,
- FUNCTION,
- ALTER,
- STORED_PROCEDURE;
- }
-
- private HashMap<String, DataPolicy> allowedPolicies;
- private boolean allowCreateTemporaryTablesDefault = true;
- private boolean allowFunctionCallsByDefault = true;
private CommandContext commandContext;
+ private PolicyDecider decider;
- public AuthorizationValidationVisitor(HashMap<String, DataPolicy> policies, CommandContext commandContext) {
- this.allowedPolicies = policies;
+ public AuthorizationValidationVisitor(PolicyDecider decider, CommandContext commandContext) {
+ this.decider = decider;
this.commandContext = commandContext;
}
-
- public void setAllowCreateTemporaryTablesDefault(
- boolean allowCreateTemporaryTablesDefault) {
- this.allowCreateTemporaryTablesDefault = allowCreateTemporaryTablesDefault;
- }
-
- public void setAllowFunctionCallsByDefault(boolean allowFunctionCallsDefault) {
- this.allowFunctionCallsByDefault = allowFunctionCallsDefault;
- }
// ############### Visitor methods for language objects ##################
@Override
public void visit(Create obj) {
- Set<String> resources = Collections.singleton(obj.getTable().getName());
- Collection<GroupSymbol> symbols = Arrays.asList(obj.getTable());
- validateTemp(resources, symbols, Context.CREATE);
+ validateTemp(PermissionType.CREATE, obj.getTable(), Context.CREATE);
}
@Override
@@ -129,30 +105,18 @@
validateEntitlements(Arrays.asList(obj.getTarget()), DataPolicy.PermissionType.ALTER, Context.ALTER);
}
- private void validateTemp(Set<String> resources,
- Collection<GroupSymbol> symbols, Context context) {
+ private void validateTemp(DataPolicy.PermissionType action, GroupSymbol symbol, Context context) {
+ String resource = symbol.getNonCorrelationName();
+ Set<String> resources = Collections.singleton(resource);
logRequest(resources, context);
- boolean allowed = false;
- for(DataPolicy p:this.allowedPolicies.values()) {
- DataPolicyMetadata policy = (DataPolicyMetadata)p;
-
- if (policy.isAllowCreateTemporaryTables() == null) {
- if (allowCreateTemporaryTablesDefault) {
- allowed = true;
- break;
- }
- } else if (policy.isAllowCreateTemporaryTables()) {
- allowed = true;
- break;
- }
- }
+ boolean allowed = decider.isTempAccessable(action, resource, context, commandContext);
logResult(resources, context, allowed);
if (!allowed) {
handleValidationError(
QueryPlugin.Util.getString("ERR.018.005.0095", commandContext.getUserName(), "CREATE_TEMPORARY_TABLES"), //$NON-NLS-1$ //$NON-NLS-2$
- symbols);
+ Arrays.asList(symbol));
}
}
@@ -166,9 +130,7 @@
@Override
public void visit(Drop obj) {
- Set<String> resources = Collections.singleton(obj.getTable().getName());
- Collection<GroupSymbol> symbols = Arrays.asList(obj.getTable());
- validateTemp(resources, symbols, Context.CREATE);
+ validateTemp(PermissionType.DROP, obj.getTable(), Context.DROP);
}
public void visit(Delete obj) {
@@ -205,7 +167,7 @@
} catch (TeiidProcessingException e) {
handleException(e, obj);
}
- } else if (!allowFunctionCallsByDefault) {
+ } else {
String schema = obj.getFunctionDescriptor().getSchema();
if (schema != null && !isSystemSchema(schema)) {
Map<String, Function> map = new HashMap<String, Function>();
@@ -221,14 +183,13 @@
* Validate insert entitlements
*/
protected void validateEntitlements(Insert obj) {
+ List<LanguageObject> insert = new LinkedList<LanguageObject>();
+ insert.add(obj.getGroup());
+ insert.addAll(obj.getVariables());
validateEntitlements(
- obj.getVariables(),
+ insert,
DataPolicy.PermissionType.CREATE,
Context.INSERT);
-
- if (obj.getGroup().isTempTable()) {
- validateTemp(Collections.singleton(obj.getGroup().getNonCorrelationName()), Arrays.asList(obj.getGroup()), Context.INSERT);
- }
}
/**
@@ -248,7 +209,10 @@
// The variables from the changes must be checked for UPDATE entitlement
// validateEntitlements on all the variables used in the update.
- validateEntitlements(obj.getChangeList().getClauseMap().keySet(), DataPolicy.PermissionType.UPDATE, Context.UPDATE);
+ List<LanguageObject> updated = new LinkedList<LanguageObject>();
+ updated.add(obj.getGroup());
+ updated.addAll(obj.getChangeList().getClauseMap().keySet());
+ validateEntitlements(updated, DataPolicy.PermissionType.UPDATE, Context.UPDATE);
}
/**
@@ -275,12 +239,10 @@
Into intoObj = obj.getInto();
if ( intoObj != null ) {
GroupSymbol intoGroup = intoObj.getGroup();
- if (intoGroup.isTempTable()) {
- validateTemp(Collections.singleton(intoGroup.getNonCorrelationName()), Arrays.asList(intoGroup), Context.INSERT);
- }
- List<ElementSymbol> intoElements = null;
+ Collection<LanguageObject> intoElements = new LinkedList<LanguageObject>();
+ intoElements.add(intoGroup);
try {
- intoElements = ResolverUtil.resolveElementsInGroup(intoGroup, getMetadata());
+ intoElements.addAll(ResolverUtil.resolveElementsInGroup(intoGroup, getMetadata()));
} catch (QueryMetadataException err) {
handleException(err, intoGroup);
} catch (TeiidComponentException err) {
@@ -292,7 +254,7 @@
}
// Validate this query's entitlements
- Collection entitledObjects = GroupCollectorVisitor.getGroups(obj, true);
+ Collection<LanguageObject> entitledObjects = new ArrayList<LanguageObject>(GroupCollectorVisitor.getGroupsIgnoreInlineViews(obj, true));
if (!isXMLCommand(obj)) {
entitledObjects.addAll(ElementCollectorVisitor.getElements(obj, true));
}
@@ -319,7 +281,7 @@
* @param auditContext The {@link AuthorizationService} to use when resource auditing is done.
*/
protected void validateEntitlements(Collection<? extends LanguageObject> symbols, DataPolicy.PermissionType actionCode, Context auditContext) {
- Map<String, LanguageObject> nameToSymbolMap = new HashMap<String, LanguageObject>();
+ Map<String, LanguageObject> nameToSymbolMap = new LinkedHashMap<String, LanguageObject>();
for (LanguageObject symbol : symbols) {
try {
String fullName = null;
@@ -333,6 +295,9 @@
GroupSymbol group = (GroupSymbol)symbol;
metadataID = group.getMetadataID();
if (metadataID instanceof TempMetadataID && !group.isProcedure()) {
+ if (group.isTempTable()) {
+ validateTemp(actionCode, group, auditContext);
+ }
continue;
}
}
@@ -380,27 +345,12 @@
}
/**
- * Out of resources specified, return the subset for which the specified not have authorization to access.
+ * Out of the resources specified, return the subset for which the specified not have authorization to access.
*/
public Set<String> getInaccessibleResources(DataPolicy.PermissionType action, Set<String> resources, Context context) {
logRequest(resources, context);
- HashSet<String> results = new HashSet<String>(resources);
-
- for(DataPolicy p:this.allowedPolicies.values()) {
- DataPolicyMetadata policy = (DataPolicyMetadata)p;
-
- if (results.isEmpty()) {
- break;
- }
-
- Iterator<String> i = results.iterator();
- while (i.hasNext()) {
- if (policy.allows(i.next(), action)) {
- i.remove();
- }
- }
- }
+ Set<String> results = decider.getInaccessibleResources(action, resources, context, commandContext);
logResult(resources, context, results.isEmpty());
return results;
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidator.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidator.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidator.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -33,8 +33,11 @@
*/
public interface AuthorizationValidator {
- void validate(Command command, QueryMetadataInterface metadata,
- DQPWorkContext workContext, CommandContext commandContext) throws QueryValidatorException, TeiidComponentException;
+ void validate(Command command, QueryMetadataInterface metadata, CommandContext commandContext) throws QueryValidatorException, TeiidComponentException;
- boolean hasRole(String roleName, DQPWorkContext workContext);
+ boolean hasRole(String roleName, CommandContext commandContext);
+
+ boolean isEnabled();
+
+ void setEnabled(boolean enabled);
}
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -135,40 +135,15 @@
*/
@ManagementProperty(description="Turn on role checking based upon the data roles defined in VDBs. (default true)")
public boolean getUseDataRoles() {
- return useDataRoles;
+ return this.authorizationValidator != null && this.authorizationValidator.isEnabled();
}
public void setUseDataRoles(boolean useEntitlements) {
- this.useDataRoles = useEntitlements;
+ if (this.authorizationValidator != null) {
+ this.authorizationValidator.setEnabled(useEntitlements);
+ }
}
- /**
- * Whether temporary table usage is enabled by default.
- * @return <code>true</code> if temporary table usage is enabled by default.
- */
- @ManagementProperty(description="Sets whether temporary table usage is allowed by default with data roles enabled. If false, the user must have a role that grants creates temporary table rights to use temporary tables. (default true)")
- public boolean isAllowCreateTemporaryTablesByDefault() {
- return allowCreateTemporaryTablesByDefault;
- }
-
- public void setAllowCreateTemporaryTablesByDefault(
- boolean allowCreateTemporaryTablesByDefault) {
- this.allowCreateTemporaryTablesByDefault = allowCreateTemporaryTablesByDefault;
- }
-
- /**
- * Whether functions are callable by default
- * @return <code>true</code> if function usage is enabled by default.
- */
- @ManagementProperty(description="Sets whether functions may be called by default with data roles enabled. If false, a specific permission must exist to call the function. (default true)")
- public boolean isAllowFunctionCallsByDefault() {
- return allowFunctionCallsByDefault;
- }
-
- public void setAllowFunctionCallsByDefault(boolean allowFunctionCallsDefault) {
- this.allowFunctionCallsByDefault = allowFunctionCallsDefault;
- }
-
@ManagementProperty(description="Long running query threshold, after which a alert can be generated by tooling if configured")
public int getQueryThresholdInSecs() {
return queryThresholdInSecs;
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -673,9 +673,6 @@
public void start(DQPConfiguration config) {
this.config = config;
this.authorizationValidator = config.getAuthorizationValidator();
- if (this.authorizationValidator == null) {
- this.authorizationValidator = new DataRoleAuthorizationValidator(config.getUseDataRoles(), config.isAllowCreateTemporaryTablesByDefault(), config.isAllowFunctionCallsByDefault());
- }
this.chunkSize = config.getLobChunkSizeInKB() * 1024;
//get buffer manager
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -217,6 +217,10 @@
}
return this.policies;
}
+
+ public void setPolicies(HashMap<String, DataPolicy> policies) {
+ this.policies = policies;
+ }
private boolean matchesPrincipal(Set<String> userRoles, DataPolicy policy) {
if (policy.isAnyAuthenticated()) {
Deleted: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRoleAuthorizationValidator.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRoleAuthorizationValidator.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRoleAuthorizationValidator.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.dqp.internal.process;
-
-import org.teiid.api.exception.query.QueryValidatorException;
-import org.teiid.core.TeiidComponentException;
-import org.teiid.query.metadata.QueryMetadataInterface;
-import org.teiid.query.sql.lang.Command;
-import org.teiid.query.util.CommandContext;
-
-/**
- * The default Teiid authorization validator
- */
-public class DataRoleAuthorizationValidator implements AuthorizationValidator {
-
- private boolean useEntitlements;
- private boolean allowCreateTemporaryTablesByDefault;
- private boolean allowFunctionCallsByDefault;
-
- public DataRoleAuthorizationValidator(boolean useEntitlements,
- boolean allowCreateTemporaryTablesByDefault, boolean allowFunctionCallsByDefault) {
- this.useEntitlements = useEntitlements;
- this.allowCreateTemporaryTablesByDefault = allowCreateTemporaryTablesByDefault;
- this.allowFunctionCallsByDefault = allowFunctionCallsByDefault;
- }
-
- @Override
- public void validate(Command command, QueryMetadataInterface metadata, DQPWorkContext workContext, CommandContext commandContext) throws QueryValidatorException, TeiidComponentException {
- if (useEntitlements && !workContext.getVDB().getDataPolicies().isEmpty()) {
- AuthorizationValidationVisitor visitor = new AuthorizationValidationVisitor(workContext.getAllowedDataPolicies(), commandContext);
- visitor.setAllowCreateTemporaryTablesDefault(allowCreateTemporaryTablesByDefault);
- visitor.setAllowFunctionCallsByDefault(allowFunctionCallsByDefault);
- Request.validateWithVisitor(visitor, metadata, command);
- }
- }
-
- @Override
- public boolean hasRole(String roleName, DQPWorkContext workContext) {
- if (!useEntitlements) {
- return true;
- }
- return workContext.getAllowedDataPolicies().containsKey(roleName);
- }
-
-}
Added: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRolePolicyDecider.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRolePolicyDecider.java (rev 0)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRolePolicyDecider.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -0,0 +1,76 @@
+package org.teiid.dqp.internal.process;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.teiid.CommandContext;
+import org.teiid.PolicyDecider;
+import org.teiid.adminapi.DataPolicy;
+import org.teiid.adminapi.DataPolicy.Context;
+import org.teiid.adminapi.DataPolicy.PermissionType;
+import org.teiid.adminapi.impl.DataPolicyMetadata;
+
+public class DataRolePolicyDecider implements PolicyDecider {
+
+ private boolean allowCreateTemporaryTablesByDefault = true;
+ private boolean allowFunctionCallsByDefault = true;
+
+ @Override
+ public Set<String> getInaccessibleResources(PermissionType action,
+ Set<String> resources, Context context, CommandContext commandContext) {
+ if (action == PermissionType.EXECUTE && context == Context.FUNCTION && allowFunctionCallsByDefault) {
+ return Collections.emptySet();
+ }
+ LinkedHashSet<String> results = new LinkedHashSet<String>(resources);
+ for(DataPolicy p:commandContext.getAllowedDataPolicies().values()) {
+ DataPolicyMetadata policy = (DataPolicyMetadata)p;
+
+ if (results.isEmpty()) {
+ break;
+ }
+
+ Iterator<String> i = results.iterator();
+ while (i.hasNext()) {
+ if (policy.allows(i.next(), action)) {
+ i.remove();
+ }
+ }
+ }
+ return results;
+ }
+
+ @Override
+ public boolean hasRole(String roleName, CommandContext context) {
+ return context.getAllowedDataPolicies().containsKey(roleName);
+ }
+
+ @Override
+ public boolean isTempAccessable(PermissionType action, String resource,
+ Context context, CommandContext commandContext) {
+ for(DataPolicy p:commandContext.getAllowedDataPolicies().values()) {
+ DataPolicyMetadata policy = (DataPolicyMetadata)p;
+
+ if (policy.isAllowCreateTemporaryTables() != null) {
+ return policy.isAllowCreateTemporaryTables();
+ }
+ }
+ return allowCreateTemporaryTablesByDefault;
+ }
+
+ public void setAllowCreateTemporaryTablesByDefault(
+ boolean allowCreateTemporaryTablesByDefault) {
+ this.allowCreateTemporaryTablesByDefault = allowCreateTemporaryTablesByDefault;
+ }
+
+ public void setAllowFunctionCallsByDefault(boolean allowFunctionCallsDefault) {
+ this.allowFunctionCallsByDefault = allowFunctionCallsDefault;
+ }
+
+ @Override
+ public boolean validateCommand(CommandContext commandContext) {
+ return !commandContext.getVdb().getDataPolicies().isEmpty();
+ }
+
+}
Property changes on: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRolePolicyDecider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java (from rev 3202, branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataRoleAuthorizationValidator.java)
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java (rev 0)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -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.dqp.internal.process;
+
+import org.teiid.PolicyDecider;
+import org.teiid.api.exception.query.QueryValidatorException;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.sql.lang.Command;
+import org.teiid.query.util.CommandContext;
+
+/**
+ * The default Teiid authorization validator
+ */
+public class DefaultAuthorizationValidator implements AuthorizationValidator {
+
+ private boolean enabled = true;
+ private PolicyDecider policyDecider;
+
+ public DefaultAuthorizationValidator() {
+ }
+
+ @Override
+ public void validate(Command command, QueryMetadataInterface metadata, CommandContext commandContext) throws QueryValidatorException, TeiidComponentException {
+ if (enabled && policyDecider.validateCommand(commandContext)) {
+ AuthorizationValidationVisitor visitor = new AuthorizationValidationVisitor(this.policyDecider, commandContext);
+ Request.validateWithVisitor(visitor, metadata, command);
+ }
+ }
+
+ @Override
+ public boolean hasRole(String roleName, CommandContext commandContext) {
+ if (!enabled) {
+ return true;
+ }
+ return this.policyDecider.hasRole(roleName, commandContext);
+ }
+
+ public void setPolicyDecider(PolicyDecider policyDecider) {
+ this.policyDecider = policyDecider;
+ }
+
+ public PolicyDecider getPolicyDecider() {
+ return policyDecider;
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+}
Property changes on: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DefaultAuthorizationValidator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -254,6 +254,7 @@
context.setSubject(workContext.getSubject());
this.context.setSession(workContext.getSession());
this.context.setRequestId(this.requestId);
+ this.context.setDQPWorkContext(this.workContext);
}
@Override
@@ -262,7 +263,10 @@
if (!DATA_ROLE.equalsIgnoreCase(roleType)) {
return false;
}
- return authorizationValidator.hasRole(roleName, workContext);
+ if (this.authorizationValidator == null) {
+ return true;
+ }
+ return authorizationValidator.hasRole(roleName, context);
}
public void setUserRequestConcurrency(int userRequestConcurrency) {
@@ -465,7 +469,9 @@
protected void validateAccess(Command command) throws QueryValidatorException, TeiidComponentException {
createCommandContext(command);
- this.authorizationValidator.validate(command, metadata, workContext, context);
+ if (this.authorizationValidator != null) {
+ this.authorizationValidator.validate(command, metadata, context);
+ }
}
}
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -26,6 +26,7 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
+import java.util.Map;
import java.util.Properties;
import java.util.Random;
import java.util.Set;
@@ -33,11 +34,14 @@
import javax.security.auth.Subject;
+import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.Session;
+import org.teiid.adminapi.VDB;
import org.teiid.api.exception.query.QueryProcessingException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.util.ArgCheck;
+import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.dqp.internal.process.PreparedPlan;
import org.teiid.dqp.internal.process.SessionAwareCache;
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
@@ -120,9 +124,11 @@
private Subject subject;
private HashSet<Object> dataObjects;
- public Session session;
+ private Session session;
- public RequestID requestId;
+ private RequestID requestId;
+
+ private DQPWorkContext dqpWorkContext;
}
private GlobalState globalState = new GlobalState();
@@ -591,4 +597,22 @@
this.globalState.requestId = requestId;
}
+ public void setDQPWorkContext(DQPWorkContext workContext) {
+ this.globalState.dqpWorkContext = workContext;
+ }
+
+ @Override
+ public Map<String, DataPolicy> getAllowedDataPolicies() {
+ return this.globalState.dqpWorkContext.getAllowedDataPolicies();
+ }
+
+ @Override
+ public VDB getVdb() {
+ return this.globalState.dqpWorkContext.getVDB();
+ }
+
+ public DQPWorkContext getDQPWorkContext() {
+ return this.globalState.dqpWorkContext;
+ }
+
}
Modified: branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestAuthorizationValidationVisitor.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestAuthorizationValidationVisitor.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestAuthorizationValidationVisitor.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -29,8 +29,7 @@
import java.util.HashSet;
import java.util.Set;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
+import org.junit.Before;
import org.junit.Test;
import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.DataPolicy.PermissionType;
@@ -40,7 +39,6 @@
import org.teiid.adminapi.impl.DataPolicyMetadata.PermissionMetaData;
import org.teiid.api.exception.query.QueryParserException;
import org.teiid.api.exception.query.QueryResolverException;
-import org.teiid.api.exception.query.QueryValidatorException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.parser.QueryParser;
@@ -58,10 +56,12 @@
public class TestAuthorizationValidationVisitor {
public static final String CONN_ID = "connID"; //$NON-NLS-1$
- private static CommandContext context = new CommandContext();
+ private CommandContext context;
- @BeforeClass public static void oneTimeSetup() {
+ @Before public void setup() {
+ context = new CommandContext();
context.setSession(new SessionMetadata());
+ context.setDQPWorkContext(new DQPWorkContext());
}
PermissionMetaData addResource(PermissionType type, boolean flag, String resource) {
@@ -179,9 +179,10 @@
HashMap<String, DataPolicy> policies = new HashMap<String, DataPolicy>();
policies.put(policy.getName(), policy);
-
- AuthorizationValidationVisitor visitor = new AuthorizationValidationVisitor(policies, context); //$NON-NLS-1$
- visitor.setAllowFunctionCallsByDefault(false);
+ this.context.getDQPWorkContext().setPolicies(policies);
+ DataRolePolicyDecider dataRolePolicyDecider = new DataRolePolicyDecider();
+ dataRolePolicyDecider.setAllowFunctionCallsByDefault(false);
+ AuthorizationValidationVisitor visitor = new AuthorizationValidationVisitor(dataRolePolicyDecider, context); //$NON-NLS-1$
ValidatorReport report = Validator.validate(command, metadata, visitor);
if(report.hasItems()) {
ValidatorFailure firstFailure = report.getItems().iterator().next();
@@ -289,11 +290,11 @@
}
@Test public void testSelectIntoTarget_e1_NotAccessible() throws Exception {
- helpTest(exampleAuthSvc2(), "SELECT e1, e2, e3, e4 INTO pm2.g2 FROM pm2.g1", RealMetadataFactory.example1Cached(), new String[] {"pm2.g2.e2","pm2.g2.e4","pm2.g2.e3"}, RealMetadataFactory.example1VDB()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ helpTest(exampleAuthSvc2(), "SELECT e1, e2, e3, e4 INTO pm2.g2 FROM pm2.g1", RealMetadataFactory.example1Cached(), new String[] {"pm2.g2", "pm2.g2.e2","pm2.g2.e4","pm2.g2.e3"}, RealMetadataFactory.example1VDB()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
@Test public void testSelectIntoTarget_e1e2_NotAccessible() throws Exception {
- helpTest(exampleAuthSvc2(), "SELECT e1, e2, e3, e4 INTO pm3.g2 FROM pm2.g1", RealMetadataFactory.example1Cached(), new String[] {"pm3.g2.e4", "pm3.g2.e3"},RealMetadataFactory.example1VDB()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ helpTest(exampleAuthSvc2(), "SELECT e1, e2, e3, e4 INTO pm3.g2 FROM pm2.g1", RealMetadataFactory.example1Cached(), new String[] {"pm3.g2", "pm3.g2.e4", "pm3.g2.e3"},RealMetadataFactory.example1VDB()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@Test public void testTempTableSelectInto() throws Exception {
@@ -326,28 +327,4 @@
helpTest(examplePolicyBQT(), "alter trigger on SmallA_2589 INSTEAD OF UPDATE enabled", RealMetadataFactory.exampleBQTCached(), new String[] {}, RealMetadataFactory.exampleBQTVDB()); //$NON-NLS-1$ //$NON-NLS-2$
}
- private void helpTestLookupVisibility(boolean visible) throws QueryParserException, QueryValidatorException, TeiidComponentException {
- VDBMetaData vdb = RealMetadataFactory.example1VDB();
- vdb.getModel("pm1").setVisible(visible); //$NON-NLS-1$
- AuthorizationValidationVisitor mvvv = new AuthorizationValidationVisitor(new HashMap<String, DataPolicy>(), context); //$NON-NLS-1$
- String sql = "select lookup('pm1.g1', 'e1', 'e2', 1)"; //$NON-NLS-1$
- Command command = QueryParser.getQueryParser().parseCommand(sql);
- Request.validateWithVisitor(mvvv, RealMetadataFactory.example1Cached(), command);
- }
-
- @Ignore("visibility no longer ristricts access")
- @Test public void testLookupVisibility() throws Exception {
- helpTestLookupVisibility(true);
- }
-
- @Ignore("visibility no longer ristricts access")
- @Test public void testLookupVisibilityFails() throws Exception {
- try {
- helpTestLookupVisibility(false);
- fail("expected exception"); //$NON-NLS-1$
- } catch (QueryValidatorException e) {
- assertEquals("Group does not exist: pm1.g1", e.getMessage()); //$NON-NLS-1$
- }
- }
-
}
Modified: branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -242,7 +242,9 @@
serverRequest.initialize(request, BufferManagerFactory.getStandaloneBufferManager(), null, new FakeTransactionService(), null, workContext, prepPlanCache);
serverRequest.setMetadata(capFinder, metadata, null);
- serverRequest.setAuthorizationValidator(new DataRoleAuthorizationValidator(false, true, true));
+ DefaultAuthorizationValidator drav = new DefaultAuthorizationValidator();
+ drav.setEnabled(false);
+ serverRequest.setAuthorizationValidator(drav);
serverRequest.processRequest();
assertNotNull(serverRequest.processPlan);
Modified: branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java 2011-06-06 20:23:11 UTC (rev 3224)
+++ branches/7.4.x/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java 2011-06-07 01:21:33 UTC (rev 3225)
@@ -82,7 +82,12 @@
request.initialize(message, BufferManagerFactory.getStandaloneBufferManager(), null,new FakeTransactionService(), TEMP_TABLE_STORE, workContext, null);
request.initMetadata();
- request.setAuthorizationValidator(new DataRoleAuthorizationValidator(true, true, true));
+ DefaultAuthorizationValidator drav = new DefaultAuthorizationValidator();
+ DataRolePolicyDecider drpd = new DataRolePolicyDecider();
+ drpd.setAllowCreateTemporaryTablesByDefault(true);
+ drpd.setAllowFunctionCallsByDefault(true);
+ drav.setPolicyDecider(drpd);
+ request.setAuthorizationValidator(drav);
request.validateAccess(command);
}
@@ -136,7 +141,9 @@
request.initialize(message, Mockito.mock(BufferManager.class),
new FakeDataManager(), new FakeTransactionService(), TEMP_TABLE_STORE, workContext, null);
- request.setAuthorizationValidator(new DataRoleAuthorizationValidator(false, true, true));
+ DefaultAuthorizationValidator drav = new DefaultAuthorizationValidator();
+ drav.setEnabled(false);
+ request.setAuthorizationValidator(drav);
request.processRequest();
return request;
}
[View Less]
13 years, 7 months