Package org.teiid.translator.loopback
Class LoopbackExecutionFactory
- java.lang.Object
-
- org.teiid.translator.ExecutionFactory<F,C>
-
- org.teiid.translator.BaseDelegatingExecutionFactory
-
- org.teiid.translator.loopback.LoopbackExecutionFactory
-
- All Implemented Interfaces:
DelegatingExecutionFactory
@Translator(name="loopback", description="A translator for testing, that returns mock data") public class LoopbackExecutionFactory extends BaseDelegatingExecutionFactory
Loopback translator.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.teiid.translator.ExecutionFactory
ExecutionFactory.Format, ExecutionFactory.NullOrder, ExecutionFactory.SupportedJoinCriteria, ExecutionFactory.TransactionSupport
-
-
Field Summary
-
Fields inherited from class org.teiid.translator.ExecutionFactory
DEFAULT_MAX_FROM_GROUPS, DEFAULT_MAX_IN_CRITERIA_SIZE, DEFAULT_MAX_PROJECTED_COLUMNS
-
-
Constructor Summary
Constructors Constructor Description LoopbackExecutionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Execution
createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection)
Create an execution object for the specified commandint
getCharacterValuesSize()
Object
getConnection(Object factory)
Return a connection object from the given connection factory.Object
getConnection(Object factory, ExecutionContext executionContext)
Return a connection object from the given connection factory.String
getDelegateName()
boolean
getIncrementRows()
void
getMetadata(MetadataFactory metadataFactory, Object conn)
Implement to provide metadata to the metadata for use by the engine.long
getPollIntervalInMilli()
int
getRowCount()
int
getWaitTime()
boolean
isSourceRequired()
Flag that indicates if a underlying source connection required for this execution factory to workboolean
isSourceRequiredForMetadata()
Flag that indicates if a underlying source connection required for this execution factory to return metadataboolean
isThrowError()
boolean
returnsSingleUpdateCount()
True if only a single value is returned for the update count.void
setCharacterValuesSize(int charValSize)
void
setIncrementRows(boolean incrementRows)
void
setPollIntervalInMilli(long intervel)
void
setRowCount(int rowCount)
void
setThrowError(boolean error)
void
setWaitTime(int waitTime)
void
start()
Initialize the connector with supplied configuration-
Methods inherited from class org.teiid.translator.BaseDelegatingExecutionFactory
areLobsUsableAfterClose, closeConnection, createDirectExecution, createProcedureExecution, createResultSetExecution, createUpdateExecution, equals, getAddSupportedFunctions, getCacheDirective, getCachePattern, getCacheTtl, getCollationLocale, getDefaultNullOrder, getDelegate, getDirectQueryProcedureName, getExcludedCommonTableExpressionName, getLanguageFactory, getMaxDependentInPredicates, getMaxFromGroups, getMaxInCriteriaSize, getMaxProjectedColumns, getPushDownFunctions, getRemoveSupportedFunctions, getRequiredLikeEscape, getSupportedFunctions, getSupportedJoinCriteria, getTransactionSupport, getTypeFacility, hashCode, initCapabilities, isCopyLobs, isForkable, isImmutable, isSourceRequiredForCapabilities, isThreadBound, requiresCriteria, setAddSupportedFunctions, setCachePattern, setCacheTtl, setCollationLocale, setCopyLobs, setDefaultNullOrder, setDelegate, setDelegateName, setDirectQueryProcedureName, setExcludedCommonTableExpressionName, setForkable, setImmutable, setMaxDependentInPredicates, setMaxFromGroups, setMaxInCriteriaSize, setMaxProjectedColumns, setRemoveSupportedFunctions, setRequiredLikeEscape, setRequiresCriteria, setSourceRequired, setSourceRequiredForCapabilities, setSourceRequiredForMetadata, setSupportedJoinCriteria, setSupportsAdvancedOlapOperations, setSupportsAggregatesAvg, setSupportsAggregatesCount, setSupportsAggregatesCountBig, setSupportsAggregatesCountStar, setSupportsAggregatesDistinct, setSupportsAggregatesEnhancedNumeric, setSupportsAggregatesMax, setSupportsAggregatesMin, setSupportsAggregatesSum, setSupportsAliasedTable, setSupportsArrayAgg, setSupportsArrayType, setSupportsBatchedUpdates, setSupportsBulkUpdate, setSupportsCommonTableExpressions, setSupportsCompareCriteriaEquals, setSupportsCompareCriteriaOrdered, setSupportsCompareCriteriaOrderedExclusive, setSupportsCorrelatedSubqueries, setSupportsCorrelatedSubqueryLimit, setSupportsDependentJoins, setSupportsDirectQueryProcedure, setSupportsElementaryOlapOperations, setSupportsExcept, setSupportsExistsCriteria, setSupportsFullDependentJoins, setSupportsFullOuterJoins, setSupportsFunctionsInGroupBy, setSupportsGeographyType, setSupportsGroupBy, setSupportsGroupByMultipleDistinctAggregates, setSupportsGroupByRollup, setSupportsHaving, setSupportsInCriteria, setSupportsInCriteriaSubquery, setSupportsInlineViews, setSupportsInnerJoins, setSupportsInsertWithQueryExpression, setSupportsIntersect, setSupportsIsDistinctCriteria, setSupportsIsNullCriteria, setSupportsLateralJoin, setSupportsLateralJoinCondition, setSupportsLikeCriteria, setSupportsLikeCriteriaEscapeCharacter, setSupportsLikeRegex, setSupportsListAgg, setSupportsMultipleOpenStatements, setSupportsNotCriteria, setSupportsOnlyCorrelatedSubqueries, setSupportsOnlyFormatLiterals, setSupportsOnlyLateralJoinProcedure, setSupportsOnlyLiteralComparison, setSupportsOnlyRelationshipStyleJoins, setSupportsOnlySingleTableGroupBy, setSupportsOnlyTimestampAddLiteral, setSupportsOrCriteria, setSupportsOrderBy, setSupportsOrderByNullOrdering, setSupportsOrderByUnrelated, setSupportsOrderByWithExtendedGrouping, setSupportsOuterJoins, setSupportsPartialFiltering, setSupportsProcedureParameterExpression, setSupportsProcedureTable, setSupportsQuantifiedCompareCriteriaAll, setSupportsQuantifiedCompareCriteriaSome, setSupportsRecursiveCommonTableExpressions, setSupportsRowLimit, setSupportsRowOffset, setSupportsScalarSubqueries, setSupportsScalarSubqueryProjection, setSupportsSearchedCaseExpressions, setSupportsSelectDistinct, setSupportsSelectExpression, setSupportsSelectExpressionArrayType, setSupportsSelectWithoutFrom, setSupportsSelfJoins, setSupportsSetQueryLimitOffset, setSupportsSetQueryOrderBy, setSupportsSimilarTo, setSupportsStringAgg, setSupportsSubqueryCommonTableExpressions, setSupportsSubqueryInOn, setSupportsUnions, setSupportsUpsert, setSupportsWindowDistinctAggregates, setSupportsWindowFrameClause, setSupportsWindowFunctionCumeDist, setSupportsWindowFunctionNthValue, setSupportsWindowFunctionNtile, setSupportsWindowFunctionPercentRank, setSupportsWindowOrderByWithAggregates, setThreadBound, setTransactionSupport, setUseAnsiJoin, setUseBindingsForDependentJoin, supportsAdvancedOlapOperations, supportsAggregatesAvg, supportsAggregatesCount, supportsAggregatesCountBig, supportsAggregatesCountStar, supportsAggregatesDistinct, supportsAggregatesEnhancedNumeric, supportsAggregatesMax, supportsAggregatesMin, supportsAggregatesSum, supportsAliasedTable, supportsArrayAgg, supportsArrayType, supportsBatchedUpdates, supportsBulkUpdate, supportsCommonTableExpressions, supportsCompareCriteriaEquals, supportsCompareCriteriaOrdered, supportsCompareCriteriaOrderedExclusive, supportsCompareCriteriaOrderedExclusive, supportsConvert, supportsCorrelatedSubqueries, supportsCorrelatedSubqueryLimit, supportsDependentJoins, supportsDirectQueryProcedure, supportsElementaryOlapOperations, supportsExcept, supportsExistsCriteria, supportsFormatLiteral, supportsFullDependentJoins, supportsFullOuterJoins, supportsFunctionsInGroupBy, supportsGeographyType, supportsGroupBy, supportsGroupByMultipleDistinctAggregates, supportsGroupByRollup, supportsHaving, supportsInCriteria, supportsInCriteriaSubquery, supportsInlineViews, supportsInnerJoins, supportsInsertWithQueryExpression, supportsIntersect, supportsIsDistinctCriteria, supportsIsNullCriteria, supportsLateralJoin, supportsLateralJoinCondition, supportsLikeCriteria, supportsLikeCriteriaEscapeCharacter, supportsLikeRegex, supportsListAgg, supportsMultipleOpenExecutions, supportsNotCriteria, supportsOnlyCorrelatedSubqueries, supportsOnlyFormatLiterals, supportsOnlyLateralJoinProcedure, supportsOnlyLiteralComparison, supportsOnlyRelationshipStyleJoins, supportsOnlySingleTableGroupBy, supportsOnlyTimestampAddLiteral, supportsOrCriteria, supportsOrderBy, supportsOrderByNullOrdering, supportsOrderByUnrelated, supportsOrderByWithExtendedGrouping, supportsOuterJoins, supportsPartialFiltering, supportsProcedureParameterExpression, supportsProcedureTable, supportsQuantifiedCompareCriteriaAll, supportsQuantifiedCompareCriteriaSome, supportsRecursiveCommonTableExpressions, supportsRowLimit, supportsRowOffset, supportsScalarSubqueries, supportsScalarSubqueryProjection, supportsSearchedCaseExpressions, supportsSelectDistinct, supportsSelectExpression, supportsSelectExpressionArrayType, supportsSelectWithoutFrom, supportsSelfJoins, supportsSetQueryLimitOffset, supportsSetQueryOrderBy, supportsSimilarTo, supportsStringAgg, supportsSubqueryCommonTableExpressions, supportsSubqueryInOn, supportsUnions, supportsUpsert, supportsWindowDistinctAggregates, supportsWindowFrameClause, supportsWindowFunctionCumeDist, supportsWindowFunctionNthValue, supportsWindowFunctionNtile, supportsWindowFunctionPercentRank, supportsWindowOrderByWithAggregates, toString, useAnsiJoin, useBindingsForDependentJoin
-
Methods inherited from class org.teiid.translator.ExecutionFactory
addPushDownFunction, getInstance, getMetadataProcessor, getNativeQueryProcedureName, setNativeQueryProcedureName, setSupportsNativeQueries, supportsNativeQueries
-
-
-
-
Method Detail
-
start
public void start() throws TranslatorException
Description copied from class:ExecutionFactory
Initialize the connector with supplied configuration- Overrides:
start
in classBaseDelegatingExecutionFactory
- Throws:
TranslatorException
-
getCharacterValuesSize
@TranslatorProperty(display="Size of values for CLOB, VARCHAR, etc.", advanced=true) public int getCharacterValuesSize()
-
setCharacterValuesSize
public void setCharacterValuesSize(int charValSize)
-
getIncrementRows
@TranslatorProperty(display="If set to true each value in each column is being incremented with each row", advanced=true) public boolean getIncrementRows()
-
setIncrementRows
public void setIncrementRows(boolean incrementRows)
-
getConnection
public Object getConnection(Object factory) throws TranslatorException
Description copied from class:ExecutionFactory
Return a connection object from the given connection factory. The default implementation assumes a JCAConnectionFactory
. Subclasses should override, if they use another type of connection factory.- Overrides:
getConnection
in classExecutionFactory
- Returns:
- a connection
- Throws:
TranslatorException
- See Also:
ExecutionFactory.getConnection(Object, ExecutionContext)
-
getConnection
public Object getConnection(Object factory, ExecutionContext executionContext) throws TranslatorException
Description copied from class:ExecutionFactory
Return a connection object from the given connection factory. The default implementation assumes a JCAConnectionFactory
. Subclasses should override, if they use another type of connection factory or wish to use theExecutionContext
. By default callsExecutionFactory.getConnection(Object)
- Overrides:
getConnection
in classBaseDelegatingExecutionFactory
executionContext
- null if this is a system request for a connection- Returns:
- a connection
- 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)
-
createExecution
public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException
Description copied from class:ExecutionFactory
Create an execution object for the specified command- Overrides:
createExecution
in classExecutionFactory
- Parameters:
command
- the commandexecutionContext
- Provides information about the context that this command is executing within, such as the identifiers for the command being executedmetadata
- Access to runtime metadata if needed to translate the commandconnection
- 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 classBaseDelegatingExecutionFactory
- Returns:
-
isSourceRequiredForMetadata
public boolean isSourceRequiredForMetadata()
Description copied from class:ExecutionFactory
Flag that indicates if a underlying source connection required for this execution factory to return metadata- Overrides:
isSourceRequiredForMetadata
in classBaseDelegatingExecutionFactory
- Returns:
- true if required
-
getMetadata
public void getMetadata(MetadataFactory metadataFactory, Object conn) throws TranslatorException
Description copied from class:ExecutionFactory
Implement to provide metadata to the metadata for use by the engine. This is the primary method of creating metadata for dynamic VDBs.- Overrides:
getMetadata
in classBaseDelegatingExecutionFactory
conn
- may be null if the source is not required- Throws:
TranslatorException
- to indicate a recoverable error, otherwise a RuntimeException- See Also:
ExecutionFactory.isSourceRequiredForMetadata()
-
getDelegateName
@TranslatorProperty(display="Delegate name", required=false) public String getDelegateName()
- Specified by:
getDelegateName
in interfaceDelegatingExecutionFactory
- Overrides:
getDelegateName
in classBaseDelegatingExecutionFactory
-
returnsSingleUpdateCount
public boolean returnsSingleUpdateCount()
Description copied from class:ExecutionFactory
True if only a single value is returned for the update count. This overrides the default expectation of an update count array for bulk/batch commands. It is expected that every command is successful.- Overrides:
returnsSingleUpdateCount
in classBaseDelegatingExecutionFactory
- Returns:
-
-