org.broadleafcommerce.openadmin.server.service.persistence
Class PersistenceManagerImpl

java.lang.Object
  extended by org.broadleafcommerce.openadmin.server.service.persistence.PersistenceManagerImpl
All Implemented Interfaces:
InspectHelper, PersistenceManager, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component(value="blPersistenceManager")
@Scope(value="prototype")
public class PersistenceManagerImpl
extends Object
implements InspectHelper, PersistenceManager, org.springframework.context.ApplicationContextAware


Field Summary
protected  SecurityVerifier adminRemoteSecurityService
           
protected  org.springframework.context.ApplicationContext applicationContext
           
protected  List<CustomPersistenceHandlerFilter> customPersistenceHandlerFilters
           
protected  List<CustomPersistenceHandler> customPersistenceHandlers
           
protected  DynamicEntityDao dynamicEntityDao
           
protected  PersistenceModule[] modules
           
protected  List<PersistenceManagerEventHandler> persistenceManagerEventHandlers
           
protected  Map<String,String> targetEntityManagers
           
protected  TargetModeType targetMode
           
 
Constructor Summary
PersistenceManagerImpl()
           
 
Method Summary
 PersistenceResponse add(PersistencePackage persistencePackage)
           
protected  PersistenceResponse executePostAddHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse)
           
protected  PersistenceResponse executePostFetchHandlers(PersistencePackage persistencePackage, CriteriaTransferObject cto, PersistenceResponse persistenceResponse)
           
protected  PersistenceResponse executePostInspectHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse)
           
protected  PersistenceResponse executePostRemoveHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse)
           
protected  PersistenceResponse executePostUpdateHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse)
           
 PersistenceResponse fetch(PersistencePackage persistencePackage, CriteriaTransferObject cto)
           
 SecurityVerifier getAdminRemoteSecurityService()
           
 Class<?>[] getAllPolymorphicEntitiesFromCeiling(Class<?> ceilingClass)
           
 PersistenceModule getCompatibleModule(OperationType operationType)
           
 List<CustomPersistenceHandlerFilter> getCustomPersistenceHandlerFilters()
           
 List<CustomPersistenceHandler> getCustomPersistenceHandlers()
           
 DynamicEntityDao getDynamicEntityDao()
           
 ClassMetadata getMergedClassMetadata(Class<?>[] entities, Map<MergedPropertyType,Map<String,FieldMetadata>> mergedProperties)
           
 PersistenceModule[] getModules()
           
 Class<?>[] getPolymorphicEntities(String ceilingEntityFullyQualifiedClassname)
           
 Map<String,FieldMetadata> getSimpleMergedProperties(String entityName, PersistencePerspective persistencePerspective)
           
 Map<String,String> getTargetEntityManagers()
           
 TargetModeType getTargetMode()
           
 Class<?>[] getUpDownInheritance(Class<?> testClass)
           
 Class<?>[] getUpDownInheritance(String testClassname)
           
 PersistenceResponse inspect(PersistencePackage persistencePackage)
           
protected  Entity postAdd(Entity entity, PersistencePackage persistencePackage)
          Deprecated. use the PersistenceManagerEventHandler api instead
 void postConstruct()
           
protected  DynamicResultSet postFetch(DynamicResultSet resultSet, PersistencePackage persistencePackage, CriteriaTransferObject cto)
          Deprecated. use the PersistenceManagerEventHandler api instead
protected  Entity postUpdate(Entity entity, PersistencePackage persistencePackage)
          Deprecated. use the PersistenceManagerEventHandler api instead
 PersistenceResponse remove(PersistencePackage persistencePackage)
           
 void setAdminRemoteSecurityService(AdminSecurityServiceRemote adminRemoteSecurityService)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setCustomPersistenceHandlerFilters(List<CustomPersistenceHandlerFilter> customPersistenceHandlerFilters)
           
 void setCustomPersistenceHandlers(List<CustomPersistenceHandler> customPersistenceHandlers)
           
 void setDynamicEntityDao(DynamicEntityDao dynamicEntityDao)
           
