Class SubjectAreaHandler
java.lang.Object
org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
- Direct Known Subclasses:
SubjectAreaCategoryHandler,SubjectAreaConfigHandler,SubjectAreaGlossaryHandler,SubjectAreaGraphHandler,SubjectAreaProjectHandler,SubjectAreaRelationshipHandler,SubjectAreaTermHandler
SubjectAreaProjectHandler manages Project objects from the property server. It runs server-side in the subject Area
OMAS and retrieves entities and relationships through the OMRSRepositoryConnector.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandlerprotected org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandlerprotected final MappersFactoryprotected final int -
Constructor Summary
ConstructorsConstructorDescriptionSubjectAreaHandler(org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler genericHandler, int maxPageSize) Construct the Subject Area Handler needed to operate within a single server instance. -
Method Summary
Modifier and TypeMethodDescription<R extends org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader,T extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.OmasObject>
List<T>convertOmrsToOmas(Collection<R> list, Class<? extends Mapper> mapperInterface) protected <T extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node>
List<T>findNodes(String userId, String typeEntityName, String typeEntityGuid, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, boolean exactValue, boolean ignoreCase, Class<? extends INodeMapper<T>> mapperClass, String methodName) List<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>getAllRelationshipForEntity(String restAPIName, String userId, String entityGuid, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, String entityTypeName) Get the relationships keyed off an entity guid.org.odpi.openmetadata.accessservices.subjectarea.responses.SubjectAreaOMASAPIResponse<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>getAllRelationshipsForEntity(String methodName, String userId, String guid, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, String entityTypeName) Get All relationships for NodeintList<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node>getNodesFromEntityDetails(Collection<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> entityDetails) List<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>getRelationshipsForEntityByType(String restAPIName, String userId, String entityGuid, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, String entityTypeName, String attachmentRelationshipTypeGUID, String attachmentRelationshipTypeName, String attachmentEntityTypeName) Get the relationships keyed off an entity guid.List<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship>getRelationshipsFromRelationships(Collection<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> relationships) protected StringsanitiseFindRequest(String searchCriteria, boolean exactValue, boolean ignoreCase) protected org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequestsanitiseFindRequest(org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, boolean exactValue, boolean ignoreCase) Take a FindRequest and sanitise it.protected voidsetNodeEffectivity(String userId, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node node, String methodName, String guid, String typeGUID, String typeName) Set the effectivity to and from dates date for a Nodeprotected voidsetRelationshipEffectivity(String userId, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node node, String methodName, String relationshipGUID, String typeGUID, String typeName) Set the effectivity to and from dates date for a Relationshipprotected voidsetUniqueQualifiedNameIfBlank(org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node node) Set unique qualifiedName into the supplied Node.protected StringvalidateGlossarySummaryDuringCreation(String userId, String methodName, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.nodesummary.GlossarySummary suppliedGlossary) This method validated for creation.
-
Field Details
-
mappersFactory
-
genericHandler
protected final org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler genericHandler -
maxPageSize
protected final int maxPageSize -
invalidParameterHandler
protected org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler invalidParameterHandler
-
-
Constructor Details
-
SubjectAreaHandler
public SubjectAreaHandler(org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler genericHandler, int maxPageSize) Construct the Subject Area Handler needed to operate within a single server instance.- Parameters:
genericHandler- generic handlermaxPageSize- maximum page size
-
-
Method Details
-
getMaxPageSize
public int getMaxPageSize() -
sanitiseFindRequest
-
sanitiseFindRequest
protected org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest sanitiseFindRequest(org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, boolean exactValue, boolean ignoreCase) Take a FindRequest and sanitise it. The FindRequest from the user could contain a regex expression which would cause the regex engine to loop. to avoid this, we turn what the user has given us into a literal and then use the exactValue and ignoreCase flags to add to the regular expression in a controlled way.- Parameters:
findRequest- supplied find request - that contains the search criteriaexactValue- flag indicating that exact value mathcing should be doneignoreCase- flag indicating that case should be ignored- Returns:
- sanitised find request
-
findNodes
protected <T extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node> List<T> findNodes(String userId, String typeEntityName, String typeEntityGuid, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, boolean exactValue, boolean ignoreCase, Class<? extends INodeMapper<T>> mapperClass, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerExceptionorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedExceptionorg.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
-
getAllRelationshipsForEntity
public org.odpi.openmetadata.accessservices.subjectarea.responses.SubjectAreaOMASAPIResponse<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship> getAllRelationshipsForEntity(String methodName, String userId, String guid, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, String entityTypeName) Get All relationships for Node- Parameters:
methodName- name of the method being called.userId- unique identifier for requesting user, under which the request is performedguid- guidfindRequest-FindRequestentityTypeName- typpe name of the starting entity- Returns:
- the relationships associated with the requested guid
-
getAllRelationshipForEntity
public List<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship> getAllRelationshipForEntity(String restAPIName, String userId, String entityGuid, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, String entityTypeName) throws org.odpi.openmetadata.accessservices.subjectarea.ffdc.exceptions.SubjectAreaCheckedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Get the relationships keyed off an entity guid.- Parameters:
restAPIName- rest API nameuserId- user identityentityGuid- globally unique identifierfindRequest-FindRequestentityTypeName- type name of the starting entity- Returns:
List<Relationship>- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.accessservices.subjectarea.ffdc.exceptions.SubjectAreaCheckedException- standard exception Subject Area OMAS servicesorg.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
-
getRelationshipsForEntityByType
public List<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship> getRelationshipsForEntityByType(String restAPIName, String userId, String entityGuid, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, String entityTypeName, String attachmentRelationshipTypeGUID, String attachmentRelationshipTypeName, String attachmentEntityTypeName) throws org.odpi.openmetadata.accessservices.subjectarea.ffdc.exceptions.SubjectAreaCheckedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Get the relationships keyed off an entity guid.- Parameters:
restAPIName- rest API nameuserId- user identityentityGuid- globally unique identifierfindRequest-FindRequestentityTypeName- type name of the starting entityattachmentRelationshipTypeGUID- attachment relationship type guidattachmentRelationshipTypeName- attachment relationship type nameattachmentEntityTypeName- attached entity type name- Returns:
List<Relationship>- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.accessservices.subjectarea.ffdc.exceptions.SubjectAreaCheckedException- standard exception Subject Area OMAS servicesorg.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
-
getRelationshipsFromRelationships
public List<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship> getRelationshipsFromRelationships(Collection<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> relationships) -
getNodesFromEntityDetails
public List<org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node> getNodesFromEntityDetails(Collection<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> entityDetails) -
convertOmrsToOmas
public <R extends org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader,T extends org.odpi.openmetadata.accessservices.subjectarea.properties.objects.OmasObject> List<T> convertOmrsToOmas(Collection<R> list, Class<? extends Mapper> mapperInterface) -
validateGlossarySummaryDuringCreation
protected String validateGlossarySummaryDuringCreation(String userId, String methodName, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.nodesummary.GlossarySummary suppliedGlossary) throws org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.accessservices.subjectarea.ffdc.exceptions.SubjectAreaCheckedException This method validated for creation.- Parameters:
userId- userId under which the request is performedmethodName- method making the callsuppliedGlossary- glossary to validate against.- Returns:
- SubjectAreaOMASAPIResponse this response is of type ResponseCategory.Category.Glossary if successful, otherwise there is an error response.
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalidorg.odpi.openmetadata.accessservices.subjectarea.ffdc.exceptions.SubjectAreaCheckedException- standard exception Subject Area OMAS services
-
setUniqueQualifiedNameIfBlank
protected void setUniqueQualifiedNameIfBlank(org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node node) Set unique qualifiedName into the supplied Node. The qualified name needs to be unique and is supplied on an addnEtity omrs call. Prior to the add, we do not know the guid of the entity. We do not want to add an entity, then immediately update it; as these changes to entity identity would be propagated across the cohort. So we set the qualified name by concatinating the supplied seed, an @ symbol and a newly generated UUID. The assumption is that this method is supplied a node that contains a name.- Parameters:
node- Node to set the unique qualified name into
-
setNodeEffectivity
protected void setNodeEffectivity(String userId, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node node, String methodName, String guid, String typeGUID, String typeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Set the effectivity to and from dates date for a Node- Parameters:
userId- calling usernode- node to update with effectivity dates if requiredmethodName- name of the calling methodguid- guid of the Bean to updatetypeGUID- the guid of the associated typetypeName- the name of the associated type- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- invalid parameterorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem with the repositoriesorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not allowed to update the security tags
-
setRelationshipEffectivity
protected void setRelationshipEffectivity(String userId, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node node, String methodName, String relationshipGUID, String typeGUID, String typeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Set the effectivity to and from dates date for a Relationship- Parameters:
userId- calling usernode- node to take the effectivity dates frommethodName- name of the calling methodrelationshipGUID- relationshipGUID of the Relationship to updatetypeGUID- the relationshipGUID of the associated typetypeName- the name of the associated type- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- invalid parameterorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem with the repositoriesorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not allowed to update the security tags
-