Class InformalTagHandler<B>
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<B>
-
- org.odpi.openmetadata.commonservices.generichandlers.InformalTagHandler<B>
-
public class InformalTagHandler<B> extends OpenMetadataAPIGenericHandler<B>
InformalTagHandler manages InformalTag objects. These are user-controlled semantic tags. InformalTagHandler runs server-side in the OMAG Server Platform and retrieves InformalTag entities through the OMRSRepositoryConnector. Since these are informal labels there is no support for effectivity dates because assets are not governed by them.
-
-
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 InformalTagHandler(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 informal tags.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTagToElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String tagGUID, String tagGUIDParameterName, boolean isPublic, String methodName)Adds a tag (either private of public) to the requested element.voidaddTagToElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String tagGUID, String tagGUIDParameterName, List<String> suppliedSupportedZones, boolean isPublic, String methodName)Adds a tag (either private of public) to the requested element.intcountTags(String userId, String elementGUID, String methodName)Count the number of informal tags attached to a supplied entity.StringcreateTag(String userId, String externalSourceGUID, String externalSourceName, String tagName, String tagDescription, boolean isPublic, String methodName)Creates a new informal tag and returns the unique identifier for it.voiddeleteTag(String userId, String externalSourceGUID, String externalSourceName, String tagGUID, String tagGUIDParameterName, String methodName)Removes a tag from the repository.voiddeleteTag(String userId, String externalSourceGUID, String externalSourceName, String tagGUID, String tagGUIDParameterName, List<String> serviceSupportedZones, String methodName)Removes a tag from the repository.List<B>findMyTags(String userId, String searchString, String searchStringParameterName, int startFrom, int pageSize, String methodName)Return the list of private tags for the user matching the supplied searchString.List<B>findTags(String userId, String searchString, String searchStringParameterName, int startFrom, int pageSize, String methodName)Return the list of tags matching the supplied searchString.List<B>getAttachedTags(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, int startingFrom, int pageSize, String methodName)Return the informal tags attached to a supplied entity.List<B>getAttachedTags(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, List<String> serviceSupportedZones, int startingFrom, int pageSize, String methodName)Return the informal tags attached to a supplied entity.List<B>getMyTagsByName(String userId, String name, String nameParameterName, int startFrom, int pageSize, String methodName)Return the list of tags exactly matching the supplied name.BgetTag(String userId, String guid, String guidParameterName, String methodName)Return the tag for the supplied unique identifier (guid).BgetTag(String userId, String guid, String guidParameterName, List<String> serviceSupportedZones, String methodName)Return the tag for the supplied unique identifier (guid).List<B>getTagsByName(String userId, String name, String nameParameterName, int startFrom, int pageSize, String methodName)Return the list of tags exactly matching the supplied name.voidremoveTagFromElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String tagGUID, String tagGUIDParameterName, List<String> suppliedSupportedZones, String methodName)Removes a tag from the element.voidupdateTagDescription(String userId, String externalSourceGUID, String externalSourceName, String tagGUID, String tagGUIDParameterName, String tagDescription, String methodName)Updates the description of an existing tag (either private of public).-
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
-
InformalTagHandler
public InformalTagHandler(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 informal tags.- 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
-
countTags
public int countTags(String userId, String elementGUID, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Count the number of informal tags 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
-
getAttachedTags
public List<B> getAttachedTags(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the informal tags attached to a supplied entity.- Parameters:
userId- calling userelementGUID- identifier for the entity that the identifier is attached toelementGUIDParameterName- name of parameter supplying the GUIDelementTypeName- name of the type of object being attached tostartingFrom- 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
-
getAttachedTags
public List<B> getAttachedTags(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, List<String> serviceSupportedZones, int startingFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the informal tags attached to a supplied entity.- Parameters:
userId- calling userelementGUID- identifier for the entity that the identifier is attached toelementGUIDParameterName- name of parameter supplying the GUIDelementTypeName- 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
-
createTag
public String createTag(String userId, String externalSourceGUID, String externalSourceName, String tagName, String tagDescription, boolean isPublic, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Creates a new informal tag 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 sourcetagName- name of the tag.tagDescription- (optional) description of the tag. Setting a description, particularly in a public tag makes the tag more valuable to other users and can act as an embryonic glossary term.isPublic- flag indicating whether the attachment of the tag is public or notmethodName- calling method- Returns:
- GUID for new tag.
- Throws:
InvalidParameterException- 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.
-
updateTagDescription
public void updateTagDescription(String userId, String externalSourceGUID, String externalSourceName, String tagGUID, String tagGUIDParameterName, String tagDescription, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Updates the description of an existing tag (either private of public). Private tags can only be updated by their creator.- 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 sourcetagGUID- unique identifier for the tag.tagGUIDParameterName- name of parameter supplying the GUIDtagDescription- description of the tag. Setting a description, particularly in a public tag makes the tag more valuable to other users and can act as an embryonic glossary term.methodName- calling method- Throws:
InvalidParameterException- 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.
-
deleteTag
public void deleteTag(String userId, String externalSourceGUID, String externalSourceName, String tagGUID, String tagGUIDParameterName, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Removes a tag from the repository. A private tag can be deleted by its creator and all of the references are lost; a public tag can be deleted by anyone, but only if it is not attached to any referenceable. This method is sufficiently special that it does not use the generic handler- 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 sourcetagGUID- unique id for the tag.tagGUIDParameterName- name of parameter supplying the GUIDmethodName- calling method- Throws:
InvalidParameterException- 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.
-
deleteTag
public void deleteTag(String userId, String externalSourceGUID, String externalSourceName, String tagGUID, String tagGUIDParameterName, List<String> serviceSupportedZones, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Removes a tag from the repository. A private tag can be deleted by its creator and all of the references are lost; a public tag can be deleted by anyone, but only if it is not attached to any referenceable. This method is sufficiently special that it does not use the generic handler- 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 sourcetagGUID- unique id for the tag.tagGUIDParameterName- name of parameter supplying the GUIDserviceSupportedZones- supported zones for calling servicemethodName- calling method- Throws:
InvalidParameterException- 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.
-
getTag
public B getTag(String userId, String guid, String guidParameterName, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the tag for the supplied unique identifier (guid). The tag is only returned if it is public or if it is private and the- Parameters:
userId- userId of the user making the requestguid- unique identifier of the tagguidParameterName- name of the parameter supplying the guidmethodName- calling method- Returns:
- tag
- 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.
-
getTag
public B getTag(String userId, String guid, String guidParameterName, List<String> serviceSupportedZones, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the tag for the supplied unique identifier (guid). The tag is only returned if it is public or if it is private and the- Parameters:
userId- userId of the user making the request.guid- unique identifier of the tag.guidParameterName- name of the parameter supplying the guidserviceSupportedZones- list of zones that assets can be retrieved frommethodName- calling method- Returns:
- tag
- 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.
-
getTagsByName
public List<B> getTagsByName(String userId, String name, String nameParameterName, int startFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the list of tags exactly matching the supplied name.- Parameters:
userId- the name of the calling username- name of tagnameParameterName- name of the parameter supplying the tag namestartFrom- index of the list ot start from (0 for start)pageSize- maximum number of elements to returnmethodName- calling method- Returns:
- tag 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.
-
getMyTagsByName
public List<B> getMyTagsByName(String userId, String name, String nameParameterName, int startFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the list of tags exactly matching the supplied name.- Parameters:
userId- the name of the calling username- name of tagnameParameterName- name of the parameter supplying the tag namestartFrom- index of the list ot start from (0 for start)pageSize- maximum number of elements to return.methodName- calling method- Returns:
- tag 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.
-
findTags
public List<B> findTags(String userId, String searchString, String searchStringParameterName, int startFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the list of tags matching the supplied searchString.- Parameters:
userId- the searchString of the calling usersearchString- searchString of tag. This may include wild card characterssearchStringParameterName- name of parameter supplying the search stringstartFrom- index of the list ot start from (0 for start)pageSize- maximum number of elements to return.methodName- calling method- Returns:
- tag 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.
-
findMyTags
public List<B> findMyTags(String userId, String searchString, String searchStringParameterName, int startFrom, int pageSize, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the list of private tags for the user matching the supplied searchString.- Parameters:
userId- the searchString of the calling user.searchString- searchString of tag. This may include wild card characters.searchStringParameterName- name of parameter supplying the search stringstartFrom- index of the list ot start from (0 for start)pageSize- maximum number of elements to return.methodName- calling method- Returns:
- tag 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.
-
addTagToElement
public void addTagToElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String tagGUID, String tagGUIDParameterName, boolean isPublic, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Adds a tag (either private of public) 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.tagGUID- unique id of the tag.tagGUIDParameterName- name of the parameter supplying the tagGUIDisPublic- flag indicating whether the attachment of the tag is public or notmethodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem adding the tag properties to the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
addTagToElement
public void addTagToElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String tagGUID, String tagGUIDParameterName, List<String> suppliedSupportedZones, boolean isPublic, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Adds a tag (either private of public) 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.tagGUID- unique id of the tag.tagGUIDParameterName- name of the parameter supplying the tagGUIDsuppliedSupportedZones- list of zones supported by this serviceisPublic- flag indicating whether the attachment of the tag is public or notmethodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem adding the tag properties to the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
removeTagFromElement
public void removeTagFromElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementType, String tagGUID, String tagGUIDParameterName, List<String> suppliedSupportedZones, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Removes a tag from the 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 to unlink from tagelementGUIDParameterName- name of the parameter supplying the elementGUIDelementType- type of the element.tagGUID- unique id for the tag.tagGUIDParameterName- name of the parameter supplying the tagGUIDsuppliedSupportedZones- list of zones supported by this servicemethodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem updating the tag properties in the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
-