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 Summary
Fields Modifier and Type Field Description protected static org.odpi.openmetadata.accessservices.subjectarea.server.services.SubjectAreaInstanceHandlerinstanceHandler
-
Constructor Summary
Constructors Constructor Description SubjectAreaRESTServicesInstance()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.<L extends Relationship>
SubjectAreaOMASAPIResponse<L>deleteRelationship(String serverName, String restAPIName, String userId, Class<? extends IRelationshipMapper<L>> clazz, String guid)Delete a relationship (relationship)protected FindRequestgetFindRequest(String searchCriteria, Date asOfTime, Integer startingFrom, Integer pageSize, String sequencingOrderName, String sequencingProperty, Integer handlerMaxPageSize)protected <L extends Relationship>
SubjectAreaOMASAPIResponse<L>getRelationship(String serverName, String restAPIName, String userId, Class<? extends IRelationshipMapper<L>> clazz, String guid)Get a relationship (relationship)protected <T> SubjectAreaOMASAPIResponse<T>getResponseForException(Exception exception, AuditLog auditLog, String className, String restAPIName)Get the appropriate response from the supplied Exceptionprotected <L extends Relationship>
SubjectAreaOMASAPIResponse<L>restoreRelationship(String serverName, String restAPIName, String userId, Class<? extends IRelationshipMapper<L>> clazz, String guid)Restore a relationship (relationship).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.
-
-
-
Method Detail
-
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-Relationshiptype of object for response- Parameters:
serverName- serverName under which this request is performed, this is used in multi tenanting to identify the tenantrestAPIName- name of the rest APIuserId- 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
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-Relationshiptype of object for response- Parameters:
serverName- serverName under which this request is performed, this is used in multi tenanting to identify the tenantrestAPIName- name of the rest APIuserId- 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
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-Relationshiptype of object for response- Parameters:
serverName- serverName under which this request is performed, this is used in multi tenanting to identify the tenantrestAPIName- rest api nameuserId- userId under which the request is performedguid- 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 <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-Relationshiptype of object for response- Parameters:
serverName- serverName under which this request is performed, this is used in multi tenanting to identify the tenantrestAPIName- rest API nameuserId- unique identifier for requesting user, under which the request is performedclazz- mapper Classguid- 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-Relationshiptype of object for response- Parameters:
serverName- serverName under which this request is performed, this is used in multi tenanting to identify the tenantrestAPIName- name of the rest APIuserId- 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
-
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 exceptionauditLog- - auditlog (may be null if unable to initialize)className- - calling class's NamerestAPIName- - calling method's name- Returns:
- response corresponding to the exception.
-
-