Class SearchKeywordHandler<B>
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<B>
-
- org.odpi.openmetadata.commonservices.generichandlers.SearchKeywordHandler<B>
-
public class SearchKeywordHandler<B> extends OpenMetadataAPIGenericHandler<B>
SearchKeywordHandler manages SearchKeyword objects. These are user controlled semantic keywords. SearchKeywordHandler runs server-side in the OMAG Server Platform and retrieves SearchKeyword entities through the OMRSRepositoryConnector. This handler does not support effectivity dates because it does not make sense for the element type.
-
-
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 SearchKeywordHandler(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 information needed to interact with the repository services
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddKeywordToElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String keywordGUID, String keywordGUIDParameterName, List<String> serviceSupportedZones, String methodName)Adds a keyword to the requested element.intcountKeywords(String userId, String elementGUID, String methodName)Count the number of informal keywords attached to a supplied entity.StringcreateKeyword(String userId, String externalSourceGUID, String externalSourceName, String keywordName, String keywordDescription, String methodName)Creates a new keyword and returns the unique identifier for it.voiddeleteKeyword(String userId, String externalSourceGUID, String externalSourceName, String keywordGUID, String methodName)Removes a keyword from the repository.List<B>findKeywords(String userId, String searchString, String searchStringParameterName, List<String> serviceSupportedZones, int startFrom, int pageSize, String methodName)Return the list of keywords matching the supplied searchString.List<B>getAttachedKeywords(String userId, String startingGUID, String startingGUIDParameterName, String startingTypeName, List<String> serviceSupportedZones, int startingFrom, int pageSize, String methodName)Return the keywords attached to a supplied entity.BgetKeyword(String userId, String guid, String guidParameterName, List<String> serviceSupportedZones, String methodName)Return the keyword for the supplied unique identifier (guid).List<B>getKeywordsByName(String userId, String keyword, String keywordParameterName, List<String> serviceSupportedZones, int startFrom, int pageSize, String methodName)Return the list of keywords exactly matching the supplied keyword.List<B>getRelatedKeywords(String userId, String startingKeywordGUID, String startingKeywordGUIDParameterName, List<String> serviceSupportedZones, int startingFrom, int pageSize, String methodName)Return the keywords attached to a supplied entity.voidlinkRelatedKeywords(String userId, String externalSourceGUID, String externalSourceName, String keywordOneGUID, String keywordOneGUIDParameterName, String keywordTwoGUID, String keywordTwoGUIDParameterName, List<String> serviceSupportedZones, String methodName)Create a related keyword relationship between search keywords.voidremoveKeywordFromElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String keywordGUID, String keywordGUIDParameterName, List<String> serviceSupportedZones, String methodName)Removes the link between a keyword and an element.voidunlinkRelatedKeywords(String userId, String externalSourceGUID, String externalSourceName, String keywordOneGUID, String keywordOneGUIDParameterName, String keywordTwoGUID, String keywordTwoGUIDParameterName, List<String> serviceSupportedZones, String methodName)Removes a relationship between keywords.voidupdateKeywordDescription(String userId, String externalSourceGUID, String externalSourceName, String keywordGUID, String keywordGUIDParameterName, String keywordDescription, List<String> serviceSupportedZones, String methodName)Updates the description of an existing keyword.-
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
-
SearchKeywordHandler
public SearchKeywordHandler(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 information needed to interact with the repository services- 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
-
createKeyword
public String createKeyword(String userId, String externalSourceGUID, String externalSourceName, String keywordName, String keywordDescription, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Creates a new keyword and returns the unique identifier for it.- 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 sourcekeywordName- name of the keyword.keywordDescription- (optional) description of the keyword. Setting a description, particularly in a public keyword makes the keyword more valuable to other users and can act as an embryonic glossary term.methodName- calling method- Returns:
- GUID for new keyword.
- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem adding the keyword properties to the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
updateKeywordDescription
public void updateKeywordDescription(String userId, String externalSourceGUID, String externalSourceName, String keywordGUID, String keywordGUIDParameterName, String keywordDescription, List<String> serviceSupportedZones, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Updates the description of an existing keyword.- 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 sourcekeywordGUID- unique identifier for the keywordkeywordGUIDParameterName- parameter providing keywordGUIDkeywordDescription- description of the keyword. Setting a description, particularly in a public keyword makes the keyword more valuable to other users and can act as an embryonic glossary term.serviceSupportedZones- supported zones for calling servicemethodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem adding the keyword properties to the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
deleteKeyword
public void deleteKeyword(String userId, String externalSourceGUID, String externalSourceName, String keywordGUID, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Removes a keyword from the repository. A private keyword can be deleted by its creator and all of the references are lost; a public keyword can be deleted by anyone, but only if it is not attached to any referenceable.- 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 sourcekeywordGUID- unique id for the keyword.methodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem updating the keyword properties in the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
countKeywords
public int countKeywords(String userId, String elementGUID, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Count the number of informal keywords attached to a supplied entity.- Parameters:
userId- calling userelementGUID- identifier for the entity that the object is attached tomethodName- calling method- Returns:
- count of attached objects
- Throws:
InvalidParameterException- the parameters are invalidUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
getAttachedKeywords
public List<B> getAttachedKeywords(String userId, String startingGUID, String startingGUIDParameterName, String startingTypeName, List<String> serviceSupportedZones, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the keywords attached to a supplied entity.- Parameters:
userId- calling userstartingGUID- identifier for the entity that the keyword is attached tostartingGUIDParameterName- name of parameter supplying the GUIDstartingTypeName- name of the type of object being attached toserviceSupportedZones- supported zones for calling servicestartingFrom- start position for resultspageSize- maximum number of resultsmethodName- 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
-
getRelatedKeywords
public List<B> getRelatedKeywords(String userId, String startingKeywordGUID, String startingKeywordGUIDParameterName, List<String> serviceSupportedZones, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the keywords attached to a supplied entity.- Parameters:
userId- calling userstartingKeywordGUID- identifier for the entity that the keyword is attached tostartingKeywordGUIDParameterName- name of parameter supplying the GUIDserviceSupportedZones- supported zones for calling servicestartingFrom- start position for resultspageSize- maximum number of resultsmethodName- 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
-
getKeyword
public B getKeyword(String userId, String guid, String guidParameterName, List<String> serviceSupportedZones, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the keyword for the supplied unique identifier (guid). The keyword is only returned if- Parameters:
userId- userId of the user making the request.guid- unique identifier of the keyword.guidParameterName- name of the parameter supplying the GUIDserviceSupportedZones- supported zones for calling servicemethodName- calling method- Returns:
- keyword
- Throws:
InvalidParameterException- the userId or guid is null or invalid.PropertyServerException- there is a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getKeywordsByName
public List<B> getKeywordsByName(String userId, String keyword, String keywordParameterName, List<String> serviceSupportedZones, int startFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the list of keywords exactly matching the supplied keyword.- Parameters:
userId- the keyword of the calling userkeyword- keyword of keywordkeywordParameterName- parameter providing keywordserviceSupportedZones- list of supported zones for this servicestartFrom- index of the list ot start from (0 for start)pageSize- maximum number of elements to returnmethodName- calling method- Returns:
- keyword list
- Throws:
InvalidParameterException- the userId is null or invalid.PropertyServerException- there is a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
findKeywords
public List<B> findKeywords(String userId, String searchString, String searchStringParameterName, List<String> serviceSupportedZones, int startFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the list of keywords matching the supplied searchString.- Parameters:
userId- the searchString of the calling user.searchString- searchString of keyword. This may include wild card characters.searchStringParameterName- name of parameter providing search stringserviceSupportedZones- list of supported zones for this service.startFrom- index of the list ot start from (0 for start)pageSize- maximum number of elements to return.methodName- calling method- Returns:
- keyword list
- Throws:
InvalidParameterException- the userId is null or invalid.PropertyServerException- there is a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
addKeywordToElement
public void addKeywordToElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String keywordGUID, String keywordGUIDParameterName, List<String> serviceSupportedZones, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Adds a keyword to the requested element.- 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 id for the element.elementGUIDParameterName- name of the parameter supplying the elementGUIDelementType- type of the element.keywordGUID- unique id of the keyword.keywordGUIDParameterName- name of the parameter supplying the keywordOneGUIDserviceSupportedZones- list of zones supported by this servicemethodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem adding the keyword properties to the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
removeKeywordFromElement
public void removeKeywordFromElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String keywordGUID, String keywordGUIDParameterName, List<String> serviceSupportedZones, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Removes the link between a keyword and an element.- Parameters:
userId- userId of user making requestexternalSourceGUID- 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 id for the referenceable to connect toelementGUIDParameterName- name of the parameter supplying the elementGUIDelementType- type of the elementkeywordGUID- unique id for the keywordkeywordGUIDParameterName- name of parameter supplying keywordGUIDserviceSupportedZones- list of supported zones for this servicemethodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem updating the keyword properties in the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
linkRelatedKeywords
public void linkRelatedKeywords(String userId, String externalSourceGUID, String externalSourceName, String keywordOneGUID, String keywordOneGUIDParameterName, String keywordTwoGUID, String keywordTwoGUIDParameterName, List<String> serviceSupportedZones, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Create a related keyword relationship between search keywords.- Parameters:
userId- userId of user making requestexternalSourceGUID- 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 sourcekeywordOneGUID- unique id for the first keywordkeywordOneGUIDParameterName- name of the parameter supplying the keywordOneGUIDkeywordTwoGUID- unique id of the second keywordkeywordTwoGUIDParameterName- name of the parameter supplying the keywordTwoGUIDserviceSupportedZones- supported zones for calling servicemethodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem adding the keyword properties to the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
unlinkRelatedKeywords
public void unlinkRelatedKeywords(String userId, String externalSourceGUID, String externalSourceName, String keywordOneGUID, String keywordOneGUIDParameterName, String keywordTwoGUID, String keywordTwoGUIDParameterName, List<String> serviceSupportedZones, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Removes a relationship between keywords.- 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 sourcekeywordOneGUID- unique id for the first keyword.keywordOneGUIDParameterName- name of the parameter supplying the keywordOneGUIDkeywordTwoGUID- unique id for the second keyword.keywordTwoGUIDParameterName- name of parameter supplying keywordTwoGUIDserviceSupportedZones- list of supported zones for this servicemethodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem updating the keyword properties in the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
-