Provider Class
Namespace
Usage
- The types of authentication that can be used to access the external system
- The features that are supported for the connection to the external system
- The Apex class that extends DataSource.Connection to sync the external system’s schema and to handle the queries and searches of the external data
The values that are returned by the DataSource.Provider class determine which settings are available in the external data source definition in Salesforce. To access the external data source definition from Setup, enter External Data Sources in the Quick Find box, then select External Data Sources.
Provider Methods
The following are methods for Provider.
getAuthenticationCapabilities()
When you call this method, be sure the list of the external system’s authentication capabilities always contains the same values. The returned authentication types should never change based on runtime conditions, user context, dynamic queries, or any other conditions. Returning different authentication types for an external system can lead to errors that are difficult to troubleshoot.
For example, if your external system supports OAuth and Anonymous authentication, always return these types every time this method is called. Don’t query the database, make callouts, or use conditional logic that varies the results of this method.
Signature
public List<DataSource.AuthenticationCapability> getAuthenticationCapabilities()
Return Value
getCapabilities()
When you call this method, be sure the list of the external system’s capabilities always contains the same values. The returned capabilities should never change based on runtime conditions, user context, dynamic queries, or any other conditions. Returning different capabilities for an external system can lead to errors that are difficult to troubleshoot.
For example, if your external system supports the ROW_QUERY and SEARCH operations, always return these capabilities every time this method is called. Don’t query the database, make callouts, or use conditional logic that varies the results of this method.
Signature
public List<DataSource.Capability> getCapabilities()
Return Value
Type: List<DataSource.Capability>
getConnection(connectionParams)
Signature
public DataSource.Connection getConnection(DataSource.ConnectionParams connectionParams)
Parameters
- connectionParams
- Type: DataSource.ConnectionParams
- Credentials for authenticating to the external system.
Return Value
Type: DataSource.Connection