org.kuali.kfs.gl.batch.service.impl
Class BalancingServiceBaseImpl<T extends Entry,S extends Balance>

java.lang.Object
  extended by org.kuali.kfs.gl.batch.service.impl.BalancingServiceBaseImpl<T,S>
All Implemented Interfaces:
BalancingService
Direct Known Subclasses:
BalancingServiceImpl, LaborBalancingServiceImpl

@Transactional
public abstract class BalancingServiceBaseImpl<T extends Entry,S extends Balance>
extends Object
implements BalancingService

Base service implementation for BalancingService. Useful for generic implementation of common code between la`bor and GL balancing.


Field Summary
protected  Class<S> balanceHistoryPersistentClass
           
protected  String batchFileDirectoryName
           
protected  org.kuali.rice.kns.service.BusinessObjectService businessObjectService
           
protected  org.kuali.rice.kns.service.DateTimeService dateTimeService
           
protected  Class<T> entryHistoryPersistentClass
           
protected  org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService
           
protected  LedgerBalanceBalancingDao ledgerBalanceBalancingDao
           
protected  LedgerBalanceHistoryBalancingDao ledgerBalanceHistoryBalancingDao
           
protected  LedgerBalancingDao ledgerBalancingDao
           
protected  LedgerEntryBalanceCachingDao ledgerEntryBalanceCachingDao
           
protected  LedgerEntryBalancingDao ledgerEntryBalancingDao
           
protected  LedgerEntryHistoryBalancingDao ledgerEntryHistoryBalancingDao
           
protected  org.kuali.rice.kns.service.ParameterService parameterService
           
protected  ReportWriterService reportWriterService
           
protected  UniversityDateService universityDateService
           
 
Constructor Summary
BalancingServiceBaseImpl()
          Constructs a BalancingServiceBaseImpl.java.
 
Method Summary
protected abstract  Integer compareBalanceHistory()
           
protected abstract  Integer compareEntryHistory()
           
protected  Map<String,Integer> customCompareHistory()
          Possible override if sub class has additional history tables.
 void customPopulateHistoryTables(Integer fiscalYear)
          Possible override if sub class has additional history tables.
protected  void customPrintRowCountHistory(Integer fiscalYear)
          Possible override if sub class has additional history tables.
protected  void deleteCustomHistory(Integer fiscalYear)
          Possible override if sub class has additional history tables.
protected  void deleteHistory(Integer universityFiscalYear, Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObjectBase> persistentClass)
          Deletes data for the given fiscal year of entries from persistentClass.
protected  boolean doesCustomHistoryExist(Integer fiscalYear)
          Possible override if sub class has additional history tables.
protected  int getHistoryCount(Integer fiscalYear, Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObjectBase> persistentClass)
          Gets count for given fiscal year of entries from persistentClass.
protected  boolean isFilesReady()
           
 boolean runBalancing()
          Handle for batch processes to kick off balancing
 void setBatchFileDirectoryName(String batchFileDirectoryName)
          Sets the batchFileDirectoryName
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          Sets the BusinessObjectService
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
          Sets the DateTimeService
 void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)
          Sets the KualiConfigurationService
 void setLedgerBalanceBalancingDao(LedgerBalanceBalancingDao ledgerBalanceBalancingDao)
          Sets the LedgerBalanceBalancingDao
 void setLedgerBalanceHistoryBalancingDao(LedgerBalanceHistoryBalancingDao ledgerBalanceHistoryBalancingDao)
          Sets the ledgerBalanceHistoryBalancingDao
 void setLedgerBalancingDao(LedgerBalancingDao ledgerBalancingDao)
          Sets the LedgerBalancingDao
 void setLedgerEntryBalanceCachingDao(LedgerEntryBalanceCachingDao ledgerEntryBalanceCachingDao)
          Sets the ledgerEntryBalanceCachingDao attribute value.
 void setLedgerEntryBalancingDao(LedgerEntryBalancingDao ledgerEntryBalancingDao)
          Sets the LedgerEntryBalancingDao
 void setLedgerEntryHistoryBalancingDao(LedgerEntryHistoryBalancingDao ledgerEntryHistoryBalancingDao)
          Sets the LedgerEntryHistoryBalancingDao
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          Sets the ParameterService
 void setReportWriterService(ReportWriterService reportWriterService)
          Sets the reportWriterService
 void setUniversityDateService(UniversityDateService universityDateService)
          Sets the UniversityDateService
protected  void updateCustomHistory(Integer postMode, OriginEntryInformation originEntry)
          Possible override if sub class has additional history tables.
protected  int updateHistoriesHelper(Integer postMode, Integer startUniversityFiscalYear, File inputFile, File errorFile)
          This is a helper method that wraps parsing poster entries for updateEntryHistory and updateBalanceHistory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.kfs.gl.batch.service.BalancingService
clearHistories, clearPosterFileCache, getBalance, getComparisonFailuresToPrintPerReport, getICRErrorOutputFile, getICRInputFile, getOriginEntry, getPastFiscalYearsToConsider, getPosterErrorOutputFile, getPosterInputFile, getReversalErrorOutputFile, getReversalInputFile, getShortTableLabel, updateBalanceHistory, updateEntryHistory
 

Field Detail

entryHistoryPersistentClass

protected Class<T extends Entry> entryHistoryPersistentClass

balanceHistoryPersistentClass

protected Class<S extends Balance> balanceHistoryPersistentClass

parameterService

protected org.kuali.rice.kns.service.ParameterService parameterService

kualiConfigurationService

protected org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService

businessObjectService

protected org.kuali.rice.kns.service.BusinessObjectService businessObjectService

dateTimeService

protected org.kuali.rice.kns.service.DateTimeService dateTimeService

universityDateService

protected UniversityDateService universityDateService

ledgerBalancingDao

protected LedgerBalancingDao ledgerBalancingDao

ledgerEntryBalancingDao

protected LedgerEntryBalancingDao ledgerEntryBalancingDao

ledgerEntryBalanceCachingDao

protected LedgerEntryBalanceCachingDao ledgerEntryBalanceCachingDao

ledgerBalanceBalancingDao

protected LedgerBalanceBalancingDao ledgerBalanceBalancingDao

ledgerBalanceHistoryBalancingDao

protected LedgerBalanceHistoryBalancingDao ledgerBalanceHistoryBalancingDao

ledgerEntryHistoryBalancingDao

protected LedgerEntryHistoryBalancingDao ledgerEntryHistoryBalancingDao

reportWriterService

protected ReportWriterService reportWriterService

batchFileDirectoryName

protected String batchFileDirectoryName
Constructor Detail

BalancingServiceBaseImpl

public BalancingServiceBaseImpl()
Constructs a BalancingServiceBaseImpl.java. The generics are expected to be of type Balance and Entry respectively.

Method Detail

runBalancing

public boolean runBalancing()
Description copied from interface: BalancingService
Handle for batch processes to kick off balancing

Specified by:
runBalancing in interface BalancingService
Returns:
boolean true when success
See Also:
BalancingService.runBalancing()

isFilesReady

protected boolean isFilesReady()
Returns:
if the files required for processing of this job are present and readable.

deleteHistory

protected void deleteHistory(Integer universityFiscalYear,
                             Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObjectBase> persistentClass)
Deletes data for the given fiscal year of entries from persistentClass.

Parameters:
universityFiscalYear - the given university fiscal year
persistentClass - table for which to delete the history

getHistoryCount

protected int getHistoryCount(Integer fiscalYear,
                              Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObjectBase> persistentClass)
Gets count for given fiscal year of entries from persistentClass.

Parameters:
fiscalYear - parameter may be null which will get count for all years
persistentClass - table for which to get the count
Returns:
count

updateHistoriesHelper

protected int updateHistoriesHelper(Integer postMode,
                                    Integer startUniversityFiscalYear,
                                    File inputFile,
                                    File errorFile)
This is a helper method that wraps parsing poster entries for updateEntryHistory and updateBalanceHistory.

Parameters:
startUniversityFiscalYear - fiscal year for which to accept the earlier parsed lines from the input file
Returns:
indicated whether records where ignored due to being older then startUniversityFiscalYear

compareBalanceHistory

protected abstract Integer compareBalanceHistory()

compareEntryHistory

protected abstract Integer compareEntryHistory()

customPopulateHistoryTables

public void customPopulateHistoryTables(Integer fiscalYear)
Possible override if sub class has additional history tables. Populates custom history tables.

Parameters:
fiscalYear - fiscal year populate should start from

doesCustomHistoryExist

protected boolean doesCustomHistoryExist(Integer fiscalYear)
Possible override if sub class has additional history tables. This returns true if value populated in any such tables.

Parameters:
fiscalYear - given fiscal year
Returns:
if data exists for any such table for given year

deleteCustomHistory

protected void deleteCustomHistory(Integer fiscalYear)
Possible override if sub class has additional history tables. Deletes data in history table. Also should print message to that affect to be consistent with rest of functionality.

Parameters:
fiscalYear - given fiscal year

updateCustomHistory

protected void updateCustomHistory(Integer postMode,
                                   OriginEntryInformation originEntry)
Possible override if sub class has additional history tables. Updates history data for custom table(s).

Parameters:
originEntry - representing the update details

customCompareHistory

protected Map<String,Integer> customCompareHistory()
Possible override if sub class has additional history tables.

Returns:
compare failures. As a HashMap of key: businessObjectName, value: count

customPrintRowCountHistory

protected void customPrintRowCountHistory(Integer fiscalYear)
Possible override if sub class has additional history tables. Prints the row count history for STATISTICS section.

Parameters:
fiscalYear - starting from which fiscal year the comparision should take place

setParameterService

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

Parameters:
parameterService - The ParameterService to set.

setKualiConfigurationService

public void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)
Sets the KualiConfigurationService

Parameters:
kualiConfigurationService - The KualiConfigurationService to set.

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
Sets the BusinessObjectService

Parameters:
businessObjectService - The BusinessObjectService to set.

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
Sets the DateTimeService

Parameters:
dateTimeService - The DateTimeService to set.

setUniversityDateService

public void setUniversityDateService(UniversityDateService universityDateService)
Sets the UniversityDateService

Parameters:
universityDateService - The UniversityDateService to set.

setLedgerBalancingDao

public void setLedgerBalancingDao(LedgerBalancingDao ledgerBalancingDao)
Sets the LedgerBalancingDao

Parameters:
ledgerBalancingDao - The LedgerBalancingDao to set.

setLedgerEntryBalancingDao

public void setLedgerEntryBalancingDao(LedgerEntryBalancingDao ledgerEntryBalancingDao)
Sets the LedgerEntryBalancingDao

Parameters:
ledgerEntryBalancingDao - The LedgerEntryBalancingDao to set.

setLedgerBalanceBalancingDao

public void setLedgerBalanceBalancingDao(LedgerBalanceBalancingDao ledgerBalanceBalancingDao)
Sets the LedgerBalanceBalancingDao

Parameters:
ledgerBalanceBalancingDao - The LedgerBalanceBalancingDao to set.

setLedgerBalanceHistoryBalancingDao

public void setLedgerBalanceHistoryBalancingDao(LedgerBalanceHistoryBalancingDao ledgerBalanceHistoryBalancingDao)
Sets the ledgerBalanceHistoryBalancingDao

Parameters:
ledgerBalanceHistoryBalancingDao - The LedgerBalanceHistoryBalancingDao to set.

setLedgerEntryHistoryBalancingDao

public void setLedgerEntryHistoryBalancingDao(LedgerEntryHistoryBalancingDao ledgerEntryHistoryBalancingDao)
Sets the LedgerEntryHistoryBalancingDao

Parameters:
ledgerEntryHistoryBalancingDao - The LedgerEntryHistoryBalancingDao to set.

setReportWriterService

public void setReportWriterService(ReportWriterService reportWriterService)
Sets the reportWriterService

Parameters:
reportWriterService - The reportWriterService to set.

setBatchFileDirectoryName

public void setBatchFileDirectoryName(String batchFileDirectoryName)
Sets the batchFileDirectoryName

Parameters:
batchFileDirectoryName - The batchFileDirectoryName to set.

setLedgerEntryBalanceCachingDao

public void setLedgerEntryBalanceCachingDao(LedgerEntryBalanceCachingDao ledgerEntryBalanceCachingDao)
Sets the ledgerEntryBalanceCachingDao attribute value.

Parameters:
ledgerEntryBalanceCachingDao - The ledgerEntryBalanceCachingDao to set.


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