Class AnnotationStore

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

public class AnnotationStore extends Object
The AnnotationStore provides the interface used by a survey action service to store annotations in the open metadata repositories.
  • Constructor Details

    • AnnotationStore

      public AnnotationStore(String userId, String assetGUID, org.odpi.openmetadata.frameworks.governanceaction.client.OpenMetadataClient openMetadataStore, String externalSourceGUID, String externalSourceName, String reportQualifiedName, String reportDisplayName, String surveyDescription, String surveyPurpose, String engineActionGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Constructor sets up the key parameters for accessing the annotations store and creates a survey report. This constructor is used by the engine service running a survey action service.
      Parameters:
      userId - calling user
      assetGUID - unique of the asset that describes the resource being surveyed
      openMetadataStore - access to the open metadata repositories
      externalSourceGUID - unique identifier of the external source that is supplying the survey data
      externalSourceName - unique name of the external source that is supplying the survey data
      reportQualifiedName - qualified name of report
      reportDisplayName - display name of report
      surveyDescription - description of report
      surveyPurpose - purpose of the survey
      engineActionGUID - unique identifier of the engine action that started this report
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem retrieving annotations from the annotation store.
    • AnnotationStore

      public AnnotationStore(String userId, org.odpi.openmetadata.frameworks.governanceaction.client.OpenMetadataClient openMetadataStore, String surveyReportGUID, String externalSourceGUID, String externalSourceName)
      Constructor sets up the key parameters for accessing the annotations store. This is typically used by a subclass that is making use of the annotation support.
      Parameters:
      userId - calling user
      openMetadataStore - access to the open metadata repositories
      surveyReportGUID - unique identifier of the survey report
      externalSourceGUID - unique identifier of the external source that is supplying the survey data
      externalSourceName - unique name of the external source that is supplying the survey data
  • Method Details

    • isForLineage

      public boolean isForLineage()
      Return the forLineage setting.
      Returns:
      boolean
    • setForLineage

      public void setForLineage(boolean forLineage)
      Set up the forLineage setting.
      Parameters:
      forLineage - boolean
    • isForDuplicateProcessing

      public boolean isForDuplicateProcessing()
      Return the forDuplicateProcessing setting.
      Returns:
      boolean
    • setForDuplicateProcessing

      public void setForDuplicateProcessing(boolean forDuplicateProcessing)
      Set up the forDuplicateProcessing setting.
      Parameters:
      forDuplicateProcessing - boolean
    • isUseCurrentEffectiveTime

      public boolean isUseCurrentEffectiveTime()
      Return the boolean setting for whether the current time for requests or null.
      Returns:
      boolean
    • setUseCurrentEffectiveTime

      public void setUseCurrentEffectiveTime(boolean useCurrentEffectiveTime)
      Set up the boolean setting for whether the current time for requests or null.
      Parameters:
      useCurrentEffectiveTime - boolean
    • getSurveyReportGUID

      public String getSurveyReportGUID()
      Return the report identifier for this survey context. Any new annotations added to this survey context will be linked to this report.
      Returns:
      unique identifier (guid) of the new survey report.
    • getAnalysisStep

      public String getAnalysisStep()
      Return the locally defined analysis step. This value is used in annotations generated in this phase.
      Returns:
      name of analysis step
    • setAnalysisStep

      public void setAnalysisStep(String analysisStep) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Set up the name of the current analysis step.
      Parameters:
      analysisStep - name
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem updating the survey report
    • getReportQualifiedName

      public String getReportQualifiedName()
      Return the unique name of the survey report that will result from this survey request.
      Returns:
      String report name
    • setReportQualifiedName

      public void setReportQualifiedName(String reportName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Set up the unique name of the survey report that will result from this survey request. The survey action engine will set up a default fully-qualified name. This method enables it to be overridden.
      Parameters:
      reportName - String report name
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem updating the survey report
    • getReportDisplayName

      public String getReportDisplayName()
      Return the display name of the survey report that will result from this survey request.
      Returns:
      String report name
    • setReportDisplayName

      public void setReportDisplayName(String reportName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Set up the display name of the survey report that will result from this survey request. The default name is null.
      Parameters:
      reportName - String report name
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem updating the survey report
    • getSurveyDescription

      public String getSurveyDescription()
      Return the description for the survey report that will result from this survey request. The default value is null.
      Returns:
      String report description
    • setSurveyDescription

      public void setSurveyDescription(String surveyDescription) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Set up the description for the survey report that will result from this survey request.
      Parameters:
      surveyDescription - String report description
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem updating the survey report
    • getSurveyPurpose

      public String getSurveyPurpose()
      Return the purpose of the survey.
      Returns:
      string
    • setSurveyPurpose

      public void setSurveyPurpose(String surveyPurpose) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Set up the purpose of the survey.
      Parameters:
      surveyPurpose - string
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem updating the survey report
    • setCompletionMessage

      public void setCompletionMessage(String completionMessage) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Set up the completion message,
      Parameters:
      completionMessage - new completion message
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem updating the survey report
    • getAnnotationsForElement

      public List<Annotation> getAnnotationsForElement(String elementGUID, int startingFrom, int maximumResults) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the list of Annotations created for the element by previous runs of the survey action service. This method follows the AssociatedAnnotation relationship from the supplied element to the
      Parameters:
      elementGUID - unique identifier of the element to query
      startingFrom - starting position in the list.
      maximumResults - maximum number of elements that can be returned
      Returns:
      list of annotation (or null if none are registered)
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem retrieving annotations from the annotation store.
    • getNewAnnotations

      public List<Annotation> getNewAnnotations(int startingFrom, int maximumResults) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the current list of annotations created by this survey run. This method is used by survey pipeline steps to pick up the annotations
      Parameters:
      startingFrom - starting position in the list.
      maximumResults - maximum number of elements that can be returned
      Returns:
      list of annotation (or null if none are registered)
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem retrieving annotations from the annotation store.
    • getExtendedAnnotations

      public List<Annotation> getExtendedAnnotations(String annotationGUID, int startingFrom, int maximumResults) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return any annotations attached to this annotation.
      Parameters:
      annotationGUID - parent annotation
      startingFrom - starting position in the list
      maximumResults - maximum number of annotations that can be returned.
      Returns:
      list of Annotation objects
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem that occurred within the property server.
    • getAnnotation

      public Annotation getAnnotation(String annotationGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return a specific annotation stored in the annotation store (previous or new).
      Parameters:
      annotationGUID - unique identifier of the annotation
      Returns:
      annotation object
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem retrieving the annotation from the annotation store.
    • addAnnotation

      public String addAnnotation(Annotation annotation, String associatedElementGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Add a new annotation to the annotation store as a top level annotation linked directly off of the report.
      Parameters:
      annotation - annotation object
      associatedElementGUID - unique identifier of the element to associate this annotation with (it is associated with the survey report automatically). This value may be null to indicate that it is only to be linked to the report.
      Returns:
      unique identifier of new annotation
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the annotation is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem adding the annotation to the annotation store.
    • addAnnotationExtension

      public String addAnnotationExtension(String parentAnnotationGUID, Annotation annotation) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Add a new annotation and link it to an existing annotation.
      Parameters:
      parentAnnotationGUID - unique identifier of the annotation that this new one is to be attached to
      annotation - annotation object
      Returns:
      unique identifier of new annotation
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem saving annotations in the annotation store.
    • updateAnnotation

      public void updateAnnotation(Annotation annotation) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Replace the current properties of an annotation.
      Parameters:
      annotation - new properties
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem updating the annotation in the annotation store.
    • deleteAnnotation

      public void deleteAnnotation(String annotationGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Remove an annotation from the annotation store.
      Parameters:
      annotationGUID - unique identifier of the annotation
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user id not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem deleting the annotation from the annotation store.