org.eclipse.datatools.sqltools.plan.internal.core
Class PlanInstance

java.lang.Object
  extended by org.eclipse.datatools.sqltools.plan.internal.core.PlanInstance
All Implemented Interfaces:
IPlanInstance

public class PlanInstance
extends java.lang.Object
implements IPlanInstance

Implementation of IPlanInstance

Author:
Hui Cao

Field Summary
 
Fields inherited from interface org.eclipse.datatools.sqltools.plan.internal.IPlanInstance
FAILED, RUNNING, SUCCESS
 
Constructor Summary
PlanInstance(PlanManager planManager, PlanRequest planRequest)
           
 
Method Summary
 void finishFail(java.lang.Throwable th)
          Failed because of the throwable
 void finishSuccess(java.lang.String rawPlan)
          Successfully finished with the return plan's raw data
 java.lang.Throwable getFailThrowable()
          Returns the fail reason throwable
 IExecutionPlanDocument[] getPlanDocuments()
          Returns the execution plan documents of this plan.
 PlanRequest getPlanRequest()
          Returns the plan request
 java.lang.String getRawPlan()
          Returns the raw data of this plan
 int getStatus()
          Returns the current status
 boolean isFinished()
          Checks if this plan is finished or not
 void setPlanDocuments(IExecutionPlanDocument[] docs)
          Sets the execution plan documents, they should be parsed from the raw data.
 void setPlanRequest(PlanRequest planRequest)
          Sets the plan request of this plan
 void setRawPlan(java.lang.String plan)
          Sets the raw data for this plan
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlanInstance

public PlanInstance(PlanManager planManager,
                    PlanRequest planRequest)
Method Detail

finishFail

public void finishFail(java.lang.Throwable th)
Description copied from interface: IPlanInstance
Failed because of the throwable

Specified by:
finishFail in interface IPlanInstance
Parameters:
th - the throwable

finishSuccess

public void finishSuccess(java.lang.String rawPlan)
Description copied from interface: IPlanInstance
Successfully finished with the return plan's raw data

Specified by:
finishSuccess in interface IPlanInstance
Parameters:
rawPlan - the plan's raw data

getFailThrowable

public java.lang.Throwable getFailThrowable()
Description copied from interface: IPlanInstance
Returns the fail reason throwable

Specified by:
getFailThrowable in interface IPlanInstance
Returns:
null if not finished yet, or not fail.

getPlanRequest

public PlanRequest getPlanRequest()
Description copied from interface: IPlanInstance
Returns the plan request

Specified by:
getPlanRequest in interface IPlanInstance
Returns:
the plan request

getRawPlan

public java.lang.String getRawPlan()
Description copied from interface: IPlanInstance
Returns the raw data of this plan

Specified by:
getRawPlan in interface IPlanInstance
Returns:
the raw data of this plan

getStatus

public int getStatus()
Description copied from interface: IPlanInstance
Returns the current status

Specified by:
getStatus in interface IPlanInstance
Returns:
@see #RUNNING
See Also:
IPlanInstance.SUCCESS, IPlanInstance.FAILED

isFinished

public boolean isFinished()
Description copied from interface: IPlanInstance
Checks if this plan is finished or not

Specified by:
isFinished in interface IPlanInstance
Returns:
true if finished (success or fail), false otherwise

setPlanRequest

public void setPlanRequest(PlanRequest planRequest)
Sets the plan request of this plan

Parameters:
planRequest - the plan request

setRawPlan

public void setRawPlan(java.lang.String plan)
Sets the raw data for this plan

Parameters:
rawPlan - the plan's raw data

getPlanDocuments

public IExecutionPlanDocument[] getPlanDocuments()
Description copied from interface: IPlanInstance
Returns the execution plan documents of this plan. The documents are parsed from raw data of this execution plan

Specified by:
getPlanDocuments in interface IPlanInstance
Returns:
the execution plan documents of this plan

setPlanDocuments

public void setPlanDocuments(IExecutionPlanDocument[] docs)
Description copied from interface: IPlanInstance
Sets the execution plan documents, they should be parsed from the raw data. Note: this is for performance consideration, that is, we don't need to parse the raw data every time when it is shown

Specified by:
setPlanDocuments in interface IPlanInstance
Parameters:
docs - the execution plan documents