Class GovernanceContext

    • Constructor Detail

      • GovernanceContext

        public GovernanceContext​(String userId,
                                 String governanceActionGUID,
                                 String requestType,
                                 Map<String,​String> requestParameters,
                                 List<RequestSourceElement> requestSourceElements,
                                 List<ActionTargetElement> actionTargetElements,
                                 OpenMetadataClient openMetadataStore)
        Constructor sets up the key parameters for processing the request to the governance action service.
        Parameters:
        userId - calling user
        governanceActionGUID - unique identifier of the governance action that triggered this governance service
        requestType - unique identifier of the asset that the annotations should be attached to
        requestParameters - name-value properties to control the governance action service
        requestSourceElements - metadata elements associated with the request to the governance action service
        actionTargetElements - metadata elements that need to be worked on by the governance action service
        openMetadataStore - client to the metadata store for use by the governance action service
    • Method Detail

      • getRequestType

        public String getRequestType()
        Return the unique identifier of the asset being discovered.
        Returns:
        string guid
      • getRequestParameters

        public Map<String,​String> getRequestParameters()
        Return the properties that hold the parameters used to drive the governance action service's processing.
        Returns:
        property map
      • getRequestSourceElements

        public List<RequestSourceElement> getRequestSourceElements()
        Return the list of metadata elements associated with the request to the governance action service. This list will not change during the lifetime of the service.
        Returns:
        list of request source elements
      • getActionTargetElements

        public List<ActionTargetElement> getActionTargetElements()
        Return the list of elements that this governance action service should work on.
        Returns:
        cached list of action target metadata elements
      • getOpenMetadataStore

        public OpenMetadataStore getOpenMetadataStore()
        Return the client to access metadata from the open metadata repositories. This enables the governance action service to retrieve more information about the metadata elements linked to the request source and action target elements.
        Returns:
        metadata store client
      • updateActionTargetStatus

        public void updateActionTargetStatus​(String actionTargetGUID,
                                             GovernanceActionStatus status,
                                             Date startDate,
                                             Date completionDate)
                                      throws InvalidParameterException,
                                             UserNotAuthorizedException,
                                             PropertyServerException
        Update the status of a specific action target. By default, these values are derived from the values for the governance action service. However, if the governance action service has to process name target elements, then setting the status on each individual target will show the progress of the governance action service.
        Parameters:
        actionTargetGUID - unique identifier of the governance action service.
        status - status enum to show its progress
        startDate - date/time that the governance action service started processing the target
        completionDate - date/time that the governance process completed processing this target.
        Throws:
        InvalidParameterException - the action target GUID is not recognized
        UserNotAuthorizedException - the governance action service is not authorized to update the action target properties
        PropertyServerException - there is a problem connecting to the metadata store
      • getCompletionStatus

        public CompletionStatus getCompletionStatus()
        Return any completion status from the governance action service.
        Returns:
        completion status enum
      • toString

        public String toString()
        Standard toString method.
        Overrides:
        toString in class Object
        Returns:
        print out of variables in a JSON-style