Class AnnotationHandler<B>
java.lang.Object
org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIRootHandler<B>
org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<B>
org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPITemplateHandler<B>
org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler<B>
org.odpi.openmetadata.commonservices.generichandlers.AnnotationHandler<B>
AnnotationHandler manages the storage and retrieval of metadata relating to annotations
as defined in the Survey Action Framework (ODF). It has both specific support for creating annotations from
ODF annotation beans and generic support for retrieving annotations. The reason for this hybrid approach is that there are a huge range
of annotation types in ODF and currently all OMASs that work with discovery metadata use the ODF beans on their API.
Therefore, it makes sense to have support for these beans in a common location so that the implementation can be shared.
Note: this handler only supports current effective time with lineage and deduplication set to false since this is all the current
discovery use cases need.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
OpenMetadataAPIGenericHandler.AnchorIdentifiers
-
Field Summary
Fields inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIRootHandler
assetActionDescription, auditLog, beanClass, converter, defaultZones, errorHandler, invalidParameterHandler, localServerUserId, publishZones, qualifiedNamePropertyNamesList, repositoryHandler, repositoryHelper, securityVerifier, serverName, serviceName, supportedZones
-
Constructor Summary
ConstructorDescriptionAnnotationHandler
(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog) Construct the annotation handler with information needed to work with B objects. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotationReview
(String userId, String annotationGUID, String annotationGUIDParameterName, int annotationStatus, Date reviewDate, String steward, String comment, String annotationReviewTypeGUID, String annotationReviewTypeName, Map<String, Object> extendedProperties, String methodName) Attach an annotation review to an annotation.addAnnotationToAnnotation
(String userId, String parentAnnotationGUID, Annotation annotation, String methodName) Add a new annotation and link it to an existing annotation.addAnnotationToSurveyReport
(String userId, String surveyReportGUID, Annotation annotation, String methodName) Add a new annotation to the annotation store as a top level annotation linked directly off of the report.void
deleteAnnotation
(String userId, String annotationGUID, String methodName) Remove an annotation from the annotation store.getAnnotation
(String userId, String annotationGUID, String methodName) Retrieve a single annotation by unique identifier.getExtendedAnnotations
(String userId, String annotationGUID, int annotationStatus, int startingFrom, int pageSize, String methodName) Return any annotations attached to this annotation.getExtendedAnnotations
(String userId, String annotationGUID, int startingFrom, int pageSize, String methodName) Return any annotations attached to this annotation.getSurveyReportAnnotations
(String userId, String surveyReportGUID, int annotationStatus, int startingFrom, int pageSize, String methodName) Return the annotations linked direction to the report.getSurveyReportAnnotations
(String userId, String surveyReportGUID, int startingFrom, int pageSize, String methodName) Return the annotations linked direction to the report.Return the annotation subtype names.Return the list of annotation subtype names mapped to their descriptions.void
updateAnnotation
(String userId, String annotationGUID, Annotation annotation, String methodName) Replace the current properties of an annotation.Methods inherited from class org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler
addAssignmentScope, addDataFieldValuesClassification, addGovernanceActionClassification, addGovernanceDefinitionScope, addGovernanceExpectationsClassification, addGovernanceMeasurementsClassification, addGovernedBy, addImplementedBy, addMoreInformation, addOwner, addRetentionClassification, addSecurityTags, addStakeholder, addSubjectAreaClassification, addTemplateClassification, clearBusinessSignificant, getAssignedActors, getAssignmentScope, getBeanByQualifiedName, getBeanByQualifiedName, getBeanGUIDByQualifiedName, getBeanGUIDByQualifiedName, getCatalogTemplateList, getCollectionMembers, getCommissionedByStakeholder, getDataFieldValuesClassifiedElement, getDescriptiveElements, getElementsSourceFrom, getEntityByUniqueQualifiedName, getGovernanceActionClassifiedElements, getGovernanceDefinitionScope, getGovernedElements, getMeanings, getMoreInformation, getMoreInformation, getOwnersElements, getReferenceValueAssignees, getResourceList, getRetentionClassifiedElements, getSecurityTagsClassifiedElements, getSemanticAssignments, getSourceElements, getStakeholders, getSubjectAreaMembers, getSubjectAreaMembers, getSupportedByResource, getSupportedByTemplate, getValidValueConsumers, getVendorProperties, linkConsolidatedDuplicate, linkElementsAsPeerDuplicates, removeAssignmentScope, removeCatalogTemplate, removeDataFieldValuesClassification, removeGovernanceActionClassification, removeGovernanceDefinitionScope, removeGovernanceExpectationsClassification, removeGovernanceMeasurementsClassification, removeGovernedBy, removeImplementedBy, removeMoreInformation, removeOwner, removeResourceListMember, removeRetentionClassification, removeSecurityTags, removeSemanticAssignment, removeStakeholder, removeSubjectAreaClassification, removeTemplateClassification, saveCatalogTemplate, saveResourceListMember, saveSemanticAssignment, saveSemanticAssignment, saveSemanticAssignments, setBusinessSignificant, setVendorProperties, unlinkElementsAsPeerDuplicates
Methods inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPITemplateHandler
createBeanFromTemplate, createBeanFromTemplate
Methods inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
addAnchorGUIDToBuilder, addAnchorsClassification, archiveBeanInRepository, archiveBeanInRepository, countAttachments, createBeanInRepository, createBeanInRepository, deleteAnchoredEntity, deleteBeanInRepository, deleteBeanInRepository, deleteBeanInRepository, deleteRelationship, findAttachmentLinks, findBeans, findBeans, findBeans, findEntities, findEntities, findEntities, findEntities, getAllAttachmentLinks, getAnchorGUIDForEntity, getAnchorGUIDFromAnchorsClassification, getAttachedElement, getAttachedElementGUID, getAttachedElementGUID, getAttachedElementGUIDs, getAttachedElementGUIDs, getAttachedElements, getAttachedElements, getAttachedElements, getAttachedEntities, getAttachedEntities, getAttachedEntities, getAttachedEntity, getAttachedEntity, getAttachmentLink, getAttachmentLink, getAttachmentLinks, getAttachmentLinks, getAttachmentLinks, getBeanByUniqueName, getBeanByUniqueName, getBeanByValue, getBeanFromEntity, getBeanFromRepository, getBeanFromRepository, getBeanFromRepository, getBeanFromRepository, getBeanGUIDByUniqueName, getBeanGUIDByUniqueName, getBeanGUIDsByClassification, getBeanHistory, getBeansByIntValue, getBeansByType, getBeansByType, getBeansByValue, getBeansByValue, getDomainName, getDomainName, getEntitiesByIntValue, getEntitiesByType, getEntitiesByType, getEntitiesByValue, getEntitiesByValue, getEntityByValue, getEntityByValue, getEntityFromRepository, getEntityFromRepository, getEntityFromRepository, getEntityGUIDByValue, getEntityGUIDsByValue, getRelationshipHistory, getSpecification, getSupplementaryProperties, getUniqueAttachmentLink, getUniqueAttachmentLink, getValidatedBeans, getValidatedEntities, linkElementToElement, linkElementToElement, linkElementToElement, maintainSupplementaryProperties, multiLinkElementToElement, relinkElementToNewElement, relinkElementToNewElement, removeClassificationFromRepository, removeClassificationFromRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, uncheckedLinkElementToElement, undoBeanUpdateInRepository, undoBeanUpdateInRepository, undoBeanUpdateInRepository, unlinkAllElements, unlinkConnectedElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, updateBeanEffectivityDates, updateBeanInRepository, updateBeanInRepository, updateBeanInRepository, updateBeanInRepository, updateBeanPropertyInRepository, updateBeanStatusInRepository, updateBeanStatusInRepository, updateClassificationEffectivityDates, updateElementToElementLink, updateElementToElementLink, updateElementToElementLink, updateRelationshipEffectivityDates, updateRelationshipProperties, updateRelationshipProperties, validateAnchorEntity, validateAnchorForEntities, validateAnchorForEntity, validateAnchorForEntity, validateAnchorGUID, validateRelationship, validateUniqueProperty, verifyExternalSourceIdentity
Methods inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIRootHandler
getConverter, getElementStub, getRepositoryHandler, getRepositoryHelper, getServerName, getServiceName, getSupportedZones, getTypeDefByName, setSecurityVerifier
-
Constructor Details
-
AnnotationHandler
public AnnotationHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog) Construct the annotation handler with information needed to work with B objects.- Parameters:
converter
- specific converter for this bean classbeanClass
- name of bean class that is represented by the generic class BserviceName
- name of this serviceserverName
- name of the local serverinvalidParameterHandler
- handler for managing parameter errorsrepositoryHandler
- manages calls to the repository servicesrepositoryHelper
- provides utilities for manipulating the repository services objectslocalServerUserId
- userId for this serversecurityVerifier
- open metadata security services verifiersupportedZones
- list of zones that the access service is allowed to serve B instances from.defaultZones
- list of zones that the access service should set in all new B instances.publishZones
- list of zones that the access service sets up in published B instances.auditLog
- destination for audit log events.
-
-
Method Details
-
getTypesOfAnnotation
Return the annotation subtype names. These are derived from the types defined in the server.- Returns:
- list of type names that are subtypes of annotation
-
getTypesOfAnnotationDescriptions
Return the list of annotation subtype names mapped to their descriptions.- Returns:
- map of type names that are subtypes of asset to their description
-
addAnnotationToSurveyReport
public String addAnnotationToSurveyReport(String userId, String surveyReportGUID, Annotation annotation, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Add a new annotation to the annotation store as a top level annotation linked directly off of the report.- Parameters:
userId
- identifier of calling usersurveyReportGUID
- unique identifier of the discovery analysis reportannotation
- annotation objectmethodName
- calling method- 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 retrieving adding the annotation to the annotation store.
-
addAnnotationToAnnotation
public String addAnnotationToAnnotation(String userId, String parentAnnotationGUID, Annotation annotation, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Add a new annotation and link it to an existing annotation.- Parameters:
userId
- identifier of calling userparentAnnotationGUID
- unique identifier of the annotation that this new one is to be attached toannotation
- annotation objectmethodName
- calling method- Returns:
- unique identifier of the 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(String userId, String annotationGUID, Annotation annotation, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Replace the current properties of an annotation.- Parameters:
userId
- identifier of calling userannotationGUID
- unique identifierannotation
- new propertiesmethodName
- calling method- 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.
-
addAnnotationReview
public void addAnnotationReview(String userId, String annotationGUID, String annotationGUIDParameterName, int annotationStatus, Date reviewDate, String steward, String comment, String annotationReviewTypeGUID, String annotationReviewTypeName, Map<String, Object> extendedProperties, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionAttach an annotation review to an annotation. The annotation status is stored in the link between the annotation and the annotation review. The rest of the properties are for the AnnotationReview entity.- Parameters:
userId
- calling userannotationGUID
- annotation to attach toannotationGUIDParameterName
- parameter supplying annotationGUIDannotationStatus
- status of the annotation as a result of the reviewreviewDate
- date of the reviewsteward
- steward who performed the reviewcomment
- comments from the stewardannotationReviewTypeGUID
- subtype of the annotation review (or null for standard type)annotationReviewTypeName
- subtype of the annotation review (or null for standard type)extendedProperties
- any additional properties from the subtypemethodName
- calling method- 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 userId, String annotationGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove an annotation from the annotation store.- Parameters:
userId
- identifier of calling userannotationGUID
- unique identifier of the annotationmethodName
- calling method- 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.
-
getAnnotation
public B getAnnotation(String userId, String annotationGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a single annotation by unique identifier. This call is typically used to retrieve the latest values for an annotation.- Parameters:
userId
- identifier of calling userannotationGUID
- unique identifier of the annotationmethodName
- calling method- Returns:
- Annotation object
- 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.
-
getSurveyReportAnnotations
public List<B> getSurveyReportAnnotations(String userId, String surveyReportGUID, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the annotations linked direction to the report.- Parameters:
userId
- identifier of calling usersurveyReportGUID
- identifier of the discovery request.startingFrom
- initial position in the stored list.pageSize
- maximum number of definitions to return on this call.methodName
- calling method- Returns:
- list of annotations
- 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.
-
getSurveyReportAnnotations
public List<B> getSurveyReportAnnotations(String userId, String surveyReportGUID, int annotationStatus, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the annotations linked direction to the report.- Parameters:
userId
- identifier of calling usersurveyReportGUID
- identifier of the survey reportannotationStatus
- status of the desired annotations - null means all statuses.startingFrom
- initial position in the stored listpageSize
- maximum number of definitions to return on this call.methodName
- calling method- Returns:
- list of annotations
- 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.
-
getExtendedAnnotations
public List<B> getExtendedAnnotations(String userId, String annotationGUID, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return any annotations attached to this annotation.- Parameters:
userId
- identifier of calling userannotationGUID
- anchor annotationstartingFrom
- starting position in the listpageSize
- maximum number of annotations that can be returned.methodName
- calling method- 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.
-
getExtendedAnnotations
public List<B> getExtendedAnnotations(String userId, String annotationGUID, int annotationStatus, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return any annotations attached to this annotation.- Parameters:
userId
- identifier of calling userannotationGUID
- anchor annotationannotationStatus
- status of the desired annotations - null means all statuses.startingFrom
- starting position in the listpageSize
- maximum number of annotations that can be returned.methodName
- calling method- 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.
-