org.kuali.kfs.gl.batch.service.impl
Class BalancingServiceImpl

java.lang.Object
  extended by org.kuali.kfs.gl.batch.service.impl.BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
      extended by org.kuali.kfs.gl.batch.service.impl.BalancingServiceImpl
All Implemented Interfaces:
BalancingService

@Transactional
public class BalancingServiceImpl
extends BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
implements BalancingService

Service implementation of BalancingService of GL balancing


Field Summary
protected  AccountBalanceDao accountBalanceDao
           
protected  BalancingDao balancingDao
           
protected  EncumbranceDao encumbranceDao
           
protected  File icrErrorOutputFile
           
protected  File icrInputFile
           
protected  File posterErrorOutputFile
           
protected  File posterInputFile
           
protected  File reversalErrorOutputFile
           
protected  File reversalInputFile
           
 
Fields inherited from class org.kuali.kfs.gl.batch.service.impl.BalancingServiceBaseImpl
balanceHistoryPersistentClass, batchFileDirectoryName, businessObjectService, dateTimeService, entryHistoryPersistentClass, kualiConfigurationService, ledgerBalanceBalancingDao, ledgerBalanceHistoryBalancingDao, ledgerBalancingDao, ledgerEntryBalanceCachingDao, ledgerEntryBalancingDao, ledgerEntryHistoryBalancingDao, parameterService, reportWriterService, universityDateService
 
Constructor Summary
BalancingServiceImpl()
           
 
Method Summary
protected  Integer accountBalanceCompareHistory()
          Does comparision, error printing and returns failure count for account balances
 void clearHistories()
          Removes the data from the History tables.
 void clearPosterFileCache()
          In order to avoid file system scans this class caches poster input and poster error filenames.
protected  Integer compareBalanceHistory()
          Compares entries in the Balance and BalanceHistory tables to ensure the amounts match.
protected  Integer compareEntryHistory()
          Compares entries in the Entry and EntryHistory tables to ensure the amounts match.
protected  org.kuali.rice.kns.util.KualiDecimal convertBigDecimalToKualiDecimal(BigDecimal biggy)
           
protected  AccountBalanceHistory createAccountBalanceHistoryFromMap(Map<String,Object> map)
           
protected  BalanceHistory createBalanceFromMap(Map<String,Object> map)
           
protected  EncumbranceHistory createEncumbranceHistoryFromMap(Map<String,Object> map)
           
protected  EntryHistory createEntryHistoryFromMap(Map<String,Object> map)
           
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  boolean doesCustomHistoryExist(Integer fiscalYear)
          Possible override if sub class has additional history tables.
protected  Integer encumbranceCompareHistory()
          Does comparision, error printing and returns failure count for encumbrances
 Balance getBalance(LedgerBalanceHistory ledgerBalanceHistory)
          Returns a Balance object for the parameters of the passed in LedgerBalanceHistory.
 int getComparisonFailuresToPrintPerReport()
           
 File getFile(String fileName, String fileExtension)
           
 File getICRErrorOutputFile()
           
 File getICRInputFile()
           
 OriginEntryInformation getOriginEntry(String inputLine, int lineNumber)
          Gets an OriginEntryInformation for the parsed line.
 int getPastFiscalYearsToConsider()
           
 File getPosterErrorOutputFile()
           
 File getPosterInputFile()
           
 File getReversalErrorOutputFile()
           
 File getReversalInputFile()
           
 String getShortTableLabel(String businessObjectName)
           
 boolean runBalancing()
          Handle for batch processes to kick off balancing
 void setAccountBalanceDao(AccountBalanceDao accountBalanceDao)
          Sets the AccountBalanceDao
 void setBalancingDao(BalancingDao balancingDao)
          Sets the BalancingDao
 void setEncumbranceDao(EncumbranceDao encumbranceDao)
          Sets the EncumbranceDao
protected  void updateAccountBalanceHistory(OriginEntryInformation originEntry)
          Update the account balance history table
 void updateBalanceHistory(Integer postMode, OriginEntryInformation originEntry)
          Updates the balance history table
