Class LikeHandler<B>
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<B>
-
- org.odpi.openmetadata.commonservices.generichandlers.LikeHandler<B>
-
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
-
-
Field Summary
-
Fields inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
auditLog, beanClass, converter, defaultZones, errorHandler, invalidParameterHandler, localServerUserId, publishZones, repositoryHandler, repositoryHelper, securityVerifier, serverName, serviceName, supportedZones
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountLikes(String userId, String elementGUID, String methodName)Count the number of Likes attached to an anchor entity.List<B>getLikes(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, List<String> serviceSupportedZones, int startingFrom, int pageSize, String methodName)Return the Likes attached to an entity.voidremoveLike(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String methodName)Remove the requested like.voidsaveLike(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, boolean isPublic, String methodName)Add or replace and existing Like for this user.-
Methods inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
addAnchorsClassification, archiveBeanInRepository, archiveBeanInRepository, countAttachments, createBeanFromTemplate, createBeanInRepository, deleteAnchoredEntity, deleteBeanInRepository, deleteBeanInRepository, deleteBeanInRepository, deleteBeanInRepository, deleteRelationship, entityMatchSearchCriteria, findAttachmentLinks, findBeanGUIDs, findBeans, findBeans, findBeans, findEntities, findEntities, getAllAttachmentLinks, getAnchorGUIDFromAnchorsClassification, getAttachedElement, getAttachedElementGUID, getAttachedElementGUID, getAttachedElementGUIDs, getAttachedElementGUIDs, getAttachedElements, getAttachedElements, getAttachedElements, getAttachedEntities, getAttachedEntities, getAttachedEntitiesFromUser, getAttachedEntity, getAttachedEntity, getAttachedEntity, getAttachedEntityFromUser, getAttachedFilteredEntities, getAttachedFilteredEntities, getAttachedFilteredEntities, getAttachmentLink, getAttachmentLinks, getAttachmentLinks, getAttachmentLinks, getBeanByUniqueName, getBeanByUniqueName, getBeanByValue, getBeanFromEntity, getBeanFromRepository, getBeanFromRepository, getBeanFromRepository, getBeanGUIDByUniqueName, getBeanGUIDByUniqueName, getBeanGUIDsByClassification, getBeanGUIDsByType, getBeanGUIDsByType, getBeanGUIDsByValue, getBeansByClassification, getBeansByCreator, getBeansByIntValue, getBeansByType, getBeansByType, getBeansByValue, getBeansByValue, getBeansByValue, getBeansByValue, getEffectiveTime, getEffectiveTime, getEntitiesByIntValue, getEntitiesByType, getEntitiesByType, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntityByValue, getEntityFromRepository, getEntityFromRepository, getEntityGUIDByValue, getEntityGUIDsByValue, getRepositoryHandler, getRepositoryHelper, getServerName, getServiceName, getTypeDefByName, getUniqueAttachmentLink, getUniqueAttachmentLink, isBeanIsolated, isEntityATypeOf, linkElementToElement, linkElementToElement, linkElementToElement, linkElementToElement, maintainSupplementaryProperties, multiLinkElementToElement, regexSearchCriteria, relinkElementToNewElement, relinkElementToNewElement, removeClassificationFromRepository, removeClassificationFromRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setSecurityVerifier, unlinkAllElements, unlinkConnectedElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, updateBeanEffectivityDates, updateBeanEffectivityDates, updateBeanInRepository, updateBeanInRepository, updateBeanInRepository, updateBeanPropertyInRepository, updateBeanStatusInRepository, updateBeanStatusInRepository, updateBeanStatusInRepository, updateClassificationEffectivityDates, updateClassificationEffectivityDates, updateElementToElementLink, updateElementToElementLink, updateElementToElementLink, updateElementToElementLink, updateRelationshipEffectivityDates, updateRelationshipEffectivityDates, updateRelationshipProperties, validateAnchorEntity, validateAnchorEntity, validateUniqueProperty, verifyExternalSourceIdentity
-
-
-
-
Constructor Detail
-
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 classbeanClass- name of bean class that is represented by the generic class BserviceName- 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 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 Detail
-
countLikes
public int countLikes(String userId, String elementGUID, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Count the number of Likes attached to an anchor entity.- Parameters:
userId- calling userelementGUID- identifier for the entity that the object is attached tomethodName- calling method- Returns:
- unique identifier of the object or null
- Throws:
InvalidParameterException- the parameters are invalidUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
getLikes
public List<B> getLikes(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, List<String> serviceSupportedZones, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the Likes attached to an entity.- Parameters:
userId- calling userelementGUID- identifier for the entity that the feedback is attached toelementGUIDParameterName- name of parameter supplying the element guidelementTypeName- name of type for the elementserviceSupportedZones- serviceSupportedZonesstartingFrom- where to start from in the listpageSize- maximum number of results that can be returnedmethodName- calling method- Returns:
- list of retrieved objects or null if none found
- Throws:
InvalidParameterException- the input properties are invalidUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
saveLike
public void saveLike(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, boolean isPublic, 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 server capability entity that represented the external source - null for localexternalSourceName- name of the software server capability entity that represented the external sourceelementGUID- unique identifier for the liked entity (Referenceable).elementGUIDParameterName- parameter supplying the elementGUIDisPublic- indicates whether the feedback should be shared or only be visible to the originating usermethodName- calling method- Throws:
InvalidParameterException- the endpoint bean properties are invalidUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
removeLike
public void removeLike(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Remove the requested like.- Parameters:
userId- calling userexternalSourceGUID- guid of the software server capability entity that represented the external source - null for localexternalSourceName- name of the software server capability entity that represented the external sourceelementGUID- object where rating is attachedelementGUIDParameterName- parameter supplying the elementGUIDmethodName- calling method- Throws:
InvalidParameterException- the entity guid is not knownUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
-