org.teiid.query.util
Class CommandContext

java.lang.Object
  extended by org.teiid.query.util.CommandContext
All Implemented Interfaces:
java.lang.Cloneable, CommandContext

public class CommandContext
extends java.lang.Object
implements java.lang.Cloneable, CommandContext

Defines the context that a command is processing in. For example, this defines who is processing the command and why. Also, this class (or subclasses) provide a means to pass context-specific information between users of the query processor framework.


Constructor Summary
CommandContext()
           
CommandContext(java.lang.Object processorID, java.lang.String connectionID, java.lang.String userName, java.io.Serializable commandPayload, java.lang.String vdbName, int vdbVersion, java.util.Properties envProperties, boolean collectNodeStatistics)
          Construct a new context.
CommandContext(java.lang.Object processorID, java.lang.String connectionID, java.lang.String userName, java.lang.String vdbName, int vdbVersion)
          Construct a new context.
 
Method Summary
 CommandContext clone()
           
 BufferManager getBufferManager()
           
 int getCallStackDepth()
           
 boolean getCollectNodeStatistics()
           
 java.io.Serializable getCommandPayload()
           
 java.lang.String getConnectionID()
           
 int getConnectorBatchSize()
           
 int getDeterminismLevel()
           
 java.util.Properties getEnvironmentProperties()
           
 java.lang.Object getFromContext(Expression expression)
           
 TempTableStore getGlobalTableStore()
           
 java.util.Set<java.lang.String> getGroups()
           
 QueryMetadataInterface getMetadata()
           
 double getNextRand()
           
 double getNextRand(long seed)
           
 org.teiid.dqp.internal.process.PreparedPlan getPlan(java.lang.String key)
           
 PlanToProcessConverter getPlanToProcessConverter()
           
 int getProcessorBatchSize()
           
 java.lang.Object getProcessorID()
           
 QueryProcessor.ProcessorFactory getQueryProcessorFactory()
           
 SecurityFunctionEvaluator getSecurityFunctionEvaluator()
           
 java.util.TimeZone getServerTimeZone()
           
 TempTableStore getTempTableStore()
           
 long getTimeoutEnd()
           
 long getTimeSliceEnd()
           
 java.lang.String getUserName()
           
 VariableContext getVariableContext()
           
 java.lang.String getVdbName()
           
 int getVdbVersion()
           
 boolean isNonBlocking()
           
 boolean isResultSetCacheEnabled()
           
 void popCall()
           
 void pushCall(java.lang.String value)
           
 void pushVariableContext(VariableContext toPush)
           
 void putPlan(java.lang.String key, org.teiid.dqp.internal.process.PreparedPlan plan, int determinismLevel)
           
 int resetDeterminismLevel()
           
 void setBufferManager(BufferManager bm)
           
 void setCollectNodeStatistics(boolean collectNodeStatistics)
           
 void setCommandPayload(java.io.Serializable commandPayload)
           
 void setConnectionID(java.lang.String connectionID)
          Sets the connectionID.
 void setConnectorBatchSize(int connectorBatchSize)
           
 void setDeterminismLevel(int level)
           
 void setEnvironmentProperties(java.util.Properties properties)
           
 void setGlobalTableStore(TempTableStore tempTableStore)
           
 void setGroups(java.util.Set<java.lang.String> groups)
           
 void setMetadata(QueryMetadataInterface metadata)
           
 void setNonBlocking(boolean nonBlocking)
           
 void setPlanToProcessConverter(PlanToProcessConverter planToProcessConverter)
           
 void setPreparedPlanCache(org.teiid.dqp.internal.process.SessionAwareCache<org.teiid.dqp.internal.process.PreparedPlan> cache)
           
 void setProcessorBatchSize(int processorBatchSize)
           
 void setProcessorID(java.lang.Object object)
           
 void setQueryProcessorFactory(QueryProcessor.ProcessorFactory queryProcessorFactory)
           
 void setResultSetCacheEnabled(boolean resultSetCacheEnabled)
           
 void setSecurityFunctionEvaluator(SecurityFunctionEvaluator securityFunctionEvaluator)
           
 void setTempTableStore(TempTableStore tempTableStore)
           
 void setTimeoutEnd(long timeoutEnd)
           
 void setTimeSliceEnd(long timeSliceEnd)
           
 void setUserName(java.lang.String userName)
          Sets the userName.
 void setValidateXML(boolean validateXML)
           
 void setVariableContext(VariableContext variableContext)
           
 void setVdbName(java.lang.String vdbName)
          Sets the vdbName.
 void setVdbVersion(int vdbVersion)
          Sets the vdbVersion.
 java.lang.String toString()
           
 boolean validateXML()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandContext

public CommandContext(java.lang.Object processorID,
                      java.lang.String connectionID,
                      java.lang.String userName,
                      java.io.Serializable commandPayload,
                      java.lang.String vdbName,
                      int vdbVersion,
                      java.util.Properties envProperties,
                      boolean collectNodeStatistics)
Construct a new context.


CommandContext

public CommandContext(java.lang.Object processorID,
                      java.lang.String connectionID,
                      java.lang.String userName,
                      java.lang.String vdbName,
                      int vdbVersion)
Construct a new context.


CommandContext

public CommandContext()
Method Detail

getDeterminismLevel

public int getDeterminismLevel()

resetDeterminismLevel

public int resetDeterminismLevel()

setDeterminismLevel

public void setDeterminismLevel(int level)

getProcessorID

public java.lang.Object getProcessorID()
Returns:

setProcessorID

public void setProcessorID(java.lang.Object object)
Parameters:
object -

clone

