public class LikeHandler<B> extends OpenMetadataAPIGenericHandler<B>
LikeHandler provides access and maintenance for Like objects and their attachment to Referenceables. There is no support for effectivity dates since this does not make sense for this element. The Like is always anchored to its connected element
  • Constructor Details

    • LikeHandler

      public LikeHandler(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 for likes.
      Parameters:
      converter - specific converter for this bean class
      beanClass - name of bean class that is represented by the generic class B
      serviceName - name of this service
      serverName - name of the local server
      invalidParameterHandler - handler for managing parameter errors
      repositoryHandler - manages calls to the repository services
      repositoryHelper - provides utilities for manipulating the repository services objects
      localServerUserId - userId for this server
      securityVerifier - open metadata security services verifier
      supportedZones - 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

    • getLikes

      public List<B> getLikes(String userId, 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 Likes attached to an entity.
      Parameters:
      userId - calling user
      elementGUID - identifier for the entity that the feedback is attached to
      elementGUIDParameterName - name of parameter supplying the element guid
      elementTypeName - name of type for the element
      serviceSupportedZones - serviceSupportedZones
      startingFrom - where to start from in the list
      pageSize - maximum number of results that can be returned
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - what is the effective time for related queries needed to do the update
      methodName - calling method
      Returns:
      list of retrieved objects or null if none found
      Throws:
      InvalidParameterException - the input properties are invalid
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server
    • saveLike

      public void saveLike(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, boolean isPublic, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Add or replace and existing Like for this user.
      Parameters:
      userId - userId of user making request.
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      elementGUID - unique identifier for the liked entity (Referenceable).
      elementGUIDParameterName - parameter supplying the elementGUID
      isPublic - indicates whether the feedback should be shared or only be visible to the originating user
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - what is the effective time for related queries needed to do the update
      methodName - calling method
      Throws:
      InvalidParameterException - the endpoint bean properties are invalid
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server
    • removeLike

      public void removeLike(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Remove the requested like.
      Parameters:
      userId - calling user
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      elementGUID - object where rating is attached
      elementGUIDParameterName - parameter supplying the elementGUID
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - what is the effective time for related queries needed to do the update
      methodName - calling method
      Throws:
      InvalidParameterException - the entity guid is not known
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server