Class MendelDuplicateInstanceRemover

java.lang.Object
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingBase
org.odpi.openmetadata.adapters.connectors.mendel.MendelDuplicateInstanceRemover

public class MendelDuplicateInstanceRemover extends AuditLoggingBase
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.
The comparison is strict: every property must match. Elements that carry a unique name, such as a Referenceable's qualifiedName, therefore never match each other.
  • Constructor Details

    • MendelDuplicateInstanceRemover

      public MendelDuplicateInstanceRemover(IntegrationContext integrationContext, PropertyHelper propertyHelper, String connectorName, boolean reportOnly, AuditLog auditLog)
      Constructor.
      Parameters:
      integrationContext - context giving access to open metadata
      propertyHelper - helper for working with element properties
      connectorName - name of the calling connector - used in messages
      reportOnly - report the duplicates rather than delete them
      auditLog - logging destination
  • Method Details

    • removeDuplicateRelationships

      public void removeDuplicateRelationships(List<String> relationshipTypeNames)
      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

      public void removeDuplicateAttachments(List<String> attachmentTypeNames)
      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