|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.massimo.tools.scriptrunner.context.AbstractExecutionContext
com.massimo.tools.scriptrunner.context.PostgresExecutionContext
public class PostgresExecutionContext
This is backed by Postgres database tables and schema.
These must be installed before this can be used.
A audit datasource must be configured, identified by the dataSourceName srAudit.
Field Summary | |
---|---|
protected Connection |
auditConnection
|
protected static String |
SQL_IS_FINISHED
|
protected static String |
SQL_LOG_INSERT
|
protected static String |
SQL_NEXT_RUN_ID
|
protected static String |
SQL_TASK_FINISHED
|
protected static String |
SQL_TASK_PROGRESS
|
protected static String |
SQL_TASK_START
|
Fields inherited from class com.massimo.tools.scriptrunner.context.AbstractExecutionContext |
---|
lastException, runId |
Constructor Summary | |
---|---|
PostgresExecutionContext(Element task)
|
Method Summary | |
---|---|
protected void |
finalize()
Attempt to close the database conenction. |
void |
finished(String taskName,
int lastRowCommitted)
Audit trail: record successful finish of Task execution |
protected String |
generateRunIdentifier(Map<String,String> properties)
The run identifier is generated by a database sequence. |
protected org.apache.log4j.Logger |
getLogger()
|
protected void |
handleSQLException(String stmtText,
SQLException se,
String errorText)
|
boolean |
isFinished(String taskName)
Audit trail: check whether Task has already been executed in this run |
void |
log(String taskName,
int log_code,
String message,
int lastRowProcessed,
String primaryKey)
Log informational messages |
void |
progress(String taskName,
int lastStepProcessed,
String key)
Audit trail: Task has finished executing its lastStepProcessed step |
protected void |
refreshConnection()
|
int |
start(String taskName)
Audit trail: start Task execution |
Methods inherited from class com.massimo.tools.scriptrunner.context.AbstractExecutionContext |
---|
getLastException, getRunIdentifier, log, setLastException, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Connection auditConnection
protected static final String SQL_IS_FINISHED
protected static final String SQL_LOG_INSERT
protected static final String SQL_NEXT_RUN_ID
protected static final String SQL_TASK_FINISHED
protected static final String SQL_TASK_PROGRESS
protected static final String SQL_TASK_START
Constructor Detail |
---|
public PostgresExecutionContext(Element task) throws SRException
task
-
SRException
Method Detail |
---|
protected void finalize() throws Throwable
finalize
in class Object
Throwable
public void finished(String taskName, int lastRowCommitted) throws SRException
SRException
protected String generateRunIdentifier(Map<String,String> properties) throws SRException
generateRunIdentifier
in class AbstractExecutionContext
SRException
protected org.apache.log4j.Logger getLogger()
getLogger
in class AbstractExecutionContext
protected void handleSQLException(String stmtText, SQLException se, String errorText) throws SRException
stmtText
- se
- errorText
-
SRException
public boolean isFinished(String taskName) throws SRException
SRException
public void log(String taskName, int log_code, String message, int lastRowProcessed, String primaryKey) throws SRException
log_code
- The Task constants or an error codeprimaryKey
- A identifier for the last step, e.g. a database row's primary key value. May be empty.
SRException
public void progress(String taskName, int lastStepProcessed, String key) throws SRException
lastStepProcessed
- On re-start, this value will returned by ExecutionContext.start(String)key
- A identifier for the last step, e.g. a database row's primary key value. May be empty.
SRException
protected void refreshConnection() throws SRException
SRException
public int start(String taskName) throws SRException
SRException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |