Class SubjectAreaCategoryRESTResource


  • @RestController
    @RequestMapping("/servers/{serverName}/open-metadata/access-services/subject-area")
    public class SubjectAreaCategoryRESTResource
    extends Object
    The SubjectAreaRESTServicesInstance provides the org.odpi.openmetadata.accessservices.subjectarea.server-side implementation of the SubjectArea Open Metadata Access Service (OMAS). This interface provides category authoring interfaces for subject area experts.
    • Constructor Detail

      • SubjectAreaCategoryRESTResource

        public SubjectAreaCategoryRESTResource()
        Default constructor
    • Method Detail

      • createCategory

        @PostMapping(path="/users/{userId}/categories")
        public SubjectAreaOMASAPIResponse<Category> createCategory​(@PathVariable
                                                                   String serverName,
                                                                   @PathVariable
                                                                   String userId,
                                                                   @RequestBody
                                                                   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 concatinated with the 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:
        serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
        userId - unique identifier for requesting user, under which the request is performed
        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

        @GetMapping(path="/users/{userId}/categories/{guid}")
        public SubjectAreaOMASAPIResponse<Category> getCategoryByGuid​(@PathVariable
                                                                      String serverName,
                                                                      @PathVariable
                                                                      String userId,
                                                                      @PathVariable
                                                                      String guid)
        Get a Category
        Parameters:
        serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
        userId - unique identifier for requesting user, under which the request is performed
        guid - guid of the category to get
        Returns:
        response, when successful contains the category associated 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

        @GetMapping(path="/users/{userId}/categories")
        public SubjectAreaOMASAPIResponse<Category> findCategory​(@PathVariable
                                                                 String serverName,
                                                                 @PathVariable
                                                                 String userId,
                                                                 @RequestParam(value="searchCriteria",required=false)
                                                                 String searchCriteria,
                                                                 @RequestParam(value="exactValue",required=false,defaultValue="false")
                                                                 Boolean exactValue,
                                                                 @RequestParam(value="ignoreCase",required=false,defaultValue="true")
                                                                 Boolean ignoreCase,
                                                                 @RequestParam(value="asOfTime",required=false)
                                                                 Date asOfTime,
                                                                 @RequestParam(value="startingFrom",required=false,defaultValue="0")
                                                                 Integer startingFrom,
                                                                 @RequestParam(value="pageSize",required=false)
                                                                 Integer pageSize,
                                                                 @RequestParam(value="sequencingOrder",required=false)
                                                                 String sequencingOrder,
                                                                 @RequestParam(value="sequencingProperty",required=false)
                                                                 String sequencingProperty)
        Find Category
        Parameters:
        serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
        userId - unique identifier for requesting user, under which the request is performed
        searchCriteria - String expression matching Category property values (this does not include the GlossarySummary content).
        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
        asOfTime - the categories returned as they were at this time. null indicates at the current time.
        startingFrom - the starting element number for this set of results. This is used when retrieving elements beyond the first page of results. Zero means the results start from the first element.
        pageSize - the maximum number of elements that can be returned on this request.
        sequencingOrder - the sequencing order for the results.
        sequencingProperty - the name of the property that should be used to sequence the results.
        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

        @GetMapping(path="/users/{userId}/categories/{guid}/relationships")
        public SubjectAreaOMASAPIResponse<Relationship> getCategoryRelationships​(@PathVariable
                                                                                 String serverName,
                                                                                 @PathVariable
                                                                                 String userId,
                                                                                 @PathVariable
                                                                                 String guid,
                                                                                 @RequestParam(value="asOfTime",required=false)
                                                                                 Date asOfTime,
                                                                                 @RequestParam(value="startingFrom",required=false)
                                                                                 Integer startingFrom,
                                                                                 @RequestParam(value="pageSize",required=false)
                                                                                 Integer pageSize,
                                                                                 @RequestParam(value="sequencingOrder",required=false)
                                                                                 SequencingOrder sequencingOrder,
                                                                                 @RequestParam(value="sequencingProperty",required=false)
                                                                                 String sequencingProperty)
        Get Category relationships
        Parameters:
        serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
        userId - unique identifier for requesting user, under which the request is performed
        guid - guid of the category to get
        asOfTime - the relationships returned as they were at this time. null indicates at the current time. If specified, the date is in milliseconds since 1970-01-01 00:00:00.
        startingFrom - the starting element number for this set of results. This is used when retrieving elements beyond the first page of results. Zero means the results start from the first element.
        pageSize - the maximum number of elements that can be returned on this request.
        sequencingOrder - the sequencing order for the results.
        sequencingProperty - the name of the property that should be used to sequence the results.
        Returns:
        a response which when successful contains the category relationships 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

        @PutMapping(path="/users/{userId}/categories/{guid}")
        public SubjectAreaOMASAPIResponse<Category> updateCategory​(@PathVariable
                                                                   String serverName,
                                                                   @PathVariable
                                                                   String userId,
                                                                   @PathVariable
                                                                   String guid,
                                                                   @RequestBody
                                                                   Category suppliedCategory,
                                                                   @RequestParam(value="isReplace",required=false,defaultValue="false")
                                                                   Boolean isReplace)
        Update a Category

        Status is not updated using this call.

        Parameters:
        serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
        userId - userId under which the request is performed
        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

        @DeleteMapping(path="/users/{userId}/categories/{guid}")
        public SubjectAreaOMASAPIResponse<Category> deleteCategory​(@PathVariable
                                                                   String serverName,
                                                                   @PathVariable
                                                                   String userId,
                                                                   @PathVariable
                                                                   String guid,
                                                                   @RequestParam(value="isPurge",required=false,defaultValue="false")
                                                                   Boolean isPurge)
        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:
        serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
        userId - userId under which the request is performed
        guid - guid of the category to be deleted.
        isPurge - true indicates a hard delete, false is a soft delete.
        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 category was not deleted.
        • EntityNotPurgedException a hard delete was issued but the category was not purged
      • restoreCategory

        @PostMapping(path="/users/{userId}/categories/{guid}")
        public SubjectAreaOMASAPIResponse<Category> restoreCategory​(@PathVariable
                                                                    String serverName,
                                                                    @PathVariable
                                                                    String userId,
                                                                    @PathVariable
                                                                    String guid)
        Restore a Category

        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:
        serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
        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 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.
      • getCategorizedTerms

        @GetMapping(path="/users/{userId}/categories/{guid}/terms")
        public SubjectAreaOMASAPIResponse<Term> getCategorizedTerms​(@PathVariable
                                                                    String serverName,
                                                                    @PathVariable
                                                                    String userId,
                                                                    @PathVariable
                                                                    String guid,
                                                                    @RequestParam(value="searchCriteria",required=false)
                                                                    String searchCriteria,
                                                                    @RequestParam(value="exactValue",required=false,defaultValue="false")
                                                                    Boolean exactValue,
                                                                    @RequestParam(value="ignoreCase",required=false,defaultValue="true")
                                                                    Boolean ignoreCase,
                                                                    @RequestParam(value="startingFrom",required=false,defaultValue="0")
                                                                    Integer startingFrom,
                                                                    @RequestParam(value="pageSize",required=false)
                                                                    Integer pageSize)
        Get the terms that are categorized by this Category
        Parameters:
        serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
        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
        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 terms is 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

        @GetMapping(path="/users/{userId}/categories/{guid}/categories")
        public SubjectAreaOMASAPIResponse<Category> getCategoryChildren​(@PathVariable
                                                                        String serverName,
                                                                        @PathVariable
                                                                        String userId,
                                                                        @PathVariable
                                                                        String guid,
                                                                        @RequestParam(value="searchCriteria",required=false)
                                                                        String searchCriteria,
                                                                        @RequestParam(value="exactValue",required=false,defaultValue="false")
                                                                        Boolean exactValue,
                                                                        @RequestParam(value="ignoreCase",required=false,defaultValue="true")
                                                                        Boolean ignoreCase,
                                                                        @RequestParam(value="startingFrom",required=false,defaultValue="0")
                                                                        Integer startingFrom,
                                                                        @RequestParam(value="pageSize",required=false)
                                                                        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:
        serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
        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.