org.teiid.translator.loopback
Class LoopbackExecutionFactory

java.lang.Object
  extended by org.teiid.translator.ExecutionFactory<java.lang.Object,java.lang.Object>
      extended by org.teiid.translator.loopback.LoopbackExecutionFactory

@Translator(name="loopback",
            description="A translator for testing, that returns mock data")
public class LoopbackExecutionFactory
extends ExecutionFactory<java.lang.Object,java.lang.Object>

Loopback translator.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.teiid.translator.ExecutionFactory
ExecutionFactory.NullOrder, ExecutionFactory.SupportedJoinCriteria
 
Field Summary
 
Fields inherited from class org.teiid.translator.ExecutionFactory
DEFAULT_MAX_FROM_GROUPS, DEFAULT_MAX_IN_CRITERIA_SIZE
 
Constructor Summary
LoopbackExecutionFactory()
           
 
Method Summary
 Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, java.lang.Object connection)
          Create an execution object for the specified command
 java.lang.Object getConnection(java.lang.Object factory)
          Return a connection object from the given connection factory.
 long getPollIntervalInMilli()
           
 int getRowCount()
           
 java.util.List getSupportedFunctions()
          Get list of all supported function names.
 int getWaitTime()
           
 boolean isSourceRequired()
          Flag that indicates if a underlying source connection required for this execution factory to work
 boolean isThrowError()
           
 void setPollIntervalInMilli(long intervel)
           
 void setRowCount(int rowCount)
           
 void setThrowError(boolean error)
           
 void setWaitTime(int waitTime)
           
 void start()
          Initialize the connector with supplied configuration
 boolean supportsAggregatesAvg()
          Support indicates connector can accept the AVG aggregate function
 boolean supportsAggregatesCount()
          Support indicates connector can accept the COUNT aggregate function
 boolean supportsAggregatesCountStar()
          Support indicates connector can accept the COUNT(*) aggregate function
 boolean supportsAggregatesDistinct()
          Support indicates connector can accept DISTINCT within aggregate functions
 boolean supportsAggregatesMax()
          Support indicates connector can accept the MAX aggregate function
 boolean supportsAggregatesMin()
          Support indicates connector can accept the MIN aggregate function
 boolean supportsAggregatesSum()
          Support indicates connector can accept the SUM aggregate function
 boolean supportsAliasedTable()
          Support indicates connector can accept groups with aliases
 boolean supportsBetweenCriteria()
          Support indicates connector accepts criteria of form (element BETWEEN constant AND constant)
NOT CURRENTLY USED - between is rewritten as compound compare criteria
 boolean supportsCaseExpressions()
          Support indicates connector can accept queries with non-searched CASE WHEN ...
 boolean supportsCompareCriteriaEquals()
          Support indicates connector accepts criteria of form (element = constant)
 boolean supportsCompareCriteriaOrdered()
          Support indicates connector accepts criteria of form (element <=|>= constant)
The query engine will may pushdown queries containing < or > if NOT is also supported.
 boolean supportsCorrelatedSubqueries()
          Support indicates connector can accept correlated subqueries wherever subqueries are accepted
 boolean supportsExcept()
          Support indicates that the connector supports the EXCEPT of two queries.
 boolean supportsExistsCriteria()
          Support indicates connector accepts the EXISTS criteria
 boolean supportsGroupBy()
          Whether the source supports an explicit GROUP BY clause
 boolean supportsHaving()
          Whether the source supports the HAVING clause
 boolean supportsInCriteria()
          Support indicates connector accepts criteria of form (element IN set)
 boolean supportsInCriteriaSubquery()
          Support indicates connector accepts IN criteria with a subquery on the right side
 boolean supportsInlineViews()
          Support indicates connector can accept inline views (subqueries in the FROM clause).
 boolean supportsIntersect()
          Support indicates that the connector supports the INTERSECT of two queries.
 boolean supportsIsNullCriteria()
          Support indicates connector accepts criteria of form (element IS NULL)
 boolean supportsLikeCriteria()
          Support indicates connector accepts criteria of form (element LIKE constant)
 boolean supportsLikeCriteriaEscapeCharacter()
          Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)
 boolean supportsNotCriteria()
          Support indicates connector accepts logical criteria NOT
 boolean supportsOrCriteria()
          Support indicates connector accepts logical criteria connected by OR
 boolean supportsQuantifiedCompareCriteriaAll()
          Support indicates connector accepts the quantified comparison criteria that use ALL
 boolean supportsQuantifiedCompareCriteriaSome()
          Support indicates connector accepts the quantified comparison criteria that use SOME
 boolean supportsRowLimit()
          Gets whether the connector can limit the number of rows returned by a query.
 boolean supportsScalarSubqueries()
          Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and HAVING clauses
 boolean supportsSearchedCaseExpressions()
          Support indicates connector can accept queries with searched CASE WHEN ...
 boolean supportsSelectExpression()
          Support indicates connector can accept expressions other than element symbols in the SELECT clause.
 boolean supportsSelfJoins()
          Support indicates connector can accept self-joins where a group is joined to itself with aliases.
 boolean supportsSetQueryOrderBy()
          Support indicates that the connector supports an ORDER BY on a SetQuery.
 boolean supportsUnions()
          Support indicates that the connector supports the UNION of two queries.
 
