Package org.alfresco.repo.domain.node
Class AuditablePropertiesEntity
- java.lang.Object
-
- org.alfresco.repo.domain.node.AuditablePropertiesEntity
-
- All Implemented Interfaces:
java.io.Serializable
public class AuditablePropertiesEntity extends java.lang.Object implements java.io.SerializableClass 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AuditablePropertiesEntity()Default constructor with all null values.AuditablePropertiesEntity(AuditablePropertiesEntity that)Copy constructor to create an unlocked instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>getAuditableProperties()java.io.SerializablegetAuditableProperty(org.alfresco.service.namespace.QName qname)static java.util.Set<org.alfresco.service.namespace.QName>getAuditablePropertyQNames()java.lang.StringgetAuditAccessed()For persistance usejava.lang.StringgetAuditCreated()For persistance usejava.lang.StringgetAuditCreator()For persistance usejava.lang.StringgetAuditModified()For persistance usejava.lang.StringgetAuditModifier()For persistance usestatic booleanhasAuditableAspect(org.alfresco.service.namespace.QName typeQName, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)static booleanhasAuditableProperty(java.util.Set<org.alfresco.service.namespace.QName> qnames)static booleanisAuditableProperty(org.alfresco.service.namespace.QName qname)voidlock()Lock the entity against further updates to prevent accidental modificationvoidsetAuditAccessed(java.lang.String auditAccessed)For persistance usevoidsetAuditCreated(java.lang.String auditCreated)For persistance usevoidsetAuditCreator(java.lang.String auditCreator)For persistance usevoidsetAuditModified(java.lang.String auditModified)For persistance usebooleansetAuditModified(java.util.Date date, long modifiedDateToleranceMs)voidsetAuditModifier(java.lang.String auditModifier)For persistance usebooleansetAuditValues(java.lang.String user, java.util.Date date, boolean force, long modifiedDateToleranceMs)Set all cm:auditable parameters as required.booleansetAuditValues(java.lang.String user, java.util.Date date, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> properties)Set all cm:auditable parameters as required, giving precedence to the supplied property map.java.lang.StringtoString()
-
-
-
Constructor Detail
-
AuditablePropertiesEntity
public AuditablePropertiesEntity()
Default constructor with all null values.
-
AuditablePropertiesEntity
public AuditablePropertiesEntity(AuditablePropertiesEntity that)
Copy constructor to create an unlocked instance
-
-
Method Detail
-
getAuditablePropertyQNames
public static java.util.Set<org.alfresco.service.namespace.QName> getAuditablePropertyQNames()
- Returns:
- Returns the QNames of the cm:auditable properties
-
hasAuditableProperty
public static boolean hasAuditableProperty(java.util.Set<org.alfresco.service.namespace.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(org.alfresco.service.namespace.QName qname)
- Returns:
- Returns true if the property belongs to the cm:auditable aspect
-
hasAuditableAspect
public static boolean hasAuditableAspect(org.alfresco.service.namespace.QName typeQName, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)- Parameters:
typeQName- a node type- Returns:
- true if the type given has the cm:auditable aspect by default
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
lock
public void lock()
Lock the entity against further updates to prevent accidental modification
-
getAuditableProperty
public java.io.Serializable getAuditableProperty(org.alfresco.service.namespace.QName qname)
- Parameters:
qname- the property name- Returns:
- Returns the value of the cm:auditable property or null
-
getAuditableProperties
public java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> getAuditableProperties()
- Returns:
- Returns a Map of auditable properties
-
setAuditValues
public boolean setAuditValues(java.lang.String user, java.util.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 thefully-authenticated userdate- the creation or modification date; null to use the current system timeforce- true to force the values to overwrite any pre-existing valuesmodifiedDateToleranceMs- 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(java.lang.String user, java.util.Date date, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> properties)Set all cm:auditable parameters as required, giving precedence to the supplied property map.- Parameters:
user- the usernamedate- the creation or modification dateproperties- the properties to override the user and date- Returns:
- Returns true if there were any changes made, otherwise false
-
getAuditCreator
public java.lang.String getAuditCreator()
For persistance use
-
setAuditCreator
public void setAuditCreator(java.lang.String auditCreator)
For persistance use
-
getAuditCreated
public java.lang.String getAuditCreated()
For persistance use
-
setAuditCreated
public void setAuditCreated(java.lang.String auditCreated)
For persistance use
-
getAuditModifier
public java.lang.String getAuditModifier()
For persistance use
-
setAuditModifier
public void setAuditModifier(java.lang.String auditModifier)
For persistance use
-
getAuditModified
public java.lang.String getAuditModified()
For persistance use
-
setAuditModified
public void setAuditModified(java.lang.String auditModified)
For persistance use
-
setAuditModified
public boolean setAuditModified(java.util.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 java.lang.String getAuditAccessed()
For persistance use
-
setAuditAccessed
public void setAuditAccessed(java.lang.String auditAccessed)
For persistance use
-
-