|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.sqltools.result.internal.model.ResultInstance
public class ResultInstance
A standard implementation of IResultInstance
Constructor Summary | |
---|---|
ResultInstance(IResultManager resultmanager,
OperationCommand command,
java.lang.Runnable terminateHandler)
|
|
ResultInstance(IResultManager resultmanager,
OperationCommand command,
java.lang.Runnable terminateHandler,
IResultInstance parentResult)
|
Method Summary | |
---|---|
int |
calculateStatus()
Calculates the status of this result instance based on the status of its sub-results |
void |
createSubResult(OperationCommand cmd,
java.lang.Runnable terminateHandler)
Creates a sub results |
void |
dispose()
Disposes resources after the instance terminated. |
long |
getElapsedTime()
|
java.util.Date |
getExecuteDate()
Returns the date-time this result instance was created |
java.lang.String |
getExecuteTime()
Returns the time in string this result instance was created |
java.lang.Throwable[] |
getFailThrowables()
Returns the exceptions thrown when generating the result instance |
java.lang.String |
getFileName()
|
int |
getFrequency()
Returns the execution frequency |
ResultItem |
getItem(int index)
Returns the result item at given index (base on 0) |
int |
getItemCount()
Returns number of result items. |
OperationCommand |
getOperationCommand()
Returns the operation command that produces this result instance. |
java.util.List |
getParameters()
Returns the parameters |
IResultInstance |
getParentResult()
Returns the parent result of this result |
java.util.List |
getResults()
|
int |
getStatus()
Returns the current status. |
java.util.List |
getSubResults()
Returns the sub-results of this result |
boolean |
hasTerminateHandler()
Checks if there is a terminate handler |
void |
increaseFrequency()
Inceases the execution frequency by 1, will only be called when this instance is re-executing |
boolean |
isFinished()
Checks if this result is finished |
boolean |
isMayHaveSubResults()
Return the current flag value which indicates that this IResultInstance object may have sub results. |
boolean |
isParentResult()
Checks if the result instance is a parent result |
void |
morePlainMessage(java.lang.String msg)
Appends a plain message. |
void |
moreResultItem(ResultItem item)
Appends a new result item. |
void |
moreResultSet(IResultSetObject resultset)
Appends a new result set. |
void |
moreResultSet(java.sql.ResultSet resultset)
Appends a new result set. |
void |
moreStatusMessage(java.lang.String msg)
Appends a status message, which will be displayed on 'Status' tab when using multiple tabs display mode |
void |
moreThrowable(java.lang.Throwable th)
Appends an exception |
void |
moreUpdateCount(int updateCount)
Appends a new update count. |
void |
reclaimedTransientThings()
When the detail information of this result instance is not needed, this method should be invoked to wait for reclaiming the detail information. |
void |
resetInstance()
Clears all the result items and parameters |
void |
setElapsedTime(long time)
|
void |
setMayHaveSubResults(boolean mayHaveSubResults)
Set new value to the flag which indicates that this IResultInstance object may have sub results. |
void |
showParameters(java.util.List params)
Shows the given parameters on SQL Results View |
void |
terminate()
Terminates the instance. |
void |
updateStatus(int status)
Updates the status of this result instance |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResultInstance(IResultManager resultmanager, OperationCommand command, java.lang.Runnable terminateHandler)
public ResultInstance(IResultManager resultmanager, OperationCommand command, java.lang.Runnable terminateHandler, IResultInstance parentResult)
Method Detail |
---|
public void morePlainMessage(java.lang.String msg)
IResultInstance
morePlainMessage
in interface IResultInstance
msg
- the plain messagepublic void moreStatusMessage(java.lang.String msg)
IResultInstance
moreStatusMessage
in interface IResultInstance
msg
- the status messagepublic void moreUpdateCount(int updateCount)
IResultInstance
moreUpdateCount
in interface IResultInstance
updateCount
- the update countpublic void moreResultSet(java.sql.ResultSet resultset) throws java.sql.SQLException
IResultInstance
moreResultSet
in interface IResultInstance
resultset
- instance of JDBC ResultSet
java.sql.SQLException
- - if a database access error occurspublic void moreResultItem(ResultItem item)
IResultInstance
moreResultItem
in interface IResultInstance
item
- the result itempublic OperationCommand getOperationCommand()
IResultInstance
getOperationCommand
in interface IResultInstance
public int getStatus()
IResultInstance
getStatus
in interface IResultInstance
OperationCommand.STATUS_RUNNING
,
OperationCommand.STATUS_SUCCEEDED
,
OperationCommand.STATUS_FAILED
,
OperationCommand.STATUS_TERMINATED
,
OperationCommand.STATUS_STARTED
,
OperationCommand.STATUS_CRITICAL_ERROR
,
OperationCommand.STATUS_WARNING
public boolean isFinished()
IResultInstance
isFinished
in interface IResultInstance
true
if this instance finishspublic ResultItem getItem(int index)
IResultInstance
getItem
in interface IResultInstance
index
- the index
public int getItemCount()
IResultInstance
getItemCount
in interface IResultInstance
public void terminate()
IResultInstance
terminate
in interface IResultInstance
public void dispose()
IResultInstance
dispose
in interface IResultInstance
public java.lang.String getExecuteTime()
IResultInstance
getExecuteTime
in interface IResultInstance
public java.util.Date getExecuteDate()
IResultInstance
getExecuteDate
in interface IResultInstance
public void updateStatus(int status)
IResultInstance
updateStatus
in interface IResultInstance
status
- the new statusOperationCommand.STATUS_STARTED
,
OperationCommand.STATUS_RUNNING
,
OperationCommand.STATUS_SUCCEEDED
,
OperationCommand.STATUS_FAILED
,
OperationCommand.STATUS_TERMINATED
,
OperationCommand.STATUS_WARNING
,
OperationCommand.STATUS_CRITICAL_ERROR
public void resetInstance()
IResultInstance
resetInstance
in interface IResultInstance
public void moreResultSet(IResultSetObject resultset)
IResultInstance
moreResultSet
in interface IResultInstance
resultset
- the IResultSetObject
instancepublic void showParameters(java.util.List params)
IResultInstance
showParameters
in interface IResultInstance
params
- the Parameter
instances listParameter
public boolean hasTerminateHandler()
IResultInstance
hasTerminateHandler
in interface IResultInstance
true
if there is a terminate handlerpublic java.util.List getParameters()
IResultInstance
getParameters
in interface IResultInstance
Parameter
instances listpublic int getFrequency()
IResultInstance
getFrequency
in interface IResultInstance
public void increaseFrequency()
IResultInstance
increaseFrequency
in interface IResultInstance
public java.lang.Throwable[] getFailThrowables()
IResultInstance
getFailThrowables
in interface IResultInstance
public void moreThrowable(java.lang.Throwable th)
IResultInstance
moreThrowable
in interface IResultInstance
th
- the exceptionpublic void createSubResult(OperationCommand cmd, java.lang.Runnable terminateHandler)
IResultInstance
createSubResult
in interface IResultInstance
cmd
- the operation request object of the new resultterminateHandler
- the terminate handlerpublic java.util.List getSubResults()
IResultInstance
getSubResults
in interface IResultInstance
public IResultInstance getParentResult()
IResultInstance
getParentResult
in interface IResultInstance
public boolean isParentResult()
IResultInstance
isParentResult
in interface IResultInstance
true
if it is a parent result, false
if it is a sub-resultpublic int calculateStatus()
IResultInstance
calculateStatus
in interface IResultInstance
public boolean isMayHaveSubResults()
IResultInstance
isMayHaveSubResults
in interface IResultInstance
public void setMayHaveSubResults(boolean mayHaveSubResults)
IResultInstance
setMayHaveSubResults
in interface IResultInstance
mayHaveSubResults
- the new flag valuepublic java.lang.String getFileName()
public long getElapsedTime()
public void setElapsedTime(long time)
public java.util.List getResults()
public void reclaimedTransientThings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |