com.simba.dsi.dataengine.utilities
Class ExecutionContext

java.lang.Object
  extended by com.simba.dsi.dataengine.utilities.ExecutionContext

public class ExecutionContext
extends java.lang.Object

An ExecutionContext holds information about parameters used for a single execution of a query. Input parameter values are provided. Output parameter values and execution status should be set upon execution.


Constructor Summary
protected ExecutionContext(java.util.ArrayList<ParameterInputValue> inputs, java.util.ArrayList<ParameterOutputValue> outputs)
          Constructor.
protected ExecutionContext(java.util.ArrayList<ParameterInputValue> inputs, java.util.ArrayList<ParameterOutputValue> outputs, ParameterGeneratedValues generatedParams)
          Constructor.
 
Method Summary
 ParameterGeneratedValues getGeneratedParameters()
          Returns the raw ParameterGeneratedValues.
 java.util.ArrayList<ParameterInputValue> getInputs()
          Returns input parameter values for the context.
 java.util.ArrayList<ParameterOutputValue> getOutputs()
          Returns output parameter value holders for the context, which should be filled in upon successful execution (execution with a status of EXECUTION_SUCCESS or EXECUTION_SUCCESS_WITH_INFO).
 int[] getSelectedGeneratedColumns(java.util.List<IColumn> columnMetadata)
          Returns generated parameter values for the context based on what was selected in the query.
static int[] getSelectedGeneratedColumns(ParameterGeneratedValues generated, java.util.List<IColumn> columnMetadata)
          Returns generated parameter values for the context based on what was selected in the query.
 ExecutionContextStatus getStatus()
          Gets the execution status for this context.
 void setInputParam(int paramIndex, ParameterInputValue parameterInputValue)
          The the parameter input value for the parameter with the given index.
 void setStatus(ExecutionContextStatus status)
          Sets the execution status for this context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionContext

protected ExecutionContext(java.util.ArrayList<ParameterInputValue> inputs,
                           java.util.ArrayList<ParameterOutputValue> outputs)
Constructor.

Parameters:
inputs - Holds ParameterInputValues for the context's input parameter values.
outputs - Holds ParameterOutputValues which should be filled in on successful execution.

ExecutionContext

protected ExecutionContext(java.util.ArrayList<ParameterInputValue> inputs,
                           java.util.ArrayList<ParameterOutputValue> outputs,
                           ParameterGeneratedValues generatedParams)
Constructor.

Parameters:
inputs - Holds ParameterInputValues for the context's input parameter values.
outputs - Holds ParameterOutputValues which should be filled in on successful execution.
generatedParams - Holds ParameterGeneratedValues holding the context's generated parameter values.
Method Detail

getStatus

public ExecutionContextStatus getStatus()
Gets the execution status for this context.

Returns:
The execution status for this context.

setStatus

public void setStatus(ExecutionContextStatus status)
Sets the execution status for this context.

Parameters:
status - The new execution status for this context.

getInputs

public java.util.ArrayList<ParameterInputValue> getInputs()
Returns input parameter values for the context.

Returns:
An ArrayList of ParameterInputValues.

getOutputs

public java.util.ArrayList<ParameterOutputValue> getOutputs()
Returns output parameter value holders for the context, which should be filled in upon successful execution (execution with a status of EXECUTION_SUCCESS or EXECUTION_SUCCESS_WITH_INFO).

Returns:
An ArrayList of ParameterOutputValues.

getGeneratedParameters

public ParameterGeneratedValues getGeneratedParameters()
Returns the raw ParameterGeneratedValues.

Returns:
A ParameterGeneratedValues containing either and int, int[], String[] which match the various parameters types that a user could use to get generated keys.

getSelectedGeneratedColumns

public int[] getSelectedGeneratedColumns(java.util.List<IColumn> columnMetadata)
                                  throws com.simba.support.exceptions.ErrorException
Returns generated parameter values for the context based on what was selected in the query. If AutoGeneratedKeys is False return nothing, if true then return everything. If ColumnIndexes is set then validate and return it. If ColumnNames is set then map the names to column indexes based on the columnMetadata

Parameters:
columnMetadata - A list of columns that should be selected from
Returns:
An array of column indexes that should be selected.
Throws:
com.simba.support.exceptions.ErrorException

getSelectedGeneratedColumns

public static int[] getSelectedGeneratedColumns(ParameterGeneratedValues generated,
                                                java.util.List<IColumn> columnMetadata)
                                         throws com.simba.support.exceptions.ErrorException
Returns generated parameter values for the context based on what was selected in the query. If AutoGeneratedKeys is False return nothing, if true then return everything. If ColumnIndexes is set then validate and return it. If ColumnNames is set then map the names to column indexes based on the columnMetadata

Parameters:
generated - A ParameterGeneratedValues object
columnMetadata - A list of columns that should be selected from
Returns:
An array of column indexes that should be selected.
Throws:
com.simba.support.exceptions.ErrorException

setInputParam

public void setInputParam(int paramIndex,
                          ParameterInputValue parameterInputValue)
The the parameter input value for the parameter with the given index.

Parameters:
paramIndex - The 0-based parameter index.
parameterInputValue - The parameter input value.


Copyright © 2006-2014 Simba Technologies Incorporated. All Rights Reserved.