Class SubjectAreaGlossaryHandler


  • public class SubjectAreaGlossaryHandler
    extends SubjectAreaHandler
    SubjectAreaGlossaryHandler manages Glossary objects from the property server. It runs server-side in the subject Area OMAS and retrieves entities and relationships through the OMRSRepositoryConnector.
    • Constructor Detail

      • SubjectAreaGlossaryHandler

        public SubjectAreaGlossaryHandler​(OpenMetadataAPIGenericHandler genericHandler,
                                          int maxPageSize)
        Construct the Subject Area Glossary Handler needed to operate within a single server instance.
        Parameters:
        genericHandler - generic handler
        maxPageSize - maximum page size
    • Method Detail

      • createGlossary

        public SubjectAreaOMASAPIResponse<Glossary> createGlossary​(String userId,
                                                                   Glossary suppliedGlossary)
        Create a Glossary. There are specializations of glossaries that can also be created using this operation. To create a specialization, you should specify a nodeType other than Glossary in the supplied glossary.

        Glossaries with the same name can be confusing. Best practise is to createGlossaries that have unique names. This Create call does not police that glossary names are unique. So it is possible to create Glossaries with the same name as each other.

        Valid nodeTypes for this request are:

        • Taxonomy to create a Taxonomy
        • CanonicalGlossary to create a canonical glossary
        • TaxonomyAndCanonicalGlossary to create a glossary that is both a taxonomy and a canonical glossary
        • Glossary to create a glossary that is not a taxonomy or a canonical glossary
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        suppliedGlossary - Glossary to create
        Returns:
        response, when successful contains the created glossary. when not successful the following Exception responses can occur
        • UserNotAuthorizedException the requesting user is not authorized to issue this request.
        • InvalidParameterException one of the parameters is null or invalid.
        • PropertyServerException Property server exception.
      • getGlossaryByGuid

        public SubjectAreaOMASAPIResponse<Glossary> getGlossaryByGuid​(String userId,
                                                                      String guid)
        Get a glossary by guid.
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - guid of the glossary to get
        Returns:
        response which when successful contains the glossary with the requested guid when not successful the following Exception responses can occur
        • UserNotAuthorizedException the requesting user is not authorized to issue this request.
        • InvalidParameterException one of the parameters is null or invalid.
        • PropertyServerException Property server exception.
      • findGlossary

        public SubjectAreaOMASAPIResponse<Glossary> findGlossary​(String userId,
                                                                 FindRequest findRequest,
                                                                 boolean exactValue,
                                                                 boolean ignoreCase)
        Find Glossary
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        findRequest - FindRequest
        exactValue - a boolean, which when set means that only exact matches will be returned, otherwise matches that start with the search criteria will be returned.
        ignoreCase - a boolean, which when set means that case will be ignored, if not set that case will be respected
        Returns:
        A list of Glossaries meeting the search Criteria
        • UserNotAuthorizedException the requesting user is not authorized to issue this request.
        • InvalidParameterException one of the parameters is null or invalid.
        • PropertyServerException Property server exception.
      • getGlossaryRelationships

        public SubjectAreaOMASAPIResponse<Relationship> getGlossaryRelationships​(String userId,
                                                                                 String guid,
                                                                                 FindRequest findRequest)
        Get Glossary relationships
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - guid
        findRequest - FindRequest
        Returns:
        the relationships associated with the requested Glossary guid

        when not successful the following Exception responses can occur

        • UserNotAuthorizedException the requesting user is not authorized to issue this request.
        • InvalidParameterException one of the parameters is null or invalid.
        • PropertyServerException Property server exception.
      • updateGlossary

        public SubjectAreaOMASAPIResponse<Glossary> updateGlossary​(String userId,
                                                                   String guid,
                                                                   Glossary suppliedGlossary,
                                                                   boolean isReplace)
        Update a Glossary

        If the caller has chosen to incorporate the glossary name in their Glossary Terms or Categories qualified name, renaming the glossary will cause those qualified names to mismatch the Glossary name. If the caller has chosen to incorporate the glossary qualifiedName in their Glossary Terms or Categories qualified name, changing the qualified name of the glossary will cause those qualified names to mismatch the Glossary name. Status is not updated using this call.

        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - guid of the glossary to update
        suppliedGlossary - glossary to be updated
        isReplace - flag to indicate that this update is a replace. When not set only the supplied (non null) fields are updated.
        Returns:
        a response which when successful contains the updated glossary when not successful the following Exception responses can occur
        • UserNotAuthorizedException the requesting user is not authorized to issue this request.
        • InvalidParameterException one of the parameters is null or invalid.
        • PropertyServerException Property server exception.
      • deleteGlossary

        public SubjectAreaOMASAPIResponse<Glossary> deleteGlossary​(String userId,
                                                                   String guid)
        Delete a Glossary instance

        The deletion of a glossary is only allowed if there is no glossary content (i.e. no terms or categories).

        There are 2 types of deletion, a soft delete and a hard delete (also known as a purge). All repositories support hard deletes. Soft deletes support is optional.

        A soft delete means that the glossary instance will exist in a deleted state in the repository after the delete operation. This means that it is possible to undo the delete. A hard delete means that the glossary will not exist after the operation.

        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - guid of the glossary to be deleted.
        Returns:
        a void response when not successful the following Exception responses can occur
        • UserNotAuthorizedException the requesting user is not authorized to issue this request.
        • InvalidParameterException one of the parameters is null or invalid.
        • PropertyServerException Property server exception.
        • EntityNotDeletedException a soft delete was issued but the glossary was not deleted.
      • restoreGlossary

        public SubjectAreaOMASAPIResponse<Glossary> restoreGlossary​(String userId,
                                                                    String guid)
        Restore a Glossary

        Restore allows the deleted Glossary to be made active again. Restore allows deletes to be undone. Hard deletes are not stored in the repository so cannot be restored.

        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - guid of the glossary to restore
        Returns:
        response which when successful contains the restored glossary when not successful the following Exception responses can occur
        • UserNotAuthorizedException the requesting user is not authorized to issue this request.
        • InvalidParameterException one of the parameters is null or invalid.
        • PropertyServerException Property server exception.
      • getTerms

        public SubjectAreaOMASAPIResponse<Term> getTerms​(String userId,
                                                         String guid,
                                                         SubjectAreaTermHandler termHandler,
                                                         FindRequest findRequest,
                                                         boolean exactValue,
                                                         boolean ignoreCase)
        Get terms that are owned by this glossary. The server has a maximum page size defined, the number of terms returned is limited by that maximum page size.
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - guid of the category to get terms
        findRequest - FindRequest
        exactValue - a boolean, which when set means that only exact matches will be returned, otherwise matches that start with the search criteria will be returned.
        ignoreCase - a boolean, which when set means that case will be ignored, if not set that case will be respected
        Returns:
        A list of terms owned by the glossary when not successful the following Exception responses can occur
        • UserNotAuthorizedException the requesting user is not authorized to issue this request.
        • InvalidParameterException one of the parameters is null or invalid.
        • PropertyServerException Property server exception.
      • getCategories

        public SubjectAreaOMASAPIResponse<Category> getCategories​(String userId,
                                                                  String guid,
                                                                  FindRequest findRequest,
                                                                  boolean exactValue,
                                                                  boolean ignoreCase,
                                                                  Boolean onlyTop,
                                                                  SubjectAreaCategoryHandler categoryHandler)
        Get the Categories owned by this glossary. The server has a maximum page size defined, the number of categories returned is limited by that maximum page size.
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - guid of the category to get terms
        findRequest - FindRequest
        exactValue - a boolean, which when set means that only exact matches will be returned, otherwise matches that start with the search criteria will be returned.
        ignoreCase - a boolean, which when set means that case will be ignored, if not set that case will be respected
        onlyTop - when only the top categories (those categories without parents) are returned.
        categoryHandler - category handler is supplied, so that we can obtain categories containing the parentCategory field, which we need to test as part of the onlyTop processing
        Returns:
        A list of categories owned by the glossary when not successful the following Exception responses can occur
        • UserNotAuthorizedException the requesting user is not authorized to issue this request.
        • InvalidParameterException one of the parameters is null or invalid.
        • PropertyServerException Property server exception.