Class SubjectAreaRESTServicesInstance

    • Field Detail

      • instanceHandler

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

      • SubjectAreaRESTServicesInstance

        public SubjectAreaRESTServicesInstance()
        Default constructor
    • Method Detail

      • createRelationship

        protected <R extends RelationshipSubjectAreaOMASAPIResponse<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 RelationshipSubjectAreaOMASAPIResponse<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 RelationshipSubjectAreaOMASAPIResponse<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 RelationshipSubjectAreaOMASAPIResponse<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 RelationshipSubjectAreaOMASAPIResponse<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
      • 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 - - auditlog (may be null if unable to initialize)
        className - - calling class's Name
        restAPIName - - calling method's name
        Returns:
        response corresponding to the exception.