public abstract class Connector extends Object
The Connector is the interface for all connector instances. Connectors are client-side interfaces to assets such as data stores, data sets, APIs, analytical functions. They handle the communication with the server that hosts the assets, along with the communication with the metadata server to serve up metadata (properties) about the assets.
Each connector implementation is paired with a connector provider. The connector provider is the factory for connector instances.
The Connector interface defines that a connector instance should be able to return a unique identifier, a connection object and a metadata object called ConnectedAssetProperties.
Each specific implementation of a connector then extends the Connector interface to add the methods to work with the particular type of asset it supports. For example, a JDBC connector would add the standard JDBC SQL interface, the OMRS Connectors add the metadata repository management APIs...
The initialize() method is called by the Connector Provider to set up the connector instance Id and the Connection properties for the connector as part of its construction process.
ConnectedAssetProperties provides descriptive properties about the asset that the connector is accessing. It is supplied to the connector later during its initialization through the initializeConnectedAssetProperties() method. See AssetConsumer OMAS for an example of this.
Both the connector and the connector provider have base classes (ConnectorBase and ConnectorProviderBase respectively) that implement all of the standard methods. The connector developer extends these classes to add the specific methods to manage the asset and configure the base classes.
| Constructor and Description |
|---|
Connector() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
disconnect()
Free up any resources held since the connector is no longer needed.
|
abstract ConnectedAssetProperties |
getConnectedAssetProperties(String userId)
Returns the properties that contain the metadata for the asset.
|
abstract ConnectionProperties |
getConnection()
Returns the connection object that was used to create the connector instance.
|
abstract String |
getConnectorInstanceId()
Returns the unique connector instance id that assigned to the connector instance when it was created.
|
abstract void |
initialize(String connectorInstanceId,
ConnectionProperties connection)
Call made by the ConnectorProvider to initialize the Connector with the base services.
|
abstract void |
initializeConnectedAssetProperties(ConnectedAssetProperties connectedAssetProperties)
Set up the connected asset properties object.
|
abstract void |
start()
Indicates that the connector is completely configured and can begin processing.
|
public abstract void initialize(String connectorInstanceId, ConnectionProperties connection)
connectorInstanceId - unique id for the connector instance useful for messages etcconnection - POJO for the configuration used to create the connector.public abstract String getConnectorInstanceId()
public abstract ConnectionProperties getConnection()
public abstract void initializeConnectedAssetProperties(ConnectedAssetProperties connectedAssetProperties)
connectedAssetProperties - properties of the connected assetpublic abstract ConnectedAssetProperties getConnectedAssetProperties(String userId) throws PropertyServerException, UserNotAuthorizedException
userId - userId of requesting userPropertyServerException - indicates a problem retrieving properties from a metadata repositoryUserNotAuthorizedException - indicates that the user is not authorized to access the asset properties.public abstract void start()
throws ConnectorCheckedException
ConnectorCheckedException - there is a problem within the connector.public abstract void disconnect()
throws ConnectorCheckedException
ConnectorCheckedException - there is a problem within the connector.Copyright © 2018–2021 LF AI & Data Foundation. All rights reserved.