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 Details

    • SurveyContext

      public SurveyContext(String userId, String assetGUID, Map<String,String> requestParameters, SurveyAssetStore assetStore, AnnotationStore annotationStore, SurveyOpenMetadataStore openMetadataStore, String surveyActionServiceName, String requesterUserId, 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
      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 ConnectorCheckedException
      Return the unique identifier of the asset being discovered.
      Returns:
      string guid
      Throws:
      ConnectorCheckedException - exception thrown if connector is no longer active
    • getRequestParameters

      public Map<String,String> getRequestParameters() throws 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:
      ConnectorCheckedException - exception thrown if connector is no longer active
    • getRequesterUserId

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

      public SurveyAssetStore getAssetStore() throws 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:
      ConnectorCheckedException - exception thrown if connector is no longer active
    • getAnnotationStore

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

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

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

      public void disconnect() throws ConnectorCheckedException
      Free up any resources held since the connector is no longer needed.
      Throws:
      ConnectorCheckedException
    • 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