Methods inherited from class org.teiid.translator.ExecutionFactory
areLobsUsableAfterClose, closeConnection, createProcedureExecution, createResultSetExecution, createUpdateExecution, getDefaultNullOrder, getInstance, getLanguageFactory, getMaxFromGroups, getMaxInCriteriaSize, getMetadata, getSupportedJoinCriteria, getTypeFacility, isImmutable, requiresCriteria, setImmutable, setRequiresCriteria, setSourceRequired, setSupportedJoinCriteria, setSupportsFullOuterJoins, setSupportsInnerJoins, setSupportsOrderBy, setSupportsOuterJoins, setSupportsSelectDistinct, supportsAggregatesEnhancedNumeric, supportsBatchedUpdates, supportsBulkUpdate, supportsCommonTableExpressions, supportsFullOuterJoins, supportsFunctionsInGroupBy, supportsInnerJoins, supportsInsertWithIterator, supportsInsertWithQueryExpression, supportsOrderBy, supportsOrderByNullOrdering, supportsOrderByUnrelated, supportsOuterJoins, supportsRowOffset, supportsSelectDistinct, useAnsiJoin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoopbackExecutionFactory

public LoopbackExecutionFactory()
Method Detail

getConnection

public java.lang.Object getConnection(java.lang.Object factory)
                               throws TranslatorException
Description copied from class: ExecutionFactory
Return a connection object from the given connection factory. The default implementation assumes a JCA ConnectionFactory. Subclasses should override, if they use another type of connection factory.

Overrides:
getConnection in class ExecutionFactory<java.lang.Object,java.lang.Object>
Returns:
Throws:
TranslatorException

getWaitTime

@TranslatorProperty(display="Max Random Wait Time",
                    advanced=true)
public int getWaitTime()

setWaitTime

public void setWaitTime(int waitTime)

getRowCount

@TranslatorProperty(display="Rows Per Query",
                    advanced=true)
public int getRowCount()

setRowCount

public void setRowCount(int rowCount)

isThrowError

@TranslatorProperty(display="Always Throw Error")
public boolean isThrowError()

setThrowError

public void setThrowError(boolean error)

getPollIntervalInMilli

@TranslatorProperty(display="Poll interval if using a Asynchronous Connector")
public long getPollIntervalInMilli()

setPollIntervalInMilli

public void setPollIntervalInMilli(long intervel)

start

public void start()
           throws TranslatorException
Description copied from class: ExecutionFactory
Initialize the connector with supplied configuration

Overrides:
start in class ExecutionFactory<java.lang.Object,java.lang.Object>
Throws:
TranslatorException

createExecution

public Execution createExecution(Command command,
                                 ExecutionContext executionContext,
                                 RuntimeMetadata metadata,
                                 java.lang.Object connection)
                          throws TranslatorException
Description copied from class: ExecutionFactory
Create an execution object for the specified command

Overrides:
createExecution in class ExecutionFactory<java.lang.Object,java.lang.Object>
Parameters:
command - the command
executionContext - Provides information about the context that this command is executing within, such as the identifiers for the command being executed
metadata - Access to runtime metadata if needed to translate the command
connection - connection factory object to the data source
Returns:
An execution object that can use to execute the command
Throws:
TranslatorException