public CommandContext clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getConnectionID

public java.lang.String getConnectionID()
Specified by:
getConnectionID in interface CommandContext
Returns:
String

getUserName

public java.lang.String getUserName()
Specified by:
getUserName in interface CommandContext
Returns:
String

getVdbName

public java.lang.String getVdbName()
Specified by:
getVdbName in interface CommandContext
Returns:
String

getVdbVersion

public int getVdbVersion()
Specified by:
getVdbVersion in interface CommandContext
Returns:
String

setConnectionID

public void setConnectionID(java.lang.String connectionID)
Sets the connectionID.

Parameters:
connectionID - The connectionID to set

setUserName

public void setUserName(java.lang.String userName)
Sets the userName.

Parameters:
userName - The userName to set

setVdbName

public void setVdbName(java.lang.String vdbName)
Sets the vdbName.

Parameters:
vdbName - The vdbName to set

setVdbVersion

public void setVdbVersion(int vdbVersion)
Sets the vdbVersion.

Parameters:
vdbVersion - The vdbVersion to set

getEnvironmentProperties

public java.util.Properties getEnvironmentProperties()
Specified by:
getEnvironmentProperties in interface CommandContext

setEnvironmentProperties

public void setEnvironmentProperties(java.util.Properties properties)

getCommandPayload

public java.io.Serializable getCommandPayload()

setCommandPayload

public void setCommandPayload(java.io.Serializable commandPayload)

setCollectNodeStatistics

public void setCollectNodeStatistics(boolean collectNodeStatistics)
Parameters:
collectNodeStatistics - The collectNodeStatistics to set.
Since:
4.2

getCollectNodeStatistics

public boolean getCollectNodeStatistics()

getConnectorBatchSize

public int getConnectorBatchSize()

setConnectorBatchSize

public void setConnectorBatchSize(int connectorBatchSize)

getProcessorBatchSize

public int getProcessorBatchSize()
Specified by:
getProcessorBatchSize in interface CommandContext

setProcessorBatchSize

public void setProcessorBatchSize(int processorBatchSize)

getNextRand

public double getNextRand()
Specified by:
getNextRand in interface CommandContext

getNextRand

public double getNextRand(long seed)
Specified by:
getNextRand in interface CommandContext

pushCall

public void pushCall(java.lang.String value)
              throws QueryProcessingException
Throws:
QueryProcessingException

getCallStackDepth

public int getCallStackDepth()

popCall

public void popCall()

getSecurityFunctionEvaluator

public SecurityFunctionEvaluator getSecurityFunctionEvaluator()
Returns:
Returns the securityFunctionEvaluator.

setSecurityFunctionEvaluator

public void setSecurityFunctionEvaluator(SecurityFunctionEvaluator securityFunctionEvaluator)
Parameters:
securityFunctionEvaluator - The securityFunctionEvaluator to set.

getTempTableStore

public TempTableStore getTempTableStore()

setTempTableStore

public void setTempTableStore(TempTableStore tempTableStore)

getServerTimeZone

public java.util.TimeZone getServerTimeZone()
Specified by:
getServerTimeZone in interface CommandContext

setPlanToProcessConverter

public void setPlanToProcessConverter(PlanToProcessConverter planToProcessConverter)

getPlanToProcessConverter

public PlanToProcessConverter getPlanToProcessConverter()

getQueryProcessorFactory

public QueryProcessor.ProcessorFactory getQueryProcessorFactory()

setQueryProcessorFactory

public void setQueryProcessorFactory(QueryProcessor.ProcessorFactory queryProcessorFactory)

getVariableContext

public VariableContext getVariableContext()

setVariableContext

public void setVariableContext(VariableContext variableContext)

pushVariableContext

public void pushVariableContext(VariableContext toPush)

getFromContext

public java.lang.Object getFromContext(Expression expression)
                                throws TeiidComponentException
Throws:
TeiidComponentException

getGroups

public java.util.Set<java.lang.String> getGroups()

setGroups

public void setGroups(java.util.Set<java.lang.String> groups)

getTimeSliceEnd

public long getTimeSliceEnd()

getTimeoutEnd

public long getTimeoutEnd()

setTimeSliceEnd

public void setTimeSliceEnd(long timeSliceEnd)

setTimeoutEnd

public void setTimeoutEnd(long timeoutEnd)

setMetadata

public void setMetadata(QueryMetadataInterface metadata)

getMetadata

public QueryMetadataInterface getMetadata()

setValidateXML

public void setValidateXML(boolean validateXML)

validateXML

public boolean validateXML()

getBufferManager

public BufferManager getBufferManager()

setBufferManager

public void setBufferManager(BufferManager bm)

getGlobalTableStore

public TempTableStore getGlobalTableStore()

setGlobalTableStore

public void setGlobalTableStore(TempTableStore tempTableStore)

isNonBlocking

public boolean isNonBlocking()

setNonBlocking

public void setNonBlocking(boolean nonBlocking)

setPreparedPlanCache

public void setPreparedPlanCache(org.teiid.dqp.internal.process.SessionAwareCache<org.teiid.dqp.internal.process.PreparedPlan> cache)

getPlan

public org.teiid.dqp.internal.process.PreparedPlan getPlan(java.lang.String key)

putPlan

public void putPlan(java.lang.String key,
                    org.teiid.dqp.internal.process.PreparedPlan plan,
                    int determinismLevel)

isResultSetCacheEnabled

public boolean isResultSetCacheEnabled()

setResultSetCacheEnabled

public void setResultSetCacheEnabled(boolean resultSetCacheEnabled)


Copyright © 2010. All Rights Reserved.