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

      • 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 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
        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,
                                       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
        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,
                                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 local
        externalSourceName - name of the software server 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
        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,
                                         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 local
        externalSourceName - name of the software server 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.
        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 local
        externalSourceName - name of the software server capability entity that represented the external source
        tagGUID - unique id for the tag.
        tagGUIDParameterName - name of parameter supplying the GUID
        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,
                              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 local
        externalSourceName - name of the software server 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
        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.
      • 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 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.
        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 string
        startFrom - 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 local
        externalSourceName - name of the software server 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
        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,
                                    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 local
        externalSourceName - name of the software server 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
        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,
                                         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 local
        externalSourceName - name of the software server 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
        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.