Class AbstractIntegrityEvent

java.lang.Object
org.alfresco.repo.node.integrity.AbstractIntegrityEvent
All Implemented Interfaces:
IntegrityEvent
Direct Known Subclasses:
AspectsIntegrityEvent, AssocSourceMultiplicityIntegrityEvent, AssocSourceTypeIntegrityEvent, AssocTargetMultiplicityIntegrityEvent, AssocTargetRoleIntegrityEvent, AssocTargetTypeIntegrityEvent, PropertiesIntegrityEvent

public abstract class AbstractIntegrityEvent extends Object implements IntegrityEvent
Base class for integrity events. It provides basic support for checking model integrity.
Author:
Derek Hulley
  • Field Details

  • Constructor Details

  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Compares based on the class of this instance and the incoming instance, before comparing based on all the internal data. If derived classes store additional data for their functionality, then they should override this.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNodeType

      protected QName getNodeType(NodeRef nodeRef)
      Gets the node type if the node exists
      Parameters:
      nodeRef - NodeRef
      Returns:
      Returns the node's type or null if the node no longer exists
    • getTraces

      public List<StackTraceElement[]> getTraces()
      Specified by:
      getTraces in interface IntegrityEvent
      Returns:
      Returns the traces (if present) that caused the creation of this event
    • addTrace

      public void addTrace(StackTraceElement[] trace)
      Specified by:
      addTrace in interface IntegrityEvent
    • getNodeRef

      protected NodeRef getNodeRef()
    • getTypeQName

      protected QName getTypeQName()
    • getQName

      protected QName getQName()
    • getAssocDef

      protected AssociationDefinition getAssocDef(List<IntegrityRecord> eventResults, QName assocTypeQName)
      Gets the association definition from the dictionary. If the source node type is provided then the association particular to the subtype is attempted.
      Parameters:
      eventResults - results to add a violation message to
      assocTypeQName - the type of the association
      Returns:
      Returns the association definition, or null if not found
    • getMultiplicityString

      protected String getMultiplicityString(boolean mandatory, boolean allowMany)