Class SurveyActionServiceConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.frameworks.surveyaction.SurveyActionServiceConnector
- All Implemented Interfaces:
AuditLoggingComponent
,SecureConnectorExtension
,VirtualConnectorExtension
,SurveyActionService
- Direct Known Subclasses:
CSVSurveyService
,FileSurveyService
,FolderSurveyService
,PostgresDatabaseSurveyActionService
,PostgresServerSurveyActionService
,SurveyActionPipelineConnector
,SurveyApacheAtlasConnector
,SurveyApacheKafkaServerConnector
public abstract class SurveyActionServiceConnector
extends ConnectorBase
implements SurveyActionService, AuditLoggingComponent, VirtualConnectorExtension
SurveyActionServiceConnector describes a specific type of connector that is responsible for analyzing the content
of a specific asset. Information about the asset to analyze is passed in the survey context.
The returned discovery context also contains the results.
Some discovery services manage the invocation of other discovery services. These discovery services are called
discovery pipelines.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, secretsStoreConnectorMap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Free up any resources held since the connector is no longer needed.protected AnnotationStore
Return the component description that is used by this connector in the audit log.protected List<SurveyActionServiceConnector>
Retrieve and validate the list of embedded connectors and cast them to survey action service connector.protected SurveyContext
Return the survey context for this survey action service.protected void
handleUnexpectedException
(String methodName, Exception error) Provide a common exception for unexpected errors.void
initializeEmbeddedConnectors
(List<Connector> embeddedConnectors) Set up the list of survey action services connectors that will be invoked as part of this survey action pipeline.void
logWrongTypeOfConnector
(String actualConnectorClass, String expectedConnectorClass, String assetGUID, String methodName) Log audit message and throw exception to indicate that the asset's connector is wrong.void
setAuditLog
(AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.void
setSurveyActionServiceName
(String surveyActionServiceName) Set up the survey action service name.void
setSurveyContext
(SurveyContext surveyContext) Set up details of the asset to analyze and the results of any previous analysis.void
start()
Indicates that the survey action service is completely configured and can begin processing.protected void
throwWrongTypeOfAsset
(String assetGUID, String assetType, String supportedAssetType, String methodName) Log that the survey action service can not process the type of asset it has been passed.void
throwWrongTypeOfConnector
(String actualConnectorClass, String expectedConnectorClass, String assetGUID, String methodName) Log audit message and throw exception to indicate that the asset's connector is wrong.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
disconnectConnectors, equals, getArrayConfigurationProperty, getAssetTypeName, getBooleanConfigurationProperty, getConnectedAssetProperties, getConnection, getConnectorInstanceId, getIntConfigurationProperty, getNetworkAddresses, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeConnectedAssetProperties, initializeSecretsStoreConnector, isActive, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toString
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp
-
Field Details
-
surveyActionServiceName
-
surveyContext
-
auditLog
-
embeddedConnectors
-
-
Constructor Details
-
SurveyActionServiceConnector
public SurveyActionServiceConnector()
-
-
Method Details
-
setAuditLog
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
-
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.
-
initializeEmbeddedConnectors
Set up the list of survey action services connectors that will be invoked as part of this survey action pipeline. The connectors are initialized waiting to start. After start() is called on the survey action pipeline, it will choreograph the invocation of its embedded survey action services by calling start() to each of them when they are to run. Similar processing is needed for the disconnect() method.- Specified by:
initializeEmbeddedConnectors
in interfaceVirtualConnectorExtension
- Parameters:
embeddedConnectors
- list of embedded connectors that are hopefully survey action services
-
setSurveyContext
Set up details of the asset to analyze and the results of any previous analysis.- Parameters:
surveyContext
- information about the asset to analyze and the results of analysis of other survey action service request. Partial results from other survey action services run as part of the same survey action service request may also be stored in the newAnnotations list.
-
setSurveyActionServiceName
Set up the survey action service name. This is used in error messages.- Parameters:
surveyActionServiceName
- name of the survey action service
-
getSurveyContext
Return the survey context for this survey action service. This is typically called after the disconnect() method is called. If called before disconnect(), it may only contain partial results.- Returns:
- survey context containing the results discovered (so far) by the survey action service.
- Throws:
ConnectorCheckedException
- the service is no longer active
-
getAnnotationStore
- Throws:
ConnectorCheckedException
-
throwWrongTypeOfAsset
protected void throwWrongTypeOfAsset(String assetGUID, String assetType, String supportedAssetType, String methodName) throws ConnectorCheckedException Log that the survey action service can not process the type of asset it has been passed.- Parameters:
assetGUID
- identifier of the assetassetType
- type of the assetsupportedAssetType
- supported asset typesmethodName
- calling method- Throws:
ConnectorCheckedException
- resulting exception
-
throwWrongTypeOfConnector
public void throwWrongTypeOfConnector(String actualConnectorClass, String expectedConnectorClass, String assetGUID, String methodName) throws ConnectorCheckedException Log audit message and throw exception to indicate that the asset's connector is wrong.- Parameters:
actualConnectorClass
- class name of the supplied connectorexpectedConnectorClass
- class name expected for the connectorassetGUID
- unique identifier for the assetmethodName
- calling method- Throws:
ConnectorCheckedException
- requested exception
-
logWrongTypeOfConnector
public void logWrongTypeOfConnector(String actualConnectorClass, String expectedConnectorClass, String assetGUID, String methodName) Log audit message and throw exception to indicate that the asset's connector is wrong.- Parameters:
actualConnectorClass
- class name of the supplied connectorexpectedConnectorClass
- class name expected for the connectorassetGUID
- unique identifier for the assetmethodName
- calling method
-
getEmbeddedSurveyActionServices
protected List<SurveyActionServiceConnector> getEmbeddedSurveyActionServices() throws ConnectorCheckedExceptionRetrieve and validate the list of embedded connectors and cast them to survey action service connector. This is used by SurveyPipelines and SurveyScanningServices.- Returns:
- list of survey action service connectors
- Throws:
ConnectorCheckedException
- one of the embedded connectors is not a survey action service
-
start
Indicates that the survey action service is completely configured and can begin processing. This is where the function of the survey action service is implemented. This is a standard method from the Open Connector Framework (OCF) so be sure to call super.start() in your version.- Overrides:
start
in classConnectorBase
- Throws:
ConnectorCheckedException
- there is a problem within the survey action service.
-
handleUnexpectedException
protected void handleUnexpectedException(String methodName, Exception error) throws ConnectorCheckedException Provide a common exception for unexpected errors.- Parameters:
methodName
- calling methoderror
- caught exception- Throws:
ConnectorCheckedException
- wrapped exception
-
disconnect
Free up any resources held since the connector is no longer needed.- Overrides:
disconnect
in classConnectorBase
- Throws:
ConnectorCheckedException
- there is a problem within the connector.
-