protected  void setMainEntityName(PersistencePackage pp, Entity entity)
           
 void setModules(PersistenceModule[] modules)
           
 void setTargetEntityManagers(Map<String,String> targetEntityManagers)
           
 void setTargetMode(TargetModeType targetMode)
           
 PersistenceResponse update(PersistencePackage persistencePackage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dynamicEntityDao

protected DynamicEntityDao dynamicEntityDao

customPersistenceHandlers

protected List<CustomPersistenceHandler> customPersistenceHandlers

customPersistenceHandlerFilters

protected List<CustomPersistenceHandlerFilter> customPersistenceHandlerFilters

targetEntityManagers

protected Map<String,String> targetEntityManagers

adminRemoteSecurityService

protected SecurityVerifier adminRemoteSecurityService

modules

protected PersistenceModule[] modules

persistenceManagerEventHandlers

protected List<PersistenceManagerEventHandler> persistenceManagerEventHandlers

targetMode

protected TargetModeType targetMode

applicationContext

protected org.springframework.context.ApplicationContext applicationContext
Constructor Detail

PersistenceManagerImpl

public PersistenceManagerImpl()
Method Detail

postConstruct

@PostConstruct
public void postConstruct()

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getAllPolymorphicEntitiesFromCeiling

public Class<?>[] getAllPolymorphicEntitiesFromCeiling(Class<?> ceilingClass)
Specified by:
getAllPolymorphicEntitiesFromCeiling in interface PersistenceManager

getUpDownInheritance

public Class<?>[] getUpDownInheritance(String testClassname)
                                throws ClassNotFoundException
Specified by:
getUpDownInheritance in interface PersistenceManager
Throws:
ClassNotFoundException

getUpDownInheritance

public Class<?>[] getUpDownInheritance(Class<?> testClass)
Specified by:
getUpDownInheritance in interface PersistenceManager

getPolymorphicEntities

public Class<?>[] getPolymorphicEntities(String ceilingEntityFullyQualifiedClassname)
                                  throws ClassNotFoundException
Specified by:
getPolymorphicEntities in interface PersistenceManager
Throws:
ClassNotFoundException

getSimpleMergedProperties

public Map<String,FieldMetadata> getSimpleMergedProperties(String entityName,
                                                           PersistencePerspective persistencePerspective)
Specified by:
getSimpleMergedProperties in interface InspectHelper
Specified by:
getSimpleMergedProperties in interface PersistenceManager

getMergedClassMetadata

public ClassMetadata getMergedClassMetadata(Class<?>[] entities,
                                            Map<MergedPropertyType,Map<String,FieldMetadata>> mergedProperties)
Specified by:
getMergedClassMetadata in interface InspectHelper
Specified by:
getMergedClassMetadata in interface PersistenceManager

inspect

public PersistenceResponse inspect(PersistencePackage persistencePackage)
                            throws ServiceException,
                                   ClassNotFoundException
Specified by:
inspect in interface PersistenceManager
Throws:
ServiceException
ClassNotFoundException

executePostInspectHandlers

protected PersistenceResponse executePostInspectHandlers(PersistencePackage persistencePackage,
                                                         PersistenceResponse persistenceResponse)
                                                  throws ServiceException
Throws:
ServiceException

fetch

public PersistenceResponse fetch(PersistencePackage persistencePackage,
                                 CriteriaTransferObject cto)
                          throws ServiceException
Specified by:
fetch in interface PersistenceManager
Throws:
ServiceException

executePostFetchHandlers

protected PersistenceResponse executePostFetchHandlers(PersistencePackage persistencePackage,
                                                       CriteriaTransferObject cto,
                                                       PersistenceResponse persistenceResponse)
                                                throws ServiceException
Throws:
ServiceException

postFetch

@Deprecated
protected DynamicResultSet postFetch(DynamicResultSet resultSet,
                                                PersistencePackage persistencePackage,
                                                CriteriaTransferObject cto)
                              throws ServiceException
Deprecated. use the PersistenceManagerEventHandler api instead

Called after the fetch event

Parameters:
resultSet -
persistencePackage -
cto -
Returns:
the modified result set
Throws:
ServiceException

add

public PersistenceResponse add(PersistencePackage persistencePackage)
                        throws ServiceException
Specified by:
add in interface PersistenceManager
Throws:
ServiceException

executePostAddHandlers

protected PersistenceResponse executePostAddHandlers(PersistencePackage persistencePackage,
                                                     PersistenceResponse persistenceResponse)
                                              throws ServiceException
Throws:
ServiceException

postAdd

@Deprecated
protected Entity postAdd(Entity entity,
                                    PersistencePackage persistencePackage)
                  throws ServiceException
Deprecated. use the PersistenceManagerEventHandler api instead

Called after the add event

Parameters:
entity -
persistencePackage -
Returns:
the modified Entity instance
Throws:
ServiceException

update

public PersistenceResponse update(PersistencePackage persistencePackage)
                           throws ServiceException
Specified by:
update in interface PersistenceManager
Throws:
ServiceException

executePostUpdateHandlers

protected PersistenceResponse executePostUpdateHandlers(PersistencePackage persistencePackage,
                                                        PersistenceResponse persistenceResponse)
                                                 throws ServiceException
Throws:
ServiceException

postUpdate

@Deprecated
protected Entity postUpdate(Entity entity,
                                       PersistencePackage persistencePackage)
                     throws ServiceException
Deprecated. use the PersistenceManagerEventHandler api instead

Called after the update event

Parameters:
entity -
persistencePackage -
Returns:
the modified Entity instance
Throws:
ServiceException

remove

public PersistenceResponse remove(PersistencePackage persistencePackage)
                           throws ServiceException
Specified by:
remove in interface PersistenceManager
Throws:
ServiceException

executePostRemoveHandlers

protected PersistenceResponse executePostRemoveHandlers(PersistencePackage persistencePackage,
                                                        PersistenceResponse persistenceResponse)
                                                 throws ServiceException
Throws:
ServiceException

getCompatibleModule

public PersistenceModule getCompatibleModule(OperationType operationType)
Specified by:
getCompatibleModule in interface InspectHelper

getDynamicEntityDao

public DynamicEntityDao getDynamicEntityDao()
Specified by:
getDynamicEntityDao in interface PersistenceManager

setDynamicEntityDao

public void setDynamicEntityDao(DynamicEntityDao dynamicEntityDao)
Specified by:
setDynamicEntityDao in interface PersistenceManager

getTargetEntityManagers

public Map<String,String> getTargetEntityManagers()
Specified by:
getTargetEntityManagers in interface PersistenceManager

setTargetEntityManagers

public void setTargetEntityManagers(Map<String,String> targetEntityManagers)
Specified by:
setTargetEntityManagers in interface PersistenceManager

getTargetMode

public TargetModeType getTargetMode()
Specified by:
getTargetMode in interface PersistenceManager

setTargetMode

public void setTargetMode(TargetModeType targetMode)
Specified by:
setTargetMode in interface PersistenceManager

getCustomPersistenceHandlers

public List<CustomPersistenceHandler> getCustomPersistenceHandlers()
Specified by:
getCustomPersistenceHandlers in interface PersistenceManager

setMainEntityName

protected void setMainEntityName(PersistencePackage pp,
                                 Entity entity)

setCustomPersistenceHandlers

public void setCustomPersistenceHandlers(List<CustomPersistenceHandler> customPersistenceHandlers)
Specified by:
setCustomPersistenceHandlers in interface PersistenceManager

getAdminRemoteSecurityService

public SecurityVerifier getAdminRemoteSecurityService()

setAdminRemoteSecurityService

public void setAdminRemoteSecurityService(AdminSecurityServiceRemote adminRemoteSecurityService)

getCustomPersistenceHandlerFilters

public List<CustomPersistenceHandlerFilter> getCustomPersistenceHandlerFilters()

setCustomPersistenceHandlerFilters

public void setCustomPersistenceHandlerFilters(List<CustomPersistenceHandlerFilter> customPersistenceHandlerFilters)

getModules

public PersistenceModule[] getModules()

setModules

public void setModules(PersistenceModule[] modules)


Copyright © 2013. All Rights Reserved.