public class LikeHandler extends FeedbackHandlerBase
| Constructor and Description |
|---|
LikeHandler(String serviceName,
String serverName,
InvalidParameterHandler invalidParameterHandler,
RepositoryHandler repositoryHandler,
OMRSRepositoryHelper repositoryHelper,
LastAttachmentHandler lastAttachmentHandler)
Construct the handler information needed to interact with the repository services
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLikeToReferenceable(String userId,
String anchorGUID,
String anchorType,
boolean isPublic,
String methodName)
Adds a "Like" to the asset.
|
List<Like> |
getLikes(String userId,
String anchorGUID,
int startingFrom,
int pageSize,
String methodName)
Return the Likes attached to an anchor entity.
|
void |
removeLikeFromReferenceable(String userId,
String anchorGUID,
String anchorType,
String methodName)
Removes a "Like" added to the asset by this user.
|
String |
saveLike(String userId,
String anchorGUID,
boolean isPublic,
String methodName)
Add or replace and existing Like for this user.
|
countAttachments, getAttachmentLinks, getAttachments, visibleToUserpublic LikeHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, LastAttachmentHandler lastAttachmentHandler)
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 objectslastAttachmentHandler - handler for recording last attachmentpublic List<Like> getLikes(String userId, String anchorGUID, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
userId - calling useranchorGUID - identifier for the entity that the feedback is attached tostartingFrom - where to start from in the listpageSize - maximum number of results that can be returnedmethodName - calling methodInvalidParameterException - the input properties are invalidUserNotAuthorizedException - user not authorized to issue this requestPropertyServerException - problem accessing the property serverpublic String saveLike(String userId, String anchorGUID, boolean isPublic, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
userId - userId of user making request.anchorGUID - unique identifier for the anchor entity (Referenceable).isPublic - indicates whether the feedback should be shared or only be visible to the originating usermethodName - calling methodInvalidParameterException - the endpoint bean properties are invalidUserNotAuthorizedException - user not authorized to issue this requestPropertyServerException - problem accessing the property serverpublic void addLikeToReferenceable(String userId, String anchorGUID, String anchorType, boolean isPublic, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
userId - userId of user making request.anchorGUID - unique identifier for the asset where the like is to be attached.anchorType - type of anchor entity.isPublic - indicates whether the feedback should be shared or only be visible to the originating usermethodName - calling methodInvalidParameterException - 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.public void removeLikeFromReferenceable(String userId, String anchorGUID, String anchorType, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
userId - userId of user making request.anchorGUID - unique identifier for the asset where the like is attached.anchorType - type of anchor entity.methodName - calling methodInvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem updating the asset properties in the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.Copyright © 2018–2019 ODPi. All rights reserved.