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
public abstract class AbstractIntegrityEvent extends java.lang.Object implements IntegrityEvent
Base class for integrity events. It provides basic support for checking model integrity.- Author:
- Derek Hulley
-
-
Field Summary
Fields Modifier and Type Field Description protected org.alfresco.service.cmr.dictionary.DictionaryServicedictionaryServiceprotected org.alfresco.service.cmr.repository.NodeServicenodeService
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIntegrityEvent(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName typeQName, org.alfresco.service.namespace.QName qname)Constructor with helper values for storage
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTrace(java.lang.StackTraceElement[] trace)booleanequals(java.lang.Object obj)Compares based on the class of this instance and the incoming instance, before comparing based on all the internal data.protected org.alfresco.service.cmr.dictionary.AssociationDefinitiongetAssocDef(java.util.List<IntegrityRecord> eventResults, org.alfresco.service.namespace.QName assocTypeQName)Gets the association definition from the dictionary.protected java.lang.StringgetMultiplicityString(boolean mandatory, boolean allowMany)protected org.alfresco.service.cmr.repository.NodeRefgetNodeRef()protected org.alfresco.service.namespace.QNamegetNodeType(org.alfresco.service.cmr.repository.NodeRef nodeRef)Gets the node type if the node existsprotected org.alfresco.service.namespace.QNamegetQName()java.util.List<java.lang.StackTraceElement[]>getTraces()protected org.alfresco.service.namespace.QNamegetTypeQName()inthashCode()java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.node.integrity.IntegrityEvent
checkIntegrity
-
-
-
-
Constructor Detail
-
AbstractIntegrityEvent
protected AbstractIntegrityEvent(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName typeQName, org.alfresco.service.namespace.QName qname)Constructor with helper values for storage
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.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:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getNodeType
protected org.alfresco.service.namespace.QName getNodeType(org.alfresco.service.cmr.repository.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 java.util.List<java.lang.StackTraceElement[]> getTraces()
- Specified by:
getTracesin interfaceIntegrityEvent- Returns:
- Returns the traces (if present) that caused the creation of this event
-
addTrace
public void addTrace(java.lang.StackTraceElement[] trace)
- Specified by:
addTracein interfaceIntegrityEvent
-
getNodeRef
protected org.alfresco.service.cmr.repository.NodeRef getNodeRef()
-
getTypeQName
protected org.alfresco.service.namespace.QName getTypeQName()
-
getQName
protected org.alfresco.service.namespace.QName getQName()
-
getAssocDef
protected org.alfresco.service.cmr.dictionary.AssociationDefinition getAssocDef(java.util.List<IntegrityRecord> eventResults, org.alfresco.service.namespace.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
protected java.lang.String getMultiplicityString(boolean mandatory, boolean allowMany)
-
-