Class CommentHandler<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.CommentHandler<B>
CommentHandler manages Comment objects. It runs server-side in
the OMAG Server Platform and retrieves Comment entities through the OMRSRepositoryConnector.
-
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
ConstructorDescriptionCommentHandler
(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 handler information needed to interact with the repository services -
Method Summary
Modifier and TypeMethodDescriptionattachNewComment
(String userId, String externalSourceGUID, String externalSourceName, String anchorGUID, String parentGUID, String parentGUIDParameterName, int commentType, String commentText, boolean isPublic, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Adds a comment and link it to the supplied parent entity.attachNewComment
(String userId, String externalSourceGUID, String externalSourceName, String anchorGUID, String parentGUID, String parentGUIDParameterName, String suppliedQualifiedName, int commentType, String commentText, boolean isPublic, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Adds a comment and link it to the supplied parent entity.void
clearAcceptedAnswer
(String userId, String externalSourceGUID, String externalSourceName, String questionCommentGUID, String questionCommentGUIDParameterName, String answerCommentGUID, String answerCommentGUIDParameterName, Date effectiveTime, boolean forLineage, boolean forDuplicateProcessing, String methodName) Unlink a comment that contains an answer to a question posed in another comment.getComments
(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Return the comments attached to an anchor entity.getComments
(String userId, String anchorGUID, String anchorGUIDParameterName, String elementGUID, String elementGUIDParameterName, String elementTypeName, List<String> serviceSupportedZones, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Return the comments attached to an entity.void
removeCommentFromElement
(String userId, String externalSourceGUID, String externalSourceName, String commentGUID, String commentGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Removes a comment added to the parent by this user.void
setupAcceptedAnswer
(String userId, String externalSourceGUID, String externalSourceName, String questionCommentGUID, String questionCommentGUIDParameterName, String answerCommentGUID, String answerCommentGUIDParameterName, boolean isPublic, Date effectiveFrom, Date effectiveTo, Date effectiveTime, boolean forLineage, boolean forDuplicateProcessing, String methodName) Link a comment that contains the best answer to a question posed in another comment.void
updateComment
(String userId, String externalSourceGUID, String externalSourceName, String commentGUID, String commentGUIDParameterName, String qualifiedName, int commentType, String commentText, boolean isPublic, boolean isMergeUpdate, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Update an existing comment.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, findBeanGUIDsByQualifiedName, findBeansByQualifiedName, findBeansByQualifiedName, getAssignedActors, getAssignmentScope, getBeanByQualifiedName, getBeanByQualifiedName, getBeanGUIDByQualifiedName, getBeanGUIDByQualifiedName, getBeanGUIDsByQualifiedName, getBeanGUIDsByQualifiedName, getBeansByQualifiedName, getBeansByQualifiedName, 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, findBeanGUIDs, findBeans, findBeans, findBeans, findEntities, findEntities, findEntities, findEntities, getAllAttachmentLinks, getAnchorGUIDFromAnchorsClassification, getAttachedElement, getAttachedElementGUID, getAttachedElementGUID, getAttachedElementGUIDs, getAttachedElementGUIDs, getAttachedElements, getAttachedElements, getAttachedElements, getAttachedEntities, getAttachedEntities, getAttachedEntities, getAttachedEntitiesFromUser, getAttachedEntity, getAttachedEntity, getAttachedEntityFromUser, getAttachmentLink, getAttachmentLinks, getAttachmentLinks, getAttachmentLinks, getAttachmentsForType, getBeanByUniqueName, getBeanByUniqueName, getBeanByValue, getBeanFromEntity, getBeanFromRepository, getBeanFromRepository, getBeanFromRepository, getBeanGUIDByUniqueName, getBeanGUIDByUniqueName, getBeanGUIDsByClassification, getBeanGUIDsByType, getBeanGUIDsByType, getBeanHistory, getBeansByClassification, getBeansByCreator, getBeansByIntValue, getBeansByType, getBeansByType, getBeansByValue, getBeansByValue, getDomainName, getDomainName, getEntitiesByIntValue, getEntitiesByType, getEntitiesByType, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntityByValue, getEntityByValue, getEntityFromRepository, getEntityFromRepository, getEntityGUIDByValue, getEntityGUIDsByValue, getSpecification, getSupplementaryProperties, getUniqueAttachmentLink, getUniqueAttachmentLink, isBeanIsolated, isEntityATypeOf, linkElementToElement, linkElementToElement, linkElementToElement, maintainSupplementaryProperties, multiLinkElementToElement, relinkElementToNewElement, relinkElementToNewElement, removeClassificationFromRepository, removeClassificationFromRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, uncheckedLinkElementToElement, undoBeanUpdateInRepository, undoBeanUpdateInRepository, undoBeanUpdateInRepository, unlinkAllElements, unlinkConnectedElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, updateBeanEffectivityDates, updateBeanEffectivityDates, updateBeanInRepository, updateBeanInRepository, updateBeanInRepository, updateBeanInRepository, updateBeanPropertyInRepository, updateBeanStatusInRepository, updateBeanStatusInRepository, updateClassificationEffectivityDates, updateElementToElementLink, updateElementToElementLink, updateElementToElementLink, updateRelationshipEffectivityDates, updateRelationshipEffectivityDates, updateRelationshipProperties, updateRelationshipProperties, validateAnchorEntity, validateAnchorEntity, validateUniqueProperty, verifyExternalSourceIdentity
Methods inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIRootHandler
getConverter, getElementStub, getRepositoryHandler, getRepositoryHelper, getServerName, getServiceName, getSupportedZones, getTypeDefByName, setSecurityVerifier
-
Constructor Details
-
CommentHandler
public CommentHandler(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 handler information needed to interact with the repository services- 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 Asset instances from.defaultZones
- list of zones that the access service should set in all new Asset instances.publishZones
- list of zones that the access service sets up in published Asset instances.auditLog
- destination for audit log events.
-
-
Method Details
-
attachNewComment
public String attachNewComment(String userId, String externalSourceGUID, String externalSourceName, String anchorGUID, String parentGUID, String parentGUIDParameterName, int commentType, String commentText, boolean isPublic, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Adds a comment and link it to the supplied parent entity.- Parameters:
userId
- String - userId of user making request.externalSourceGUID
- guid of the software capability entity that represented the external source - null for localexternalSourceName
- name of the software capability entity that represented the external sourceanchorGUID
- head of the comment chainparentGUID
- String - unique id for a referenceable entity that the comment is to be attached to.parentGUIDParameterName
- name of parameter that supplied the entity's unique identifier.commentType
- ordinal of comment enum.commentText
- String - the text of the comment.isPublic
- should this be visible to all or private to the callereffectiveFrom
- the date when this element is active - null for active noweffectiveTo
- the date when this element becomes inactive - null for active until deletedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName
- calling method- Returns:
- guid of new comment.
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- There is a problem adding the asset properties to the property server.UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
attachNewComment
public String attachNewComment(String userId, String externalSourceGUID, String externalSourceName, String anchorGUID, String parentGUID, String parentGUIDParameterName, String suppliedQualifiedName, int commentType, String commentText, boolean isPublic, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Adds a comment and link it to the supplied parent entity.- Parameters:
userId
- String - userId of user making request.externalSourceGUID
- guid of the software capability entity that represented the external source - null for localexternalSourceName
- name of the software capability entity that represented the external sourceanchorGUID
- head of the comment chainparentGUID
- String - unique id for a referenceable entity that the comment is to be attached to.parentGUIDParameterName
- name of parameter that supplied the entity's unique identifier.suppliedQualifiedName
- unique identifier for the commentcommentType
- ordinal of comment enum.commentText
- String - the text of the comment.isPublic
- should this be visible to all or private to the callereffectiveFrom
- the date when this element is active - null for active noweffectiveTo
- the date when this element becomes inactive - null for active until deletedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName
- calling method- Returns:
- guid of new comment.
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- There is a problem adding the asset properties to the property server.UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
updateComment
public void updateComment(String userId, String externalSourceGUID, String externalSourceName, String commentGUID, String commentGUIDParameterName, String qualifiedName, int commentType, String commentText, boolean isPublic, boolean isMergeUpdate, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Update an existing comment.- Parameters:
userId
- userId of user making request.externalSourceGUID
- guid of the software capability entity that represented the external source - null for localexternalSourceName
- name of the software capability entity that represented the external sourcecommentGUID
- unique identifier for the comment to changecommentGUIDParameterName
- name of parameter for commentGUIDqualifiedName
- unique name of the commentcommentType
- type of comment enum.commentText
- the text of the comment.isPublic
- indicates whether the feedback should be shared or only be visible to the originating userisMergeUpdate
- should the new properties be merged with existing properties (true) or completely replace them (false)?effectiveFrom
- the date when this element is active - null for active noweffectiveTo
- the date when this element becomes inactive - null for active until deletedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName
- calling method- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem adding the asset properties to the property server.UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
removeCommentFromElement
public void removeCommentFromElement(String userId, String externalSourceGUID, String externalSourceName, String commentGUID, String commentGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Removes a comment added to the parent by this user.- Parameters:
userId
- userId of user making request.externalSourceGUID
- guid of the software capability entity that represented the external source - null for localexternalSourceName
- name of the software capability entity that represented the external sourcecommentGUIDParameterName
- parameter supplying thecommentGUID
- unique identifier for the comment object.forLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName
- calling method- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem updating the asset properties in the property server.UserNotAuthorizedException
- the user does not have permission to perform this request.
-
setupAcceptedAnswer
public void setupAcceptedAnswer(String userId, String externalSourceGUID, String externalSourceName, String questionCommentGUID, String questionCommentGUIDParameterName, String answerCommentGUID, String answerCommentGUIDParameterName, boolean isPublic, Date effectiveFrom, Date effectiveTo, Date effectiveTime, boolean forLineage, boolean forDuplicateProcessing, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Link a comment that contains the best answer to a question posed in another comment.- Parameters:
userId
- calling userexternalSourceGUID
- guid of the software capability entity that represented the external source - null for localexternalSourceName
- name of the software capability entity that represented the external sourcequestionCommentGUID
- unique identifier of the comment containing the questionquestionCommentGUIDParameterName
- parameter supplying questionCommentGUIDanswerCommentGUID
- unique identifier of the comment containing the accepted answeranswerCommentGUIDParameterName
- parameter supplying the answerCommentGUIDisPublic
- who can retrieve the relationshipeffectiveFrom
- the time that the relationship element must be effective from (null for any time, new Date() for now)effectiveTo
- the time that the relationship must be effective to (null for any time, new Date() for now)effectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)forLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?methodName
- calling method- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
clearAcceptedAnswer
public void clearAcceptedAnswer(String userId, String externalSourceGUID, String externalSourceName, String questionCommentGUID, String questionCommentGUIDParameterName, String answerCommentGUID, String answerCommentGUIDParameterName, Date effectiveTime, boolean forLineage, boolean forDuplicateProcessing, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Unlink a comment that contains an answer to a question posed in another comment.- Parameters:
userId
- calling userexternalSourceGUID
- guid of the software capability entity that represented the external source - null for localexternalSourceName
- name of the software capability entity that represented the external sourcequestionCommentGUID
- unique identifier of the comment containing the questionquestionCommentGUIDParameterName
- parameter supplying questionCommentGUIDanswerCommentGUID
- unique identifier of the comment containing the accepted answeranswerCommentGUIDParameterName
- parameter supplying answerCommentGUIDeffectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)forLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?methodName
- calling method- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getComments
public List<B> getComments(String userId, String anchorGUID, String anchorGUIDParameterName, String elementGUID, String elementGUIDParameterName, String elementTypeName, List<String> serviceSupportedZones, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the comments attached to an entity.- Parameters:
userId
- calling useranchorGUID
- expected anchorGUID for this elementanchorGUIDParameterName
- parameter supplying anchorGUIDelementGUID
- identifier for the entity that the comment is attached toelementGUIDParameterName
- name of the parameter providing the element GUIDelementTypeName
- name of the type of the anchor entityserviceSupportedZones
- supported zones for the particular servicestartingFrom
- where to start from in the listpageSize
- maximum number of results that can be returnedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName
- calling method- Returns:
- list of retrieved objects
- Throws:
InvalidParameterException
- the input properties are invalidUserNotAuthorizedException
- user not authorized to issue this requestPropertyServerException
- problem accessing the property server
-
getComments
public List<B> getComments(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the comments attached to an anchor entity. (No special security checking is required).- Parameters:
userId
- calling userelementGUID
- identifier for the entity that the comment is attached toelementGUIDParameterName
- name of the parameter providing the element GUIDelementTypeName
- name of the type of the anchor entitystartingFrom
- where to start from in the listpageSize
- maximum number of results that can be returnedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName
- calling method- Returns:
- list of retrieved objects
- Throws:
InvalidParameterException
- the input properties are invalidUserNotAuthorizedException
- user not authorized to issue this requestPropertyServerException
- problem accessing the property server
-