java.lang.Object
org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
Direct Known Subclasses:
SubjectAreaCategoryHandler, SubjectAreaConfigHandler, SubjectAreaGlossaryHandler, SubjectAreaGraphHandler, SubjectAreaProjectHandler, SubjectAreaRelationshipHandler, SubjectAreaTermHandler

public abstract class SubjectAreaHandler extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected final org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
     
    protected org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler
     
    protected final MappersFactory
     
    protected final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SubjectAreaHandler(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 Type
    Method
    Description
    <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 Node
    int
     
    List<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 String
    sanitiseFindRequest(String searchCriteria, boolean exactValue, boolean ignoreCase)
     
    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.
    protected void
    setNodeEffectivity(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 Node
    protected void
    setRelationshipEffectivity(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 Relationship
    protected void
    setUniqueQualifiedNameIfBlank(org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Node node)
    Set unique qualifiedName into the supplied Node.
    protected String
    validateGlossarySummaryDuringCreation(String userId, String methodName, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.nodesummary.GlossarySummary suppliedGlossary)
    This method validated for creation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mappersFactory

      protected final MappersFactory 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 handler
      maxPageSize - maximum page size
  • Method Details

    • getMaxPageSize

      public int getMaxPageSize()
    • sanitiseFindRequest

      protected String sanitiseFindRequest(String searchCriteria, boolean exactValue, boolean ignoreCase)
    • 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 criteria
      exactValue - flag indicating that exact value mathcing should be done
      ignoreCase - 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.PropertyServerException
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      org.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 performed
      guid - guid
      findRequest - FindRequest
      entityTypeName - 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 name
      userId - user identity
      entityGuid - globally unique identifier
      findRequest - FindRequest
      entityTypeName - 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 services
      org.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 name
      userId - user identity
      entityGuid - globally unique identifier
      findRequest - FindRequest
      entityTypeName - type name of the starting entity
      attachmentRelationshipTypeGUID - attachment relationship type guid
      attachmentRelationshipTypeName - attachment relationship type name
      attachmentEntityTypeName - 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 services
      org.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 performed
      methodName - method making the call
      suppliedGlossary - 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 invalid
      org.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 user
      node - node to update with effectivity dates if required
      methodName - name of the calling method
      guid - guid of the Bean to update
      typeGUID - the guid of the associated type
      typeName - the name of the associated type
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - invalid parameter
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem with the repositories
      org.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 user
      node - node to take the effectivity dates from
      methodName - name of the calling method
      relationshipGUID - relationshipGUID of the Relationship to update
      typeGUID - the relationshipGUID of the associated type
      typeName - the name of the associated type
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - invalid parameter
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem with the repositories
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user is not allowed to update the security tags