protected  void updateCustomHistory(Integer postMode, OriginEntryInformation originEntry)
          Possible override if sub class has additional history tables.
protected  void updateEncumbranceHistory(OriginEntryInformation originEntry)
          Update the encumbrance history table
 void updateEntryHistory(Integer postMode, OriginEntryInformation originEntry)
          Update the entry history table
 
Methods inherited from class org.kuali.kfs.gl.batch.service.impl.BalancingServiceBaseImpl
deleteHistory, getHistoryCount, isFilesReady, setBatchFileDirectoryName, setBusinessObjectService, setDateTimeService, setKualiConfigurationService, setLedgerBalanceBalancingDao, setLedgerBalanceHistoryBalancingDao, setLedgerBalancingDao, setLedgerEntryBalanceCachingDao, setLedgerEntryBalancingDao, setLedgerEntryHistoryBalancingDao, setParameterService, setReportWriterService, setUniversityDateService, updateHistoriesHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

balancingDao

protected BalancingDao balancingDao

accountBalanceDao

protected AccountBalanceDao accountBalanceDao

encumbranceDao

protected EncumbranceDao encumbranceDao

posterInputFile

protected File posterInputFile

posterErrorOutputFile

protected File posterErrorOutputFile

reversalInputFile

protected File reversalInputFile

reversalErrorOutputFile

protected File reversalErrorOutputFile

icrInputFile

protected File icrInputFile

icrErrorOutputFile

protected File icrErrorOutputFile
Constructor Detail

BalancingServiceImpl

public BalancingServiceImpl()
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
Overrides:
runBalancing in class BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
Returns:
boolean true when success
See Also:
BalancingService.runBalancing()

getPosterInputFile

public File getPosterInputFile()
Specified by:
getPosterInputFile in interface BalancingService
Returns:
input poster file. Returns null if no file found.
See Also:
BalancingService.getPosterInputFile()

getPosterErrorOutputFile

public File getPosterErrorOutputFile()
Specified by:
getPosterErrorOutputFile in interface BalancingService
Returns:
output poster error file. Returns null if no file found.
See Also:
BalancingService.getPosterErrorOutputFile()

getReversalInputFile

public File getReversalInputFile()
Specified by:
getReversalInputFile in interface BalancingService
Returns:
input reversal file. Returns null if no file found.
See Also:
BalancingService.getReversalInputFile()

getReversalErrorOutputFile

public File getReversalErrorOutputFile()
Specified by:
getReversalErrorOutputFile in interface BalancingService
Returns:
output reversal error file. Returns null if no file found.
See Also:
BalancingService.getReversalErrorOutputFile()

getICRInputFile

public File getICRInputFile()
Specified by:
getICRInputFile in interface BalancingService
Returns:
input ICR file. Returns null if no file found.
See Also:
BalancingService.getICRInputFile()

getICRErrorOutputFile

public File getICRErrorOutputFile()
Specified by:
getICRErrorOutputFile in interface BalancingService
Returns:
output ICR error file. Returns null if no file found.
See Also:
BalancingService.getICRErrorOutputFile()

getFile

public File getFile(String fileName,
                    String fileExtension)

getPastFiscalYearsToConsider

public int getPastFiscalYearsToConsider()
Specified by:
getPastFiscalYearsToConsider in interface BalancingService
Returns:
system parameter for NUMBER_OF_PAST_FISCAL_YEARS_TO_CONSIDER
See Also:
BalancingService.getPastFiscalYearsToConsider()

getComparisonFailuresToPrintPerReport

public int getComparisonFailuresToPrintPerReport()
Specified by:
getComparisonFailuresToPrintPerReport in interface BalancingService
Returns:
system parameter for NUMBER_OF_COMPARISON_FAILURES_TO_PRINT_PER_REPORT
See Also:
BalancingService.getComparisonFailuresToPrintPerReport()

getShortTableLabel

