Package org.teiid.translator.loopback
Class LoopbackExecution
- java.lang.Object
-
- org.teiid.translator.loopback.LoopbackExecution
-
- All Implemented Interfaces:
Execution
,ProcedureExecution
,ResultSetExecution
,UpdateExecution
public class LoopbackExecution extends Object implements UpdateExecution, ProcedureExecution
Represents the execution of a command.
-
-
Field Summary
Fields Modifier and Type Field Description static Long
DAY_SECONDS
-
Constructor Summary
Constructors Constructor Description LoopbackExecution(Command command, LoopbackExecutionFactory config, ExecutionContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancels the execution abnormally.void
close()
Terminates the execution normally.static String
constructIncrementedString(int characterValuesSize)
Creates string "ABCD...ZABC..." of length characterValueSizevoid
execute()
Execute the associated command.List<?>
getOutputParameterValues()
Get the output parameter values.int[]
getUpdateCounts()
Returns the update counts for the execution.static String
incrementString(String string, BigInteger number)
Increments the string by appending unique number in sequence.List<?>
next()
Retrieves the next row of the resultset.
-
-
-
Field Detail
-
DAY_SECONDS
public static final Long DAY_SECONDS
-
-
Constructor Detail
-
LoopbackExecution
public LoopbackExecution(Command command, LoopbackExecutionFactory config, ExecutionContext context)
-
-
Method Detail
-
constructIncrementedString
public static String constructIncrementedString(int characterValuesSize)
Creates string "ABCD...ZABC..." of length characterValueSize- Parameters:
characterValuesSize
-- Returns:
-
next
public List<?> next() throws TranslatorException, DataNotAvailableException
Description copied from interface:ResultSetExecution
Retrieves the next row of the resultset.- Specified by:
next
in interfaceResultSetExecution
- Returns:
- the next row or null indicating that there are no more results
- Throws:
TranslatorException
DataNotAvailableException
-
execute
public void execute() throws TranslatorException
Description copied from interface:Execution
Execute the associated command. Results will be retrieved through a specific sub-interface call.- Specified by:
execute
in interfaceExecution
- Throws:
TranslatorException
-
getUpdateCounts
public int[] getUpdateCounts() throws DataNotAvailableException, TranslatorException
Description copied from interface:UpdateExecution
Returns the update counts for the execution.
A single positive integer value is expected for non bulk/batch commands.
bulk/batch should return an integer for each value/command. 0 or greater for successful update count, -2 for no info, -3 failure- Specified by:
getUpdateCounts
in interfaceUpdateExecution
- Returns:
- the update counts corresponding to the command executed
- Throws:
DataNotAvailableException
TranslatorException
-
getOutputParameterValues
public List<?> getOutputParameterValues() throws TranslatorException
Description copied from interface:ProcedureExecution
Get the output parameter values. Results should place the return parameter first if it is present, then the IN/OUT and OUT parameters should follow in the order they appeared in the command.- Specified by:
getOutputParameterValues
in interfaceProcedureExecution
- Throws:
TranslatorException
- If an error occurs while retrieving the output value
-
close
public void close()
Description copied from interface:Execution
Terminates the execution normally.
-
cancel
public void cancel() throws TranslatorException
Description copied from interface:Execution
Cancels the execution abnormally. This will happen via a different thread from the one performing the execution, so should be expected to happen in a multi-threaded scenario.- Specified by:
cancel
in interfaceExecution
- Throws:
TranslatorException
-
incrementString
public static String incrementString(String string, BigInteger number)
Increments the string by appending unique number in sequence. Preserves string length.- Parameters:
number
- Number in the sequence of strings (which row)- Returns:
-
-