Author: rareddy
Date: 2010-09-01 13:02:49 -0400 (Wed, 01 Sep 2010)
New Revision: 2514
Modified:
branches/7.1.x/api/src/main/java/org/teiid/translator/Translator.java
branches/7.1.x/client/src/main/java/org/teiid/adminapi/impl/VDBTranslatorMetaData.java
branches/7.1.x/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java
branches/7.1.x/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
branches/7.1.x/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
branches/7.1.x/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
branches/7.1.x/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
branches/7.1.x/runtime/src/main/java/org/teiid/deployers/TranslatorAnnotationScanningDeployer.java
Log:
TEIID-1214: Adding description field to every translator. Also made sure this description
is shown in the JOPR tool.
Modified: branches/7.1.x/api/src/main/java/org/teiid/translator/Translator.java
===================================================================
--- branches/7.1.x/api/src/main/java/org/teiid/translator/Translator.java 2010-09-01
15:38:19 UTC (rev 2513)
+++ branches/7.1.x/api/src/main/java/org/teiid/translator/Translator.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -37,4 +37,5 @@
*/
public @interface Translator {
String name();
+ String description() default "";
}
Modified:
branches/7.1.x/client/src/main/java/org/teiid/adminapi/impl/VDBTranslatorMetaData.java
===================================================================
---
branches/7.1.x/client/src/main/java/org/teiid/adminapi/impl/VDBTranslatorMetaData.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/client/src/main/java/org/teiid/adminapi/impl/VDBTranslatorMetaData.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -42,6 +42,7 @@
private static final long serialVersionUID = -3454161477587996138L;
private String type;
private Class executionClass;
+ private String description;
@Override
@ManagementProperty(description="Name of the Translator", mandatory = true)
@@ -85,5 +86,14 @@
public void setExecutionFactoryClass(Class clazz) {
this.executionClass = clazz;
addProperty(EXECUTION_FACTORY_CLASS, clazz.getName());
- }
+ }
+
+ @ManagementProperty(description="Translator Description")
+ public String getDescription() {
+ return this.description;
+ }
+
+ public void setDescription(String desc) {
+ this.description = desc;
+ }
}
Modified:
branches/7.1.x/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -37,7 +37,7 @@
import org.teiid.translator.ResultSetExecution;
import org.teiid.translator.Translator;
import org.teiid.translator.TranslatorException;
-@Translator(name="yahoo")
+@Translator(name="yahoo", description="A translator for testing to obtain
stock quotes from Yahoo web site")
public class YahooExecutionFactory extends ExecutionFactory<Object, Object> {
public static final int YAHOO_MAX_SET_SIZE = 100;
Modified:
branches/7.1.x/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -61,7 +61,7 @@
import org.teiid.translator.TranslatorProperty;
import org.teiid.translator.TypeFacility;
-@Translator(name="file")
+@Translator(name="file", description="File Translator, reads contents of
files or writes to them")
public class FileExecutionFactory extends ExecutionFactory<ConnectionFactory,
FileConnection> {
private final class FileProcedureExecution implements ProcedureExecution {
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -77,7 +77,7 @@
/**
* JDBC implementation of Connector interface.
*/
-@Translator(name="jdbc-ansi")
+@Translator(name="jdbc-ansi", description="JDBC ANSI translator, can used
with any ANSI compatible JDBC Driver")
public class JDBCExecutionFactory extends ExecutionFactory<DataSource, Connection>
{
public static final int DEFAULT_MAX_IN_CRITERIA = 1000;
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -33,7 +33,7 @@
* This capabilities class may come in handy for testing and for
* sources that support JDBC but don't support extended JDBC capabilities.
*/
-@Translator(name="jdbc-simple")
+@Translator(name="jdbc-simple", description="An extended JDBC ANSI
translator with some simple capabilities")
public class SimpleJDBCExecutionFactory extends JDBCExecutionFactory {
public SimpleJDBCExecutionFactory() {
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -33,7 +33,7 @@
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.sybase.SybaseExecutionFactory;
-@Translator(name="access")
+@Translator(name="access", description="A translator for Microsoft Access
Database")
public class AccessExecutionFactory extends SybaseExecutionFactory {
public AccessExecutionFactory() {
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -47,7 +47,7 @@
import org.teiid.translator.jdbc.LocateFunctionModifier;
import org.teiid.translator.jdbc.ModFunctionModifier;
-@Translator(name="db2")
+@Translator(name="db2", description="A translator for IBM DB2
Database")
public class DB2ExecutionFactory extends JDBCExecutionFactory {
private final class NullHandlingFormatModifier extends
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -35,7 +35,7 @@
/**
* @since 4.3
*/
-@Translator(name="derby")
+@Translator(name="derby", description="A translator for Apache Derby
Database")
public class DerbyExecutionFactory extends DB2ExecutionFactory {
public static final String TEN_1 = "10.1"; //$NON-NLS-1$
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -39,7 +39,7 @@
import org.teiid.translator.jdbc.hsql.AddDiffModifier;
import org.teiid.translator.jdbc.oracle.ConcatFunctionModifier;
-@Translator(name="h2")
+@Translator(name="h2", description="A translator for open source H2
Database")
public class H2ExecutionFactory extends JDBCExecutionFactory {
@Override
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -35,7 +35,7 @@
import org.teiid.translator.jdbc.FunctionModifier;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
-@Translator(name="hsql")
+@Translator(name="hsql", description="A translator for open source HSQL
Database")
public class HsqlExecutionFactory extends JDBCExecutionFactory {
@Override
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -34,7 +34,7 @@
import org.teiid.translator.jdbc.JDBCExecutionFactory;
-@Translator(name="informix")
+@Translator(name="informix", description="A translator for Informix
Database")
public class InformixExecutionFactory extends JDBCExecutionFactory {
@Override
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -14,7 +14,7 @@
/**
* Capabilities compatible with MM 5.5.x
*/
-@Translator(name="metamatrix")
+@Translator(name="metamatrix", description="A translator for MetaMatrix
Virtual Database")
public class MetaMatrixExecutionFactory extends JDBCExecutionFactory {
public List<String> getSupportedFunctions() {
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -47,7 +47,7 @@
/**
* Translator class for accessing the ModeShape JCR repository.
*/
-@Translator(name="modeshape")
+@Translator(name="modeshape", description="A translator for open source
Modeshape JCA repository")
public class ModeShapeExecutionFactory extends JDBCExecutionFactory {
public ModeShapeExecutionFactory() {
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -32,7 +32,7 @@
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.FunctionModifier;
-@Translator(name="mysql5")
+@Translator(name="mysql5", description="A translator for open source
MySQL5 Database")
public class MySQL5ExecutionFactory extends MySQLExecutionFactory {
@Override
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -43,7 +43,7 @@
/**
* @since 4.3
*/
-@Translator(name="mysql")
+@Translator(name="mysql", description="A translator for open source MySQL
Database, used with any version lower than 5")
public class MySQLExecutionFactory extends JDBCExecutionFactory {
public MySQLExecutionFactory() {
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -62,7 +62,7 @@
import org.teiid.translator.jdbc.LocateFunctionModifier;
-@Translator(name="oracle")
+@Translator(name="oracle", description="A translator for Oracle
Database")
public class OracleExecutionFactory extends JDBCExecutionFactory {
private static final String TIME_FORMAT = "HH24:MI:SS"; //$NON-NLS-1$
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -57,7 +57,7 @@
* Translator class for PostgreSQL. Updated to expect a 8.0+ jdbc client
* @since 4.3
*/
-@Translator(name="postgresql")
+@Translator(name="postgresql", description="A translator for postgreSQL
Database")
public class PostgreSQLExecutionFactory extends JDBCExecutionFactory {
public static final String EIGHT_0 = "8.0"; //$NON-NLS-1$
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -41,7 +41,7 @@
/**
* Updated to assume the use of the DataDirect, 2005 driver, or later.
*/
-@Translator(name="sqlserver")
+@Translator(name="sqlserver", description="A translator for Microsoft SQL
Server Database")
public class SQLServerExecutionFactory extends SybaseExecutionFactory {
public static final String V_2005 = "2005"; //$NON-NLS-1$
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -51,7 +51,7 @@
import org.teiid.translator.jdbc.oracle.ConcatFunctionModifier;
-@Translator(name="sybase")
+@Translator(name="sybase", description="A translator for Sybase
Database")
public class SybaseExecutionFactory extends JDBCExecutionFactory {
public static final String TWELVE_5 = "12.5"; //$NON-NLS-1$
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -35,7 +35,7 @@
/**
* @since 4.3
*/
-@Translator(name="teiid")
+@Translator(name="teiid", description="A translator for Teiid Virtual
Database")
public class TeiidExecutionFactory extends JDBCExecutionFactory {
public static final String SEVEN_0 = "7.0"; //$NON-NLS-1$
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -33,7 +33,7 @@
/**
* for Teradata database Release V2R5.1
*/
-@Translator(name="teradata")
+@Translator(name="teradata", description="A translator for Teradata
Database")
public class TeradataExecutionFactory extends JDBCExecutionFactory {
public TeradataExecutionFactory() {
Modified:
branches/7.1.x/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -41,7 +41,7 @@
* LDAP translator. This is responsible for initializing
* a connection factory, and obtaining connections to LDAP.
*/
-@Translator(name="ldap")
+@Translator(name="ldap", description="A translator for LDAP
directory")
public class LDAPExecutionFactory extends ExecutionFactory<ConnectionFactory,
LdapContext> {
public enum SearchDefaultScope {
Modified:
branches/7.1.x/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -37,7 +37,7 @@
/**
* Loopback translator.
*/
-@Translator(name="loopback")
+@Translator(name="loopback", description="A translator for testing, that
returns mock data")
public class LoopbackExecutionFactory extends ExecutionFactory<Object, Object> {
private int waitTime = 0;
Modified:
branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -48,7 +48,7 @@
import org.teiid.translator.salesforce.execution.QueryExecutionImpl;
import org.teiid.translator.salesforce.execution.UpdateExecutionImpl;
-@Translator(name="salesforce")
+@Translator(name="salesforce", description="A translator for
Salesforce")
public class SalesForceExecutionFactory extends ExecutionFactory<ConnectionFactory,
SalesforceConnection> {
private String connectorStateClass;
Modified:
branches/7.1.x/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java
===================================================================
---
branches/7.1.x/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -49,7 +49,7 @@
import org.teiid.translator.TypeFacility;
import org.teiid.translator.WSConnection;
-@Translator(name="ws")
+@Translator(name="ws", description="A translator for making Web Service
calls")
public class WSExecutionFactory extends ExecutionFactory<ConnectionFactory,
WSConnection> {
public enum Binding {
Modified:
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
===================================================================
---
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -63,16 +63,9 @@
String RESOURCE_NAME = "resourceName";
}
- /*
- * (non-Javadoc)
- *
- * @seeorg.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.
- * ResourceContext)
- */
@Override
public void start(ResourceContext context) {
- this.setComponentName(context.getPluginConfiguration().getSimpleValue(
- "name", null));
+ this.setComponentName(context.getPluginConfiguration().getSimpleValue( "name",
null));
this.resourceConfiguration=context.getPluginConfiguration();
super.start(context);
}
@@ -94,8 +87,7 @@
*
* @see MeasurementFacet#getValues(MeasurementReport, Set)
*/
- public void getValues(MeasurementReport report,
- Set<MeasurementScheduleRequest> requests) {
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest>
requests) {
for (MeasurementScheduleRequest request : requests) {
String name = request.getName();
@@ -107,11 +99,9 @@
Number value = new Integer(1); // dummy measurement value -
// this should come from the
// managed resource
- report.addData(new MeasurementDataNumeric(request, value
- .doubleValue()));
+ report.addData(new MeasurementDataNumeric(request, value.doubleValue()));
} catch (Exception e) {
- LOG.error("Failed to obtain measurement [" + name //$NON-NLS-1$
- + "]. Cause: " + e); //$NON-NLS-1$
+ LOG.error("Failed to obtain measurement [" + name + "]. Cause: "
+ e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -121,12 +111,8 @@
protected void setOperationArguments(String name,
Configuration configuration, Map argumentMap) {
//No operations for translators
-
}
- /* (non-Javadoc)
- * @see org.teiid.rhq.plugin.Facet#loadResourceConfiguration()
- */
@Override
public Configuration loadResourceConfiguration() {
@@ -144,8 +130,8 @@
LOG.error(msg, e);
}
- String translatorName = ProfileServiceUtil.getSimpleValue(
- translator, "name", String.class);
+ String translatorName = ProfileServiceUtil.getSimpleValue( translator,
"name", String.class);
+ String description = ProfileServiceUtil.getSimpleValue( translator,
"description", String.class);
Configuration c = resourceConfiguration;
PropertyList list = new PropertyList("translatorList");
@@ -153,12 +139,12 @@
c.put(list);
// First get translator specific properties
- ManagedProperty translatorProps = translator
- .getProperty("property");
+ ManagedProperty translatorProps = translator.getProperty("property");
getTranslatorValues(translatorProps.getValue(), propMap, list);
// Now get common properties
c.put(new PropertySimple("name", translatorName));
+ c.put(new PropertySimple("description", description));
return c;
@@ -169,8 +155,7 @@
MetaType metaType = pValue.getMetaType();
Map<String, T> unwrappedvalue = null;
if (metaType.isComposite()) {
- unwrappedvalue = (Map<String, T>) MetaValueFactory
- .getInstance().unwrap(pValue);
+ unwrappedvalue = (Map<String, T>)
MetaValueFactory .getInstance().unwrap(pValue);
for (String key : unwrappedvalue.keySet()) {
map = new PropertyMap("property");
Modified:
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
===================================================================
---
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -41,8 +41,8 @@
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.plugins.jbossas5.ApplicationServerComponent;
import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection;
+import org.teiid.core.util.ApplicationInfo;
import org.teiid.rhq.plugin.util.PluginConstants;
import org.teiid.rhq.plugin.util.ProfileServiceUtil;
@@ -69,8 +69,9 @@
for (ManagedComponent translator : translators) {
String translatorKey = translator.getName();
- String translatorName = ProfileServiceUtil.getSimpleValue(
- translator, "name", String.class);
+ String translatorName = ProfileServiceUtil.getSimpleValue(translator,
"name", String.class); //$NON-NLS-1$
+ String description = ProfileServiceUtil.getSimpleValue(translator,
"description", String.class); //$NON-NLS-1$
+
/**
*
* A discovered resource must have a unique key, that must stay the
@@ -80,8 +81,8 @@
discoveryContext.getResourceType(), // ResourceType
translatorKey, // Resource Key
translatorName, // Resource Name
- null, // Version
- PluginConstants.ComponentType.Translator.DESCRIPTION, // Description
+ ApplicationInfo.getInstance().getReleaseNumber(), // Version
+ description, // Description
discoveryContext.getDefaultPluginConfiguration(), // Plugin config
null // Process info from a process scan
);
@@ -89,19 +90,19 @@
// Get plugin config map for models
Configuration configuration = detail.getPluginConfiguration();
- configuration.put(new PropertySimple("name", translatorName));
+ configuration.put(new PropertySimple("name", translatorName));//$NON-NLS-1$
detail.setPluginConfiguration(configuration);
// Add to return values
// First get translator specific properties
- ManagedProperty translatorProps = translator.getProperty("property");
- PropertyList list = new PropertyList("translatorList");
+ ManagedProperty translatorProps =
translator.getProperty("property");//$NON-NLS-1$
+ PropertyList list = new PropertyList("translatorList");//$NON-NLS-1$
PropertyMap propMap = null;
getTranslatorValues(translatorProps.getValue(), propMap, list);
// Now get common properties
- configuration.put(new PropertySimple("name", translatorName));
- configuration.put(new
PropertySimple("type",ProfileServiceUtil.getSimpleValue(translator,"type",
String.class)));
+ configuration.put(new PropertySimple("name", translatorName));//$NON-NLS-1$
+ configuration.put(new
PropertySimple("type",ProfileServiceUtil.getSimpleValue(translator,"type",
String.class)));//$NON-NLS-1$ //$NON-NLS-2$
detail.setPluginConfiguration(configuration);
// Add to return values
@@ -121,9 +122,9 @@
unwrappedvalue = (Map<String, T>)
MetaValueFactory.getInstance().unwrap(pValue);
for (String key : unwrappedvalue.keySet()) {
- map = new PropertyMap("properties");
- map.put(new PropertySimple("name", key));
- map.put(new PropertySimple("value", unwrappedvalue.get(key)));
+ map = new PropertyMap("properties");//$NON-NLS-1$
+ map.put(new PropertySimple("name", key));//$NON-NLS-1$
+ map.put(new PropertySimple("value",
unwrappedvalue.get(key)));//$NON-NLS-1$
//map.put(new PropertySimple("description", "Custom property"));
list.add(map);
}
Modified:
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
===================================================================
---
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -124,7 +124,6 @@
public final static String TYPE = "teiid"; //$NON-NLS-1$
public final static String SUBTYPE = "translator"; //$NON-NLS-1$
public final static String NAME = "Translator"; //$NON-NLS-1$
- public final static String DESCRIPTION = "Teiid Translator"; //$NON-NLS-1$
public static interface Operations {
Modified: branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml 2010-09-01 15:38:19
UTC (rev 2513)
+++ branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml 2010-09-01 17:02:49
UTC (rev 2514)
@@ -605,8 +605,9 @@
createDeletePolicy="both" creationDataType="configuration">
<resource-configuration>
- <c:simple-property name="name" displayName="Name"
- description="Name of the translator" readOnly="true"
required="false" />
+ <c:simple-property name="name" displayName="Name"
description="Name of the translator" readOnly="true"
required="false" />
+ <c:simple-property name="description"
displayName="Description" description="Description the translator"
readOnly="true" required="false" />
+
<c:list-property name="translatorList" readOnly="true"
required="false" displayName="Properties"
description="Translator properties">
<c:map-property name="properties" readOnly="true">
Modified:
branches/7.1.x/runtime/src/main/java/org/teiid/deployers/TranslatorAnnotationScanningDeployer.java
===================================================================
---
branches/7.1.x/runtime/src/main/java/org/teiid/deployers/TranslatorAnnotationScanningDeployer.java 2010-09-01
15:38:19 UTC (rev 2513)
+++
branches/7.1.x/runtime/src/main/java/org/teiid/deployers/TranslatorAnnotationScanningDeployer.java 2010-09-01
17:02:49 UTC (rev 2514)
@@ -75,6 +75,7 @@
TranslatorMetaData data = new TranslatorMetaData();
data.setName(bean.name());
data.setExecutionFactoryClass(clazz);
+ data.setDescription(bean.description());
return data;
}