public String getShortTableLabel(String businessObjectName)
Specified by:
getShortTableLabel in interface BalancingService
Parameters:
businessObjectName - name of the BO for which to return the label
Returns:
functional short labels for tables affected in this process
See Also:
BalancingService.getShortTableLabel(java.lang.String)

getOriginEntry

public OriginEntryInformation getOriginEntry(String inputLine,
                                             int lineNumber)
Description copied from interface: BalancingService
Gets an OriginEntryInformation for the parsed line. This needs to be handled separately for GL and Labor because Labor is a special case of GL (positionNumber + emplid). Could be done with an OriginEntryHistory interface but in the interest of not mucking with OriginEntries the is done with delegation.

Specified by:
getOriginEntry in interface BalancingService
Parameters:
inputLine - line that was read from getPosterInputFilename
lineNumber - line number we are currently reading from getPosterInputFilename
Returns:
parsed line into an object as per inputLine parameter
See Also:
BalancingService.getOriginEntry(java.lang.String, int)

updateEntryHistory

public void updateEntryHistory(Integer postMode,
                               OriginEntryInformation originEntry)
Description copied from interface: BalancingService
Update the entry history table

Specified by:
updateEntryHistory in interface BalancingService
originEntry - representing the update details
See Also:
org.kuali.kfs.gl.batch.service.BalancingService#updateEntryHistory(org.kuali.kfs.gl.businessobject.OriginEntryInformation), org.kuali.kfs.gl.batch.service.impl.PostEntry#post(org.kuali.kfs.gl.businessobject.Transaction, int, java.util.Date)

updateBalanceHistory

public void updateBalanceHistory(Integer postMode,
                                 OriginEntryInformation originEntry)
Description copied from interface: BalancingService
Updates the balance history table

Specified by:
updateBalanceHistory in interface BalancingService
originEntry - representing the update details
See Also:
org.kuali.kfs.gl.batch.service.BalancingService#updateBalanceHistory(org.kuali.kfs.gl.businessobject.OriginEntryInformation), org.kuali.kfs.gl.batch.service.impl.PostBalance#post(org.kuali.kfs.gl.businessobject.Transaction, int, java.util.Date)

getBalance

public Balance getBalance(LedgerBalanceHistory ledgerBalanceHistory)
Description copied from interface: BalancingService
Returns a Balance object for the parameters of the passed in LedgerBalanceHistory. Necessary for generic amount comparision since it may be either labor or gl.

Specified by:
getBalance in interface BalancingService
Parameters:
ledgerBalanceHistory - to retrieve the Balance object for
Returns:
balance object adhereing to the Balance interface
See Also:
BalancingService.getBalance(org.kuali.kfs.gl.businessobject.LedgerBalanceHistory)

clearPosterFileCache

public void clearPosterFileCache()
Description copied from interface: BalancingService
In order to avoid file system scans this class caches poster input and poster error filenames. In rare cases they may want to be reset.

Specified by:
clearPosterFileCache in interface BalancingService
See Also:
BalancingService.clearPosterFileCache()

customPopulateHistoryTables

public void customPopulateHistoryTables(Integer fiscalYear)
Description copied from class: BalancingServiceBaseImpl
Possible override if sub class has additional history tables. Populates custom history tables.

Overrides:
customPopulateHistoryTables in class BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
Parameters:
fiscalYear - fiscal year populate should start from
See Also:
BalancingServiceBaseImpl.customPopulateHistoryTables(java.lang.Integer)

doesCustomHistoryExist

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

Overrides:
doesCustomHistoryExist in class BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
Parameters:
fiscalYear - given fiscal year
Returns:
if data exists for any such table for given year
See Also:
BalancingServiceBaseImpl.doesCustomHistoryExist(java.lang.Integer)

deleteCustomHistory

protected void deleteCustomHistory(Integer fiscalYear)
Description copied from class: BalancingServiceBaseImpl
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.

