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

java.lang.Object
  extended by org.kuali.kfs.gl.batch.service.impl.ReconciliationServiceImpl
All Implemented Interfaces:
ReconciliationService

@Transactional
public class ReconciliationServiceImpl
extends Object
implements ReconciliationService

Default implementation of ReconciliationService


Nested Class Summary
protected  class ReconciliationServiceImpl.JavaAttributeAugmentedColumnReconciliation
          A wrapper around ColumnReconciliation objects to provide it with information specific to the java beans representing each BO.
 
Constructor Summary
ReconciliationServiceImpl()
           
 
Method Summary
protected  org.kuali.rice.kns.util.KualiDecimal[] createColumnSumsArray(int size)
          Creates an array of KualiDecimals of a given size, and initializes all elements to KualiDecimal.ZERO
protected  Message generateColumnSumErrorMessage(ColumnReconciliation column, org.kuali.rice.kns.util.KualiDecimal actualValue)
          Generates the error message for the sum of column(s) not matching the reconciliation value
protected  Message generateRowCountMismatchMessage(ReconciliationBlock block, int actualRowCount)
          Generates the error message for the number of entries reconciled being unequal to the expected value
protected  Class<? extends OriginEntryFull> getOriginEntryClass()
          Gets the originEntryClass attribute.
protected  ReconciliationDao getReconciliationDao()
          Gets the reconciliationDao attribute.
protected  boolean performSanityChecks(List<ColumnReconciliation> columns, List<ReconciliationServiceImpl.JavaAttributeAugmentedColumnReconciliation> javaAttributeNames, org.kuali.rice.kns.util.KualiDecimal[] columnSums, List<Message> errorMessages)
          Performs basic checking to ensure that values are set up so that reconciliation can proceed
 void reconcile(Iterator<OriginEntryFull> entries, ReconciliationBlock reconBlock, List<Message> errorMessages)
          Performs the reconciliation on origin entries using the data from the ReconciliationBlock parameter
protected  List<ReconciliationServiceImpl.JavaAttributeAugmentedColumnReconciliation> resolveJavaAttributeNames(List<ColumnReconciliation> columns)
          Resolves a mapping between the database columns and the java attribute name (i.e.
 void setOriginEntryClass(Class<? extends OriginEntryFull> originEntryClass)
          Sets the originEntryClass attribute value.
 void setReconciliationDao(ReconciliationDao reconciliationDao)
          Sets the reconciliationDao attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReconciliationServiceImpl

public ReconciliationServiceImpl()
Method Detail

reconcile

public void reconcile(Iterator<OriginEntryFull> entries,
                      ReconciliationBlock reconBlock,
                      List<Message> errorMessages)
Performs the reconciliation on origin entries using the data from the ReconciliationBlock parameter

Specified by:
reconcile in interface ReconciliationService
Parameters:
entries - origin entries
reconBlock - reconciliation data
errorMessages - a non-null list onto which error messages will be appended. This list will be modified by reference.
See Also:
ReconciliationService.reconcile(java.util.Iterator, org.kuali.kfs.gl.batch.service.impl.ReconciliationBlock, java.util.List)

generateColumnSumErrorMessage

protected Message generateColumnSumErrorMessage(ColumnReconciliation column,
                                                org.kuali.rice.kns.util.KualiDecimal actualValue)
Generates the error message for the sum of column(s) not matching the reconciliation value

Parameters:
column - the column reconciliation data (recall that this "column" can be the sum of several columns)
actualValue - the value of the column(s)
Returns:
the message

generateRowCountMismatchMessage

protected Message generateRowCountMismatchMessage(ReconciliationBlock block,
                                                  int actualRowCount)
Generates the error message for the number of entries reconciled being unequal to the expected value

Parameters:
block - The file reconciliation data
actualRowCount - the number of rows encountered
Returns:
the message

performSanityChecks

protected boolean performSanityChecks(List<ColumnReconciliation> columns,
                                      List<ReconciliationServiceImpl.JavaAttributeAugmentedColumnReconciliation> javaAttributeNames,
                                      org.kuali.rice.kns.util.KualiDecimal[] columnSums,
                                      List<Message> errorMessages)
Performs basic checking to ensure that values are set up so that reconciliation can proceed

Parameters:
columns - the columns generated by the ReconciliationParserService
javaAttributeNames - the java attribute names corresponding to each field in columns. (see resolveJavaAttributeNames(List))
columnSums - a list of KualiDecimals used to store column sums as reconciliation iterates through the origin entries
errorMessages - a list to which error messages will be appended.
Returns:
true if there are no problems, false otherwise

createColumnSumsArray

protected org.kuali.rice.kns.util.KualiDecimal[] createColumnSumsArray(int size)
Creates an array of KualiDecimals of a given size, and initializes all elements to KualiDecimal.ZERO

Parameters:
size - the size of the constructed array
Returns:
the array, all initialized to KualiDecimal.ZERO

resolveJavaAttributeNames

protected List<ReconciliationServiceImpl.JavaAttributeAugmentedColumnReconciliation> resolveJavaAttributeNames(List<ColumnReconciliation> columns)
Resolves a mapping between the database columns and the java attribute name (i.e. bean property names)

Parameters:
columns - columns parsed by the ReconciliationParserService
Returns:
a list of ReconciliationServiceImpl.JavaAttributeAugmentedColumnReconciliation (see class description) objects. The returned list will have the same size as the parameter, and each element in one list corresponds to the element at the same position in the other list

getReconciliationDao

protected ReconciliationDao getReconciliationDao()
Gets the reconciliationDao attribute.

Returns:
Returns the reconciliationDao.

setReconciliationDao

public void setReconciliationDao(ReconciliationDao reconciliationDao)
Sets the reconciliationDao attribute value.

Parameters:
reconciliationDao - The reconciliationDao to set.

getOriginEntryClass

protected Class<? extends OriginEntryFull> getOriginEntryClass()
Gets the originEntryClass attribute.

Returns:
Returns the originEntryClass.

setOriginEntryClass

public void setOriginEntryClass(Class<? extends OriginEntryFull> originEntryClass)
Sets the originEntryClass attribute value.

Parameters:
originEntryClass - The originEntryClass to set.


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