public abstract class SubjectAreaHandler extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CATEGORY_ANCHOR_RELATIONSHIP_NAME |
protected static String |
CATEGORY_HIERARCHY_LINK_RELATIONSHIP_NAME |
protected static String |
CATEGORY_TYPE_NAME |
protected static String |
GLOSSARY_TYPE_NAME |
protected InvalidParameterHandler |
invalidParameterHandler |
protected MappersFactory |
mappersFactory |
protected int |
maxPageSize |
protected OMRSAPIHelper |
oMRSAPIHelper |
protected static String |
PROJECT_SCOPE_RELATIONSHIP_NAME |
protected static String |
PROJECT_TYPE_NAME |
protected static String |
TERM_ANCHOR_RELATIONSHIP_NAME |
protected static String |
TERM_CATEGORIZATION_RELATIONSHIP_NAME |
protected static String |
TERM_TYPE_NAME |
| Constructor and Description |
|---|
SubjectAreaHandler(OMRSAPIHelper oMRSAPIHelper,
int maxPageSize)
Construct the Subject Area Project Handler
needed to operate within a single server instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
categoryMatchSearchCriteria(Category category,
String searchCriteria)
return whether the Category matches the search criteria
|
protected void |
checkReadOnly(String methodName,
Node node,
String operation)
Check whether the node is readonly and throw and exception if it is
|
protected void |
checkRelationshipReadOnly(String methodName,
Relationship relationship,
String operation)
Check whether the relationship is readonly and throw and exception if it is
|
<R extends InstanceHeader,T extends OmasObject> |
convertOmrsToOmas(Collection<R> list,
Class<? extends Mapper> mapperInterface) |
protected <T extends Node> |
findEntities(String userId,
String typeEntityName,
FindRequest findRequest,
Class<? extends INodeMapper<T>> mapperClass,
String methodName) |
List<Relationship> |
getAllRelationshipForEntity(String restAPIName,
String userId,
String entityGuid,
FindRequest findRequest)
Get the relationships keyed off an entity guid.
|
SubjectAreaOMASAPIResponse<Relationship> |
getAllRelationshipsForEntity(String methodName,
String userId,
String guid,
FindRequest findRequest)
Get All relationships for Node
|
int |
getMaxPageSize() |
List<Node> |
getNodesFromEntityDetails(Collection<EntityDetail> entityDetails) |
<T extends Node> |
getRelatedNodesForEnd1(String methodName,
String userId,
String guid,
String relationshipTypeName,
Class<? extends INodeMapper<T>> mapperClass,
Integer startingFrom,
Integer pageSize)
Get the related nodes from end 1 of a given type of relationship
|
<T extends Node> |
getRelatedNodesForEnd2(String methodName,
String userId,
String guid,
String relationshipTypeName,
Class<? extends INodeMapper<T>> mapperClass,
Integer startingFrom,
Integer pageSize)
Get the related nodes from end 2 of a given type of relationship
|
List<Relationship> |
getRelationshipsFromRelationships(Collection<Relationship> relationships) |
protected void |
setUniqueQualifiedNameIfBlank(Node node)
Set unique qualifiedName into the supplied Node.
|
protected boolean |
termMatchSearchCriteria(Term term,
String searchCriteria)
return whether the Term matches the search criteria
|
protected String |
validateGlossarySummaryDuringCreation(String userId,
String methodName,
GlossarySummary suppliedGlossary)
This method validated for creation.
|
protected static final String GLOSSARY_TYPE_NAME
protected static final String CATEGORY_TYPE_NAME
protected static final String TERM_TYPE_NAME
protected static final String PROJECT_TYPE_NAME
protected static final String TERM_ANCHOR_RELATIONSHIP_NAME
protected static final String TERM_CATEGORIZATION_RELATIONSHIP_NAME
protected static final String PROJECT_SCOPE_RELATIONSHIP_NAME
protected static final String CATEGORY_ANCHOR_RELATIONSHIP_NAME
protected static final String CATEGORY_HIERARCHY_LINK_RELATIONSHIP_NAME
protected final MappersFactory mappersFactory
protected final OMRSAPIHelper oMRSAPIHelper
protected final int maxPageSize
protected InvalidParameterHandler invalidParameterHandler
public SubjectAreaHandler(OMRSAPIHelper oMRSAPIHelper, int maxPageSize)
oMRSAPIHelper - omrs API helpermaxPageSize - maximum page sizepublic int getMaxPageSize()
protected <T extends Node> List<T> findEntities(String userId, String typeEntityName, FindRequest findRequest, Class<? extends INodeMapper<T>> mapperClass, String methodName) throws SubjectAreaCheckedException, PropertyServerException, UserNotAuthorizedException, InvalidParameterException
public <T extends Node> SubjectAreaOMASAPIResponse<T> getRelatedNodesForEnd1(String methodName, String userId, String guid, String relationshipTypeName, Class<? extends INodeMapper<T>> mapperClass, Integer startingFrom, Integer pageSize)
methodName - name of the method being called.userId - unique identifier for requesting user, under which the request is performedguid - guidrelationshipTypeName - relationship type namemapperClass - mapper class used to get the type name of the Node to returnstartingFrom - retrieve items starting from this locationpageSize - maximum size of the returned itemspublic <T extends Node> SubjectAreaOMASAPIResponse<T> getRelatedNodesForEnd2(String methodName, String userId, String guid, String relationshipTypeName, Class<? extends INodeMapper<T>> mapperClass, Integer startingFrom, Integer pageSize)
methodName - name of the method being called.userId - unique identifier for requesting user, under which the request is performedguid - guidrelationshipTypeName - relationship type namemapperClass - mapper class used to get the type name of the Node to returnstartingFrom - retrieve items starting from this locationpageSize - maximum size of the returned itemspublic SubjectAreaOMASAPIResponse<Relationship> getAllRelationshipsForEntity(String methodName, String userId, String guid, FindRequest findRequest)
methodName - name of the method being called.userId - unique identifier for requesting user, under which the request is performedguid - guidfindRequest - FindRequestpublic List<Relationship> getAllRelationshipForEntity(String restAPIName, String userId, String entityGuid, FindRequest findRequest) throws SubjectAreaCheckedException, PropertyServerException, UserNotAuthorizedException, InvalidParameterException
restAPIName - rest API nameuserId - user identityentityGuid - globally unique identifierfindRequest - FindRequestList<Relationship>PropertyServerException - something went wrong with the REST call stack.UserNotAuthorizedException - the requesting user is not authorized to issue this request.SubjectAreaCheckedException - standard exception Subject Area OMAS servicesInvalidParameterExceptionpublic List<Relationship> getRelationshipsFromRelationships(Collection<Relationship> relationships)
public List<Node> getNodesFromEntityDetails(Collection<EntityDetail> entityDetails)
public <R extends InstanceHeader,T extends OmasObject> List<T> convertOmrsToOmas(Collection<R> list, Class<? extends Mapper> mapperInterface)
protected String validateGlossarySummaryDuringCreation(String userId, String methodName, GlossarySummary suppliedGlossary) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException, SubjectAreaCheckedException
userId - userId under which the request is performedmethodName - method making the callsuppliedGlossary - glossary to validate against.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 servicesprotected void setUniqueQualifiedNameIfBlank(Node node)
node - Node to set the unique qualified name intoprotected boolean categoryMatchSearchCriteria(Category category, String searchCriteria)
category - category to use for matchsearchCriteria - criteria to use for matchprotected boolean termMatchSearchCriteria(Term term, String searchCriteria)
term - term to use for matchsearchCriteria - criteria to use for matchprotected void checkReadOnly(String methodName, Node node, String operation) throws PropertyServerException
methodName - calling methodNamenode - node to checkoperation - operation being attemptedPropertyServerException - exception thrown when the node is readonlyprotected void checkRelationshipReadOnly(String methodName, Relationship relationship, String operation) throws PropertyServerException
methodName - calling methodNamerelationship - relationship to checkoperation - operation being attemptedPropertyServerException - exception thrown when the relationship is readonlyCopyright © 2018–2021 LF AI & Data Foundation. All rights reserved.