Class DiscoveryAnnotationStore

java.lang.Object
org.odpi.openmetadata.frameworks.discovery.DiscoveryAnnotationStore

public abstract class DiscoveryAnnotationStore extends Object
The DiscoveryAnnotationStore provides the interface used by a discovery engine to store annotations in the annotation store. There is one instance of the annotation store for each discovery request. The userId that made the discovery request is the default user for the annotation store. This userId may be over-ridden by the discovery engine.
  • Field Details

  • Constructor Details

    • DiscoveryAnnotationStore

      public DiscoveryAnnotationStore(String userId, String assetGUID, DiscoveryAnalysisReportStore discoveryReport)
      Constructor sets up the key parameters for accessing the annotations store.
      Parameters:
      userId - calling user
      assetGUID - unique identifier of the asset that the annotations should be attached to
      discoveryReport - discovery report that these annotations will be filed against.
  • Method Details

    • getDiscoveryReport

      public DiscoveryAnalysisReportStore getDiscoveryReport()
      Return the report identifier for this discovery context. Any new annotations added to tis discovery context will be linked to this report.
      Returns:
      the new discovery report.
    • getTypesOfAnnotation

      public abstract List<String> getTypesOfAnnotation() throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the annotation subtype names.
      Returns:
      list of type names that are subtypes of annotation
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - full path or userId is null
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing property server
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - security access problem
    • getTypesOfAnnotationWithDescriptions

      public abstract Map<String,String> getTypesOfAnnotationWithDescriptions() throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the annotation subtype names mapped to their descriptions.
      Returns:
      list of type names that are subtypes of annotation
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - full path or userId is null
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing property server
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - security access problem
    • getPreviousAnnotationsForAsset

      public abstract List<Annotation> getPreviousAnnotationsForAsset(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 asset by previous runs of the discovery service.
      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.
    • getPreviousAnnotationsForAsset

      public abstract List<Annotation> getPreviousAnnotationsForAsset(AnnotationStatus status, 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 from previous runs of the discovery service that are set to a specific status. If status is null then annotations that have been reviewed, approved and/or actioned are returned from discovery reports that are not waiting or in progress.
      Parameters:
      status - status value to use on the 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.
    • getNewAnnotationsForAsset

      public abstract List<Annotation> getNewAnnotationsForAsset(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 for this discovery run.
      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 abstract 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 abstract 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.
    • addAnnotationToDiscoveryReport

      public abstract String addAnnotationToDiscoveryReport(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 to the annotation store as a top level annotation linked directly off of the report.
      Parameters:
      annotation - annotation object
      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.
    • addAnnotationToAnnotation

      public abstract String addAnnotationToAnnotation(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 abstract 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 abstract 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.
    • getPreviousDataFieldsForAsset

      public abstract List<DataField> getPreviousDataFieldsForAsset(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 data fields from previous runs of the discovery service.
      Parameters:
      startingFrom - starting position in the list.
      maximumResults - maximum number of elements that can be returned
      Returns:
      list of data fields (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 data fields from the annotation store.
    • getNewDataFieldsForAsset

      public abstract List<DataField> getNewDataFieldsForAsset(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 data fields for this discovery run.
      Parameters:
      startingFrom - starting position in the list.
      maximumResults - maximum number of elements that can be returned
      Returns:
      list of data fields (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 data fields from the annotation store.
    • getNestedDataFields

      public abstract List<DataField> getNestedDataFields(String parentDataFieldGUID, 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:
      parentDataFieldGUID - parent data field identifier
      startingFrom - starting position in the list
      maximumResults - maximum number of annotations that can be returned.
      Returns:
      list of DataField 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.
    • getDataField

      public abstract DataField getDataField(String dataFieldGUID) 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 data field stored in the annotation store (previous or new).
      Parameters:
      dataFieldGUID - unique identifier of the data field
      Returns:
      data field 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 data field from the annotation store.
    • addDataFieldToDiscoveryReport

      public abstract String addDataFieldToDiscoveryReport(String annotationGUID, DataField dataField) 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 data field to the Annotation store linked off of an annotation (typically SchemaAnalysisAnnotation).
      Parameters:
      annotationGUID - unique identifier of the annotation that the data field is to be linked to
      dataField - dataField object
      Returns:
      unique identifier of new data field
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the dataField is invalid or the annotation GUID points to an annotation that can not be associated with a data field.
      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 data field to the Annotation store.
    • addDataFieldToDataField

      public abstract String addDataFieldToDataField(String parentDataFieldGUID, DataField dataField) 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 data field and link it to an existing data field.
      Parameters:
      parentDataFieldGUID - unique identifier of the data field that this new one is to be attached to
      dataField - data field object
      Returns:
      unique identifier of new data field
      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 data fields in the annotation store.
    • addAnnotationToDataField

      public abstract String addAnnotationToDataField(String parentDataFieldGUID, 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 data field.
      Parameters:
      parentDataFieldGUID - unique identifier of the data field that this new one is to be attached to
      annotation - data field 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 data fields in the annotation store.
    • updateDataField

      public abstract void updateDataField(DataField dataField) 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 a data field.
      Parameters:
      dataField - 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 data field in the annotation store.
    • deleteDataField

      public abstract void deleteDataField(String dataFieldGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Remove a data field from the annotation store.
      Parameters:
      dataFieldGUID - unique identifier of the data field
      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 data field from the annotation store.