isSourceRequired

public boolean isSourceRequired()
Description copied from class: ExecutionFactory
Flag that indicates if a underlying source connection required for this execution factory to work

Overrides:
isSourceRequired in class ExecutionFactory<java.lang.Object,java.lang.Object>
Returns:

getSupportedFunctions

public java.util.List getSupportedFunctions()
Description copied from class: ExecutionFactory
Get list of all supported function names. Arithmetic functions have names like "+".

Overrides:
getSupportedFunctions in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsGroupBy

public boolean supportsGroupBy()
Description copied from class: ExecutionFactory
Whether the source supports an explicit GROUP BY clause

Overrides:
supportsGroupBy in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsAggregatesAvg

public boolean supportsAggregatesAvg()
Description copied from class: ExecutionFactory
Support indicates connector can accept the AVG aggregate function

Overrides:
supportsAggregatesAvg in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsAggregatesCount

public boolean supportsAggregatesCount()
Description copied from class: ExecutionFactory
Support indicates connector can accept the COUNT aggregate function

Overrides:
supportsAggregatesCount in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsAggregatesCountStar

public boolean supportsAggregatesCountStar()
Description copied from class: ExecutionFactory
Support indicates connector can accept the COUNT(*) aggregate function

Overrides:
supportsAggregatesCountStar in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsAggregatesDistinct

public boolean supportsAggregatesDistinct()
Description copied from class: ExecutionFactory
Support indicates connector can accept DISTINCT within aggregate functions

Overrides:
supportsAggregatesDistinct in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsAggregatesMax

public boolean supportsAggregatesMax()
Description copied from class: ExecutionFactory
Support indicates connector can accept the MAX aggregate function

Overrides:
supportsAggregatesMax in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsAggregatesMin

public boolean supportsAggregatesMin()
Description copied from class: ExecutionFactory
Support indicates connector can accept the MIN aggregate function

Overrides:
supportsAggregatesMin in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsAggregatesSum

public boolean supportsAggregatesSum()
Description copied from class: ExecutionFactory
Support indicates connector can accept the SUM aggregate function

Overrides:
supportsAggregatesSum in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsAliasedTable

public boolean supportsAliasedTable()
Description copied from class: ExecutionFactory
Support indicates connector can accept groups with aliases

Overrides:
supportsAliasedTable in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsBetweenCriteria

public boolean supportsBetweenCriteria()
Description copied from class: ExecutionFactory
Support indicates connector accepts criteria of form (element BETWEEN constant AND constant)
NOT CURRENTLY USED - between is rewritten as compound compare criteria

Overrides:
supportsBetweenCriteria in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsCaseExpressions

public boolean supportsCaseExpressions()
Description copied from class: ExecutionFactory
Support indicates connector can accept queries with non-searched CASE WHEN ... END
NOT CURRENTLY USED - case is pushed down as searched case

Overrides:
supportsCaseExpressions in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsCompareCriteriaEquals

public boolean supportsCompareCriteriaEquals()
Description copied from class: ExecutionFactory
Support indicates connector accepts criteria of form (element = constant)

Overrides:
supportsCompareCriteriaEquals in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsCorrelatedSubqueries

public boolean supportsCorrelatedSubqueries()
Description copied from class: ExecutionFactory
Support indicates connector can accept correlated subqueries wherever subqueries are accepted

Overrides:
supportsCorrelatedSubqueries in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsExistsCriteria

public boolean supportsExistsCriteria()
Description copied from class: ExecutionFactory
Support indicates connector accepts the EXISTS criteria

Overrides:
supportsExistsCriteria in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsInCriteria

public boolean supportsInCriteria()
Description copied from class: ExecutionFactory
Support indicates connector accepts criteria of form (element IN set)

Overrides:
supportsInCriteria in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsInCriteriaSubquery

public boolean supportsInCriteriaSubquery()
Description copied from class: ExecutionFactory
Support indicates connector accepts IN criteria with a subquery on the right side

Overrides:
supportsInCriteriaSubquery in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsIsNullCriteria

public boolean supportsIsNullCriteria()
Description copied from class: ExecutionFactory
Support indicates connector accepts criteria of form (element IS NULL)

