Class MendelDuplicateInstanceRemover
java.lang.Object
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingBase
org.odpi.openmetadata.adapters.connectors.mendel.MendelDuplicateInstanceRemover
MendelDuplicateInstanceRemover removes the exact duplicates that a process creates when it adds the same thing
more than once - typically a connector that re-links or re-attaches everything each time it catalogues a
document. Unlike the peer duplicates that the rest of Mendel manages, these instances are identical apart from
their unique identifiers and audit headers, so there is nothing to decide: the oldest is kept and the rest are
deleted using the server's default delete method.
- Duplicate relationships: relationships of the same type that connect the same two elements and have the same properties and effectivity dates.
- Duplicate attached elements: elements of the same type with the same properties, attached to the same element (at end 1) through the same type of relationship (with the same relationship properties), and anchored to that element. The anchor test means only elements that belong to the element are removed - a shared element is never deleted. Deleting the element also deletes its attachment relationship.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.auditlog.AuditLoggingBase
auditLog -
Constructor Summary
ConstructorsConstructorDescriptionMendelDuplicateInstanceRemover(IntegrationContext integrationContext, PropertyHelper propertyHelper, String connectorName, boolean reportOnly, AuditLog auditLog) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidremoveDuplicateAttachments(List<String> attachmentTypeNames) Remove the duplicate elements attached through each of the requested relationship types.voidremoveDuplicateRelationships(List<String> relationshipTypeNames) Remove the duplicate relationships of each of the requested types.Methods inherited from class org.odpi.openmetadata.frameworks.auditlog.AuditLoggingBase
logExceptionRecord, logExceptionRecord, logRecord, logRecord
-
Constructor Details
-
MendelDuplicateInstanceRemover
public MendelDuplicateInstanceRemover(IntegrationContext integrationContext, PropertyHelper propertyHelper, String connectorName, boolean reportOnly, AuditLog auditLog) Constructor.- Parameters:
integrationContext- context giving access to open metadatapropertyHelper- helper for working with element propertiesconnectorName- name of the calling connector - used in messagesreportOnly- report the duplicates rather than delete themauditLog- logging destination
-
-
Method Details
-
removeDuplicateRelationships
Remove the duplicate relationships of each of the requested types. A failure with one type is logged and the next type is processed.- Parameters:
relationshipTypeNames- relationship types to process
-
removeDuplicateAttachments
Remove the duplicate elements attached through each of the requested relationship types. Only the elements at end 1 that have more than one attachment of the type are retrieved. A failure with one type is logged and the next type is processed.- Parameters:
attachmentTypeNames- relationship types to process
-