Spring Data Core

org.springframework.data.auditing
Class IsNewAwareAuditingHandler<T>

java.lang.Object
  extended by org.springframework.data.auditing.AuditingHandler<T>
      extended by org.springframework.data.auditing.IsNewAwareAuditingHandler<T>
All Implemented Interfaces:
InitializingBean

public class IsNewAwareAuditingHandler<T>
extends AuditingHandler<T>

AuditingHandler extension that uses an IsNewStrategyFactory to expose a generic markAudited(Object) method that will route calls to AuditingHandler.markCreated(Object) or AuditingHandler.markModified(Object) based on the IsNewStrategy determined from the factory.

Since:
1.5
Author:
Oliver Gierke

Constructor Summary
IsNewAwareAuditingHandler(IsNewStrategyFactory isNewStrategyFactory)
          Creates a new IsNewAwareAuditingHandler using the given IsNewStrategyFactory.
 
Method Summary
 void markAudited(Object object)
          Marks the given object created or modified based on the IsNewStrategy returned by the IsNewStrategyFactory configured.
 
Methods inherited from class org.springframework.data.auditing.AuditingHandler
afterPropertiesSet, markCreated, markModified, setAuditorAware, setDateTimeForNow, setDateTimeProvider, setModifyOnCreation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsNewAwareAuditingHandler

public IsNewAwareAuditingHandler(IsNewStrategyFactory isNewStrategyFactory)
Creates a new IsNewAwareAuditingHandler using the given IsNewStrategyFactory.

Parameters:
isNewStrategyFactory - must not be null.
Method Detail

markAudited

public void markAudited(Object object)
Marks the given object created or modified based on the IsNewStrategy returned by the IsNewStrategyFactory configured. Will rout the calls to AuditingHandler.markCreated(Object) and AuditingHandler.markModified(Object) accordingly.

Parameters:
object -

Spring Data Core

Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.