| org.pentaho.plugin.ComponentBase org.pentaho.plugin.sql.SQLBaseComponent
All known Subclasses: org.pentaho.plugin.sql.SQLLookupRule,
Method Summary | |
public void | dispose() dispose of the resultset, and if the owner, dispose of the connection. | public IPentahoResultSet | doQuery(SQLConnection sqlConnection, String query, boolean forwardOnlyResultset) | public void | done() nothing to do in done call from runtime context. | protected boolean | executeAction() determines state of component, and executes accordingly.
various inputs that impact the state include:
live - returns a live result set vs. | public IPentahoResultSet | executePrepared(Map preparedParams) executes a prepared method that returns a result set
executePrepared looks up any "PREPARELATER" params
in the preparedParams map.
Parameters: preparedParams - a map of possible parameters. | protected IPentahoConnection | getConnection() | protected IPentahoConnection | getConnection(IPentahoConnection defaultConnection) This method retrieves a connection based on the components
inputs. | public IPentahoConnection | getDatasourceConnection() attempt to aquire a connection. | abstract public Log | getLogger() | protected IPentahoMetaData | getMetadata(IPentahoResultSet resultSet, boolean live) returns metadata based on the result set. | public String | getQuery() | abstract public String | getResultOutputName() | public IPentahoResultSet | getResultSet() | public boolean | init() | protected boolean | prepareQuery(String rawQuery) called when in prepared-component mode, this method populates the preparedQuery string and
preparedParameters object. | public int | resolveParameter(String template, String parameter, Matcher parameterMatcher, int copyStart, StringBuffer results) This method is called when TemplateUtil.applyTemplate() encounters a parameter. | protected boolean | runQuery(String rawQuery, boolean live) executes the specified query template. | public IPentahoConnection | shareConnection() return this class's connection. | public boolean | validateAction() validates the action. | abstract public boolean | validateSystemSettings() | protected void | waitFor(int millis) |
PREPARE_PARAMETER_PREFIX | final public static String PREPARE_PARAMETER_PREFIX(Code) | | |
connection | protected IPentahoConnection connection(Code) | | reference to connection object
|
connectionOwner | protected boolean connectionOwner(Code) | | is set to false if using another IPreparedComponents connection vs own
|
preparedParameters | protected List preparedParameters(Code) | | stores the prepared parameters for later use
|
preparedQuery | String preparedQuery(Code) | | stores the prepared query for later use
|
dispose | public void dispose()(Code) | | dispose of the resultset, and if the owner, dispose of the connection.
|
done | public void done()(Code) | | nothing to do in done call from runtime context.
|
executeAction | protected boolean executeAction()(Code) | | determines state of component, and executes accordingly.
various inputs that impact the state include:
live - returns a live result set vs. an in memory copy
transform - transform a result set based on additional inputs
prepared_component - if available, use existing connection from prepared component
max_rows - sets the number of rows that should be returned in result sets
The specified output also impacts the state of the execution. If prepared_component is defined
as an output, setup the query but delay execution.
|
executePrepared | public IPentahoResultSet executePrepared(Map preparedParams)(Code) | | executes a prepared method that returns a result set
executePrepared looks up any "PREPARELATER" params
in the preparedParams map.
Parameters: preparedParams - a map of possible parameters. result set |
getConnection | protected IPentahoConnection getConnection()(Code) | | pass through to getConnection(defaultConnection)
connection |
getConnection | protected IPentahoConnection getConnection(IPentahoConnection defaultConnection)(Code) | | This method retrieves a connection based on the components
inputs.
Parameters: defaultConnection - a default connection to use if no other is available new connection object |
getDatasourceConnection | public IPentahoConnection getDatasourceConnection()(Code) | | attempt to aquire a connection. if connection isn't available, wait a certain period of time
before trying again.
connection |
getLogger | abstract public Log getLogger()(Code) | | |
getMetadata | protected IPentahoMetaData getMetadata(IPentahoResultSet resultSet, boolean live)(Code) | | returns metadata based on the result set. if not live, create an in memory version
Parameters: resultSet - result set object to find metadata Parameters: live - if false, create an in memory version metadata object |
getResultOutputName | abstract public String getResultOutputName()(Code) | | |
getResultSet | public IPentahoResultSet getResultSet()(Code) | | returns the result set object
pentaho result set |
init | public boolean init()(Code) | | nothing is done in the init function
true always |
prepareQuery | protected boolean prepareQuery(String rawQuery)(Code) | | called when in prepared-component mode, this method populates the preparedQuery string and
preparedParameters object.
Parameters: rawQuery - |
resolveParameter | public int resolveParameter(String template, String parameter, Matcher parameterMatcher, int copyStart, StringBuffer results)(Code) | | This method is called when TemplateUtil.applyTemplate() encounters a parameter.
TemplateUtil.applyTemplate is called when someone makes a call to applyInputsToFormat()
In this class it is called in the above "runQuery()" method.
Parameters: template - the source string Parameters: parameter - the parameter value Parameters: parameterMatcher - the regex parameter matcher Parameters: copyStart - the start of the copy Parameters: results - the output result the next copystart |
runQuery | protected boolean runQuery(String rawQuery, boolean live)(Code) | | executes the specified query template. The query template is first formatted and then
executed. If live, the original result set is made available as an output. If not live,
the result set is converted into memory and the connection and live result set are closed.
Parameters: rawQuery - query template Parameters: live - returns original result set if true, memory result set if false true if successful |
shareConnection | public IPentahoConnection shareConnection()(Code) | | return this class's connection. This implements the IPreparedComponent
interface, which may share its connection with others.
connection object |
validateAction | public boolean validateAction()(Code) | | validates the action. checks to verify inputs are available to execute
- verify query is available
- verify connection is available, via jndi, connection string, or prepared component
- verify output is specified
|
validateSystemSettings | abstract public boolean validateSystemSettings()(Code) | | |
waitFor | protected void waitFor(int millis)(Code) | | pause the thread a certain number of milliseconds
Parameters: millis - time to sleep |
Methods inherited from org.pentaho.plugin.ComponentBase | protected void addTempParameter(String name, IActionParameter param)(Code)(Java Doc) protected void addTempParameterObject(String name, Object paramObject)(Code)(Java Doc) protected String applyInputsToFormat(String format)(Code)(Java Doc) protected void audit(String messageType, String message, String value, int duration)(Code)(Java Doc) protected void createFeedbackParameter(IActionParameter actionParam)(Code)(Java Doc) protected void createFeedbackParameter(SelectionMapper selMap, String fieldName, Object defaultValues)(Code)(Java Doc) protected void createFeedbackParameter(SelectionMapper selMap, String fieldName, Object defaultValues, boolean optional)(Code)(Java Doc) protected void createFeedbackParameter(String fieldName, String displayName, String hint, String defaultValue, boolean visible)(Code)(Java Doc) protected void createFeedbackParameter(String fieldName, String displayName, String hint, String defaultValue, boolean visible, boolean optional)(Code)(Java Doc) public void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle)(Code)(Java Doc) public void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle, boolean optional)(Code)(Java Doc) public String createNewInstance(boolean persisted, Map parameters, boolean forceImmediateWrite)(Code)(Java Doc) abstract public void done()(Code)(Java Doc) public int execute()(Code)(Java Doc) abstract protected boolean executeAction() throws Throwable(Code)(Java Doc) protected boolean feedbackAllowed()(Code)(Java Doc) public ActionDefinition getActionDefinition()(Code)(Java Doc) public String getActionName()(Code)(Java Doc) public String getActionTitle()(Code)(Java Doc) public Node getComponentDefinition()(Code)(Java Doc) public Node getComponentDefinition(boolean process)(Code)(Java Doc) protected String getContentUrl(IContentItem contentItem)(Code)(Java Doc) protected DataSource getDataSource(String parameterName)(Code)(Java Doc) protected OutputStream getDefaultOutputStream(String mimeType)(Code)(Java Doc) protected OutputStream getFeedbackOutputStream()(Code)(Java Doc) public String getId()(Code)(Java Doc) public String getInitFailMessage()(Code)(Java Doc) public boolean getInitOk()(Code)(Java Doc) protected boolean getInputBooleanValue(String inputName, boolean defaultValue)(Code)(Java Doc) protected long getInputLongValue(String inputName, long defaultValue)(Code)(Java Doc) protected Set getInputNames()(Code)(Java Doc) protected IActionParameter getInputParameter(String parameterName)(Code)(Java Doc) protected InputStream getInputStream(String inputName)(Code)(Java Doc) protected String getInputStringValue(String inputName)(Code)(Java Doc) protected String getInputStringValue(String inputName, boolean applyTemplates)(Code)(Java Doc) protected Object getInputValue(String inputName)(Code)(Java Doc) public String getInstanceId()(Code)(Java Doc) public String getLogId()(Code)(Java Doc) public String getObjectName()(Code)(Java Doc) protected IContentItem getOutputContentItem(String mimeType)(Code)(Java Doc) protected IContentItem getOutputContentItem(String outputName, String mimeType)(Code)(Java Doc) protected IContentItem getOutputItem(String outputName, String mimeType, String extension)(Code)(Java Doc) protected IActionParameter getOutputItem(String outputName)(Code)(Java Doc) protected Set getOutputNames()(Code)(Java Doc) protected int getOutputPreference()(Code)(Java Doc) public String getProcessId()(Code)(Java Doc) protected IActionResource getResource(String resourceName)(Code)(Java Doc) public String getResourceAsString(IActionResource resource)(Code)(Java Doc) protected DataSource getResourceDataSource(IActionResource resource) throws FileNotFoundException(Code)(Java Doc) protected InputStream getResourceInputStream(IActionResource resource) throws FileNotFoundException(Code)(Java Doc) protected Set getResourceNames()(Code)(Java Doc) public IRuntimeContext getRuntimeContext()(Code)(Java Doc) public IPentahoSession getSession()(Code)(Java Doc) protected Object getSetting(String name)(Code)(Java Doc) protected String getSolutionName()(Code)(Java Doc) protected String getSolutionPath()(Code)(Java Doc) protected String getStringSetting(String name)(Code)(Java Doc) abstract public boolean init()(Code)(Java Doc) public void inputMissingError(String paramName)(Code)(Java Doc) protected boolean isDefinedInput(String inputName)(Code)(Java Doc) protected boolean isDefinedOutput(String outputName)(Code)(Java Doc) protected boolean isDefinedResource(String resourceName)(Code)(Java Doc) protected boolean isPromptPending()(Code)(Java Doc) public void outputMissingError(String paramName)(Code)(Java Doc) public void promptNeeded()(Code)(Java Doc) public void promptNow()(Code)(Java Doc) public int resolveParameter(String template, String parameterName, Matcher parameterMatcher, int copyStart, StringBuffer result)(Code)(Java Doc) public void resourceComponentSettingError(String paramName)(Code)(Java Doc) public void resourceMissingError(String paramName)(Code)(Java Doc) protected void saveSetting(String name, Object value)(Code)(Java Doc) public void setActionDefinition(ActionDefinition actionDefinition)(Code)(Java Doc) public void setActionName(String actionName)(Code)(Java Doc) public void setComponentDefinition(Node componentDefinition)(Code)(Java Doc) protected void setFeedbackMimeType(String mimeType)(Code)(Java Doc) public void setInstanceId(String instanceId)(Code)(Java Doc) protected void setOutputMimeType(String mimeType)(Code)(Java Doc) protected void setOutputMimeType(String outputName, String mimeType)(Code)(Java Doc) protected void setOutputValue(String outputName, Object value)(Code)(Java Doc) public void setProcessId(String processId)(Code)(Java Doc) public void setRuntimeContext(IRuntimeContext runtimeContext)(Code)(Java Doc) public void setSession(IPentahoSession session)(Code)(Java Doc) final public int validate()(Code)(Java Doc) abstract protected boolean validateAction()(Code)(Java Doc) abstract protected boolean validateSystemSettings()(Code)(Java Doc)
|
|
|