Class ConnectorProviderBase
- java.lang.Object
-
- org.odpi.openmetadata.frameworks.connectors.ConnectorProvider
-
- org.odpi.openmetadata.frameworks.connectors.ConnectorProviderBase
-
- All Implemented Interfaces:
AuditLoggingComponent
- Direct Known Subclasses:
AssetCatalogOutTopicClientProvider
,AssetConsumerOutTopicClientProvider
,AssetConsumerOutTopicServerProvider
,AssetLineageOutTopicClientProvider
,AssetManagerOutTopicClientProvider
,AssetManagerOutTopicServerProvider
,AssetOwnerOutTopicClientProvider
,AssetOwnerOutTopicServerProvider
,AvroFileStoreProvider
,BasicFileStoreProvider
,CommunityProfileOutTopicClientProvider
,CommunityProfileOutTopicServerProvider
,CSVFileStoreProvider
,DataEngineConnectorProviderBase
,DataEngineInTopicClientProvider
,DataFolderProvider
,DataManagerOutTopicClientProvider
,DataManagerOutTopicServerProvider
,DigitalArchitectureOutTopicClientProvider
,DigitalArchitectureOutTopicServerProvider
,DiscoveryServiceProvider
,ElasticsearchIntegrationProvider
,GovernanceActionServiceProviderBase
,GovernanceEngineOutTopicClientProvider
,GovernanceEngineOutTopicServerProvider
,IntegrationConnectorProvider
,ITInfrastructureOutTopicClientProvider
,ITInfrastructureOutTopicServerProvider
,LineageGraphProviderBase
,OMAGServerConfigStoreProviderBase
,OMRSAuditLogStoreProviderBase
,OMRSCohortRegistryStoreProviderBase
,OMRSRepositoryConnectorProviderBase
,OMRSRepositoryEventMapperProviderBase
,OMRSTopicProvider
,OpenMetadataArchiveStoreProviderBase
,OpenMetadataPlatformSecurityProvider
,OpenMetadataServerSecurityProvider
,OpenMetadataTopicProvider
,RESTClientConnectorProvider
,SecurityManagerOutTopicClientProvider
,SecurityManagerOutTopicServerProvider
,SecurityOfficerOutTopicClientProvider
,SecurityOfficerOutTopicServerProvider
,StewardshipActionOutTopicClientProvider
,StewardshipActionOutTopicServerProvider
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");
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditLog
auditLog
protected java.util.List<java.lang.String>
connectorInterfaces
protected ConnectorType
connectorTypeBean
-
Constructor Summary
Constructors Constructor Description ConnectorProviderBase()
Typical constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
Provide a common implementation of equals for all OCF Connector Provider objects.Connector
getConnector(Connection connection)
Creates a new instance of a connector using the name of the connector provider in the supplied connection.Connector
getConnector(ConnectionProperties connection)
Creates a new instance of a connector based on the information in the supplied connection.java.lang.String
getConnectorClassName()
Return the class name for the connector that the connector provider generates.ComponentDescription
getConnectorComponentDescription()
Return the component description that is used by this connector in the audit log.ConnectorType
getConnectorType()
Returns the properties about the type of connector that this ConnectorProvider supports.ConnectorTypeProperties
getConnectorTypeProperties()
Returns the properties about the type of connector that this Connector Provider supports.protected java.lang.String
getNewConnectorGUID()
Each connector has a guid to make it easier to correlate log messages from the various components that serve it.int
hashCode()
Provide a common implementation of hashCode for all OCF Connector Provider objects.void
setAuditLog(AuditLog auditLog)
Receive an audit log object that can be used to record audit log messages.protected void
setConnectorClassName(java.lang.String newConnectorClassName)
Update the class name for this connector provider.protected void
setConnectorComponentDescription(ComponentDescription connectorComponentDescription)
Update the component name to use in the creation of the connector's audit log.protected 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.java.lang.String
toString()
Standard toString method.
-
-
-
Field Detail
-
connectorInterfaces
protected java.util.List<java.lang.String> connectorInterfaces
-
auditLog
protected AuditLog auditLog
-
connectorTypeBean
protected ConnectorType connectorTypeBean
-
-
Method Detail
-
getNewConnectorGUID
protected java.lang.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.- Returns:
- guid for a new connector instance
-
getConnectorClassName
public java.lang.String getConnectorClassName()
Return the class name for the connector that the connector provider generates.- Returns:
- connectorClassName will be null initially.
-
getConnectorComponentDescription
public ComponentDescription getConnectorComponentDescription()
Return the component description that is used by this connector in the audit log.- Specified by:
getConnectorComponentDescription
in interfaceAuditLoggingComponent
- Returns:
- id, name, description, wiki page URL.
-
setConnectorClassName
protected void setConnectorClassName(java.lang.String newConnectorClassName)
Update the class name for this connector provider.- Parameters:
newConnectorClassName
- this must be a valid Java class name for a class that implements the org.odpi.openmetadata.Connector interface.
-
setConnectorComponentDescription
protected void setConnectorComponentDescription(ComponentDescription connectorComponentDescription)
Update the component name to use in the creation of the connector's audit log.- Parameters:
connectorComponentDescription
- component description.
-
setAuditLog
public 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.- Specified by:
setAuditLog
in interfaceAuditLoggingComponent
- Parameters:
auditLog
- audit log object
-
getConnectorTypeProperties
public ConnectorTypeProperties getConnectorTypeProperties()
Returns the properties about the type of connector that this Connector Provider supports.- Specified by:
getConnectorTypeProperties
in 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
public ConnectorType getConnectorType()
Returns the properties about the type of connector that this ConnectorProvider supports.- Specified by:
getConnectorType
in 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.
-
setConnectorTypeProperties
protected 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.- Parameters:
connectorTypeBean
- default properties for this type of 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:
getConnector
in 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:
getConnector
in 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.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- random UUID as hashcode
-
equals
public boolean equals(java.lang.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.- Overrides:
equals
in classjava.lang.Object
- Parameters:
object
- object to test- Returns:
- boolean flag
-
toString
public java.lang.String toString()
Standard toString method.- Overrides:
toString
in classjava.lang.Object
- Returns:
- print out of variables in a JSON-style
-
-