Class LikeHandler
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
org.odpi.openmetadata.frameworks.openmetadata.handlers.FeedbackHandler
org.odpi.openmetadata.frameworks.openmetadata.handlers.LikeHandler
LikeHandler is the handler for managing likes.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
auditLog, classificationBuilder, elementBuilder, localServerName, localServiceName, metadataElementTypeName, openMetadataClient, propertyHelper, relationshipBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionLikeHandler
(String localServerName, AuditLog auditLog, String serviceName, OpenMetadataClient openMetadataClient) Create a new handler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLikeToElement
(String userId, String elementGUID, UpdateOptions updateOptions, LikeProperties properties) Adds a "Like" to the element.getAttachedLikes
(String userId, String elementGUID, QueryOptions queryOptions) Return the likes attached to an element.void
removeLikeFromElement
(String userId, String elementGUID, MetadataSourceOptions metadataSourceOptions) Removes a "Like" added to the element by this user.Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.FeedbackHandler
addFeedbackToElement, getFeedbackForUser
Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
addDefaultType, addDefaultType, addDefaultType, addGovernanceDefinitionFamily, addMermaidToRootElement, convertRootElement, convertRootElement, convertRootElements, convertSolutionComponent, convertSolutionPort, createElementFromTemplate, createNewElement, findRootElements, getElementHierarchies, getElementHierarchy, getElementRelatedElements, getFullParentContext, getInformationSupplyChainContext, getQueryOptions, getQueryOptions, getQueryOptions, getRelatedRootElements, getRootElementByGUID, getRootElementByUniqueName, getRootElementsByName, updateElement, updateElementStatus
-
Constructor Details
-
LikeHandler
public LikeHandler(String localServerName, AuditLog auditLog, String serviceName, OpenMetadataClient openMetadataClient) Create a new handler.- Parameters:
localServerName
- name of this server (view server)auditLog
- logging destinationserviceName
- local service nameopenMetadataClient
- access to open metadata
-
-
Method Details
-
addLikeToElement
public void addLikeToElement(String userId, String elementGUID, UpdateOptions updateOptions, LikeProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Adds a "Like" to the element.- Parameters:
userId
- userId of user making requestelementGUID
- unique identifier for the elementupdateOptions
- provides a structure for the additional options when updating an element.properties
- properties- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem adding the element properties to the property server.UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
removeLikeFromElement
public void removeLikeFromElement(String userId, String elementGUID, MetadataSourceOptions metadataSourceOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Removes a "Like" added to the element by this user.- Parameters:
userId
- userId of user making request.elementGUID
- unique identifier for the like object.metadataSourceOptions
- options to control access to open metadata- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem updating the element properties in the property server.UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
getAttachedLikes
public List<OpenMetadataRootElement> getAttachedLikes(String userId, String elementGUID, QueryOptions queryOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the likes attached to an element.- Parameters:
userId
- userId of user making request.elementGUID
- unique identifier for the element that the comments are connected to (maybe a comment too).queryOptions
- multiple options to control the query- Returns:
- list of likes
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem updating the element properties in the property server.UserNotAuthorizedException
- the user does not have permission to perform this request.
-