JBoss.orgCommunity Documentation

Chapter 2. Connector API

2.1. Overview
2.2. Connector Lifecycle
2.2.1. Starting
2.2.2. Running
2.2.3. Stopping
2.3. Connections to Source
2.3.1. Obtaining connections
2.3.2. Releasing Connections
2.4. Executing Commands
2.4.1. Execution Modes
2.4.2. ResultSetExecution
2.4.3. Update Execution
2.4.4. Procedure Execution
2.4.5. Asynchronous Executions
2.4.6. Bulk Execution
2.4.7. Command Completion
2.4.8. Command Cancellation
2.5. Monitored Connectors

A component called the Connector Manager is controlling access to your connector. This chapter reviews the basics of how the Connector Manager interacts with your connector while leaving reference details and advanced topics to be covered in later chapters.

A custom connector must implement the following interfaces to connect and query an enterprise Data Source. These interfaces are in package called org.teiid.connector.api:

Note that many of the interfaces above have base implementations in the org.teiid.connector.basic package. Consider extending the corresponding BasicXXX class rather than fully implementing the interface.

The most important interfaces provided by Teiid to the connector are the following:

  • ConnectorEnvironment – an interface describing access to external resources for your connector.

  • ConnectorLogger – an interface for writing logging information to Teiid logs.

  • ExecutionContext – interface defining the execution context available to the connector when executing a command.

Teiid can automatically monitor connectors, which will update a status flag on the connector. This status can be checked via the AdminApi and is exposed in the console. To use connector monitoring effectively:

Possible status results include: