Class SubjectAreaRESTServicesInstance

java.lang.Object
org.odpi.openmetadata.accessservices.subjectarea.server.services.SubjectAreaRESTServicesInstance
Direct Known Subclasses:
SubjectAreaCategoryRESTServices, SubjectAreaConfigRESTServices, SubjectAreaGlossaryRESTServices, SubjectAreaGraphRESTServices, SubjectAreaProjectRESTServices, SubjectAreaRelationshipRESTServices, SubjectAreaTermRESTServices

public class SubjectAreaRESTServicesInstance extends Object
SubjectAreaRESTServicesInstance caches references to OMRS objects for a specific server. It is also responsible for registering itself in the instance map.
  • Field Details

    • instanceHandler

      protected static org.odpi.openmetadata.accessservices.subjectarea.server.services.SubjectAreaInstanceHandler instanceHandler
  • Constructor Details

    • SubjectAreaRESTServicesInstance

      public SubjectAreaRESTServicesInstance()
      Default constructor
  • Method Details

    • createRelationship

      protected <R extends Relationship> SubjectAreaOMASAPIResponse<R> createRelationship(String serverName, String restAPIName, String userId, Class<? extends IRelationshipMapper<R>> clazz, R relationship)
      Create a relationship (relationship), which is a link between two Nodes.

      Type Parameters:
      R - Relationship type of object for response
      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      restAPIName - name of the rest API
      userId - userId under which the request is performed
      clazz - mapper Class
      relationship - relationship to create
      Returns:
      response, when successful contains the created relationship when not successful the following Exception responses can occur
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service.
      • InvalidParameterException one of the parameters is null or invalid.
      • UnrecognizedGUIDException the supplied guid was not recognised
      • ClassificationException Error processing a classification.
      • StatusNotSupportedException A status value is not supported.
      • FunctionNotSupportedException Function is not supported.
    • getRelationship

      protected <L extends Relationship> SubjectAreaOMASAPIResponse<L> getRelationship(String serverName, String restAPIName, String userId, Class<? extends IRelationshipMapper<L>> clazz, String guid)
      Get a relationship (relationship)
      Type Parameters:
      L - Relationship type of object for response
      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      restAPIName - name of the rest API
      userId - unique identifier for requesting user, under which the request is performed
      clazz - mapper Class
      guid - guid of the relationship to get
      Returns:
      response which when successful contains the relationship with the requested guid when not successful the following Exception responses can occur
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service.
      • InvalidParameterException one of the parameters is null or invalid.
      • UnrecognizedGUIDException the supplied guid was not recognised
    • updateRelationship

      protected <L extends Relationship> SubjectAreaOMASAPIResponse<L> updateRelationship(String serverName, String restAPIName, String userId, String guid, Class<? extends IRelationshipMapper<L>> clazz, L relationship, boolean isReplace)
      Update a relationship.

      Type Parameters:
      L - Relationship type of object for response
      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      restAPIName - rest api name
      userId - userId under which the request is performed
      guid - unique identifier of the relationship
      clazz - mapper Class
      relationship - the relationship to update
      isReplace - flag to indicate that this update is a replace. When not set only the supplied (non null) fields are updated.
      Returns:
      response, when successful contains the updated relationship when not successful the following Exception responses can occur
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service.
      • InvalidParameterException one of the parameters is null or invalid.
      • UnrecognizedGUIDException the supplied guid was not recognised
      • ClassificationException Error processing a classification.
      • StatusNotSupportedException A status value is not supported.
      • FunctionNotSupportedException Function not supported.
    • deleteRelationship

      public <L extends Relationship> SubjectAreaOMASAPIResponse<L> deleteRelationship(String serverName, String restAPIName, String userId, Class<? extends IRelationshipMapper<L>> clazz, String guid)
      Delete a relationship (relationship)
      Type Parameters:
      L - Relationship type of object for response
      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      restAPIName - rest API name
      userId - unique identifier for requesting user, under which the request is performed
      clazz - mapper Class
      guid - guid of the HAS A relationship to delete
      Returns:
      response for a soft delete, the response contains the deleted relationship when not successful the following Exception responses can occur
      • UnrecognizedGUIDException the supplied guid was not recognised
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • FunctionNotSupportedException Function not supported.
      • InvalidParameterException one of the parameters is null or invalid.
      • MetadataServerUncontactableException not able to communicate with a Metadata repository service. There is a problem retrieving properties from the metadata repository.
      • EntityNotDeletedException a soft delete was issued but the relationship was not deleted.
    • restoreRelationship

      protected <L extends Relationship> SubjectAreaOMASAPIResponse<L> restoreRelationship(String serverName, String restAPIName, String userId, Class<? extends IRelationshipMapper<L>> clazz, String guid)
      Restore a relationship (relationship).

      Restore allows the deleted relationship to be made active again. Restore allows deletes to be undone. Hard deletes are not stored in the repository so cannot be restored.

      Type Parameters:
      L - Relationship type of object for response
      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      restAPIName - name of the rest API
      userId - unique identifier for requesting user, under which the request is performed
      clazz - mapper Class
      guid - guid of the relationship to restore
      Returns:
      response which when successful contains the restored relationship when not successful the following Exception responses can occur
      • UnrecognizedGUIDException the supplied guid was not recognised
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • FunctionNotSupportedException Function not supported.
      • InvalidParameterException one of the parameters is null or invalid.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service. There is a problem retrieving properties from the metadata repository.
      • EntityNotDeletedException a soft delete was issued but the relationship was not deleted.
      • EntityNotPurgedException a hard delete was issued but the relationship was not purged
    • getFindRequest

      protected FindRequest getFindRequest(String searchCriteria, Date asOfTime, Integer startingFrom, Integer pageSize, String sequencingOrderName, String sequencingProperty, Integer handlerMaxPageSize)
    • getResponseForException

      protected <T> SubjectAreaOMASAPIResponse<T> getResponseForException(Exception exception, AuditLog auditLog, String className, String restAPIName)
      Get the appropriate response from the supplied Exception
      Parameters:
      exception - - supplied exception
      auditLog - - ffdc (may be null if unable to initialize)
      className - - calling class's Name
      restAPIName - - calling method's name
      Returns:
      response corresponding to the exception.