Class 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.
  • Constructor Details

    • 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 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

    • getAttachedTags

      public List<B> getAttachedTags(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the informal tags attached to a supplied entity.
      Parameters:
      userId - calling user
      elementGUID - identifier for the entity that the identifier is attached to
      elementGUIDParameterName - name of parameter supplying the GUID
      elementTypeName - name of the type of object being attached to
      startingFrom - start position for results
      pageSize - maximum number of results
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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
    • getAttachedTags

      public List<B> getAttachedTags(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 informal tags attached to a supplied entity.
      Parameters:
      userId - calling user
      elementGUID - identifier for the entity that the identifier is attached to
      elementGUIDParameterName - name of parameter supplying the GUID
      elementTypeName - name of the type of object being attached to
      serviceSupportedZones - supported zones for calling service
      startingFrom - start position for results
      pageSize - maximum number of results
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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
    • createTag

      public String createTag(String userId, String externalSourceGUID, String externalSourceName, String tagName, String tagDescription, boolean isPublic, Date effectiveFrom, Date effectiveTo, Date effectiveTime, 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 capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      tagName - 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 not
      effectiveFrom - the date when this element is active - null for active now
      effectiveTo - the date when this element becomes inactive - null for active until deleted
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - 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, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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 capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      tagGUID - unique identifier for the tag.
      tagGUIDParameterName - name of parameter supplying the GUID
      tagDescription - 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.
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Removes a tag from the repository. A private tag can be deleted by its creator and all 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 capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      tagGUID - unique id for the tag.
      tagGUIDParameterName - name of parameter supplying the GUID
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - 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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Removes a tag from the repository. A private tag can be deleted by its creator and all 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 capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      tagGUID - unique id for the tag.
      tagGUIDParameterName - name of parameter supplying the GUID
      serviceSupportedZones - supported zones for calling service
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - 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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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 guid
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - 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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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 guid
      serviceSupportedZones - list of zones that assets can be retrieved from
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - 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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the list of tags exactly matching the supplied name.
      Parameters:
      userId - the name of the calling user
      name - name of tag
      nameParameterName - name of the parameter supplying the tag name
      startFrom - index of the list ot start from (0 for start)
      pageSize - maximum number of elements to return
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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.
    • getMyTagsByName

      public List<B> getMyTagsByName(String userId, String name, String nameParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the list of tags exactly matching the supplied name.
      Parameters:
      userId - the name of the calling user
      name - name of tag
      nameParameterName - name of the parameter supplying the tag name
      startFrom - index of the list ot start from (0 for start)
      pageSize - maximum number of elements to return.
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the list of tags 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 string
      startFrom - index of the list ot start from (0 for start)
      pageSize - maximum number of elements to return.
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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 string
      startFrom - index of the list ot start from (0 for start)
      pageSize - maximum number of elements to return.
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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 capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      elementGUID - unique id for the element.
      elementGUIDParameterName - name of the parameter supplying the elementGUID
      elementType - type of the element.
      tagGUID - unique id of the tag.
      tagGUIDParameterName - name of the parameter supplying the tagGUID
      isPublic - flag indicating whether the attachment of the tag is public or not
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - 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, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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 capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      elementGUID - unique id for the element.
      elementGUIDParameterName - name of the parameter supplying the elementGUID
      elementType - type of the element.
      tagGUID - unique id of the tag.
      tagGUIDParameterName - name of the parameter supplying the tagGUID
      suppliedSupportedZones - list of zones supported by this service
      isPublic - flag indicating whether the attachment of the tag is public or not
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship
      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 - 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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Removes a tag from the element.
      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 id for the element to unlink from tag
      elementGUIDParameterName - name of the parameter supplying the elementGUID
      elementType - type of the element.
      tagGUID - unique id for the tag.
      tagGUIDParameterName - name of the parameter supplying the tagGUID
      suppliedSupportedZones - list of zones supported by this service
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - 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.