Class SubjectAreaCategoryHandler

java.lang.Object
org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaCategoryHandler

public class SubjectAreaCategoryHandler extends SubjectAreaHandler
The SubjectAreaRESTServicesInstance provides the org.odpi.openmetadata.accessservices.subjectarea.server-side implementation of the SubjectArea Open Metadata Access Service (OMAS). This interface provides glossary authoring interfaces for subject area experts.
  • Constructor Details

    • SubjectAreaCategoryHandler

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

    • createCategory

      public SubjectAreaOMASAPIResponse<Category> createCategory(String userId, SubjectAreaRelationshipHandler relationshipHandler, Category suppliedCategory)
      Create a Category. There is specialization of a Category that can also be created using this operation. To create this specialization, you should specify a nodeType other than Category in the supplied category.

      Valid nodeTypes for this request are:

      • SubjectAreaDefinition to create a Category that represents a subject area
      • Category to create a category that is not a subject area

      The qualifiedName can be specified and will be honoured. If it is specified then the caller may wish to ensure that it is unique. If this qualifiedName is not specified then one will be generated as GlossaryCategory concatenated with the guid.

      Failure to create the Categories classifications, link to its glossary or its icon, results in the create failing and the category being deleted

      Parameters:
      userId - unique identifier for requesting user, under which the request is performed
      relationshipHandler - relationship handler
      suppliedCategory - category to create
      Returns:
      response, when successful contains the created category. 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.
    • getCategoryByGuid

      public SubjectAreaOMASAPIResponse<Category> getCategoryByGuid(String userId, String guid)
      Get a Category
      Parameters:
      userId - unique identifier for requesting user, under which the request is performed
      guid - guid of the category to get. This could be a guid for a SubjectAreaDefinition, which is a type of category
      Returns:
      response which when successful contains the category with the requested guid n 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.
    • findCategory

      public SubjectAreaOMASAPIResponse<Category> findCategory(String userId, FindRequest findRequest, boolean exactValue, boolean ignoreCase)
      Find Category
      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 Categories 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.
    • getCategoryRelationships

      public SubjectAreaOMASAPIResponse<Relationship> getCategoryRelationships(String userId, String guid, FindRequest findRequest)
      Get Category 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 Category 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.
    • updateCategory

      public SubjectAreaOMASAPIResponse<Category> updateCategory(String userId, SubjectAreaRelationshipHandler relationshipHandler, String guid, Category suppliedCategory, boolean isReplace)
      Update a Category

      Status is not updated using this call. The category parent can be updated with this call. For isReplace a null category parent will remove the existing parent relationship.

      Parameters:
      userId - userId under which the request is performed
      relationshipHandler - relationshipHandler
      guid - guid of the category to update
      suppliedCategory - category 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 category 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.
    • deleteCategory

      public SubjectAreaOMASAPIResponse<Category> deleteCategory(String userId, String guid)
      Delete a Category or SubjectAreaDefinition instance

      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. Soft delete is the default.

      A soft delete means that the category 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 category will not exist after the operation. when not successful the following Exception responses can occur

      Parameters:
      userId - userId under which the request is performed
      guid - guid of the category to be deleted.
      Returns:
      a void response n 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 category was not deleted.
    • restoreCategory

      public SubjectAreaOMASAPIResponse<Category> restoreCategory(String userId, String guid)
      Restore a Category or a SubjectAreaDefinition

      Restore allows the deleted Category 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 category to restore
      Returns:
      response which when successful contains the restored category n 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.
    • getCategorizedTerms

      public SubjectAreaOMASAPIResponse<Term> getCategorizedTerms(String userId, String guid, String searchCriteria, boolean exactValue, boolean ignoreCase, SubjectAreaTermHandler termHandler, Integer startingFrom, Integer pageSize)
      Get the terms that are categorized by this Category
      Parameters:
      userId - unique identifier for requesting user, under which the request is performed
      guid - guid of the category to get terms
      searchCriteria - String expression to match the categorized Term property values.
      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
      termHandler - term handler
      startingFrom - initial position in the stored list.
      pageSize - maximum number of definitions to return on this call.
      Returns:
      A list of terms categorized by this Category 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.
    • getCategoryChildren

      public SubjectAreaOMASAPIResponse<Category> getCategoryChildren(String userId, String guid, String searchCriteria, boolean exactValue, boolean ignoreCase, Integer startingFrom, Integer pageSize)
      Get this Category's child Categories. 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 parent category
      searchCriteria - String expression matching child Category property values.
      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
      startingFrom - the starting element number for this set of results. This is used when retrieving elements
      pageSize - the maximum number of elements that can be returned on this request.
      Returns:
      A list of child categories filtered by the search criteria if one is supplied. 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.