Class DiscoveryEngineHandler
java.lang.Object
org.odpi.openmetadata.governanceservers.enginehostservices.admin.GovernanceEngineHandler
org.odpi.openmetadata.engineservices.assetanalysis.handlers.DiscoveryEngineHandler
The DiscoveryEngineHandler is responsible for running discovery services on demand. It is initialized
with the configuration for the discovery services it supports along with the clients to the
asset properties store and annotations store.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.governanceservers.enginehostservices.admin.GovernanceEngineHandler
auditLog, engineUserId, governanceEngineGUID, governanceEngineName, governanceEngineProperties, maxPageSize, serverClient, serverName, serverUserId
-
Constructor Summary
ConstructorsConstructorDescriptionDiscoveryEngineHandler
(EngineConfig engineConfig, String serverName, String serverUserId, GovernanceEngineConfigurationClient configurationClient, GovernanceEngineClient serverClient, DiscoveryEngineClient discoveryEngineClient, AuditLog auditLog, int maxPageSize) Create a client-side object for calling a discovery engine. -
Method Summary
Modifier and TypeMethodDescriptiondiscoverAsset
(String assetGUID, String discoveryRequestType, Map<String, String> analysisParameters, List<String> annotationTypes) Request the execution of a discovery service to explore a specific asset.getAnnotation
(String annotationGUID) Retrieve a single annotation by unique identifier.getDiscoveryReport
(String discoveryRequestGUID) Request the discovery report for a discovery request that has completed.getDiscoveryReportAnnotations
(String discoveryRequestGUID, int startingFrom, int maximumResults) Return the annotations linked direction to the report.getExtendedAnnotations
(String annotationGUID, int startingFrom, int maximumResults) Return any annotations attached to this annotation.runGovernanceService
(String governanceActionGUID, String governanceRequestType, Date startDate, Map<String, String> requestParameters, List<RequestSourceElement> requestSourceElements, List<ActionTargetElement> actionTargetElements) Run an instance of a governance action service in its own thread and return the handler (for disconnect processing).void
scanAllAssets
(String discoveryRequestType, Map<String, String> analysisParameters, List<String> annotationTypes) Request the execution of a discovery service for each asset that is found (limited by the supported zones of the Discovery Engine OMAS).Methods inherited from class org.odpi.openmetadata.governanceservers.enginehostservices.admin.GovernanceEngineHandler
executeGovernanceAction, getGovernanceEngineName, getServiceCache, getSummary, publishWatchdogEvent, refreshConfig, refreshServiceConfig, terminate, validateGovernanceEngineInitialized
-
Constructor Details
-
DiscoveryEngineHandler
public DiscoveryEngineHandler(EngineConfig engineConfig, String serverName, String serverUserId, GovernanceEngineConfigurationClient configurationClient, GovernanceEngineClient serverClient, DiscoveryEngineClient discoveryEngineClient, AuditLog auditLog, int maxPageSize) Create a client-side object for calling a discovery engine.- Parameters:
engineConfig
- the unique identifier of the discovery engine.serverName
- the name of the engine host server where the discovery engine is runningserverUserId
- user id for the server to useconfigurationClient
- client to retrieve the configurationserverClient
- client used by the engine host services to control the execution of governance action requestsdiscoveryEngineClient
- REST client for direct REST Calls to Discovery Engine OMAS - used by discovery servicesauditLog
- logging destinationmaxPageSize
- maximum number of results that can be returned in a single request
-
-
Method Details
-
discoverAsset
public String discoverAsset(String assetGUID, String discoveryRequestType, Map<String, String> analysisParameters, List<String> annotationTypes) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRequest the execution of a discovery service to explore a specific asset.- Parameters:
assetGUID
- identifier of the asset to analyze.discoveryRequestType
- identifier of the type of discovery request to run - this determines which discovery service to run.analysisParameters
- name value properties to control the analysisannotationTypes
- list of the types of annotations to produce (and no others)- Returns:
- unique id for the discovery request.
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem with connecting to the metadata server or there is a problem with the setup of the discovery engine.
-
scanAllAssets
public void scanAllAssets(String discoveryRequestType, Map<String, String> analysisParameters, List<String> annotationTypes) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRequest the execution of a discovery service for each asset that is found (limited by the supported zones of the Discovery Engine OMAS).- Parameters:
discoveryRequestType
- identifier of the type of discovery to run - this determines which discovery service to run.analysisParameters
- name value properties to control the analysisannotationTypes
- list of the types of annotations to produce (and no others)- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem with connecting to the metadata server or there is a problem with the setup of the discovery engine.
-
runGovernanceService
public GovernanceServiceHandler runGovernanceService(String governanceActionGUID, String governanceRequestType, Date startDate, Map<String, String> requestParameters, List<RequestSourceElement> requestSourceElements, List<ActionTargetElement> actionTargetElements) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRun an instance of a governance action service in its own thread and return the handler (for disconnect processing).- Specified by:
runGovernanceService
in classGovernanceEngineHandler
- Parameters:
governanceActionGUID
- unique identifier of the asset to analysegovernanceRequestType
- governance request type to use when calling the governance enginestartDate
- date/time to start the governance action servicerequestParameters
- name-value properties to control the governance action servicerequestSourceElements
- metadata elements associated with the request to the governance action serviceactionTargetElements
- metadata elements that need to be worked on by the governance action service- Returns:
- service handler for this request
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem detected by the governance action engine.
-
getDiscoveryReport
public DiscoveryAnalysisReport getDiscoveryReport(String discoveryRequestGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Request the discovery report for a discovery request that has completed.- Parameters:
discoveryRequestGUID
- identifier of the discovery request.- Returns:
- discovery report
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem connecting to the metadata server.
-
getDiscoveryReportAnnotations
public List<Annotation> getDiscoveryReportAnnotations(String discoveryRequestGUID, int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the annotations linked direction to the report.- Parameters:
discoveryRequestGUID
- identifier of the discovery request.startingFrom
- initial position in the stored list.maximumResults
- maximum number of definitions to return on this call.- Returns:
- list of annotations
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem connecting to the metadata server.
-
getExtendedAnnotations
public List<Annotation> getExtendedAnnotations(String annotationGUID, int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return any annotations attached to this annotation.- Parameters:
annotationGUID
- anchor annotationstartingFrom
- starting position in the listmaximumResults
- maximum number of annotations that can be returned.- Returns:
- list of Annotation objects
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem connecting to the metadata server.
-
getAnnotation
public Annotation getAnnotation(String annotationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a single annotation by unique identifier. This call is typically used to retrieve the latest values for an annotation.- Parameters:
annotationGUID
- unique identifier of the annotation- Returns:
- Annotation object
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem connecting to the metadata server.
-