public class RatingHandler extends FeedbackHandlerBase
invalidParameterHandler, lastAttachmentHandler, repositoryHandler, repositoryHelper, serverName, serviceName| Constructor and Description |
|---|
RatingHandler(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 |
addRatingToReferenceable(String userId,
String anchorGUID,
String anchorType,
StarRating starRating,
String review,
boolean isPublic,
String methodName)
Adds a star rating and optional review text to the asset.
|
List<Rating> |
getRatings(String userId,
String anchorGUID,
int startingFrom,
int pageSize,
String methodName)
Return the Ratings attached to an anchor entity.
|
void |
removeRatingFromReferencable(String userId,
String anchorGUID,
String anchorType,
String methodName)
Removes of a review that was added to the asset by this user.
|
countAttachments, getAttachmentLinks, getAttachments, visibleToUserpublic RatingHandler(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<Rating> getRatings(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 void addRatingToReferenceable(String userId, String anchorGUID, String anchorType, StarRating starRating, String review, boolean isPublic, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
userId - userId of user making request.anchorGUID - unique identifier of referenceableanchorType - type name of referenceable.starRating - StarRating enumeration for not recommended, one to five stars.review - user review of asset. This can be null.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 removeRatingFromReferencable(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 rating 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–2020 ODPi. All rights reserved.