org.kuali.kfs.sys.batch.service.impl
Class FiscalYearMakerServiceImpl

java.lang.Object
  extended by org.kuali.kfs.sys.batch.service.impl.FiscalYearMakerServiceImpl
All Implemented Interfaces:
FiscalYearMakerService

@Transactional
public class FiscalYearMakerServiceImpl
extends Object
implements FiscalYearMakerService

See Also:
org.kuali.kfs.coa.batch.service.FiscalYearMakerService

Constructor Summary
FiscalYearMakerServiceImpl()
           
 
Method Summary
protected  boolean checkChildrenForParentReference(Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> parent, Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> children, Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>>> parentChildren, Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> checkedParents)
          Recursively checks all children of children who are parents for reference to the given parent class
protected  void findCircularReferenceAndThrowException(Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>>> parentChildren)
          Finds circular references (class which is a child to itself) and throws exception indicating the invalid parent-child configuration
protected  Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> getChildren(Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>>> parentChildren)
          Gets all classes that are child of another class in the given Map
protected  List<FiscalYearMaker> getFiscalYearMakerHelpersInCopyOrder()
          Returns List of FiscalYearMaker objects in the order they should be copied.
protected  List<FiscalYearMaker> getFiscalYearMakerHelpersInDeleteOrder(List<FiscalYearMaker> fiscalYearMakerHelpersCopyOrder)
          Returns List of FiscalYearMaker objects in the order they should be deleted.
protected  Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,FiscalYearMaker> getFiscalYearMakerMap()
          Helper method to build a Map with the copy class as the key and its corresponding FiscalYearMaker as the Map value
protected  List<FiscalYearMaker> getFiscalYearMakers()
          Gets the fiscalYearMakers attribute.
protected  FiscalYearMakersDao getFiscalYearMakersDao()
          Gets the fiscalYearMakersDao attribute.
protected  org.kuali.rice.kns.service.KualiModuleService getKualiModuleService()
          Gets the kualiModuleService attribute.
protected  org.kuali.rice.kns.service.ParameterService getParameterService()
          Gets the parameterService attribute.
protected  Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>>> getParentChildrenMap()
          Helper method to build a Map with Parent classes as the key and their Set of child classes as the value
 void initialize()
          Populates the fiscal year maker list from the installed modules
protected  boolean isParentClass(Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> businessObjectClass)
          Checks if the given class is a parent (to at least one other class)
 void runProcess()
          Runs the fiscal year maker process for the configured base year
protected  void setFiscalYearMakers(List<FiscalYearMaker> fiscalYearMakers)
          Sets the fiscalYearMakers attribute value.
 void setFiscalYearMakersDao(FiscalYearMakersDao fiscalYearMakersDao)
          Sets the fiscalYearMakersDao attribute value.
 void setKualiModuleService(org.kuali.rice.kns.service.KualiModuleService kualiModuleService)
          Sets the kualiModuleService attribute value.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          Sets the parameterService attribute value.
protected  void validateFiscalYearMakerConfiguration()
          Validates each configured fiscal year maker implementation
protected  void writeCopyFailureMessages(Collection<String> copyErrors)
          Write outs errors encountered while creating new records for an object to LOG.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FiscalYearMakerServiceImpl

public FiscalYearMakerServiceImpl()
Method Detail

runProcess

public void runProcess()
Description copied from interface: FiscalYearMakerService
Runs the fiscal year maker process for the configured base year

Specified by:
runProcess in interface FiscalYearMakerService
See Also:
org.kuali.kfs.coa.batch.service.FiscalYearMakerService#runProcess()

getFiscalYearMakerHelpersInCopyOrder

protected List<FiscalYearMaker> getFiscalYearMakerHelpersInCopyOrder()
Returns List of FiscalYearMaker objects in the order they should be copied. Ordered by Parent classes first then children. This is necessary to ensure referential integrity is satisfied when the new record is inserted.

Returns:
List in copy order

getFiscalYearMakerHelpersInDeleteOrder

