Class SubjectAreaCategoryHandler
-
Field Summary
Fields inherited from class org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
genericHandler, invalidParameterHandler, mappersFactory, maxPageSize
-
Constructor Summary
ConstructorsConstructorDescriptionSubjectAreaCategoryHandler
(OpenMetadataAPIGenericHandler genericHandler, int maxPageSize) Construct the Subject Area Category Handler needed to operate within a single server instance. -
Method Summary
Modifier and TypeMethodDescriptioncreateCategory
(String userId, SubjectAreaRelationshipHandler relationshipHandler, Category suppliedCategory) Create a Category.deleteCategory
(String userId, String guid) Delete a Category or SubjectAreaDefinition instancefindCategory
(String userId, FindRequest findRequest, boolean exactValue, boolean ignoreCase) Find CategorygetCategorizedTerms
(String userId, String guid, String searchCriteria, boolean exactValue, boolean ignoreCase, SubjectAreaTermHandler termHandler, Integer startingFrom, Integer pageSize) Get the terms that are categorized by this CategorygetCategoryByGuid
(String userId, String guid) Get a CategorygetCategoryChildren
(String userId, String guid, String searchCriteria, boolean exactValue, boolean ignoreCase, Integer startingFrom, Integer pageSize) Get this Category's child Categories.getCategoryRelationships
(String userId, String guid, FindRequest findRequest) Get Category relationshipsrestoreCategory
(String userId, String guid) Restore a Category or a SubjectAreaDefinitionupdateCategory
(String userId, SubjectAreaRelationshipHandler relationshipHandler, String guid, Category suppliedCategory, boolean isReplace) Update a CategoryMethods inherited from class org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
convertOmrsToOmas, findNodes, getAllRelationshipForEntity, getAllRelationshipsForEntity, getMaxPageSize, getNodesFromEntityDetails, getRelationshipsForEntityByType, getRelationshipsFromRelationships, sanitiseFindRequest, sanitiseFindRequest, setNodeEffectivity, setRelationshipEffectivity, setUniqueQualifiedNameIfBlank, validateGlossarySummaryDuringCreation
-
Constructor Details
-
SubjectAreaCategoryHandler
Construct the Subject Area Category Handler needed to operate within a single server instance.- Parameters:
genericHandler
- generic handlermaxPageSize
- 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 performedrelationshipHandler
- relationship handlersuppliedCategory
- 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
Get a Category- Parameters:
userId
- unique identifier for requesting user, under which the request is performedguid
- 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 performedfindRequest
-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 performedguid
- guidfindRequest
-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 CategoryStatus 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 performedrelationshipHandler
- relationshipHandlerguid
- guid of the category to updatesuppliedCategory
- category to be updatedisReplace
- 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
Delete a Category or SubjectAreaDefinition instanceThere 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 performedguid
- 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
Restore a Category or a SubjectAreaDefinitionRestore 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 performedguid
- 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 performedguid
- guid of the category to get termssearchCriteria
- 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 respectedtermHandler
- term handlerstartingFrom
- 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 performedguid
- guid of the parent categorysearchCriteria
- 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 respectedstartingFrom
- the starting element number for this set of results. This is used when retrieving elementspageSize
- 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.
-