Class SubjectAreaRelationshipHandler


  • public class SubjectAreaRelationshipHandler
    extends SubjectAreaHandler
    TheSubjectAreaTermRESTServices provides the server-side implementation of the SubjectArea Open Metadata Access Service (OMAS) for Terms. This interface provides relationship authoring interfaces for subject area experts.
    • Constructor Detail

      • SubjectAreaRelationshipHandler

        public SubjectAreaRelationshipHandler​(OpenMetadataAPIGenericHandler genericHandler,
                                              int maxPageSize)
        Construct the Subject Area Relationship Handler needed to operate within a single server instance.
        Parameters:
        genericHandler - generic handler
        maxPageSize - maximum page size
    • Method Detail

      • createRelationship

        public <R extends RelationshipSubjectAreaOMASAPIResponse<R> createRelationship​(String restAPIName,
                                                                                         String userId,
                                                                                         Class<? extends IRelationshipMapper<R>> clazz,
                                                                                         R relationship)
        Create a relationship, which is a link between two Nodes.

        Type Parameters:
        R - Relationship type of object for response
        Parameters:
        restAPIName - rest API name
        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

        public <R extends RelationshipSubjectAreaOMASAPIResponse<R> getRelationship​(String restAPIName,
                                                                                      String userId,
                                                                                      Class<? extends IRelationshipMapper<R>> clazz,
                                                                                      String guid)
        Get a relationship (relationship)
        Type Parameters:
        R - Relationship type of object for response
        Parameters:
        restAPIName - rest API name
        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

        public <R extends RelationshipSubjectAreaOMASAPIResponse<R> updateRelationship​(String restAPIName,
                                                                                         String userId,
                                                                                         String relationshipGuid,
                                                                                         Class<? extends IRelationshipMapper<R>> clazz,
                                                                                         R relationship,
                                                                                         Boolean isReplace)
        Update a relationship.

        Type Parameters:
        R - Relationship type of object for response
        Parameters:
        restAPIName - rest API name
        userId - userId under which the request is performed
        relationshipGuid - 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 <R extends RelationshipSubjectAreaOMASAPIResponse<R> deleteRelationship​(String restAPIName,
                                                                                         String userId,
                                                                                         Class<? extends IRelationshipMapper<R>> clazz,
                                                                                         String guid)
        Delete a relationship
        Type Parameters:
        R - Relationship type of object for response
        Parameters:
        restAPIName - rest API name
        userId - unique identifier for requesting user, under which the request is performed
        clazz - mapper Class
        guid - guid of the 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 respository service. There is a problem retrieving properties from the metadata repository.
        • EntityNotDeletedException a soft delete was issued but the relationship was not deleted.
      • restoreRelationship

        public <R extends RelationshipSubjectAreaOMASAPIResponse<R> restoreRelationship​(String restAPIName,
                                                                                          String userId,
                                                                                          Class<? extends IRelationshipMapper<R>> clazz,
                                                                                          String guid)
        Restore a 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:
        R - Relationship type of object for response
        Parameters:
        restAPIName - rest API name
        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.