protected List<FiscalYearMaker> getFiscalYearMakerHelpersInDeleteOrder(List<FiscalYearMaker> fiscalYearMakerHelpersCopyOrder)
Returns List of FiscalYearMaker objects in the order they should be deleted. Ordered by Child classes first then Parents. This is necessary to ensure referential integrity is satisfied when the new record is deleted.

Parameters:
fiscalYearMakerHelpersCopyOrder - list of fiscal year makers in copy order
Returns:
List in delete order

findCircularReferenceAndThrowException

protected void findCircularReferenceAndThrowException(Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>>> parentChildren)
Finds circular references (class which is a child to itself) and throws exception indicating the invalid parent-child configuration

Parameters:
parents - Set of parent classes to check
parentChildren - Map with parent class as the key and its children classes as value

checkChildrenForParentReference

protected boolean checkChildrenForParentReference(Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> parent,
                                                  Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> children,
                                                  Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>>> parentChildren,
                                                  Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> checkedParents)
Recursively checks all children of children who are parents for reference to the given parent class

Parameters:
parent - Class of parent to check for
children - Set of children classes to check
parentChildren - Map with parent class as the key and its children classes as value
checkedParents - Set of parent classes we have already checked (to prevent endless recursiveness)
Returns:
true if the parent class was found in one of the children list (meaning we have a circular reference), false otherwise

getParentChildrenMap

protected Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>>> getParentChildrenMap()
Helper method to build a Map with Parent classes as the key and their Set of child classes as the value

Returns:
Map> of parent to children classes

isParentClass

protected boolean isParentClass(Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> businessObjectClass)
Checks if the given class is a parent (to at least one other class)

Parameters:
businessObjectClass - class to check
Returns:
true if class is a parent, false otherwise

getChildren

protected Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> getChildren(Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>>> parentChildren)
Gets all classes that are child of another class in the given Map

Parameters:
parentChildren - Map with parent class as the key and its children classes as value
Returns:
Set of classes that are a child of another class

getFiscalYearMakerMap

protected Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,FiscalYearMaker> getFiscalYearMakerMap()
Helper method to build a Map with the copy class as the key and its corresponding FiscalYearMaker as the Map value

Returns:
Map of copy classes to FiscalYearMaker objects

validateFiscalYearMakerConfiguration

protected void validateFiscalYearMakerConfiguration()
Validates each configured fiscal year maker implementation


writeCopyFailureMessages

protected void writeCopyFailureMessages(Collection<String> copyErrors)
Write outs errors encountered while creating new records for an object to LOG.

Parameters:
copyErrors - Collection of error messages to write

initialize

public void initialize()
Populates the fiscal year maker list from the installed modules


setFiscalYearMakers

protected void setFiscalYearMakers(List<FiscalYearMaker> fiscalYearMakers)
Sets the fiscalYearMakers attribute value.

Parameters:
fiscalYearMakers - The fiscalYearMakers to set.

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
Sets the parameterService attribute value.

Parameters:
parameterService - The parameterService to set.

setFiscalYearMakersDao

public void setFiscalYearMakersDao(FiscalYearMakersDao fiscalYearMakersDao)
Sets the fiscalYearMakersDao attribute value.

Parameters:
fiscalYearMakersDao - The fiscalYearMakersDao to set.

setKualiModuleService

public void setKualiModuleService(org.kuali.rice.kns.service.KualiModuleService kualiModuleService)
Sets the kualiModuleService attribute value.

Parameters:
kualiModuleService - The kualiModuleService to set.

getFiscalYearMakersDao

protected FiscalYearMakersDao getFiscalYearMakersDao()
Gets the fiscalYearMakersDao attribute.

Returns:
Returns the fiscalYearMakersDao.

getParameterService

protected org.kuali.rice.kns.service.ParameterService getParameterService()
Gets the parameterService attribute.

Returns:
Returns the parameterService.

getKualiModuleService

protected org.kuali.rice.kns.service.KualiModuleService getKualiModuleService()
Gets the kualiModuleService attribute.

Returns:
Returns the kualiModuleService.

getFiscalYearMakers

protected List<FiscalYearMaker> getFiscalYearMakers()
Gets the fiscalYearMakers attribute.

Returns:
Returns the fiscalYearMakers.


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.