Class AuditablePropertiesEntity

java.lang.Object
org.alfresco.repo.domain.node.AuditablePropertiesEntity
All Implemented Interfaces:
Serializable

public class AuditablePropertiesEntity extends Object implements Serializable
Class holding properties associated with the cm:auditable aspect. This aspect is common enough to warrant direct inclusion on the Node entity.
Since:
3.4
Author:
Derek Hulley
See Also:
  • Constructor Details

    • AuditablePropertiesEntity

      public AuditablePropertiesEntity()
      Default constructor with all null values.
    • AuditablePropertiesEntity

      public AuditablePropertiesEntity(AuditablePropertiesEntity that)
      Copy constructor to create an unlocked instance
  • Method Details

    • getAuditablePropertyQNames

      public static Set<QName> getAuditablePropertyQNames()
      Returns:
      Returns the QNames of the cm:auditable properties
    • hasAuditableProperty

      public static boolean hasAuditableProperty(Set<QName> qnames)
      Parameters:
      qnames - the property names to check
      Returns:
      Returns true if the set contains a cm:auditable property
    • isAuditableProperty

      public static boolean isAuditableProperty(QName qname)
      Returns:
      Returns true if the property belongs to the cm:auditable aspect
    • hasAuditableAspect

      public static boolean hasAuditableAspect(QName typeQName, DictionaryService dictionaryService)
      Parameters:
      typeQName - a node type
      Returns:
      true if the type given has the cm:auditable aspect by default
    • toString

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

      public void lock()
      Lock the entity against further updates to prevent accidental modification
    • getAuditableProperty

      public Serializable getAuditableProperty(QName qname)
      Parameters:
      qname - the property name
      Returns:
      Returns the value of the cm:auditable property or null
    • getAuditableProperties

      public Map<QName,Serializable> getAuditableProperties()
      Returns:
      Returns a Map of auditable properties
    • setAuditValues

      public boolean setAuditValues(String user, Date date, boolean force, long modifiedDateToleranceMs)
      Set all cm:auditable parameters as required. Where possible, the creation and modification data will be shared so as to reduce data duplication.
      Parameters:
      user - the username; null to use the fully-authenticated user
      date - the creation or modification date; null to use the current system time
      force - true to force the values to overwrite any pre-existing values
      modifiedDateToleranceMs - the number of milliseconds' to tolerate before updating the modification date. Setting this to 1000L (say) will mean that the modification time will not be changed if the existing value is withing 1000 ms of the new time.
      Returns:
      Returns true if there were any changes made, otherwise false
    • setAuditValues

      public boolean setAuditValues(String user, Date date, Map<QName,Serializable> properties)
      Set all cm:auditable parameters as required, giving precedence to the supplied property map.
      Parameters:
      user - the username
      date - the creation or modification date
      properties - the properties to override the user and date
      Returns:
      Returns true if there were any changes made, otherwise false
    • getAuditCreator

      public String getAuditCreator()
      For persistance use
    • setAuditCreator

      public void setAuditCreator(String auditCreator)
      For persistance use
    • getAuditCreated

      public String getAuditCreated()
      For persistance use
    • setAuditCreated

      public void setAuditCreated(String auditCreated)
      For persistance use
    • getAuditModifier

      public String getAuditModifier()
      For persistance use
    • setAuditModifier

      public void setAuditModifier(String auditModifier)
      For persistance use
    • getAuditModified

      public String getAuditModified()
      For persistance use
    • setAuditModified

      public void setAuditModified(String auditModified)
      For persistance use
    • setAuditModified

      public boolean setAuditModified(Date date, long modifiedDateToleranceMs)
      Parameters:
      modifiedDateToleranceMs - the number of milliseconds' to tolerate before updating the modification date. Setting this to 1000L (say) will mean that the modification time will not be changed if the existing value is withing 1000 ms of the new time.
      Returns:
      Returns true if there were any changes made, otherwise false
    • getAuditAccessed

      public String getAuditAccessed()
      For persistance use
    • setAuditAccessed

      public void setAuditAccessed(String auditAccessed)
      For persistance use