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)


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.audit.AuditDAO
AuditDAO.AuditApplicationInfo
 
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
 AuditDAO.AuditApplicationInfo createAuditApplication(java.lang.String application, java.lang.Long modelId)
          Fallout implementation from new audit DAO
 java.lang.Long createAuditEntry(java.lang.Long applicationId, long time, java.lang.String username, java.util.Map values)
          Fallout implementation from new audit DAO
 void deleteAuditEntries(java.lang.Long applicationId, java.lang.Long from, java.lang.Long to)
          Fallout implementation from new audit DAO
 boolean equals(java.lang.Object obj)
          Checks equality by type and uuid
 void findAuditEntries(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults)
          Fallout implementation from new audit DAO
 void flush()
          Just flushes the session
 AuditDAO.AuditApplicationInfo getAuditApplication(java.lang.String applicationName)
          Fallout implementation from new audit DAO
 java.util.List getAuditTrail(NodeRef nodeRef)
          Get the audit trail for a node.
 ContentStore getContentStore()
           
 org.alfresco.util.Pair getOrCreateAuditModel(java.net.URL url)
          Fallout implementation from new audit DAO
 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)
           
 void updateAuditApplicationDisabledPaths(java.lang.Long id, java.util.Set disabledPaths)
          Fallout implementation from new audit DAO
 void updateAuditApplicationModel(java.lang.Long id, java.lang.Long modelId)
          Fallout implementation from new audit DAO
 
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

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


getOrCreateAuditModel

public org.alfresco.util.Pair getOrCreateAuditModel(java.net.URL url)
Fallout implementation from new audit DAO

Specified by:
getOrCreateAuditModel in interface AuditDAO
Returns:
Returns the ID of the config matching the input stream and the content storage details
Throws:
java.lang.UnsupportedOperationException - always
Since:
3.2

createAuditApplication

public AuditDAO.AuditApplicationInfo createAuditApplication(java.lang.String application,
                                                            java.lang.Long modelId)
Fallout implementation from new audit DAO

Specified by:
createAuditApplication in interface AuditDAO
Parameters:
application - the name of the application
modelId - the ID of the model configuration
Throws:
java.lang.UnsupportedOperationException - always
Since:
3.2

getAuditApplication

public AuditDAO.AuditApplicationInfo getAuditApplication(java.lang.String applicationName)
Fallout implementation from new audit DAO

Specified by:
getAuditApplication in interface AuditDAO
Parameters:
applicationName - the name of the application
Returns:
Returns details of an existing application or null if it doesn't exist
Throws:
java.lang.UnsupportedOperationException - always
Since:
3.2

updateAuditApplicationModel

public void updateAuditApplicationModel(java.lang.Long id,
                                        java.lang.Long modelId)
Fallout implementation from new audit DAO

Specified by:
updateAuditApplicationModel in interface AuditDAO
Parameters:
id - the ID of the audit application
modelId - the ID of the new model
Throws:
java.lang.UnsupportedOperationException - always
Since:
3.2

updateAuditApplicationDisabledPaths

public void updateAuditApplicationDisabledPaths(java.lang.Long id,
                                                java.util.Set disabledPaths)
Fallout implementation from new audit DAO

Specified by:
updateAuditApplicationDisabledPaths in interface AuditDAO
Parameters:
id - the ID of the audit application
disabledPaths - the new disabled paths
Throws:
java.lang.UnsupportedOperationException - always
Since:
3.2

deleteAuditEntries

public void deleteAuditEntries(java.lang.Long applicationId,
                               java.lang.Long from,
                               java.lang.Long to)
Fallout implementation from new audit DAO

Specified by:
deleteAuditEntries in interface AuditDAO
Parameters:
applicationId - and existing audit application ID
from - the minimum entry time (inclusive, optional)
to - the maximum entry time (exclusive, optional)
Throws:
java.lang.UnsupportedOperationException - always
Since:
3.2

createAuditEntry

public java.lang.Long createAuditEntry(java.lang.Long applicationId,
                                       long time,
                                       java.lang.String username,
                                       java.util.Map values)
Fallout implementation from new audit DAO

Specified by:
createAuditEntry in interface AuditDAO
Parameters:
applicationId - an existing audit application ID
time - the time (ms since epoch) to log the entry against
username - the authenticated user (null if not present)
values - the values to record
Returns:
Returns the unique entry ID
Throws:
java.lang.UnsupportedOperationException - always
Since:
3.2

findAuditEntries

public void findAuditEntries(AuditService.AuditQueryCallback callback,
                             AuditQueryParameters parameters,
                             int maxResults)
Fallout implementation from new audit DAO

Specified by:
findAuditEntries in interface AuditDAO
Parameters:
callback - the data callback per entry
parameters - the parameters for the query (may not be null)
maxResults - the maximum number of results to retrieve
Throws:
java.lang.UnsupportedOperationException - always
Since:
3.2


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