public class SubjectAreaTermHandler extends SubjectAreaHandler
CATEGORY_ANCHOR_RELATIONSHIP_NAME, CATEGORY_HIERARCHY_LINK_RELATIONSHIP_NAME, CATEGORY_TYPE_NAME, GLOSSARY_TYPE_NAME, invalidParameterHandler, mappersFactory, maxPageSize, oMRSAPIHelper, PROJECT_SCOPE_RELATIONSHIP_NAME, PROJECT_TYPE_NAME, TERM_ANCHOR_RELATIONSHIP_NAME, TERM_CATEGORIZATION_RELATIONSHIP_NAME, TERM_TYPE_NAME| Constructor and Description |
|---|
SubjectAreaTermHandler(OMRSAPIHelper oMRSAPIHelper,
int maxPageSize)
Construct the Subject Area Term Handler
needed to operate within a single server instance.
|
| Modifier and Type | Method and Description |
|---|---|
SubjectAreaOMASAPIResponse<Term> |
createTerm(String userId,
Term suppliedTerm)
Create a Term.
|
SubjectAreaOMASAPIResponse<Term> |
deleteTerm(String userId,
String guid,
Boolean isPurge)
Delete a Term instance
|
SubjectAreaOMASAPIResponse<Term> |
findTerm(String userId,
FindRequest findRequest)
Find Term
|
SubjectAreaOMASAPIResponse<Term> |
getTermByGuid(String userId,
String guid)
Get a term by guid.
|
SubjectAreaOMASAPIResponse<Category> |
getTermCategories(String userId,
String guid,
SubjectAreaCategoryHandler categoryHandler,
Integer startingFrom,
Integer pageSize)
Get the Categories categorizing this Term.
|
SubjectAreaOMASAPIResponse<Line> |
getTermRelationships(String userId,
String guid,
FindRequest findRequest)
Get Term relationships
|
SubjectAreaOMASAPIResponse<Term> |
restoreTerm(String userId,
String guid)
Restore a Term
|
SubjectAreaOMASAPIResponse<Term> |
updateTerm(String userId,
String guid,
Term suppliedTerm,
boolean isReplace)
Update a Term
|
protected void |
validateCategoriesDuringCreation(String userId,
String methodName,
List<CategorySummary> suppliedCategories)
This method validates that any Categories supplied to a Term create exist.
|
convertOmrsToOmas, findEntities, getAllLineForEntity, getAllRelationshipsForEntity, getLinesFromRelationships, getMaxPageSize, getNodesFromEntityDetails, getRelatedNodesForEnd1, getRelatedNodesForEnd2, setUniqueQualifiedNameIfBlank, validateGlossarySummaryDuringCreationpublic SubjectAreaTermHandler(OMRSAPIHelper oMRSAPIHelper, int maxPageSize)
oMRSAPIHelper - omrs API helpermaxPageSize - maximum page sizepublic SubjectAreaOMASAPIResponse<Term> createTerm(String userId, Term suppliedTerm)
Terms with the same name can be confusing. Best practise is to createTerms that have unique names. This Create call does not police that term names are unique. So it is possible to create Terms with the same name as each other.
Valid nodeTypes for this request are:
userId - unique identifier for requesting user, under which the request is performedsuppliedTerm - Term to createprotected void validateCategoriesDuringCreation(String userId, String methodName, List<CategorySummary> suppliedCategories) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException, SubjectAreaCheckedException
userId - userId under which the request is performedmethodName - method making the callsuppliedCategories - categories to validate.PropertyServerException - something went wrong with the REST call stack.UserNotAuthorizedException - the requesting user is not authorized to issue this request.InvalidParameterException - one of the parameters is null or invalidSubjectAreaCheckedException - standard exception Subject Area OMAS servicespublic SubjectAreaOMASAPIResponse<Term> getTermByGuid(String userId, String guid)
userId - unique identifier for requesting user, under which the request is performedguid - guid of the term to getpublic SubjectAreaOMASAPIResponse<Term> findTerm(String userId, FindRequest findRequest)
userId - unique identifier for requesting user, under which the request is performedfindRequest - FindRequestpublic SubjectAreaOMASAPIResponse<Line> getTermRelationships(String userId, String guid, FindRequest findRequest)
userId - unique identifier for requesting user, under which the request is performedguid - guidfindRequest - FindRequestpublic SubjectAreaOMASAPIResponse<Term> updateTerm(String userId, String guid, Term suppliedTerm, boolean isReplace)
If the caller has chosen to incorporate the term name in their Term Terms or Categories qualified name, renaming the term will cause those qualified names to mismatch the Term name. If the caller has chosen to incorporate the term qualifiedName in their Term Terms or Categories qualified name, changing the qualified name of the term will cause those qualified names to mismatch the Term name. Status is not updated using this call. The Categories categorising this Term can be amended using this call; this means that the termCategorization relationships are removed and/or added in this call. For an update (rather than a replace) with no categories supplied, no changes are made to the termCategorizations; otherwise the supplied categorizing Categories will replace the existing ones.
userId - unique identifier for requesting user, under which the request is performedguid - guid of the term to updatesuppliedTerm - term to be updatedisReplace - flag to indicate that this update is a replace. When not set only the supplied (non null) fields are updated.public SubjectAreaOMASAPIResponse<Term> deleteTerm(String userId, String guid, Boolean isPurge)
The deletion of a term is only allowed if there is no term 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. Soft delete is the default.
A soft delete means that the term 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 term will not exist after the operation. when not successful the following Exceptions can occur
userId - unique identifier for requesting user, under which the request is performedguid - guid of the term to be deleted.isPurge - true indicates a hard delete, false is a soft delete.public SubjectAreaOMASAPIResponse<Term> restoreTerm(String userId, String guid)
Restore allows the deleted Term to be made active again. Restore allows deletes to be undone. Hard deletes are not stored in the repository so cannot be restored.
userId - unique identifier for requesting user, under which the request is performedguid - guid of the term to restorepublic SubjectAreaOMASAPIResponse<Category> getTermCategories(String userId, String guid, SubjectAreaCategoryHandler categoryHandler, Integer startingFrom, Integer pageSize)
userId - unique identifier for requesting user, under which the request is performedguid - guid of the category to get termscategoryHandler - category handlerstartingFrom - 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.Copyright © 2018–2021 LF AI & Data Foundation. All rights reserved.