public interface ConnectorFactory
Modifier and Type | Field and Description |
---|---|
static int |
API_MAJOR_VERSION
The connector API major version.
|
static int |
API_MINOR_VERSION
The connector API minor version.
|
static java.lang.String |
API_VERSION
The connector API version, expressed as "(major).(minor)".
|
Modifier and Type | Method and Description |
---|---|
Connector |
createConnector(ConnectorContext context,
ConnectorSpec connectorSpec,
boolean keepAlive)
Factory method for creating a connector instance, given the specified connector specification.
|
ConnectorModel |
getConnectorModel(ConnectorFactoryContext context,
ConnectorType type)
Returns the
ConnectorModel object of the specified connector type. |
default OAuthManager |
getOAuthManager(ConnectorContext context,
ConnectorType type)
Returns an
OAuthManager object that can be used for OAuth authentication of third parties. |
java.util.List<ConnectorType> |
getSupportedTypes()
Returns a list of connector types that are supported by this connector factory.
|
default PropertyModel |
refreshConnectorProperty(ConnectorContext context,
ConnectorSpec connectorSpec,
PropertyModel property)
This method is used if a connector contains a DYNAMIC_LIST field.
|
default ConnectorSpec |
updateLegacyConnectorSpec(ConnectorSpec connectorSpec)
If this connector has previous versions, this method can be used to convert connector specification from
the old version to the current version.
|
default DataSetSpec |
updateLegacyDataSetSpec(DataSetSpec dataSetSpec)
If this connector has previous versions, this method can be used to convert data set specification from
the old version to the current version.
|
static final int API_MAJOR_VERSION
static final int API_MINOR_VERSION
static final java.lang.String API_VERSION
java.util.List<ConnectorType> getSupportedTypes()
ConnectorType
listConnectorModel getConnectorModel(ConnectorFactoryContext context, ConnectorType type)
ConnectorModel
object of the specified connector type.context
- A context object that can be used to access tenant information, etc.type
- The connector type, sub-type and versionConnectorModel
Connector createConnector(ConnectorContext context, ConnectorSpec connectorSpec, boolean keepAlive) throws ConnectorException
context
- A context object that can be used to access tenant information, etc.connectorSpec
- The connector specification, including connector name, type and propertieskeepAlive
- false
if the created connector instance is temporary (e.g. for testing connection), true
otherwise.Connector
instanceConnectorException
default OAuthManager getOAuthManager(ConnectorContext context, ConnectorType type) throws ConnectorException
OAuthManager
object that can be used for OAuth authentication of third parties. It is used with OAUTH field type.
By default, this method returns null
.context
- A context object that can be used to access tenant information, etc.type
- The connector type, sub-type and versionOAUthManager
object, if anyConnectorException
default PropertyModel refreshConnectorProperty(ConnectorContext context, ConnectorSpec connectorSpec, PropertyModel property) throws ConnectorException
PropertyModel
object which contains the updated list items.
By default, this method returns the original property unchanged.context
- A context object that can be used to access tenant information, etc.connectorSpec
- The current connector specification that the user is editingproperty
- The DYNAMIC_LIST property to be updatedPropertyModel
objectConnectorException
default ConnectorSpec updateLegacyConnectorSpec(ConnectorSpec connectorSpec)
connectorSpec
- Old version ConnectorSpec
objectConnectorSpec
objectdefault DataSetSpec updateLegacyDataSetSpec(DataSetSpec dataSetSpec)
dataSetSpec
- Old version DataSetSpec
objectDataSetSpec
object