org.alfresco.repo.audit.hibernate
Class HibernateAuditDAO

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.alfresco.repo.audit.hibernate.HibernateAuditDAO
All Implemented Interfaces:
AuditDAO, TransactionalDao, org.springframework.beans.factory.InitializingBean

public class HibernateAuditDAO
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements AuditDAO, TransactionalDao

Assumes mimetype and encoding sent to the content store (we are not saving this anywhere)


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateAuditDAO()
           
 
Method Summary
 void audit(AuditState auditInfo)
          Create an audit entry.
 void beforeCommit()
          NO-OP
 boolean equals(java.lang.Object obj)
          Checks equality by type and uuid
 void flush()
          Just flushes the session
 java.util.List getAuditTrail(NodeRef nodeRef)
          Get the audit trail for a node.
 ContentStore getContentStore()
           
 int hashCode()
           
 boolean isDirty()
          Does this Session contain any changes which must be synchronized with the store?
 AuditSource queryApplicationSource(java.lang.String application)
          Helper method to get the application source
 AuditSource queryApplicationSource(java.lang.String application, java.lang.String service, java.lang.String method)
          Helper method to get the application source
 java.util.List queryAuditTrail(NodeRef nodeRef)
          Helper method to get all the audit entries for a node.
static AuditConfig queryLatestConfig(org.hibernate.Session session)
          Helper method to get the latest audit config
 AuditDate queryLatestDate()
          Helper method to get the latest audit date
 AuditDate queryLatestDate(java.util.Date date)
          Helper method to get the latest audit date
 void setContentStore(ContentStore contentStore)
           
 void setLocalSessionFactory(org.springframework.orm.hibernate3.LocalSessionFactoryBean localSessionFactory)
           
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateAuditDAO

public HibernateAuditDAO()
Method Detail

getContentStore

public ContentStore getContentStore()

setContentStore

public void setContentStore(ContentStore contentStore)

setLocalSessionFactory

public void setLocalSessionFactory(org.springframework.orm.hibernate3.LocalSessionFactoryBean localSessionFactory)

audit

public void audit(AuditState auditInfo)
Description copied from interface: AuditDAO
Create an audit entry.

Specified by:
audit in interface AuditDAO

equals

public boolean equals(java.lang.Object obj)
Checks equality by type and uuid

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
HibernateAuditDAO.uuid

isDirty

public boolean isDirty()
Does this Session contain any changes which must be synchronized with the store?

Specified by:
isDirty in interface TransactionalDao
Returns:
true => changes are pending

flush

public void flush()
Just flushes the session

Specified by:
flush in interface TransactionalDao

beforeCommit

public void beforeCommit()
NO-OP

Specified by:
beforeCommit in interface TransactionalDao

getAuditTrail

public java.util.List getAuditTrail(NodeRef nodeRef)
Description copied from interface: AuditDAO
Get the audit trail for a node.

Specified by:
getAuditTrail in interface AuditDAO
Returns:

queryLatestConfig

public static AuditConfig queryLatestConfig(org.hibernate.Session session)
Helper method to get the latest audit config


queryLatestDate

public AuditDate queryLatestDate()
Helper method to get the latest audit date


queryAuditTrail

public java.util.List queryAuditTrail(NodeRef nodeRef)
Helper method to get all the audit entries for a node.


queryApplicationSource

public AuditSource queryApplicationSource(java.lang.String application)
Helper method to get the application source

Parameters:
application -
Returns:

queryApplicationSource

public AuditSource queryApplicationSource(java.lang.String application,
                                          java.lang.String service,
                                          java.lang.String method)
Helper method to get the application source

Parameters:
application -
Returns:

queryLatestDate

public AuditDate queryLatestDate(java.util.Date date)
Helper method to get the latest audit date



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