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

      • 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 local
        externalSourceName - name of the software server capability entity that represented the external source
        keywordName - 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 local
        externalSourceName - name of the software server capability entity that represented the external source
        keywordGUID - unique identifier for the keyword
        keywordGUIDParameterName - parameter providing keywordGUID
        keywordDescription - 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 service
        methodName - 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 local
        externalSourceName - name of the software server capability entity that represented the external source
        keywordGUID - 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.
      • 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 user
        startingGUID - identifier for the entity that the keyword is attached to
        startingGUIDParameterName - name of parameter supplying the GUID
        startingTypeName - 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
      • 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 user
        startingKeywordGUID - identifier for the entity that the keyword is attached to
        startingKeywordGUIDParameterName - name of parameter supplying the GUID
        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
      • 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 user
        keyword - keyword of keyword
        keywordParameterName - parameter providing keyword
        serviceSupportedZones - 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.
      • 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 string
        serviceSupportedZones - 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 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.
        keywordGUID - unique id of the keyword.
        keywordGUIDParameterName - name of the parameter supplying the keywordOneGUID
        serviceSupportedZones - 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 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 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 referenceable to connect to
        elementGUIDParameterName - name of the parameter supplying the elementGUID
        elementType - type of the element
        keywordGUID - unique id for the keyword
        keywordGUIDParameterName - name of parameter supplying keywordGUID
        serviceSupportedZones - list of supported zones for this service
        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.
      • 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 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
        keywordOneGUID - unique id for the first keyword
        keywordOneGUIDParameterName - name of the parameter supplying the keywordOneGUID
        keywordTwoGUID - unique id of the second keyword
        keywordTwoGUIDParameterName - name of the parameter supplying the keywordTwoGUID
        serviceSupportedZones - supported zones for calling service
        methodName - 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 local
        externalSourceName - name of the software server capability entity that represented the external source
        keywordOneGUID - unique id for the first keyword.
        keywordOneGUIDParameterName - name of the parameter supplying the keywordOneGUID
        keywordTwoGUID - unique id for the second keyword.
        keywordTwoGUIDParameterName - name of parameter supplying keywordTwoGUID
        serviceSupportedZones - list of supported zones for this service
        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.