- All Implemented Interfaces:
- Direct Known Subclasses:
public abstract class ConnectorProviderBase extends ConnectorProvider implements 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 SummaryConstructorDescriptionTypical constructor
Method SummaryModifier and TypeMethodDescription
booleanProvide a common implementation of equals for all OCF Connector Provider objects.Creates a new instance of a connector using the name of the connector provider in the supplied 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.Return 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.
protected StringEach connector has a guid to make it easier to correlate log messages from the various components that serve it.
hashCode()Provide a common implementation of hashCode for all OCF Connector Provider objects.
voidReceive an audit log object that can be used to record audit log messages.
protected voidUpdate the class name for this connector provider.
protected voidUpdate the component name to use in the creation of the connector's audit log.
protected voidSetter method to enable a subclass to set up the connector type properties that are added to a connection properties object.
toString()Standard toString method.
ConnectorProviderBasepublic ConnectorProviderBase()Typical constructor
getNewConnectorGUIDprotected String getNewConnectorGUID()Each connector has a guid to make it easier to correlate log messages from the various components that serve it. It uses a type 4 (pseudo randomly generated) UUID. The UUID is generated using a cryptographically strong pseudo random number generator.
- guid for a new connector instance
getConnectorClassNamepublic String getConnectorClassName()Return the class name for the connector that the connector provider generates.
- connectorClassName will be null initially.
getConnectorComponentDescriptionpublic ComponentDescription getConnectorComponentDescription()Return the component description that is used by this connector in the audit log.
setConnectorClassNameprotected void setConnectorClassName
(String newConnectorClassName)Update the class name for this connector provider.
newConnectorClassName- this must be a valid Java class name for a class that implements the org.odpi.openmetadata.Connector interface.
setConnectorComponentDescriptionprotected void setConnectorComponentDescription
(ComponentDescription connectorComponentDescription)Update the component name to use in the creation of the connector's audit log.
connectorComponentDescription- component description.
setAuditLogpublic void setAuditLog
(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.
getConnectorTypePropertiespublic ConnectorTypeProperties getConnectorTypeProperties()Returns the properties about the type of connector that this Connector Provider supports.
getConnectorTypepublic ConnectorType getConnectorType()Returns the properties about the type of connector that this ConnectorProvider supports.
setConnectorTypePropertiesprotected void setConnectorTypeProperties
(ConnectorType connectorTypeBean)Setter method to enable a subclass to set up the connector type properties that are added to a connection properties object. The connector type properties guide the ConnectorBroker and ConnectorProvider on how to create and configure a Connector instance.
connectorTypeBean- default properties for this type of connector
getConnectorpublic Connector getConnector
(Connection connection) throws ConnectionCheckedException, ConnectorCheckedExceptionCreates a new instance of a connector using the name of the connector provider in the supplied connection.
getConnectorpublic Connector getConnector
(ConnectionProperties connection) throws ConnectionCheckedException, ConnectorCheckedExceptionCreates a new instance of a connector based on the information in the supplied connection.
- Specified by:
connection- connection that should have all the properties needed by the Connector Provider to create a connector instance.
- Connector instance of the connector.
ConnectionCheckedException- if there are missing or invalid properties in the connection
ConnectorCheckedException- if there are issues instantiating or initializing the connector
hashCodepublic 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.
equalspublic boolean equals
(Object object)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.
toStringpublic String toString()Standard toString method.