Class SubjectAreaRelationshipHandler
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
-
- org.odpi.openmetadata.accessservices.subjectarea.handlers.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.
-
-
Field Summary
-
Fields inherited from class org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
CATEGORY_ANCHOR_RELATIONSHIP_NAME, CATEGORY_HIERARCHY_LINK_RELATIONSHIP_NAME, CATEGORY_TYPE_NAME, GLOSSARY_TYPE_NAME, invalidParameterHandler, mappersFactory, maxPageSize, oMRSAPIHelper, PROJECT_SCOPE_RELATIONSHIP_NAME, PROJECT_TYPE_NAME, TERM_ANCHOR_RELATIONSHIP_NAME, TERM_CATEGORIZATION_RELATIONSHIP_NAME, TERM_TYPE_NAME
-
-
Constructor Summary
Constructors Constructor Description SubjectAreaRelationshipHandler(OMRSAPIHelper oMRSAPIHelper, int maxPageSize)Construct the Subject Area Relationship Handler needed to operate within a single server instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R extends Relationship>
SubjectAreaOMASAPIResponse<R>createRelationship(String restAPIName, String userId, Class<? extends IRelationshipMapper<R>> clazz, R relationship)Create a relationship, which is a link between two Nodes.<R extends Relationship>
SubjectAreaOMASAPIResponse<R>deleteRelationship(String restAPIName, String userId, Class<? extends IRelationshipMapper<R>> clazz, String guid, Boolean isPurge)Delete a relationship<R extends Relationship>
SubjectAreaOMASAPIResponse<R>getRelationship(String restAPIName, String userId, Class<? extends IRelationshipMapper<R>> clazz, String guid)Get a relationship (relationship)<R extends Relationship>
SubjectAreaOMASAPIResponse<R>restoreRelationship(String restAPIName, String userId, Class<? extends IRelationshipMapper<R>> clazz, String guid)Restore a relationship.<R extends Relationship>
SubjectAreaOMASAPIResponse<R>updateRelationship(String restAPIName, String userId, String relationshipGuid, Class<? extends IRelationshipMapper<R>> clazz, R relationship, Boolean isReplace)Update a relationship.-
Methods inherited from class org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
categoryMatchSearchCriteria, checkReadOnly, checkRelationshipReadOnly, convertOmrsToOmas, findNodes, getAllRelationshipForEntity, getAllRelationshipsForEntity, getMaxPageSize, getNodesFromEntityDetails, getRelatedNodesForEnd1, getRelatedNodesForEnd2, getRelationshipsFromRelationships, sanitiseFindRequest, sanitiseFindRequest, setUniqueQualifiedNameIfBlank, termMatchSearchCriteria, validateGlossarySummaryDuringCreation
-
-
-
-
Constructor Detail
-
SubjectAreaRelationshipHandler
public SubjectAreaRelationshipHandler(OMRSAPIHelper oMRSAPIHelper, int maxPageSize)
Construct the Subject Area Relationship Handler needed to operate within a single server instance.- Parameters:
oMRSAPIHelper- omrs API helpermaxPageSize- maximum page size
-
-
Method Detail
-
createRelationship
public <R extends Relationship> SubjectAreaOMASAPIResponse<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-Relationshiptype of object for response- Parameters:
restAPIName- rest API nameuserId- userId under which the request is performedclazz- mapper Classrelationship- 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 Relationship> SubjectAreaOMASAPIResponse<R> getRelationship(String restAPIName, String userId, Class<? extends IRelationshipMapper<R>> clazz, String guid)
Get a relationship (relationship)- Type Parameters:
R-Relationshiptype of object for response- Parameters:
restAPIName- rest API nameuserId- unique identifier for requesting user, under which the request is performedclazz- mapper Classguid- 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 Relationship> SubjectAreaOMASAPIResponse<R> updateRelationship(String restAPIName, String userId, String relationshipGuid, Class<? extends IRelationshipMapper<R>> clazz, R relationship, Boolean isReplace)
Update a relationship.- Type Parameters:
R-Relationshiptype of object for response- Parameters:
restAPIName- rest API nameuserId- userId under which the request is performedrelationshipGuid- unique identifier of the relationshipclazz- mapper Classrelationship- the relationship to updateisReplace- 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 Relationship> SubjectAreaOMASAPIResponse<R> deleteRelationship(String restAPIName, String userId, Class<? extends IRelationshipMapper<R>> clazz, String guid, Boolean isPurge)
Delete a relationship- Type Parameters:
R-Relationshiptype of object for response- Parameters:
restAPIName- rest API nameuserId- unique identifier for requesting user, under which the request is performedclazz- mapper Classguid- guid of the HAS A relationship to deleteisPurge- true indicates a hard delete, false is a soft 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.
- EntityNotPurgedException a hard delete was issued but the relationship was not purged
-
restoreRelationship
public <R extends Relationship> SubjectAreaOMASAPIResponse<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-Relationshiptype of object for response- Parameters:
restAPIName- rest API nameuserId- unique identifier for requesting user, under which the request is performedclazz- mapper Classguid- 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
-
-