Class AnnotationStore
java.lang.Object
org.odpi.openmetadata.frameworks.surveyaction.AnnotationStore
The AnnotationStore provides the interface used by a survey action service to
store annotations in the open metadata repositories.
-
Constructor Summary
ConstructorDescriptionAnnotationStore
(String userId, String assetGUID, OpenMetadataClient openMetadataStore, String externalSourceGUID, String externalSourceName, String reportQualifiedName, String reportDisplayName, String surveyDescription, String surveyPurpose, String engineActionGUID) Constructor sets up the key parameters for accessing the annotations store and creates a survey report.AnnotationStore
(String userId, OpenMetadataClient openMetadataStore, String surveyReportGUID, String externalSourceGUID, String externalSourceName) Constructor sets up the key parameters for accessing the annotations store. -
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation
(Annotation annotation, String associatedElementGUID) Add a new annotation to the annotation store as a top level annotation linked directly off of the report.addAnnotationExtension
(String parentAnnotationGUID, Annotation annotation) Add a new annotation and link it to an existing annotation.void
deleteAnnotation
(String annotationGUID) Remove an annotation from the annotation store.Return the locally defined analysis step.getAnnotation
(String annotationGUID) Return a specific annotation stored in the annotation store (previous or new).getAnnotationsForElement
(String elementGUID, int startingFrom, int maximumResults) Return the list of Annotations created for the element by previous runs of the survey action service.getExtendedAnnotations
(String annotationGUID, int startingFrom, int maximumResults) Return any annotations attached to this annotation.getNewAnnotations
(int startingFrom, int maximumResults) Return the current list of annotations created by this survey run.Return the display name of the survey report that will result from this survey request.Return the unique name of the survey report that will result from this survey request.Return the description for the survey report that will result from this survey request.Return the purpose of the survey.Return the report identifier for this survey context.boolean
Return the forDuplicateProcessing setting.boolean
Return the forLineage setting.boolean
Return the boolean setting for whether the current time for requests or null.void
setAnalysisStep
(String analysisStep) Set up the name of the current analysis step.void
setCompletionMessage
(String completionMessage) Set up the completion message,void
setForDuplicateProcessing
(boolean forDuplicateProcessing) Set up the forDuplicateProcessing setting.void
setForLineage
(boolean forLineage) Set up the forLineage setting.void
setReportDisplayName
(String reportName) Set up the display name of the survey report that will result from this survey request.void
setReportQualifiedName
(String reportName) Set up the unique name of the survey report that will result from this survey request.void
setSurveyDescription
(String surveyDescription) Set up the description for the survey report that will result from this survey request.void
setSurveyPurpose
(String surveyPurpose) Set up the purpose of the survey.protected void
setSurveyReportGUID
(String surveyReportGUID) Allow a subclass to override the survey report GUID.void
setUseCurrentEffectiveTime
(boolean useCurrentEffectiveTime) Set up the boolean setting for whether the current time for requests or null.void
updateAnnotation
(Annotation annotation) Replace the current properties of an annotation.
-
Constructor Details
-
AnnotationStore
public AnnotationStore(String userId, String assetGUID, OpenMetadataClient openMetadataStore, String externalSourceGUID, String externalSourceName, String reportQualifiedName, String reportDisplayName, String surveyDescription, String surveyPurpose, String engineActionGUID) throws InvalidParameterException, UserNotAuthorizedException, 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 userassetGUID
- unique of the asset that describes the resource being surveyedopenMetadataStore
- access to the open metadata repositoriesexternalSourceGUID
- unique identifier of the external source that is supplying the survey dataexternalSourceName
- unique name of the external source that is supplying the survey datareportQualifiedName
- qualified name of reportreportDisplayName
- display name of reportsurveyDescription
- description of reportsurveyPurpose
- purpose of the surveyengineActionGUID
- unique identifier of the engine action that started this report- 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.
-
AnnotationStore
public AnnotationStore(String userId, 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 useropenMetadataStore
- access to the open metadata repositoriessurveyReportGUID
- unique identifier of the survey reportexternalSourceGUID
- unique identifier of the external source that is supplying the survey dataexternalSourceName
- unique name of the external source that is supplying the survey data
-
-
Method Details
-
setSurveyReportGUID
Allow a subclass to override the survey report GUID.- Parameters:
surveyReportGUID
- unique identifier of the survey report.
-
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
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
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 InvalidParameterException, PropertyServerException, UserNotAuthorizedException Set up the name of the current analysis step.- Parameters:
analysisStep
- name- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem updating the survey report
-
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 InvalidParameterException, PropertyServerException, 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:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem updating the survey report
-
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 InvalidParameterException, PropertyServerException, 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:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem updating the survey report
-
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 InvalidParameterException, PropertyServerException, UserNotAuthorizedException Set up the description for the survey report that will result from this survey request.- Parameters:
surveyDescription
- String report description- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem updating the survey report
-
getSurveyPurpose
Return the purpose of the survey.- Returns:
- string
-
setSurveyPurpose
public void setSurveyPurpose(String surveyPurpose) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Set up the purpose of the survey.- Parameters:
surveyPurpose
- string- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem updating the survey report
-
setCompletionMessage
public void setCompletionMessage(String completionMessage) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Set up the completion message,- Parameters:
completionMessage
- new completion message- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user id not authorized to issue this requestPropertyServerException
- there was a problem updating the survey report
-
getAnnotationsForElement
public List<Annotation> getAnnotationsForElement(String elementGUID, int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, 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 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.
-
getNewAnnotations
public List<Annotation> getNewAnnotations(int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, 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:
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 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 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.
-
addAnnotation
public String addAnnotation(Annotation annotation, String associatedElementGUID) 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 objectassociatedElementGUID
- 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:
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.
-
addAnnotationExtension
public String addAnnotationExtension(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 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 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.
-