org.alfresco.repo.domain.hibernate
Class HibernateUsageDeltaDAO

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

public class HibernateUsageDeltaDAO
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements UsageDeltaDAO, TransactionalDao

Hibernate-specific implementation of the persistence-independent Usage Delta DAO interface


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateUsageDeltaDAO()
           
 
Method Summary
 void beforeCommit()
          NO-OP
 int deleteDeltas(java.lang.Long nodeId)
           
 int deleteDeltas(NodeRef nodeRef)
           
 boolean equals(java.lang.Object obj)
          Checks equality by type and uuid
 void flush()
          Just flushes the session
 long getAndRemoveTotalDeltaSize(NodeRef nodeRef)
          Guard against deleting deltas committed by another transaction after calculating the delta sum above.
 long getTotalDeltaSize(NodeRef nodeRef)
          Get the total delta size for a node.
 java.util.Set getUsageDeltaNodes()
           
 int hashCode()
           
 void insertDelta(NodeRef usageNodeRef, long deltaSize)
          Create a usage delta entry.
 boolean isDirty()
          Does this Session contain any changes which must be synchronized with the store?
 void setNodeDaoService(NodeDaoService nodeDaoService)
           
 
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

HibernateUsageDeltaDAO

public HibernateUsageDeltaDAO()
Method Detail

setNodeDaoService

public void setNodeDaoService(NodeDaoService nodeDaoService)

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:
HibernateUsageDeltaDAO.uuid

beforeCommit

public void beforeCommit()
NO-OP

Specified by:
beforeCommit in interface TransactionalDao

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

deleteDeltas

public int deleteDeltas(NodeRef nodeRef)
Specified by:
deleteDeltas in interface UsageDeltaDAO

deleteDeltas

public int deleteDeltas(java.lang.Long nodeId)
Specified by:
deleteDeltas in interface UsageDeltaDAO

getTotalDeltaSize

public long getTotalDeltaSize(NodeRef nodeRef)
Description copied from interface: UsageDeltaDAO
Get the total delta size for a node.

Specified by:
getTotalDeltaSize in interface UsageDeltaDAO
Returns:
sum of delta sizes (in bytes) - can be +ve or -ve

getAndRemoveTotalDeltaSize

public long getAndRemoveTotalDeltaSize(NodeRef nodeRef)
Guard against deleting deltas committed by another transaction after calculating the delta sum above. If the expected number of deletes is different from the actual number of deletes then deltas from another committed transaction are probably being removed.

Specified by:
getAndRemoveTotalDeltaSize in interface UsageDeltaDAO
Returns:
sum of delta sizes (in bytes) - can be +ve or -ve

insertDelta

public void insertDelta(NodeRef usageNodeRef,
                        long deltaSize)
Description copied from interface: UsageDeltaDAO
Create a usage delta entry.

Specified by:
insertDelta in interface UsageDeltaDAO
deltaSize - the size change

getUsageDeltaNodes

public java.util.Set getUsageDeltaNodes()
Specified by:
getUsageDeltaNodes in interface UsageDeltaDAO


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