Package org.alfresco.repo.node.integrity
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
Base class for integrity events. It provides basic support for checking model integrity.
- Author:
- Derek Hulley
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractIntegrityEvent(NodeService nodeService, DictionaryService dictionaryService, NodeRef nodeRef, QName typeQName, QName qname) Constructor with helper values for storage -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTrace(StackTraceElement[] trace) booleanCompares based on the class of this instance and the incoming instance, before comparing based on all the internal data.protected AssociationDefinitiongetAssocDef(List<IntegrityRecord> eventResults, QName assocTypeQName) Gets the association definition from the dictionary.protected StringgetMultiplicityString(boolean mandatory, boolean allowMany) protected NodeRefprotected QNamegetNodeType(NodeRef nodeRef) Gets the node type if the node existsprotected QNamegetQName()protected QNameinthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.alfresco.repo.node.integrity.IntegrityEvent
checkIntegrity
-
Field Details
-
nodeService
-
dictionaryService
-
-
Constructor Details
-
AbstractIntegrityEvent
protected AbstractIntegrityEvent(NodeService nodeService, DictionaryService dictionaryService, NodeRef nodeRef, QName typeQName, QName qname) Constructor with helper values for storage
-
-
Method Details
-
hashCode
public int hashCode() -
equals
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. -
toString
-
getNodeType
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
- Specified by:
getTracesin interfaceIntegrityEvent- Returns:
- Returns the traces (if present) that caused the creation of this event
-
addTrace
- Specified by:
addTracein interfaceIntegrityEvent
-
getNodeRef
-
getTypeQName
-
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 toassocTypeQName- the type of the association- Returns:
- Returns the association definition, or null if not found
-
getMultiplicityString
-