Overrides:
supportsIsNullCriteria in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsLikeCriteria

public boolean supportsLikeCriteria()
Description copied from class: ExecutionFactory
Support indicates connector accepts criteria of form (element LIKE constant)

Overrides:
supportsLikeCriteria in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsLikeCriteriaEscapeCharacter

public boolean supportsLikeCriteriaEscapeCharacter()
Description copied from class: ExecutionFactory
Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)

Overrides:
supportsLikeCriteriaEscapeCharacter in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsNotCriteria

public boolean supportsNotCriteria()
Description copied from class: ExecutionFactory
Support indicates connector accepts logical criteria NOT

Overrides:
supportsNotCriteria in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsOrCriteria

public boolean supportsOrCriteria()
Description copied from class: ExecutionFactory
Support indicates connector accepts logical criteria connected by OR

Overrides:
supportsOrCriteria in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsQuantifiedCompareCriteriaAll

public boolean supportsQuantifiedCompareCriteriaAll()
Description copied from class: ExecutionFactory
Support indicates connector accepts the quantified comparison criteria that use ALL

Overrides:
supportsQuantifiedCompareCriteriaAll in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsScalarSubqueries

public boolean supportsScalarSubqueries()
Description copied from class: ExecutionFactory
Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and HAVING clauses

Overrides:
supportsScalarSubqueries in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsSearchedCaseExpressions

public boolean supportsSearchedCaseExpressions()
Description copied from class: ExecutionFactory
Support indicates connector can accept queries with searched CASE WHEN ... END

Overrides:
supportsSearchedCaseExpressions in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsSelfJoins

public boolean supportsSelfJoins()
Description copied from class: ExecutionFactory
Support indicates connector can accept self-joins where a group is joined to itself with aliases. Connector must also support ExecutionFactory.supportsAliasedTable().

Overrides:
supportsSelfJoins in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsInlineViews

public boolean supportsInlineViews()
Description copied from class: ExecutionFactory
Support indicates connector can accept inline views (subqueries in the FROM clause).

Overrides:
supportsInlineViews in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsQuantifiedCompareCriteriaSome

public boolean supportsQuantifiedCompareCriteriaSome()
Description copied from class: ExecutionFactory
Support indicates connector accepts the quantified comparison criteria that use SOME

Overrides:
supportsQuantifiedCompareCriteriaSome in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsRowLimit

public boolean supportsRowLimit()
Description copied from class: ExecutionFactory
Gets whether the connector can limit the number of rows returned by a query.

Overrides:
supportsRowLimit in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsSelectExpression

public boolean supportsSelectExpression()
Description copied from class: ExecutionFactory
Support indicates connector can accept expressions other than element symbols in the SELECT clause. Specific supports for the expression type are still checked.

Overrides:
supportsSelectExpression in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsSetQueryOrderBy

public boolean supportsSetQueryOrderBy()
Description copied from class: ExecutionFactory
Support indicates that the connector supports an ORDER BY on a SetQuery.

Overrides:
supportsSetQueryOrderBy in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsUnions

public boolean supportsUnions()
Description copied from class: ExecutionFactory
Support indicates that the connector supports the UNION of two queries.

Overrides:
supportsUnions in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsCompareCriteriaOrdered

public boolean supportsCompareCriteriaOrdered()
Description copied from class: ExecutionFactory
Support indicates connector accepts criteria of form (element <=|>= constant)
The query engine will may pushdown queries containing < or > if NOT is also supported.

Overrides:
supportsCompareCriteriaOrdered in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsExcept

public boolean supportsExcept()
Description copied from class: ExecutionFactory
Support indicates that the connector supports the EXCEPT of two queries.

Overrides:
supportsExcept in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsHaving

public boolean supportsHaving()
Description copied from class: ExecutionFactory
Whether the source supports the HAVING clause

Overrides:
supportsHaving in class ExecutionFactory<java.lang.Object,java.lang.Object>

supportsIntersect

public boolean supportsIntersect()
Description copied from class: ExecutionFactory
Support indicates that the connector supports the INTERSECT of two queries.

Overrides:
supportsIntersect in class ExecutionFactory<java.lang.Object,java.lang.Object>


Copyright © 2010. All Rights Reserved.