Class SurveyContext

java.lang.Object
org.odpi.openmetadata.frameworks.surveyaction.SurveyContext

public class SurveyContext extends Object
SurveyContext provides a survey action service with access to information about the survey request along with access to the open metadata repository interfaces.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SurveyContext(String userId, String assetGUID, Map<String,String> requestParameters, List<org.odpi.openmetadata.frameworks.governanceaction.properties.ActionTargetElement> actionTargetElements, SurveyAssetStore assetStore, AnnotationStore annotationStore, SurveyOpenMetadataStore openMetadataStore, String surveyActionServiceName, String requesterUserId, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog)
    Constructor sets up the key parameters for using the context.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Free up any resources held since the connector is no longer needed.
    boolean
    equals(Object objectToCompare)
    Compare the values of the supplied object with those stored in the current object.
    List<org.odpi.openmetadata.frameworks.governanceaction.properties.ActionTargetElement>
    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.
    List<org.odpi.openmetadata.frameworks.governanceaction.properties.NewActionTarget>
    Return any additional action targets that should be made available to downstream governance actions.
    Return the guards provided by the survey action service.
    org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageDefinition
    Return the populated message to act as the completion message.
    Return any new request parameters for downstream governance actions.
    org.odpi.openmetadata.frameworks.governanceaction.properties.CompletionStatus
    Return the completion status provided by the survey action service.
    org.odpi.openmetadata.frameworks.governanceaction.fileclassifier.FileClassifier
    Return the file classifier that retrieves file reference data from the open metadata repositories.
    Return a generic interface for accessing and updating open metadata elements, classifications and relationships.
    Return the requester user identifier.
    Return the properties that hold the parameters used to drive the survey action service's analysis.
    int
    Create a hash code for this element type.
    void
    recordCompletionStatus(org.odpi.openmetadata.frameworks.governanceaction.properties.CompletionStatus status, List<String> outputGuards, Map<String,String> requestParameters, List<org.odpi.openmetadata.frameworks.governanceaction.properties.NewActionTarget> newActionTargets, org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageDefinition completionMessage)
    Declare that all the processing for the governance action service is finished and the status of the work.
    Standard toString method.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SurveyContext

      public SurveyContext(String userId, String assetGUID, Map<String,String> requestParameters, List<org.odpi.openmetadata.frameworks.governanceaction.properties.ActionTargetElement> actionTargetElements, SurveyAssetStore assetStore, AnnotationStore annotationStore, SurveyOpenMetadataStore openMetadataStore, String surveyActionServiceName, String requesterUserId, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog)
      Constructor sets up the key parameters for using the context.
      Parameters:
      userId - calling user
      assetGUID - unique identifier of the asset that the annotations should be attached to
      requestParameters - name-value properties to control the survey action service
      actionTargetElements - metadata elements that need to be worked on by the governance action service
      assetStore - survey asset store for the survey action service
      annotationStore - annotation store for the survey action service
      openMetadataStore - generic metadata API from the Governance Action Framework (GAF)
      surveyActionServiceName - name of the running service
      requesterUserId - original user requesting this governance service
      auditLog - logging destination
  • Method Details

    • getAssetGUID

      public String getAssetGUID() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Return the unique identifier of the asset being discovered.
      Returns:
      string guid
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - exception thrown if connector is no longer active
    • getRequestParameters

      public Map<String,String> getRequestParameters() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Return the properties that hold the parameters used to drive the survey action service's analysis.
      Returns:
      AdditionalProperties object storing the analysis parameters
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - exception thrown if connector is no longer active
    • getActionTargetElements

      public List<org.odpi.openmetadata.frameworks.governanceaction.properties.ActionTargetElement> getActionTargetElements()
      Return the list of elements that this governance action service should work on.
      Returns:
      cached list of action target metadata elements
    • getRequesterUserId

      public String getRequesterUserId()
      Return the requester user identifier.
      Returns:
      userId
    • getAssetStore

      public SurveyAssetStore getAssetStore() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      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:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - exception thrown if connector is no longer active
    • getAnnotationStore

      public AnnotationStore getAnnotationStore() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Return the annotation store for the survey action service. This is where the annotations are stored and retrieved from.
      Returns:
      annotation store
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - exception thrown if connector is no longer active
    • getOpenMetadataStore

      public SurveyOpenMetadataStore getOpenMetadataStore() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Return a generic interface for accessing and updating open metadata elements, classifications and relationships.
      Returns:
      open metadata store
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - exception thrown if connector is no longer active
    • getFileClassifier

      public org.odpi.openmetadata.frameworks.governanceaction.fileclassifier.FileClassifier getFileClassifier() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Return the file classifier that retrieves file reference data from the open metadata repositories.
      Returns:
      file classifier
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - exception thrown if connector is no longer active
    • disconnect

      public void disconnect() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Free up any resources held since the connector is no longer needed.
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
    • recordCompletionStatus

      public void recordCompletionStatus(org.odpi.openmetadata.frameworks.governanceaction.properties.CompletionStatus status, List<String> outputGuards, Map<String,String> requestParameters, List<org.odpi.openmetadata.frameworks.governanceaction.properties.NewActionTarget> newActionTargets, org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageDefinition completionMessage) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Declare that all the processing for the governance action service is finished and the status of the work.
      Parameters:
      status - completion status enum value
      outputGuards - optional guard strings for triggering subsequent action(s)
      requestParameters - properties to pass to the next governance action service
      newActionTargets - map of action target names to GUIDs for the resulting governance action service
      completionMessage - message to describe completion results or reasons for failure
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the completion status is null
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the governance action service is not authorized to update the governance action service status
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem connecting to the metadata store
    • getCompletionStatus

      public org.odpi.openmetadata.frameworks.governanceaction.properties.CompletionStatus getCompletionStatus()
      Return the completion status provided by the survey action service.
      Returns:
      enum
    • getCompletionGuards

      public List<String> 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

      public org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageDefinition getCompletionMessage()
      Return the populated message to act as the completion message.
      Returns:
      audit log message definition
    • getCompletionRequestParameters

      public Map<String,String> getCompletionRequestParameters()
      Return any new request parameters for downstream governance actions.
      Returns:
      map of request parameter name to request parameter value
    • getCompletionActionTargets

      public List<org.odpi.openmetadata.frameworks.governanceaction.properties.NewActionTarget> 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

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

      public boolean equals(Object objectToCompare)
      Compare the values of the supplied object with those stored in the current object.
      Overrides:
      equals in class Object
      Parameters:
      objectToCompare - supplied object
      Returns:
      boolean result of comparison
    • hashCode

      public int hashCode()
      Create a hash code for this element type.
      Overrides:
      hashCode in class Object
      Returns:
      int hash code