Class ConnectorProviderBase
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.ConnectorProvider
org.odpi.openmetadata.frameworks.connectors.ConnectorProviderBase
- All Implemented Interfaces:
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
public abstract class ConnectorProviderBase
extends ConnectorProvider
implements org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
ConnectorProviderBase is a base class for a connector provider. It manages all the class loading
for subclass implementations of the connector provider along with the generation of new connector guids.
ConnectorProviderBase creates a connector instance with the class name from the private variable called
connectorClassName. This class name is initialized to null. If the getConnector method is called when
the connectorClassName is null, it throws ConnectorCheckedException.
This is its default behaviour.
To use the ConnectorProviderBase, create a new class that extends the ConnectorProviderBase class
and in the constructor call super.setConnectorClassName("your connector's class name");
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanProvide a common implementation of equals for all OCF Connector Provider objects.getConnector(Connection connection) Creates a new instance of a connector using the name of the connector provider in the supplied connection.getConnector(ConnectionProperties connection) Creates a new instance of a connector based on the information in the supplied connection.Return the class name for the connector that the connector provider generates.org.odpi.openmetadata.frameworks.auditlog.ComponentDescriptionReturn the component description that is used by this connector in the audit log.Returns the properties about the type of connector that this ConnectorProvider supports.Returns the properties about the type of connector that this Connector Provider supports.inthashCode()Provide a common implementation of hashCode for all OCF Connector Provider objects.voidsetAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.toString()Standard toString method.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorProvider
getSupportedConfigurationProperties, getSupportedTemplateTypes
-
Constructor Details
-
ConnectorProviderBase
public ConnectorProviderBase()Typical constructor
-
-
Method Details
-
getConnectorClassName
Return the class name for the connector that the connector provider generates.- Returns:
- connectorClassName will be null initially.
-
getConnectorComponentDescription
public org.odpi.openmetadata.frameworks.auditlog.ComponentDescription getConnectorComponentDescription()Return the component description that is used by this connector in the audit log.- Specified by:
getConnectorComponentDescriptionin interfaceorg.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent- Returns:
- id, name, description, wiki page URL.
-
setAuditLog
public void setAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) Receive an audit log object that can be used to record audit log messages. The caller has initialized it with the correct component description and log destinations.- Specified by:
setAuditLogin interfaceorg.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent- Parameters:
auditLog- audit log object
-
getConnectorTypeProperties
Returns the properties about the type of connector that this Connector Provider supports.- Specified by:
getConnectorTypePropertiesin classConnectorProvider- Returns:
- properties including the name of the connector type, the connector provider class and any specific connection properties that are recognized by this connector.
-
getConnectorType
Returns the properties about the type of connector that this ConnectorProvider supports.- Specified by:
getConnectorTypein classConnectorProvider- Returns:
- properties including the name of the connector type, the connector provider class and any specific connection properties that are recognized by this connector.
-
getConnector
public Connector getConnector(Connection connection) throws ConnectionCheckedException, ConnectorCheckedException Creates a new instance of a connector using the name of the connector provider in the supplied connection.- Specified by:
getConnectorin classConnectorProvider- Parameters:
connection- properties for the connector and connector provider.- Returns:
- new connector instance.
- Throws:
ConnectionCheckedException- an error with the connection.ConnectorCheckedException- an error initializing the connector.
-
getConnector
public Connector getConnector(ConnectionProperties connection) throws ConnectionCheckedException, ConnectorCheckedException Creates a new instance of a connector based on the information in the supplied connection.- Specified by:
getConnectorin classConnectorProvider- Parameters:
connection- connection that should have all the properties needed by the Connector Provider to create a connector instance.- Returns:
- Connector instance of the connector.
- Throws:
ConnectionCheckedException- if there are missing or invalid properties in the connectionConnectorCheckedException- if there are issues instantiating or initializing the connector
-
hashCode
public int hashCode()Provide a common implementation of hashCode for all OCF Connector Provider objects. The UUID is unique and is randomly assigned and so its hashCode is as good as anything to describe the hash code of the properties object. -
equals
Provide a common implementation of equals for all OCF Connector Provider objects. The UUID is unique and is randomly assigned and so its hashCode is as good as anything to evaluate the equality of the connector provider object. -
toString
Standard toString method.
-