Overrides:
deleteCustomHistory in class BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
Parameters:
fiscalYear - given fiscal year
See Also:
BalancingServiceBaseImpl.deleteCustomHistory(java.lang.Integer)

updateCustomHistory

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

Overrides:
updateCustomHistory in class BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
originEntry - representing the update details
See Also:
org.kuali.kfs.gl.batch.service.impl.BalancingServiceBaseImpl#updateCustomHistory(org.kuali.kfs.gl.businessobject.OriginEntryInformation)

updateAccountBalanceHistory

protected void updateAccountBalanceHistory(OriginEntryInformation originEntry)
Update the account balance history table

Parameters:
originEntry - representing the update details
See Also:
org.kuali.kfs.gl.batch.service.impl.PostAccountBalance#post(org.kuali.kfs.gl.businessobject.Transaction, int, java.util.Date)

clearHistories

public void clearHistories()
Description copied from interface: BalancingService
Removes the data from the History tables.

Specified by:
clearHistories in interface BalancingService
See Also:
org.kuali.kfs.gl.batch.service.BalancingService#clearBalanceHistory()

compareBalanceHistory

protected Integer compareBalanceHistory()
Compares entries in the Balance and BalanceHistory tables to ensure the amounts match.

Specified by:
compareBalanceHistory in class BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
Returns:
count is compare failures

compareEntryHistory

protected Integer compareEntryHistory()
Compares entries in the Entry and EntryHistory tables to ensure the amounts match.

Specified by:
compareEntryHistory in class BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
Returns:
count is compare failures

updateEncumbranceHistory

protected void updateEncumbranceHistory(OriginEntryInformation originEntry)
Update the encumbrance history table

Parameters:
originEntry - representing the update details
See Also:
org.kuali.kfs.gl.batch.service.impl.PostEncumbrance#post(org.kuali.kfs.gl.businessobject.Transaction, int, java.util.Date)

customCompareHistory

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

Overrides:
customCompareHistory in class BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
Returns:
compare failures. As a HashMap of key: businessObjectName, value: count
See Also:
BalancingServiceBaseImpl.customCompareHistory()

accountBalanceCompareHistory

protected Integer accountBalanceCompareHistory()
Does comparision, error printing and returns failure count for account balances

Returns:
failure count

encumbranceCompareHistory

protected Integer encumbranceCompareHistory()
Does comparision, error printing and returns failure count for encumbrances

Returns:
failure count

customPrintRowCountHistory

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

Overrides:
customPrintRowCountHistory in class BalancingServiceBaseImpl<EntryHistory,BalanceHistory>
Parameters:
fiscalYear - starting from which fiscal year the comparision should take place
See Also:
org.kuali.kfs.gl.batch.service.impl.BalancingServiceBaseImpl#customPrintRowCountHistory()

setBalancingDao

public void setBalancingDao(BalancingDao balancingDao)
Sets the BalancingDao

Parameters:
balancingDao - The BalancingDao to set.

setAccountBalanceDao

public void setAccountBalanceDao(AccountBalanceDao accountBalanceDao)
Sets the AccountBalanceDao

Parameters:
accountBalanceDao - The AccountBalanceDao to set.

setEncumbranceDao

public void setEncumbranceDao(EncumbranceDao encumbranceDao)
Sets the EncumbranceDao

Parameters:
encumbranceDao - The EncumbranceDao to set.

createBalanceFromMap

protected BalanceHistory createBalanceFromMap(Map<String,Object> map)

createEntryHistoryFromMap

protected EntryHistory createEntryHistoryFromMap(Map<String,Object> map)

createAccountBalanceHistoryFromMap

protected AccountBalanceHistory createAccountBalanceHistoryFromMap(Map<String,Object> map)

createEncumbranceHistoryFromMap

protected EncumbranceHistory createEncumbranceHistoryFromMap(Map<String,Object> map)

convertBigDecimalToKualiDecimal

protected org.kuali.rice.kns.util.KualiDecimal convertBigDecimalToKualiDecimal(BigDecimal biggy)


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