Class DiscoveryAnnotationStore
java.lang.Object
org.odpi.openmetadata.frameworks.discovery.DiscoveryAnnotationStore
- Direct Known Subclasses:
DiscoveryAnnotationStoreClient
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 Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected DiscoveryAnalysisReportStore
protected String
-
Constructor Summary
ConstructorsConstructorDescriptionDiscoveryAnnotationStore
(String userId, String assetGUID, DiscoveryAnalysisReportStore discoveryReport) Constructor sets up the key parameters for accessing the annotations store. -
Method Summary
Modifier and TypeMethodDescriptionabstract String
addAnnotationToAnnotation
(String parentAnnotationGUID, Annotation annotation) Add a new annotation and link it to an existing annotation.abstract String
addAnnotationToDataField
(String parentDataFieldGUID, Annotation annotation) Add a new annotation and link it to an existing data field.abstract String
addAnnotationToDiscoveryReport
(Annotation annotation) Add a new annotation to the annotation store as a top level annotation linked directly off of the report.abstract String
addDataFieldToDataField
(String parentDataFieldGUID, DataField dataField) Add a new data field and link it to an existing data field.abstract String
addDataFieldToDiscoveryReport
(String annotationGUID, DataField dataField) Add a new data field to the Annotation store linked off of an annotation (typically SchemaAnalysisAnnotation).abstract void
deleteAnnotation
(String annotationGUID) Remove an annotation from the annotation store.abstract void
deleteDataField
(String dataFieldGUID) Remove a data field from the annotation store.abstract Annotation
getAnnotation
(String annotationGUID) Return a specific annotation stored in the annotation store (previous or new).abstract DataField
getDataField
(String dataFieldGUID) Return a specific data field stored in the annotation store (previous or new).Return the report identifier for this discovery context.abstract List<Annotation>
getExtendedAnnotations
(String annotationGUID, int startingFrom, int maximumResults) Return any annotations attached to this annotation.getNestedDataFields
(String parentDataFieldGUID, int startingFrom, int maximumResults) Return any annotations attached to this annotation.abstract List<Annotation>
getNewAnnotationsForAsset
(int startingFrom, int maximumResults) Return the current list of annotations for this discovery run.getNewDataFieldsForAsset
(int startingFrom, int maximumResults) Return the current list of data fields for this discovery run.abstract List<Annotation>
getPreviousAnnotationsForAsset
(int startingFrom, int maximumResults) Return the list of Annotations created for the asset by previous runs of the discovery service.abstract List<Annotation>
getPreviousAnnotationsForAsset
(AnnotationStatus status, int startingFrom, int maximumResults) Return the list of annotations from previous runs of the discovery service that are set to a specific status.getPreviousDataFieldsForAsset
(int startingFrom, int maximumResults) Return the list of data fields from previous runs of the discovery service.Return the annotation subtype names.Return the annotation subtype names mapped to their descriptions.abstract void
updateAnnotation
(Annotation annotation) Replace the current properties of an annotation.abstract void
updateDataField
(DataField dataField) Replace the current properties of a data field.
-
Field Details
-
userId
-
assetGUID
-
discoveryReport
-
-
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 userassetGUID
- unique identifier of the asset that the annotations should be attached todiscoveryReport
- discovery report that these annotations will be filed against.
-
-
Method Details
-
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 InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionReturn the annotation subtype names.- Returns:
- list of type names that are subtypes of annotation
- Throws:
InvalidParameterException
- full path or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getTypesOfAnnotationWithDescriptions
public abstract Map<String,String> getTypesOfAnnotationWithDescriptions() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionReturn the annotation subtype names mapped to their descriptions.- Returns:
- list of type names that are subtypes of annotation
- Throws:
InvalidParameterException
- full path or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getPreviousAnnotationsForAsset
public abstract List<Annotation> getPreviousAnnotationsForAsset(int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, 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:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem retrieving annotations from the annotation store.
-
getPreviousAnnotationsForAsset
public abstract List<Annotation> getPreviousAnnotationsForAsset(AnnotationStatus status, int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, 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 querystartingFrom
- 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:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem retrieving annotations from the annotation store.
-
getNewAnnotationsForAsset
public abstract List<Annotation> getNewAnnotationsForAsset(int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, 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:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem retrieving annotations from the annotation store.
-
getExtendedAnnotations
public abstract List<Annotation> getExtendedAnnotations(String annotationGUID, int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return any annotations attached to this annotation.- Parameters:
annotationGUID
- parent annotationstartingFrom
- starting position in the listmaximumResults
- maximum number of annotations that can be returned.- Returns:
- list of Annotation objects
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem that occurred within the property server.
-
getAnnotation
public abstract Annotation getAnnotation(String annotationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return a specific annotation stored in the annotation store (previous or new).- Parameters:
annotationGUID
- unique identifier of the annotation- Returns:
- annotation object
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem retrieving the annotation from the annotation store.
-
addAnnotationToDiscoveryReport
public abstract String addAnnotationToDiscoveryReport(Annotation annotation) throws InvalidParameterException, UserNotAuthorizedException, 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:
InvalidParameterException
- the annotation is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem adding the annotation to the annotation store.
-
addAnnotationToAnnotation
public abstract String addAnnotationToAnnotation(String parentAnnotationGUID, Annotation annotation) throws InvalidParameterException, UserNotAuthorizedException, 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 toannotation
- annotation object- Returns:
- unique identifier of new annotation
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem saving annotations in the annotation store.
-
updateAnnotation
public abstract void updateAnnotation(Annotation annotation) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Replace the current properties of an annotation.- Parameters:
annotation
- new properties- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem updating the annotation in the annotation store.
-
deleteAnnotation
public abstract void deleteAnnotation(String annotationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove an annotation from the annotation store.- Parameters:
annotationGUID
- unique identifier of the annotation- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem deleting the annotation from the annotation store.
-
getPreviousDataFieldsForAsset
public abstract List<DataField> getPreviousDataFieldsForAsset(int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, 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:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem retrieving data fields from the annotation store.
-
getNewDataFieldsForAsset
public abstract List<DataField> getNewDataFieldsForAsset(int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, 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:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem retrieving data fields from the annotation store.
-
getNestedDataFields
public abstract List<DataField> getNestedDataFields(String parentDataFieldGUID, int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return any annotations attached to this annotation.- Parameters:
parentDataFieldGUID
- parent data field identifierstartingFrom
- starting position in the listmaximumResults
- maximum number of annotations that can be returned.- Returns:
- list of DataField objects
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem that occurred within the property server.
-
getDataField
public abstract DataField getDataField(String dataFieldGUID) throws InvalidParameterException, UserNotAuthorizedException, 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:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem retrieving the data field from the annotation store.
-
addDataFieldToDiscoveryReport
public abstract String addDataFieldToDiscoveryReport(String annotationGUID, DataField dataField) throws InvalidParameterException, UserNotAuthorizedException, 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 todataField
- dataField object- Returns:
- unique identifier of new data field
- Throws:
InvalidParameterException
- the dataField is invalid or the annotation GUID points to an annotation that can not be associated with a data field.UserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem adding the data field to the Annotation store.
-
addDataFieldToDataField
public abstract String addDataFieldToDataField(String parentDataFieldGUID, DataField dataField) throws InvalidParameterException, UserNotAuthorizedException, 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 todataField
- data field object- Returns:
- unique identifier of new data field
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem saving data fields in the annotation store.
-
addAnnotationToDataField
public abstract String addAnnotationToDataField(String parentDataFieldGUID, Annotation annotation) throws InvalidParameterException, UserNotAuthorizedException, 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 toannotation
- data field object- Returns:
- unique identifier of new annotation
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem saving data fields in the annotation store.
-
updateDataField
public abstract void updateDataField(DataField dataField) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Replace the current properties of a data field.- Parameters:
dataField
- new properties- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem updating the data field in the annotation store.
-
deleteDataField
public abstract void deleteDataField(String dataFieldGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove a data field from the annotation store.- Parameters:
dataFieldGUID
- unique identifier of the data field- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem deleting the data field from the annotation store.
-