Class SurveyContext
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextBase
org.odpi.openmetadata.frameworks.opensurvey.SurveyContext
SurveyContext provides a survey action service with access to information about
the survey request along with access to the open metadata repository interfaces.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextBase
connectorActivityReportWriter, connectorGUID, connectorId, connectorName, connectorUserId, defaultDeleteMethod, externalSourceGUID, externalSourceName, fileClassifier, generateIntegrationReport, governanceDefinitionClient, localServerName, localServiceName, maxPageSize, openMetadataClient, openMetadataStore, propertyHelper
-
Constructor Summary
ConstructorsConstructorDescriptionSurveyContext
(String localServerName, String localServiceName, String externalSourceGUID, String externalSourceName, String connectorId, String connectorName, String connectorUserId, String connectorGUID, boolean generateIntegrationReport, OpenMetadataClient openMetadataClient, AuditLog auditLog, int maxPageSize, DeleteMethod deleteMethod, String assetGUID, Map<String, String> requestParameters, List<ActionTargetElement> actionTargetElements, SurveyAssetStore assetStore, AnnotationStore annotationStore, String surveyActionServiceName, String requesterUserId) Constructor sets up the key parameters for using the context. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine whether a particular element should be surveyed.Return the list of elements that this governance action service should work on.Return the annotation store for the survey action service.Return the unique identifier of the asset being discovered.Return the asset store for the survey action service.Return any additional action targets that should be made available to downstream governance actions.Return the guards provided by the survey action service.Return the populated message to act as the completion message.Return any new request parameters for downstream governance actions.Return the completion status provided by the survey action service.Return the requester user identifier.Return the properties that hold the parameters used to drive the survey action service's analysis.Return the survey action service.void
recordCompletionStatus
(CompletionStatus status, List<String> outputGuards, Map<String, String> requestParameters, List<NewActionTarget> newActionTargets, AuditLogMessageDefinition completionMessage) Declare that all the processing for the governance action service is finished and the status of the work.toString()
Standard toString method.Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextBase
createIncidentReport, disconnect, getActorProfileClient, getActorRoleClient, getAnchorGUID, getAnchorGUID, getAssetClient, getAssetClient, getConnectionClient, getConnectorId, getConnectorName, getConnectorTypeClient, getEndpointClient, getFileClassifier, getGlossaryClient, getGlossaryTermClient, getGovernanceDefinitionClient, getGovernanceDefinitionClient, getLocalServerName, getLocalServiceName, getMaxPageSize, getMultiLanguageClient, getMyUserId, getOpenMetadataStore, getSchemaAttributeClient, getSchemaAttributeClient, getSchemaTypeClient, getSchemaTypeClient, getSoftwareCapabilityClient, getSoftwareCapabilityClient, getValidMetadataValuesClient, getValidValueDefinitionClient, isTypeOf, isTypeOf, openToDo, openToDo, publishReport, registerContextEvent, registerDirectoryListener, registerDirectoryTreeListener, registerFileListener, reportElementCreation, reportElementDelete, reportElementUpdate, setActiveReportPublishing, startRecording, unregisterDirectoryListener, unregisterDirectoryTreeListener, unregisterFileListener, validateIsActive
-
Constructor Details
-
SurveyContext
public SurveyContext(String localServerName, String localServiceName, String externalSourceGUID, String externalSourceName, String connectorId, String connectorName, String connectorUserId, String connectorGUID, boolean generateIntegrationReport, OpenMetadataClient openMetadataClient, AuditLog auditLog, int maxPageSize, DeleteMethod deleteMethod, String assetGUID, Map<String, String> requestParameters, List<ActionTargetElement> actionTargetElements, SurveyAssetStore assetStore, AnnotationStore annotationStore, String surveyActionServiceName, String requesterUserId) Constructor sets up the key parameters for using the context.- Parameters:
localServerName
- name of local serverlocalServiceName
- name of the service to callexternalSourceGUID
- metadata collection unique idexternalSourceName
- metadata collection unique nameconnectorId
- id of this connector instanceconnectorName
- name of this connector instanceconnectorUserId
- userId to use when issuing open metadata requestsconnectorGUID
- unique identifier of the connector element that describes this connector in the open metadata store(s)generateIntegrationReport
- should the context generate an integration report?openMetadataClient
- client to access open metadata storeauditLog
- logging destinationmaxPageSize
- max number of resultsdeleteMethod
- default delete methodassetGUID
- unique identifier of the asset that the annotations should be attached torequestParameters
- name-value properties to control the survey action serviceactionTargetElements
- metadata elements that need to be worked on by the governance action serviceannotationStore
- annotation store for the survey action servicesurveyActionServiceName
- name of the running servicerequesterUserId
- original user requesting this governance service
-
-
Method Details
-
getAssetGUID
Return the unique identifier of the asset being discovered.- Returns:
- string guid
- Throws:
UserNotAuthorizedException
- exception thrown if connector is no longer active
-
getRequestParameters
Return the properties that hold the parameters used to drive the survey action service's analysis.- Returns:
- AdditionalProperties object storing the analysis parameters
- Throws:
UserNotAuthorizedException
- exception thrown if connector is no longer active
-
getActionTargetElements
Return the list of elements that this governance action service should work on.- Returns:
- cached list of action target metadata elements
-
getRequesterUserId
Return the requester user identifier.- Returns:
- userId
-
getAssetStore
Return the asset store for the survey action service. This is able to provide a connector to the asset configured with the properties of the asset from a property server.- Returns:
- asset store
- Throws:
UserNotAuthorizedException
- exception thrown if connector is no longer active
-
getAnnotationStore
Return the annotation store for the survey action service. This is where the annotations are stored and retrieved from.- Returns:
- annotation store
- Throws:
UserNotAuthorizedException
- exception thrown if connector is no longer active
-
elementShouldBeSurveyed
public boolean elementShouldBeSurveyed(String elementName, List<String> excludedNames, List<String> includedNames) Determine whether a particular element should be surveyed. The include list takes precedent over the exclude list.- Parameters:
elementName
- name of the elementexcludedNames
- list of names to exclude (null means ignore value)includedNames
- list of names to include (null means ignore value)- Returns:
- flag indicating whether to work with the database
-
recordCompletionStatus
public void recordCompletionStatus(CompletionStatus status, List<String> outputGuards, Map<String, String> requestParameters, List<NewActionTarget> newActionTargets, AuditLogMessageDefinition completionMessage) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionDeclare that all the processing for the governance action service is finished and the status of the work.- Parameters:
status
- completion status enum valueoutputGuards
- optional guard strings for triggering subsequent action(s)requestParameters
- properties to pass to the next governance action servicenewActionTargets
- map of action target names to GUIDs for the resulting governance action servicecompletionMessage
- message to describe completion results or reasons for failure- Throws:
InvalidParameterException
- the completion status is nullUserNotAuthorizedException
- the governance action service is not authorized to update the governance action service statusPropertyServerException
- there is a problem connecting to the metadata store
-
getSurveyActionServiceName
Return the survey action service.- Returns:
- qualified name
-
getCompletionStatus
Return the completion status provided by the survey action service.- Returns:
- enum
-
getCompletionGuards
Return the guards provided by the survey action service. If these are null then a standard guard (eg SURVEY_INVALID, SURVEY_COMPLETE, SURVEY_FAILED) is used- Returns:
- list of strings
-
getCompletionMessage
Return the populated message to act as the completion message.- Returns:
- audit log message definition
-
getCompletionRequestParameters
Return any new request parameters for downstream governance actions.- Returns:
- map of request parameter name to request parameter value
-
getCompletionActionTargets
Return any additional action targets that should be made available to downstream governance actions. This is in addition to the actual survey report.- Returns:
- list of new action targets
-
toString
Standard toString method.
-