org.teiid.connector.api
Interface ExecutionContext


public interface ExecutionContext

The security context provides information about the user context in which this query is being run. As of 4.2, the SecurityContext is a sub-interface of ExecutionContext such that both interfaces contain all of the methods from the prior independent interfaces. Thus, these interfaces can now be used interchangeably.


Method Summary
 void addWarning(java.lang.Exception ex)
          Add an exception as a warning to this Execution.
 int getBatchSize()
          Return the current connector batch size.
 java.lang.String getConnectionIdentifier()
          Get the identifier for the connection through which the command is being executed.
 java.lang.String getConnectorIdentifier()
          Get the identifier for the current connector running the command
 ConnectorIdentity getConnectorIdentity()
          Get the ConnectorIdentity created by the Connector's ConnectorIdentityFactory
 java.lang.String getExecutionCountIdentifier()
          Execution count defines an id; where every access to the connector from the MetaMatrix server in a given command execution boundary is uniquely defined; Like for example in the case of "batched execution" of commands, each execution of command gets new identifier.
 java.io.Serializable getExecutionPayload()
          Get the trusted payload passed when the user statement was executed.
 java.lang.String getPartIdentifier()
          This specifies the node id for the atomic request in the relational plan of query.
 java.lang.String getRequestIdentifier()
          Get the identifier for the MetaMatrix command being executed.
 java.io.Serializable getTrustedPayload()
          Get the trusted payload passed when the user connected.
 java.lang.String getUser()
          Get the user name for the user running this query.
 java.lang.String getVirtualDatabaseName()
          Get the name of the VDB this query is being run against.
 java.lang.String getVirtualDatabaseVersion()
          Get the version of the VDB this query is being run against.
 boolean isTransactional()
           
 void keepExecutionAlive(boolean alive)
          When the execution is turned on with "alive=true", the execution object will not be implicitly closed at the end of the last batch.
 

Method Detail

getConnectorIdentity

ConnectorIdentity getConnectorIdentity()
Get the ConnectorIdentity created by the Connector's ConnectorIdentityFactory

Returns:
the ConnectorIdentity or SingleIdentity if the Connector does not implement ConnectorIdentityFactory
Since:
6.0

getConnectorIdentifier

java.lang.String getConnectorIdentifier()
Get the identifier for the current connector running the command

Returns:
Connector identifier; never null

getRequestIdentifier

java.lang.String getRequestIdentifier()
Get the identifier for the MetaMatrix command being executed. This can be correlated back to identifiers exposed in other parts of the MetaMatrix system.

Returns:
MetaMatrix command identifier

getPartIdentifier

java.lang.String getPartIdentifier()
This specifies the node id for the atomic request in the relational plan of query. when combined with the request identifier, uniquely identifies a command sent to a connector.


getExecutionCountIdentifier

java.lang.String getExecutionCountIdentifier()
Execution count defines an id; where every access to the connector from the MetaMatrix server in a given command execution boundary is uniquely defined; Like for example in the case of "batched execution" of commands, each execution of command gets new identifier.


getVirtualDatabaseName

java.lang.String getVirtualDatabaseName()
Get the name of the VDB this query is being run against.

Returns:
VDB name, never null

getVirtualDatabaseVersion

java.lang.String getVirtualDatabaseVersion()
Get the version of the VDB this query is being run against.

Returns:
VDB version, never null

getUser

java.lang.String getUser()
Get the user name for the user running this query.

Returns:
User name, never null

getTrustedPayload

java.io.Serializable getTrustedPayload()
Get the trusted payload passed when the user connected. MetaMatrix has no knowledge about what the payload contains - it is merely passed through the system. It is most often used to pass security information such as credentials. It is available in the connector, as is the Execution Payload, for connector developers to utilize.

Returns:
Trusted payload if one exists, otherwise null

getExecutionPayload

java.io.Serializable getExecutionPayload()
Get the trusted payload passed when the user statement was executed. MetaMatrix has no knowledge about what the payload contains - it is merely passed through the system. It is most often used to pass security information such as credentials.

The execution payload differs from the Trusted Payload in that it is set on the Statement and so may not be constant over the Connection lifecycle and may be changed upon each statement execution. The Execution Payload is not authenticated or validated by the MetaMatrix system.

Given that the Execution Payload is not authenticated by the MetaMatrix system, connector writers are responsible for ensuring its validity. This can possibly be accomplished by comparing it against the Trusted Payload.

Returns:
Trusted execution payload if one exists, otherwise null
Since:
4.2

getConnectionIdentifier

java.lang.String getConnectionIdentifier()
Get the identifier for the connection through which the command is being executed. This represents the original JDBC user connection to the MetaMatrix system

Returns:
Connection identifier

keepExecutionAlive

void keepExecutionAlive(boolean alive)
When the execution is turned on with "alive=true", the execution object will not be implicitly closed at the end of the last batch. It will only be closed at end of the user query. This is useful in keeping the connection open for LOB (clob/blob/xml) streaming.

Parameters:
alive -

getBatchSize

int getBatchSize()
Return the current connector batch size. This may be used as a hint to the underlying source query.

Returns:
the Connector batch size.

addWarning

void addWarning(java.lang.Exception ex)
Add an exception as a warning to this Execution.

Parameters:
ex -

isTransactional

boolean isTransactional()


Copyright © 2009. All Rights Reserved.