org.alfresco.repo.node.integrity
Class AbstractIntegrityEvent

java.lang.Object
  extended by 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.


Field Summary
protected  org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
           
protected  org.alfresco.service.cmr.repository.NodeService nodeService
           
 
Constructor Summary
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 Summary
 void addTrace(java.lang.StackTraceElement[] trace)
           
 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.
protected  org.alfresco.service.cmr.dictionary.AssociationDefinition getAssocDef(java.util.List eventResults, org.alfresco.service.namespace.QName assocTypeQName)
          Gets the association definition from the dictionary.
protected  java.lang.String getMultiplicityString(boolean mandatory, boolean allowMany)
           
protected  org.alfresco.service.cmr.repository.NodeRef getNodeRef()
           
protected  org.alfresco.service.namespace.QName getNodeType(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Gets the node type if the node exists
protected  org.alfresco.service.namespace.QName getQName()
           
 java.util.List getTraces()
           
protected  org.alfresco.service.namespace.QName getTypeQName()
           
 int hashCode()
           
 java.lang.String toString()
           
 
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
 

Field Detail

nodeService

protected final org.alfresco.service.cmr.repository.NodeService nodeService

dictionaryService

protected final org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
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:
hashCode in class java.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:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.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 -
Returns:
Returns the node's type or null if the node no longer exists

getTraces

public java.util.List getTraces()
Specified by:
getTraces in interface IntegrityEvent
Returns:
Returns the traces (if present) that caused the creation of this event

addTrace

public void addTrace(java.lang.StackTraceElement[] trace)
Specified by:
addTrace in interface IntegrityEvent

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 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 to
assocTypeQName - 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)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.