Class OMRSAPIHelper
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.subjectarea.utilities.OMRSAPIHelper
-
public class OMRSAPIHelper extends Object
This is a facade around the OMRS API. It transforms the OMRS Exceptions into OMAS exceptions
-
-
Constructor Summary
Constructors Constructor Description OMRSAPIHelper(String serviceName, String serverName, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<EntityDetail>callFindEntitiesByPropertyValue(String userId, String entityTypeGUID, String searchCriteria, int fromEntityElement, int pageSize, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, String restAPIName)List<EntityDetail>callGetEntitiesByType(String userId, String entityTypeGUID, Date asOfTime, int fromEntityElement, int pageSize, String sequencingProperty, SequencingOrder sequencingOrder, String restAPIName)List<EntityDetail>callGetEntitiesForRelationshipEnd(String restAPIName, String userId, String anchorEntityGUID, String anchorEntityTypeName, boolean anchorAtEnd1, String relationshipTypeGUID, String relationshipTypeName, int startingFrom, int pageSize)List<EntityDetail>callGetEntitiesForRelationshipEnd1(String restAPIName, String userId, String anchorEntityGUID, String anchorEntityTypeName, String relationshipTypeName, int startingFrom, int pageSize)List<EntityDetail>callGetEntitiesForRelationshipEnd2(String restAPIName, String userId, String anchorEntityGUID, String anchorEntityTypeName, String relationshipTypeName)List<EntityDetail>callGetEntitiesForRelationshipEnd2(String restAPIName, String userId, String anchorEntityGUID, String anchorEntityTypeName, String relationshipTypeName, int startingFrom, int pageSize)InstanceGraphcallGetEntityNeighbourhood(String restAPIName, String userId, String entityGUID, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification, Date asOfTime, int level)List<Relationship>callGetRelationshipsForEntity(String restAPIName, String userId, String entityGUID, String relationshipTypeGuid, int fromRelationshipElement, int pageSize)List<Relationship>callGetRelationshipsForEntity(String restAPIName, String userId, String entityGUID, String relationshipTypeGuid, int fromRelationshipElement, int pageSize, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder)List<Relationship>callGetRelationshipsForEntity(String restAPIName, String userId, String entityGUID, String relationshipTypeGUID, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize)StringcallOMRSAddEntity(String restAPIName, String userId, EntityDetail entityDetail)Optional<Relationship>callOMRSAddRelationship(String restAPIName, String userId, Relationship relationship)voidcallOMRSClassifyEntity(String restAPIName, String userId, String entityGUID, String classificationTypeGUID, String classificationName, InstanceProperties instanceProperties)voidcallOMRSClassifyEntity(String restAPIName, String userId, String entityGUID, Classification classification)voidcallOMRSDeClassifyEntity(String restAPIName, String userId, String entityGUID, String classificationName)voidcallOMRSDeleteEntity(String restAPIName, String userId, String entityTypeName, String obsoleteGuid)voidcallOMRSDeleteRelationship(String restAPIName, String userId, String typeGuid, String typeName, String guid)Optional<EntityDetail>callOMRSGetEntityByGuid(String userId, String entityGUID, String entityTypeName, String restAPIName)Optional<Relationship>callOMRSGetRelationshipByGuid(String restAPIName, String userId, String relationshipGUID)voidcallOMRSPurgeEntity(String restAPIName, String userId, String entityTypeName, String obsoleteGuid)voidcallOMRSPurgeRelationship(String restAPIName, String userId, String typeGuid, String typeName, String guid)voidcallOMRSRestoreEntity(String restAPIName, String userId, String deletedEntityGUID)voidcallOMRSRestoreRelationship(String restAPIName, String userId, String guid)voidcallOMRSUpdateClassification(String restAPIName, String userId, String entityGUID, Classification existingClassification, InstanceProperties newProperties)Optional<EntityDetail>callOMRSUpdateEntity(String restAPIName, String userId, EntityDetail entityDetail)voidcallOMRSUpdateRelationship(String restAPIName, String userId, Relationship relationship)List<EntityDetail>findEntitiesByPropertyValue(String restAPIName, String userId, String typeName, String searchCriteria, Date asOfTime, int startingFrom, int pageSize, SequencingOrder sequencingOrder, String sequencingProperty)List<EntityDetail>findEntitiesByPropertyValue(String restAPIName, String userId, String typeName, FindRequest findRequest)List<Relationship>getAllRelationshipsForEntity(String restAPIName, String userId, String entityGUID, FindRequest findRequest)List<EntityDetail>getEntitiesByType(String restAPIName, String userId, String typeName, Date asOfTime, int startingFrom, int pageSize, String sequencingProperty, SequencingOrder sequencingOrder)List<EntityDetail>getEntitiesByType(String restAPIName, String userId, String typeName, FindRequest findRequest)OMRSRepositoryHelpergetOMRSRepositoryHelper()List<Relationship>getRelationshipsByType(String userId, String entityGuid, String entityTypeName, String relationshipTypeName, String methodName)RepositoryHandlergetRepositoryHandler()StringgetServiceName()Get the service name - ths is used for loggingStringgetTypeDefGUID(String typeDefName)StringgetTypeDefGUID(String sourceName, String typeDefName)booleanisEmptyContent(List<String> relationshipTypeNames, String userId, String entityGuid, String entityTypeName, String methodName)booleanisTypeOf(String actualTypeName, String expectedTypeName)
-
-
-
Constructor Detail
-
OMRSAPIHelper
public OMRSAPIHelper(String serviceName, String serverName, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper)
- Parameters:
serviceName- name of the consuming serviceserverName- name of this server instancerepositoryHelper- helper used by the convertersrepositoryHandler- issues common calls to the open metadata repository to retrieve and store metadata
-
-
Method Detail
-
getServiceName
public String getServiceName()
Get the service name - ths is used for logging- Returns:
- service name
-
getOMRSRepositoryHelper
public OMRSRepositoryHelper getOMRSRepositoryHelper()
-
getRepositoryHandler
public RepositoryHandler getRepositoryHandler()
-
callOMRSAddEntity
public String callOMRSAddEntity(String restAPIName, String userId, EntityDetail entityDetail) throws SubjectAreaCheckedException, UserNotAuthorizedException, PropertyServerException
-
callOMRSGetEntityByGuid
public Optional<EntityDetail> callOMRSGetEntityByGuid(String userId, String entityGUID, String entityTypeName, String restAPIName) throws SubjectAreaCheckedException, PropertyServerException, UserNotAuthorizedException, InvalidParameterException
-
callFindEntitiesByPropertyValue
public List<EntityDetail> callFindEntitiesByPropertyValue(String userId, String entityTypeGUID, String searchCriteria, int fromEntityElement, int pageSize, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, String restAPIName) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callGetEntitiesByType
public List<EntityDetail> callGetEntitiesByType(String userId, String entityTypeGUID, Date asOfTime, int fromEntityElement, int pageSize, String sequencingProperty, SequencingOrder sequencingOrder, String restAPIName) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSUpdateEntity
public Optional<EntityDetail> callOMRSUpdateEntity(String restAPIName, String userId, EntityDetail entityDetail) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSDeleteEntity
public void callOMRSDeleteEntity(String restAPIName, String userId, String entityTypeName, String obsoleteGuid) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSPurgeEntity
public void callOMRSPurgeEntity(String restAPIName, String userId, String entityTypeName, String obsoleteGuid) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSRestoreEntity
public void callOMRSRestoreEntity(String restAPIName, String userId, String deletedEntityGUID) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSClassifyEntity
public void callOMRSClassifyEntity(String restAPIName, String userId, String entityGUID, Classification classification) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSClassifyEntity
public void callOMRSClassifyEntity(String restAPIName, String userId, String entityGUID, String classificationTypeGUID, String classificationName, InstanceProperties instanceProperties) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSUpdateClassification
public void callOMRSUpdateClassification(String restAPIName, String userId, String entityGUID, Classification existingClassification, InstanceProperties newProperties) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSDeClassifyEntity
public void callOMRSDeClassifyEntity(String restAPIName, String userId, String entityGUID, String classificationName) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSAddRelationship
public Optional<Relationship> callOMRSAddRelationship(String restAPIName, String userId, Relationship relationship) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSGetRelationshipByGuid
public Optional<Relationship> callOMRSGetRelationshipByGuid(String restAPIName, String userId, String relationshipGUID) throws SubjectAreaCheckedException, UserNotAuthorizedException, PropertyServerException
-
callOMRSUpdateRelationship
public void callOMRSUpdateRelationship(String restAPIName, String userId, Relationship relationship) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSDeleteRelationship
public void callOMRSDeleteRelationship(String restAPIName, String userId, String typeGuid, String typeName, String guid) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSRestoreRelationship
public void callOMRSRestoreRelationship(String restAPIName, String userId, String guid) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callOMRSPurgeRelationship
public void callOMRSPurgeRelationship(String restAPIName, String userId, String typeGuid, String typeName, String guid) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
getRelationshipsByType
public List<Relationship> getRelationshipsByType(String userId, String entityGuid, String entityTypeName, String relationshipTypeName, String methodName) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callGetRelationshipsForEntity
public List<Relationship> callGetRelationshipsForEntity(String restAPIName, String userId, String entityGUID, String relationshipTypeGuid, int fromRelationshipElement, int pageSize) throws PropertyServerException, SubjectAreaCheckedException, UserNotAuthorizedException
-
getAllRelationshipsForEntity
public List<Relationship> getAllRelationshipsForEntity(String restAPIName, String userId, String entityGUID, FindRequest findRequest) throws PropertyServerException, SubjectAreaCheckedException, UserNotAuthorizedException
-
callGetRelationshipsForEntity
public List<Relationship> callGetRelationshipsForEntity(String restAPIName, String userId, String entityGUID, String relationshipTypeGuid, int fromRelationshipElement, int pageSize, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder) throws SubjectAreaCheckedException, PropertyServerException, UserNotAuthorizedException
-
callGetRelationshipsForEntity
public List<Relationship> callGetRelationshipsForEntity(String restAPIName, String userId, String entityGUID, String relationshipTypeGUID, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) throws UserNotAuthorizedException, PropertyServerException, SubjectAreaCheckedException
-
callGetEntitiesForRelationshipEnd2
public List<EntityDetail> callGetEntitiesForRelationshipEnd2(String restAPIName, String userId, String anchorEntityGUID, String anchorEntityTypeName, String relationshipTypeName) throws PropertyServerException, SubjectAreaCheckedException, UserNotAuthorizedException
-
callGetEntitiesForRelationshipEnd1
public List<EntityDetail> callGetEntitiesForRelationshipEnd1(String restAPIName, String userId, String anchorEntityGUID, String anchorEntityTypeName, String relationshipTypeName, int startingFrom, int pageSize) throws PropertyServerException, SubjectAreaCheckedException, UserNotAuthorizedException
-
callGetEntitiesForRelationshipEnd2
public List<EntityDetail> callGetEntitiesForRelationshipEnd2(String restAPIName, String userId, String anchorEntityGUID, String anchorEntityTypeName, String relationshipTypeName, int startingFrom, int pageSize) throws PropertyServerException, SubjectAreaCheckedException, UserNotAuthorizedException
-
callGetEntitiesForRelationshipEnd
public List<EntityDetail> callGetEntitiesForRelationshipEnd(String restAPIName, String userId, String anchorEntityGUID, String anchorEntityTypeName, boolean anchorAtEnd1, String relationshipTypeGUID, String relationshipTypeName, int startingFrom, int pageSize) throws SubjectAreaCheckedException, UserNotAuthorizedException, PropertyServerException
-
callGetEntityNeighbourhood
public InstanceGraph callGetEntityNeighbourhood(String restAPIName, String userId, String entityGUID, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification, Date asOfTime, int level) throws SubjectAreaCheckedException, UserNotAuthorizedException, PropertyServerException
-
findEntitiesByPropertyValue
public List<EntityDetail> findEntitiesByPropertyValue(String restAPIName, String userId, String typeName, FindRequest findRequest) throws PropertyServerException, SubjectAreaCheckedException, UserNotAuthorizedException
-
findEntitiesByPropertyValue
public List<EntityDetail> findEntitiesByPropertyValue(String restAPIName, String userId, String typeName, String searchCriteria, Date asOfTime, int startingFrom, int pageSize, SequencingOrder sequencingOrder, String sequencingProperty) throws SubjectAreaCheckedException, PropertyServerException, UserNotAuthorizedException
-
getEntitiesByType
public List<EntityDetail> getEntitiesByType(String restAPIName, String userId, String typeName, FindRequest findRequest) throws PropertyServerException, SubjectAreaCheckedException, UserNotAuthorizedException
-
getEntitiesByType
public List<EntityDetail> getEntitiesByType(String restAPIName, String userId, String typeName, Date asOfTime, int startingFrom, int pageSize, String sequencingProperty, SequencingOrder sequencingOrder) throws SubjectAreaCheckedException, PropertyServerException, UserNotAuthorizedException
-
isEmptyContent
public boolean isEmptyContent(List<String> relationshipTypeNames, String userId, String entityGuid, String entityTypeName, String methodName) throws SubjectAreaCheckedException, PropertyServerException, UserNotAuthorizedException
- Parameters:
relationshipTypeNames- relationships type names for searchuserId- unique identifier for requesting user, under which the request is performedentityGuid- guid of the glossary to be deleted.entityTypeName- starting entity's type namemethodName- name of the method being called.- Returns:
- empty content or not
- Throws:
PropertyServerException- something went wrong with the REST call stack.UserNotAuthorizedException- the requesting user is not authorized to issue this request.SubjectAreaCheckedException- standard exception Subject Area OMAS services
-
-