|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.wgen.op.Op
Command-pattern object that encapsulates some database operations or business logic.
| Field Summary | |
private java.lang.Long |
_callersUserId
The userID of the end-user responsible for causing the instantiation of this Op. |
private java.lang.String |
_defaultDataSourceName
The default DataSource name for DatabaseCall objects instantiated by the Op's helper methods. |
protected OpExecutor |
_opExecutor
The executor of the Op. |
protected java.util.Map |
_options
Options for this Op's execution. |
protected Op |
_rootOp
The Op, if any, that may have been responsible for this Op's instantiation. |
private TraceKey |
_traceKey
The trace key for the request creating this Op. |
protected org.apache.log4j.Logger |
LOG
Logger for the implementation class. |
private static long |
serialVersionUID
UID for serialization compatibility. |
| Constructor Summary | |
protected |
Op(Op callingOp)
Constructor to be used by an Op that needs to instantiate another Op. |
|
Op(TraceKey traceKey)
Default constructor must use a TraceKey object. |
| Method Summary | |
protected abstract void |
_execute(CallExecutor exec)
Execute the body of the Op. |
Op |
execute()
Invoke the OpExecutor, or if the OpExecutor is null, use the OpExecutorFactory to create one. |
java.lang.String |
getAmountOfWorkDone()
Characterizes the amount of work done by the Op, such as number of records retrieved. |
java.lang.Long |
getCallersUserId()
The ID of the end-user responsible for the instantiation and execution of this Op. |
java.lang.String |
getDefaultDataSourceName()
The datasource to be used for new DatabaseCalls provided by this Op. |
org.apache.log4j.Logger |
getLogger()
The Logger associated with the implementation class. |
java.util.Map |
getOptions()
The execution options for this Op. |
Op |
getRootOp()
The top-most Op in the execution. |
TraceKey |
getTraceKey()
The traceKey for this Op identifying the request responsible for the Op's instantiation and execution. |
protected DatabaseCall |
makeFunction(java.lang.String callText)
Convenience method to create a call declared as a database function with the Op's defaultDataSourceName. |
protected DatabaseCall |
makeProcedure(java.lang.String callText)
Convenience method to create a call declared as a database procedure with the Op's defaultDataSourceName. |
protected DatabaseCall |
makeQuery(java.lang.String callText)
Convenience method to create a call declared as a SQL query with the Op's defaultDataSourceName. |
void |
setDefaultDataSourceName(java.lang.String defaultDataSourceName)
Change the datasource to be used for new DatabaseCalls created in the make* convenience methods. |
void |
setOpExecutor(OpExecutor executor)
The executor for this Op. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final long serialVersionUID
protected transient org.apache.log4j.Logger LOG
private final TraceKey _traceKey
protected transient OpExecutor _opExecutor
protected final Op _rootOp
private final java.lang.Long _callersUserId
protected java.util.Map _options
private java.lang.String _defaultDataSourceName
| Constructor Detail |
public Op(TraceKey traceKey)
traceKey - the traceKey identifying the request responsible for the
instantiation and execution of this Op
java.lang.NullPointerException - if traceKey or traceKey.getUserId() is nullParamTriggerState.TRACE_KEY_USER_DATA_KEY,
OpModule.getDataSourceName()protected Op(Op callingOp)
callingOp - the Op responsible for this Op's instantiation and execution
java.lang.NullPointerException - if the callingOp is null| Method Detail |
public final java.lang.Long getCallersUserId()
public final TraceKey getTraceKey()
public final Op getRootOp()
public void setDefaultDataSourceName(java.lang.String defaultDataSourceName)
defaultDataSourceName - the name of the datasource to be used for new
DatabaseCalls instantiated by the make* convenience methods.makeFunction(java.lang.String),
makeProcedure(java.lang.String),
makeQuery(java.lang.String)public java.lang.String getDefaultDataSourceName()
public java.util.Map getOptions()
Op(net.wgen.op.logging.TraceKey),
ParamTriggerState.TRACE_KEY_USER_DATA_KEYpublic org.apache.log4j.Logger getLogger()
public void setOpExecutor(OpExecutor executor)
executor - the executor to use for execution
public Op execute()
throws OpException
OpException
protected abstract void _execute(CallExecutor exec)
throws OpException
exec - what will perform DB or other calls
OpExceptionpublic java.lang.String getAmountOfWorkDone()
protected DatabaseCall makeFunction(java.lang.String callText)
callText - the function name
protected DatabaseCall makeProcedure(java.lang.String callText)
callText - the procedure name
protected DatabaseCall makeQuery(java.lang.String callText)
callText - the parameterized query text
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||