org.kuali.kfs.gl.batch
Class CollectorScrubberProcess

java.lang.Object
  extended by org.kuali.kfs.gl.batch.CollectorScrubberProcess

public class CollectorScrubberProcess
extends Object

This class scrubs the billing details in a collector batch. Note that all services used by this class are passed in as parameters to the constructor. NOTE: IT IS IMPERATIVE that a new instance of this class is constructed and used to parse each batch. Sharing instances to scrub multiple batches may lead to unpredictable results.


Field Summary
protected  CollectorBatch batch
           
protected  String collectorFileDirectoryName
           
protected  CollectorReportData collectorReportData
           
protected  org.kuali.rice.kns.service.DateTimeService dateTimeService
           
protected  Set<DocumentGroupData> errorDocumentGroups
           
protected  String errorFileName
           
protected  String expiredFileName
           
protected  String inputFileName
           
protected  org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService
           
protected  org.kuali.rice.kns.service.PersistenceService persistenceService
           
protected  ScrubberService scrubberService
           
protected  String validFileName
           
 
Constructor Summary
CollectorScrubberProcess(CollectorBatch batch, org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService, org.kuali.rice.kns.service.PersistenceService persistenceService, ScrubberService scrubberService, CollectorReportData collectorReportData, org.kuali.rice.kns.service.DateTimeService dateTimeService, String collectorFileDirectoryName)
          Constructs a CollectorScrubberProcess.java.
 
Method Summary
protected  void applyChangesToDetailsFromScrubberEdits(Map<OriginEntryInformation,OriginEntryInformation> unscrubbedToScrubbedEntries)
          Updates all Collector details with the data from scrubbed origin entries
protected  void applyScrubberEditsToDetail(OriginEntryInformation originEntry, CollectorDetail detail)
          Updates the Collector detail with the data from a scrubbed entry
protected  boolean isOriginEntryRelatedToDetailRecord(OriginEntryInformation originEntry, CollectorDetail detail)
          Determines if an origin entry is related to the given Collector detail record
protected  void removeInterDepartmentalBillingAssociatedWithErrorGroup()
          This method's purpose is similar to the scrubber's demerger.
protected  void removeInterDepartmentalBillingNotAssociatedWithInputEntries()
          Removes Collector IB details not associated with entries in the Collector data
protected  void retrieveErrorDocumentGroups()
          Based on the origin entries in the origin entry scrubber-produced error group, creates a set of all DocumentGroupDatas represented by those origin entries and initializes the errorDocumentGroups variable
protected  void retrieveTotalsOnInputOriginEntriesAssociatedWithErrorGroup()
          Computes the totals of the input entries that were associated with the entries in the error group, which is created in the scrubber.
 CollectorScrubberStatus scrub()
          Scrubs the entries read in by the Collector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

batch

protected CollectorBatch batch

inputFileName

protected String inputFileName

validFileName

protected String validFileName

errorFileName

protected String errorFileName

expiredFileName

protected String expiredFileName

kualiConfigurationService

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

persistenceService

protected org.kuali.rice.kns.service.PersistenceService persistenceService

collectorReportData

protected CollectorReportData collectorReportData

scrubberService

protected ScrubberService scrubberService

dateTimeService

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

errorDocumentGroups

protected Set<DocumentGroupData> errorDocumentGroups

collectorFileDirectoryName

protected String collectorFileDirectoryName
Constructor Detail

CollectorScrubberProcess

public CollectorScrubberProcess(CollectorBatch batch,
                                org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService,
                                org.kuali.rice.kns.service.PersistenceService persistenceService,
                                ScrubberService scrubberService,
                                CollectorReportData collectorReportData,
                                org.kuali.rice.kns.service.DateTimeService dateTimeService,
                                String collectorFileDirectoryName)
Constructs a CollectorScrubberProcess.java.

Parameters:
batch - the batch to scrub
inputGroup - the origin entry group that holds all of the origin entries coming from the parsed input groups in the given batch
validGroup - the origin entry group that holds all of the origin entries coming that are in the origin entry scrubber valid group
errorGroup - the origin entry group that holds all of the origin entries coming that are in the origin entry scrubber error group
expiredGroup - are in the origin entry scrubber valid group that are in the origin entry scrubber expired group
originEntryService - the origin entry service that holds the origin entries in the batch (not necessarily the default implementation)
originEntryGroupService - the origin entry group service that holds the 3 group parameters (not necessarily the default implementation)
kualiConfigurationService - the config service
persistenceService - the persistence service
Method Detail

scrub

public CollectorScrubberStatus scrub()
Scrubs the entries read in by the Collector

Returns:
a CollectorScrubberStatus object encapsulating the results of the scrubbing process

removeInterDepartmentalBillingNotAssociatedWithInputEntries

protected void removeInterDepartmentalBillingNotAssociatedWithInputEntries()
Removes Collector IB details not associated with entries in the Collector data


removeInterDepartmentalBillingAssociatedWithErrorGroup

protected void removeInterDepartmentalBillingAssociatedWithErrorGroup()
This method's purpose is similar to the scrubber's demerger. This method scans through all of the origin entries and removes those billing details that share the same doc number, doc type, and origination code


isOriginEntryRelatedToDetailRecord

protected boolean isOriginEntryRelatedToDetailRecord(OriginEntryInformation originEntry,
                                                     CollectorDetail detail)
Determines if an origin entry is related to the given Collector detail record

Parameters:
originEntry - the origin entry to check
detail - the Collector detail to check against
Returns:
true if the origin entry is related, false otherwise

applyScrubberEditsToDetail

protected void applyScrubberEditsToDetail(OriginEntryInformation originEntry,
                                          CollectorDetail detail)
Updates the Collector detail with the data from a scrubbed entry

Parameters:
originEntry - a scrubbed origin entry
detail - a Collector detail to update

applyChangesToDetailsFromScrubberEdits

protected void applyChangesToDetailsFromScrubberEdits(Map<OriginEntryInformation,OriginEntryInformation> unscrubbedToScrubbedEntries)
Updates all Collector details with the data from scrubbed origin entries

Parameters:
unscrubbedToScrubbedEntries - a Map relating original origin entries to scrubbed origin entries

retrieveErrorDocumentGroups

protected void retrieveErrorDocumentGroups()
Based on the origin entries in the origin entry scrubber-produced error group, creates a set of all DocumentGroupDatas represented by those origin entries and initializes the errorDocumentGroups variable


retrieveTotalsOnInputOriginEntriesAssociatedWithErrorGroup

protected void retrieveTotalsOnInputOriginEntriesAssociatedWithErrorGroup()
Computes the totals of the input entries that were associated with the entries in the error group, which is created in the scrubber. These totals are reflected in the collector report data object.



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