Class PersistenceManagerEventHandlerAdapter
java.lang.Object
org.broadleafcommerce.openadmin.server.service.persistence.PersistenceManagerEventHandlerAdapter
- All Implemented Interfaces:
PersistenceManagerEventHandler
,org.springframework.core.Ordered
- Direct Known Subclasses:
ArchiveStatusPersistenceEventHandler
public class PersistenceManagerEventHandlerAdapter
extends Object
implements PersistenceManagerEventHandler
Convenience adapter for PersistenceManagerEventHandler implementations that don't need to implement every
method of the interface.
- Author:
- Jeff Fischer
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
postAdd
(PersistenceManager persistenceManager, Entity entity, PersistencePackage persistencePackage) Called after an addpostFetch
(PersistenceManager persistenceManager, DynamicResultSet resultSet, PersistencePackage persistencePackage, CriteriaTransferObject cto) Called after the fetch, which is a request for one or more persisted entitiespostInspect
(PersistenceManager persistenceManager, DynamicResultSet resultSet, PersistencePackage persistencePackage) Called after the inspection for the entity described by persistencePackagepostRemove
(PersistenceManager persistenceManager, PersistencePackage persistencePackage) Called after a removepostUpdate
(PersistenceManager persistenceManager, Entity entity, PersistencePackage persistencePackage) Called after an updatepreAdd
(PersistenceManager persistenceManager, PersistencePackage persistencePackage) Called prior to an addpreFetch
(PersistenceManager persistenceManager, PersistencePackage persistencePackage, CriteriaTransferObject cto) Called prior to a fetch, which is a request for one or more persisted entitiespreInspect
(PersistenceManager persistenceManager, PersistencePackage persistencePackage) Called prior to inspection for the entity described by persistencePackagepreRemove
(PersistenceManager persistenceManager, PersistencePackage persistencePackage) Called prior to a removepreUpdate
(PersistenceManager persistenceManager, PersistencePackage persistencePackage) Called prior to an updateprocessValidationError
(PersistenceManager persistenceManager, Entity entity, PersistencePackage persistencePackage) Called after a validation error.
-
Constructor Details
-
PersistenceManagerEventHandlerAdapter
public PersistenceManagerEventHandlerAdapter()
-
-
Method Details
-
postAdd
public PersistenceManagerEventHandlerResponse postAdd(PersistenceManager persistenceManager, Entity entity, PersistencePackage persistencePackage) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called after an add- Specified by:
postAdd
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callentity
- the result of the addpersistencePackage
- the descriptive information for the call- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
preFetch
public PersistenceManagerEventHandlerResponse preFetch(PersistenceManager persistenceManager, PersistencePackage persistencePackage, CriteriaTransferObject cto) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called prior to a fetch, which is a request for one or more persisted entities- Specified by:
preFetch
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callpersistencePackage
- the descriptive information for the callcto
- the criteria describing the parameters of the fetch - converted into the where clause for the select query- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
postFetch
public PersistenceManagerEventHandlerResponse postFetch(PersistenceManager persistenceManager, DynamicResultSet resultSet, PersistencePackage persistencePackage, CriteriaTransferObject cto) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called after the fetch, which is a request for one or more persisted entities- Specified by:
postFetch
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callresultSet
- the fetch result datapersistencePackage
- the descriptive information for the callcto
- the criteria describing the parameters of the fetch - converted into the where clause for the select query- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
preAdd
public PersistenceManagerEventHandlerResponse preAdd(PersistenceManager persistenceManager, PersistencePackage persistencePackage) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called prior to an add- Specified by:
preAdd
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callpersistencePackage
- the descriptive information for the call- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
preUpdate
public PersistenceManagerEventHandlerResponse preUpdate(PersistenceManager persistenceManager, PersistencePackage persistencePackage) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called prior to an update- Specified by:
preUpdate
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callpersistencePackage
- the descriptive information for the call- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
postUpdate
public PersistenceManagerEventHandlerResponse postUpdate(PersistenceManager persistenceManager, Entity entity, PersistencePackage persistencePackage) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called after an update- Specified by:
postUpdate
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callentity
- the result of the updatepersistencePackage
- the descriptive information for the call- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
preRemove
public PersistenceManagerEventHandlerResponse preRemove(PersistenceManager persistenceManager, PersistencePackage persistencePackage) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called prior to a remove- Specified by:
preRemove
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callpersistencePackage
- the descriptive information for the call- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
postRemove
public PersistenceManagerEventHandlerResponse postRemove(PersistenceManager persistenceManager, PersistencePackage persistencePackage) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called after a remove- Specified by:
postRemove
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callpersistencePackage
- the descriptive information for the call- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
postInspect
public PersistenceManagerEventHandlerResponse postInspect(PersistenceManager persistenceManager, DynamicResultSet resultSet, PersistencePackage persistencePackage) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called after the inspection for the entity described by persistencePackage- Specified by:
postInspect
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callresultSet
- the inspection result datapersistencePackage
- the descriptive information for the call- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
preInspect
public PersistenceManagerEventHandlerResponse preInspect(PersistenceManager persistenceManager, PersistencePackage persistencePackage) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called prior to inspection for the entity described by persistencePackage- Specified by:
preInspect
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callpersistencePackage
- the descriptive information for the call- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
processValidationError
public PersistenceManagerEventHandlerResponse processValidationError(PersistenceManager persistenceManager, Entity entity, PersistencePackage persistencePackage) throws ServiceException Description copied from interface:PersistenceManagerEventHandler
Called after a validation error. Validations occur on adds, updates and removes. The validation confirms the persistence request is correct and does not have any errors. This event handling hook provides an opportunity to impact and/or modify the results of validation errors. Errors are generally reviewed in this method by looking atEntity.getPropertyValidationErrors()
- Specified by:
processValidationError
in interfacePersistenceManagerEventHandler
- Parameters:
persistenceManager
- the PersistenceManager instance making the callentity
- the results of the persistence requestpersistencePackage
- the descriptive information for the call- Returns:
- the response containing any changes, status or additional data
- Throws:
ServiceException
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-