public class OMEntityDao extends Object
| Constructor and Description |
|---|
OMEntityDao(OMRSRepositoryConnector enterpriseConnector,
List<String> supportedZones,
OMRSAuditLog auditLog) |
| Modifier and Type | Method and Description |
|---|---|
EntityDetail |
addEntity(String typeName,
String qualifiedName,
InstanceProperties properties,
boolean zoneRestricted)
Returns the entity of the given type with the specified qualified name; if it doesn't already exists, it is created with the provided instance properties
|
EntityDetail |
addEntity(String typeName,
String qualifiedName,
InstanceProperties properties,
List<Classification> classifications,
boolean zoneRestricted)
Returns the entity of the given type with the specified qualified name; if it doesn't already exists, it is created with the provided instance properties
|
EntityDetail |
addExternalEntity(String userId,
String typeName,
String qualifiedName,
String externalSourceGuid,
String externalSourceName,
InstanceProperties properties,
List<Classification> classifications,
boolean zoneRestricted) |
Relationship |
addExternalRelationship(String userId,
String relationshipType,
String externalSourceGuid,
String externalSourceName,
String guid1,
String guid2,
InstanceProperties instanceProperties) |
Relationship |
addRelationship(String relationshipType,
String guid1,
String guid2,
InstanceProperties instanceProperties)
Returns the relationship of the given type with the specified qualified name; if it doesn't already exists, it is created with the provided instance properties
|
InstanceProperties |
buildMatchingInstanceProperties(Map<String,String> properties,
boolean zoneRestricted)
Returns the properties object for the given pair of key - value that can be used for retrieving
|
OMEntityWrapper |
createOrUpdateEntity(String typeName,
String qualifiedName,
InstanceProperties properties,
List<Classification> classifications,
boolean update,
boolean zoneRestricted) |
OMEntityWrapper |
createOrUpdateExternalEntity(String userId,
String typeName,
String qualifiedName,
String externalSourceGuid,
String externalSourceName,
InstanceProperties properties,
List<Classification> classifications,
boolean update,
boolean zoneRestricted) |
List<EntityDetail> |
findEntities(InstanceProperties matchProperties,
String typeName,
int fromElement,
int pageSize) |
EntityDetail |
getEntity(String typeName,
String qualifiedName,
boolean zoneRestricted)
Returns the entity of the specified type retrieved based on qualified name
|
EntityDetail |
getEntityByGuid(String guid) |
List<EntityDetail> |
getEntityDetails(List<Relationship> relationships,
Function<Relationship,String> relationshipEndFunction) |
List<EntityDetail> |
getRelatedEntities(List<String> allEntitiesGuids,
String relationshipType,
Function<Relationship,String> relationshipEndFunction)
Return list of guids of entities linked through the mentioned relationship
|
List<Relationship> |
getRelationships(String relationshipType,
String guid) |
void |
purgeEntity(EntitySummary entitySummary) |
void |
purgeRelationship(Relationship relationship) |
void |
purgeRelationships(List<Relationship> relationship) |
public OMEntityDao(OMRSRepositoryConnector enterpriseConnector, List<String> supportedZones, OMRSAuditLog auditLog)
public EntityDetail getEntity(String typeName, String qualifiedName, boolean zoneRestricted)
typeName - name of the type def for the entity to be retrievedqualifiedName - qualified name property of the entity to be retrievedzoneRestricted - public List<EntityDetail> findEntities(InstanceProperties matchProperties, String typeName, int fromElement, int pageSize)
public EntityDetail getEntityByGuid(String guid)
public List<Relationship> getRelationships(String relationshipType, String guid)
public EntityDetail addEntity(String typeName, String qualifiedName, InstanceProperties properties, boolean zoneRestricted) throws InvalidParameterException, PropertyErrorException, RepositoryErrorException, EntityNotKnownException, FunctionNotSupportedException, PagingErrorException, ClassificationErrorException, UserNotAuthorizedException, TypeErrorException, StatusNotSupportedException
typeName - is the entity typequalifiedName - - qualified name property of the entity, unique for the same entity typeproperties - specific to the entity typeInvalidParameterExceptionPropertyErrorExceptionRepositoryErrorExceptionEntityNotKnownExceptionFunctionNotSupportedExceptionPagingErrorExceptionClassificationErrorExceptionUserNotAuthorizedExceptionTypeErrorExceptionStatusNotSupportedExceptionpublic EntityDetail addEntity(String typeName, String qualifiedName, InstanceProperties properties, List<Classification> classifications, boolean zoneRestricted) throws InvalidParameterException, StatusNotSupportedException, PropertyErrorException, EntityNotKnownException, TypeErrorException, FunctionNotSupportedException, PagingErrorException, ClassificationErrorException, UserNotAuthorizedException, RepositoryErrorException
typeName - is the entity typequalifiedName - - qualified name property of the entity, unique for the same entity typeproperties - specific to the entity typeclassifications - classifications to be added to entityzoneRestricted - InvalidParameterExceptionStatusNotSupportedExceptionPropertyErrorExceptionEntityNotKnownExceptionTypeErrorExceptionFunctionNotSupportedExceptionPagingErrorExceptionClassificationErrorExceptionUserNotAuthorizedExceptionRepositoryErrorExceptionpublic OMEntityWrapper createOrUpdateEntity(String typeName, String qualifiedName, InstanceProperties properties, List<Classification> classifications, boolean update, boolean zoneRestricted) throws UserNotAuthorizedException, FunctionNotSupportedException, InvalidParameterException, RepositoryErrorException, PropertyErrorException, TypeErrorException, PagingErrorException, ClassificationErrorException, StatusNotSupportedException, EntityNotKnownException
public OMEntityWrapper createOrUpdateExternalEntity(String userId, String typeName, String qualifiedName, String externalSourceGuid, String externalSourceName, InstanceProperties properties, List<Classification> classifications, boolean update, boolean zoneRestricted)
public EntityDetail addExternalEntity(String userId, String typeName, String qualifiedName, String externalSourceGuid, String externalSourceName, InstanceProperties properties, List<Classification> classifications, boolean zoneRestricted)
public Relationship addRelationship(String relationshipType, String guid1, String guid2, InstanceProperties instanceProperties)
relationshipType - is the relationship type nameguid1 - first end of the relationshipguid2 - second end of the relationshipinstanceProperties - specific to the relationship typepublic Relationship addExternalRelationship(String userId, String relationshipType, String externalSourceGuid, String externalSourceName, String guid1, String guid2, InstanceProperties instanceProperties)
public InstanceProperties buildMatchingInstanceProperties(Map<String,String> properties, boolean zoneRestricted)
properties - - all properties to use for matchingzoneRestricted - public void purgeRelationships(List<Relationship> relationship)
public void purgeRelationship(Relationship relationship)
public void purgeEntity(EntitySummary entitySummary) throws RepositoryErrorException, UserNotAuthorizedException, InvalidParameterException, EntityNotKnownException, EntityNotDeletedException, FunctionNotSupportedException
public List<EntityDetail> getRelatedEntities(List<String> allEntitiesGuids, String relationshipType, Function<Relationship,String> relationshipEndFunction)
allEntitiesGuids - relationshipType - relationshipEndFunction - public List<EntityDetail> getEntityDetails(List<Relationship> relationships, Function<Relationship,String> relationshipEndFunction)
Copyright © 2018–2019 ODPi. All rights reserved.