Class CommentExchangeHandler
java.lang.Object
org.odpi.openmetadata.accessservices.assetmanager.handlers.CommentExchangeHandler
CommentExchangeHandler is the server side handler for managing comments.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCommentExchangeHandler
(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 comment exchange handler with information needed to work with comment related objects for Asset Manager OMAS. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearAcceptedAnswer
(String userId, String assetManagerGUID, String assetManagerName, String questionCommentGUID, String answerCommentGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Unlink a comment that contains an answer to a question posed in another comment.void
clearElementAsDataField
(String userId, MetadataCorrelationProperties correlationProperties, String elementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Remove the data field designation from the element.createComment
(String userId, String guid, String guidParameterName, MetadataCorrelationProperties correlationProperties, boolean isPublic, CommentProperties commentProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Create a new comment.findComments
(String userId, String assetManagerGUID, String assetManagerName, String searchString, String searchStringParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the list of comment metadata elements that contain the search string.getAttachedComments
(String userId, String assetManagerGUID, String assetManagerName, String elementGUID, String elementGUIDParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Return the comments attached to an element.getCommentByGUID
(String userId, String assetManagerGUID, String assetManagerName, String commentGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the comment metadata element with the supplied unique identifier.void
removeComment
(String userId, MetadataCorrelationProperties correlationProperties, String commentGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Remove the metadata element representing a comment.void
setElementAsDataField
(String userId, MetadataCorrelationProperties correlationProperties, String elementGUID, DataFieldValuesProperties properties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Classify the element to indicate that it describes a data field and supply properties that describe the characteristics of the data values found within.void
setupAcceptedAnswer
(String userId, String assetManagerGUID, String assetManagerName, String questionCommentGUID, String answerCommentGUID, boolean isPublic, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Link a comment that contains the best answer to a question posed in another comment.void
updateComment
(String userId, MetadataCorrelationProperties correlationProperties, String commentGUID, CommentProperties commentProperties, boolean isMergeUpdate, boolean isPublic, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Update the metadata element representing a comment.
-
Field Details
-
elementGUIDParameterName
- See Also:
-
-
Constructor Details
-
CommentExchangeHandler
public CommentExchangeHandler(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 comment exchange handler with information needed to work with comment related objects for Asset Manager OMAS.- Parameters:
serviceName
- 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 instances from.defaultZones
- list of zones that the access service should set in all new instances.publishZones
- list of zones that the access service sets up in published instances.auditLog
- destination for audit log events.
-
-
Method Details
-
createComment
public String createComment(String userId, String guid, String guidParameterName, MetadataCorrelationProperties correlationProperties, boolean isPublic, CommentProperties commentProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a new comment.- Parameters:
userId
- calling userguid
- unique identifier of the element to attach the comment toguidParameterName
- parameter for guidcorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadataisPublic
- is this visible to other peoplecommentProperties
- properties to storeforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- Returns:
- unique identifier of the new metadata element
- 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)
-
updateComment
public void updateComment(String userId, MetadataCorrelationProperties correlationProperties, String commentGUID, CommentProperties commentProperties, boolean isMergeUpdate, boolean isPublic, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the metadata element representing a comment.- Parameters:
userId
- calling usercorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadatacommentGUID
- unique identifier of the metadata element to updatecommentProperties
- new properties for this elementisMergeUpdate
- should the properties be merged with the existing properties or completely over-write themisPublic
- is this visible to other peopleforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- 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)
-
removeComment
public void removeComment(String userId, MetadataCorrelationProperties correlationProperties, String commentGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the metadata element representing a comment. This will delete the comment and all comment replies.- Parameters:
userId
- calling usercorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadatacommentGUID
- unique identifier of the metadata element to removeforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- optional date for effective time of the query. Null means any effective timemethodName
- 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)
-
setupAcceptedAnswer
public void setupAcceptedAnswer(String userId, String assetManagerGUID, String assetManagerName, String questionCommentGUID, String answerCommentGUID, boolean isPublic, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Link a comment that contains the best answer to a question posed in another comment.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerquestionCommentGUID
- unique identifier of the comment containing the questionanswerCommentGUID
- unique identifier of the comment containing the accepted answerisPublic
- 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)forLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- optional date for effective time of the query. Null means any effective timemethodName
- 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 assetManagerGUID, String assetManagerName, String questionCommentGUID, String answerCommentGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Unlink a comment that contains an answer to a question posed in another comment.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerquestionCommentGUID
- unique identifier of the comment containing the questionanswerCommentGUID
- unique identifier of the comment containing the accepted answerforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- optional date for effective time of the query. Null means any effective timemethodName
- 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)
-
findComments
public List<CommentElement> findComments(String userId, String assetManagerGUID, String assetManagerName, String searchString, String searchStringParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of comment metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callersearchString
- string to find in the propertiessearchStringParameterName
- name of parameter for search stringstartFrom
- paging start pointpageSize
- maximum 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 matching metadata elements
- 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)
-
getAttachedComments
public List<CommentElement> getAttachedComments(String userId, String assetManagerGUID, String assetManagerName, String elementGUID, String elementGUIDParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the comments attached to an element.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerelementGUID
- unique identifier for the element where the like is attached.elementGUIDParameterName
- name of parameter for elementGUIDstartFrom
- paging start pointpageSize
- maximum 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 matching metadata elements
- 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)
-
getCommentByGUID
public CommentElement getCommentByGUID(String userId, String assetManagerGUID, String assetManagerName, String commentGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the comment metadata element with the supplied unique identifier.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callercommentGUID
- unique identifier of the requested metadata elementforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- Returns:
- matching metadata element
- 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)
-
setElementAsDataField
public void setElementAsDataField(String userId, MetadataCorrelationProperties correlationProperties, String elementGUID, DataFieldValuesProperties properties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Classify the element to indicate that it describes a data field and supply properties that describe the characteristics of the data values found within.- Parameters:
userId
- calling usercorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadataelementGUID
- unique identifier of the metadata element to updateproperties
- characterizations of the data values stored in the data fieldforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- optional date for effective time of the query. Null means any effective timemethodName
- 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)
-
clearElementAsDataField
public void clearElementAsDataField(String userId, MetadataCorrelationProperties correlationProperties, String elementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the data field designation from the element.- Parameters:
userId
- calling usercorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadataelementGUID
- unique identifier of the metadata element to updateforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- optional date for effective time of the query. Null means any effective timemethodName
- 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)
-