|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.kfs.gl.batch.service.impl.ScrubberProcessImpl
public class ScrubberProcessImpl
This class has the logic for the scrubber. It is required because the scrubber process needs instance variables. Instance variables in a spring service are shared between all code calling the service. This will make sure each run of the scrubber has it's own instance variables instead of being shared.
Field Summary | |
---|---|
protected DocumentNumberAwareReportWriterService |
preScrubberReportWriterService
|
Constructor Summary | |
---|---|
ScrubberProcessImpl()
|
Method Summary | |
---|---|
protected void |
addTransactionError(String errorMessage,
String errorValue,
int type)
Add an error message to the list of messages for this transaction |
Date |
calculateRunDate(Date currentDate)
This method modifies the run date if it is before the cutoff time specified by the RunTimeService See KULRNE-70 This method is public to facilitate unit testing |
protected String |
checkAndSetTransactionTypeCostShare(String financialBalanceTypeCode,
String desc,
String currentValidLine)
|
protected boolean |
checkingBypassEntry(String financialBalanceTypeCode,
String desc,
DemergerReportData demergerReport)
|
protected void |
createOutputEntry(OriginEntryInformation entry,
PrintStream ps)
|
protected void |
createOutputEntry(String line,
PrintStream ps)
|
protected org.kuali.kfs.gl.batch.service.impl.ScrubberProcessImpl.TransactionError |
generateCostShareEncumbranceEntries(OriginEntryInformation scrubbedEntry,
ScrubberReportData scrubberReport)
The purpose of this method is to generate a "Cost Share Encumbrance" transaction for the current transaction and its offset. |
protected org.kuali.kfs.gl.batch.service.impl.ScrubberProcessImpl.TransactionError |
generateCostShareEntries(OriginEntryInformation scrubbedEntry,
ScrubberReportData scrubberReport)
Generates a cost share entry and offset for the given entry and saves both to the valid group |
protected void |
generateDemergerRemovedTransactionsReport(String errorFileName)
|
protected boolean |
generateOffset(OriginEntryInformation scrubbedEntry,
ScrubberReportData scrubberReport)
The purpose of this method is to build the actual offset transaction. |
protected void |
generateScrubberBlankBalanceTypeCodeReport(String inputFileName)
Generates the scrubber report that lists out the input origin entries with blank balance type codes. |
protected void |
generateScrubberTransactionListingReport(String documentNumber,
String inputFileName)
Generates the scrubber listing report for the GLCP document |
AccountingCycleCachingService |
getAccountingCycleCachingService()
Gets the accountingCycleCachingService attribute. |
org.kuali.rice.kns.service.KualiConfigurationService |
getConfigurationService()
Gets the configurationService attribute. |
org.kuali.rice.kns.service.DateTimeService |
getDateTimeService()
Gets the dateTimeService attribute. |
ReportWriterService |
getDemergerRemovedTransactionsListingReportWriterService()
Gets the demergerRemovedTransactionsListingReportWriterService attribute. |
ReportWriterService |
getDemergerReportWriterService()
Gets the demergerReportWriterService attribute. |
FlexibleOffsetAccountService |
getFlexibleOffsetAccountService()
Gets the flexibleOffsetAccountService attribute. |
protected String |
getOffsetMessage()
Generate the offset message with the flag at the end |
org.kuali.rice.kns.service.ParameterService |
getParameterService()
Gets the parameterService attribute. |
org.kuali.rice.kns.service.PersistenceService |
getPersistenceService()
Gets the persistenceService attribute. |
PreScrubberService |
getPreScrubberService()
Gets the preScrubberService attribute. |
RunDateService |
getRunDateService()
Gets the runDateService attribute. |
ReportWriterService |
getScrubberBadBalanceListingReportWriterService()
Gets the scrubberBadBalanceListingReportWriterService attribute. |
DocumentNumberAwareReportWriterService |
getScrubberLedgerReportWriterService()
Gets the scrubberLedgerReportWriterService attribute. |
DocumentNumberAwareReportWriterService |
getScrubberListingReportWriterService()
Gets the scrubberListingReportWriterService attribute. |
DocumentNumberAwareReportWriterService |
getScrubberReportWriterService()
Gets the scrubberReportWriterService attribute. |
ScrubberValidator |
getScrubberValidator()
Gets the scrubberValidator attribute. |
protected String |
getTransactionType(OriginEntryInformation transaction)
Determine the type of the transaction by looking at attributes |
protected String |
getTransactionType(String financialBalanceTypeCode,
String desc)
|
String |
getTransferDescription()
Gets the transferDescription attribute. |
protected void |
handleDemergerSaveValidEntry(String entryString)
|
protected void |
handleEndOfScrubberReport(ScrubberReportData scrubberReport)
|
protected void |
handleTransactionError(Transaction errorTransaction,
Message message)
|
protected void |
handleTransactionErrors(Transaction errorTransaction,
List<Message> messages)
|
protected boolean |
isFatal(List<Message> errors)
Determines if a given error is fatal and should stop this scrubber run |
void |
performDemerger()
The demerger process reads all of the documents in the error group, then moves all of the original entries for that document from the valid group to the error group. |
protected void |
plantFundAccountLookup(OriginEntryInformation scrubbedEntry,
OriginEntryFull liabilityEntry)
Updates the entries with the proper chart and account for the plant fund |
protected String |
processCapitalization(OriginEntryInformation scrubbedEntry,
ScrubberReportData scrubberReport)
Generates capitalization entries if necessary |
protected void |
processGroup(boolean reportOnlyMode,
ScrubberReportData scrubberReport)
This will process a group of origin entries. |
protected String |
processLiabilities(OriginEntryInformation scrubbedEntry,
ScrubberReportData scrubberReport)
Generate the liability entries for the entry if necessary |
protected String |
processPlantIndebtedness(OriginEntryInformation scrubbedEntry,
ScrubberReportData scrubberReport)
Generates the plant indebtedness entries |
protected void |
putTransactionError(Transaction s,
String errorMessage,
String errorValue,
int type)
Puts a transaction error into this instance's collection of errors |
void |
scrubCollectorBatch(ScrubberStatus scrubberStatus,
CollectorBatch batch,
CollectorReportData collectorReportData)
Scrubs the origin entry and ID billing details if the given batch. |
void |
scrubEntries()
Scrubs all entries in all groups and documents. |
void |
scrubEntries(boolean reportOnlyMode,
String documentNumber)
Scrub all entries that need it in origin entry. |
void |
scrubGroupReportOnly(String fileName,
String documentNumber)
Scrub this single group read only. |
void |
setAccountingCycleCachingService(AccountingCycleCachingService accountingCycleCachingService)
Sets the accountingCycleCachingService attribute value. |
void |
setBatchFileDirectoryName(String batchFileDirectoryName)
Sets the batchFileDirectoryName attribute value. |
void |
setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
Sets the businessObjectService attribute value. |
void |
setConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService configurationService)
Sets the configurationService attribute value. |
void |
setCostShareObjectCode(OriginEntryFull costShareEntry,
OriginEntryInformation originEntry)
Sets the proper cost share object code in an entry and its offset |
void |
setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
Sets the dateTimeService attribute value. |
void |
setDemergerRemovedTransactionsListingReportWriterService(ReportWriterService demergerRemovedTransactionsListingReportWriterService)
Sets the demergerRemovedTransactionsListingReportWriterService attribute value. |
void |
setDemergerReportWriterService(ReportWriterService demergerReportWriterService)
Sets the demergerReportWriterService attribute value. |
protected void |
setDescriptions()
Get all the transaction descriptions from the param table |
void |
setFlexibleOffsetAccountService(FlexibleOffsetAccountService flexibleOffsetAccountService)
Sets the flexibleOffsetAccountService attribute value. |
static void |
setLOG(org.apache.log4j.Logger log)
Sets the lOG attribute value. |
protected void |
setOffsetString()
Generate the flag for the end of specific descriptions. |
void |
setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
Sets the parameterService attribute value. |
void |
setPersistenceService(org.kuali.rice.kns.service.PersistenceService persistenceService)
Sets the persistenceService attribute value. |
void |
setPreScrubberReportWriterService(DocumentNumberAwareReportWriterService preScrubberReportWriterService)
Sets the preScrubberReportWriterService attribute value. |
void |
setPreScrubberService(PreScrubberService preScrubberService)
Sets the preScrubberService attribute value. |
void |
setRunDateService(RunDateService runDateService)
Sets the runDateService attribute value. |
void |
setScrubberBadBalanceListingReportWriterService(ReportWriterService scrubberBadBalanceListingReportWriterService)
Sets the scrubberBadBalanceListingReportWriterService attribute value. |
void |
setScrubberLedgerReportWriterService(DocumentNumberAwareReportWriterService scrubberLedgerReportWriterService)
Sets the scrubberLedgerReportWriterService attribute value. |
void |
setScrubberListingReportWriterService(DocumentNumberAwareReportWriterService scrubberListingReportWriterService)
Sets the scrubberListingReportWriterService attribute value. |
void |
setScrubberReportWriterService(DocumentNumberAwareReportWriterService scrubberReportWriterService)
Sets the scrubberReportWriterService attribute value. |
void |
setScrubberValidator(ScrubberValidator scrubberValidator)
Sets the scrubberValidator attribute value. |
void |
setTransferDescription(String transferDescription)
Sets the transferDescription attribute value. |
protected boolean |
shouldScrubberGenerateOffsetsForDocType(String docTypeCode)
Determines if the scrubber should generate offsets for the given document type |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DocumentNumberAwareReportWriterService preScrubberReportWriterService
Constructor Detail |
---|
public ScrubberProcessImpl()
Method Detail |
---|
public void scrubGroupReportOnly(String fileName, String documentNumber)
scrubGroupReportOnly
in interface ScrubberProcess
group
- the origin entry group that should be scrubbedthe
- document number of any specific entries to scrubpublic void scrubEntries()
scrubEntries
in interface ScrubberProcess
public void scrubCollectorBatch(ScrubberStatus scrubberStatus, CollectorBatch batch, CollectorReportData collectorReportData)
scrubCollectorBatch
in interface ScrubberProcess
batch
- the data gathered from a Collector filecollectorReportData
- the statistics generated by running the Collectorpublic void scrubEntries(boolean reportOnlyMode, String documentNumber)
scrubEntries
in interface ScrubberProcess
group
- the specific origin entry group to scrubdocumentNumber
- the number of the document with entries to scrubpublic void performDemerger()
performDemerger
in interface ScrubberProcess
errorGroup
- this scrubber run's error groupvalidGroup
- this scrubber run's valid groupprotected String getTransactionType(OriginEntryInformation transaction)
transaction
- Transaction to identify
protected String getTransactionType(String financialBalanceTypeCode, String desc)
protected void processGroup(boolean reportOnlyMode, ScrubberReportData scrubberReport)
originEntryGroup
- Group to processprotected boolean isFatal(List<Message> errors)
errors
- errors from a scrubber run
protected org.kuali.kfs.gl.batch.service.impl.ScrubberProcessImpl.TransactionError generateCostShareEntries(OriginEntryInformation scrubbedEntry, ScrubberReportData scrubberReport)
scrubbedEntry
- the originEntry that was scrubbed
protected void setDescriptions()
protected void setOffsetString()
protected String getOffsetMessage()
protected String processCapitalization(OriginEntryInformation scrubbedEntry, ScrubberReportData scrubberReport)
scrubbedEntry
- the entry to generate capitalization entries (possibly) for
protected String processPlantIndebtedness(OriginEntryInformation scrubbedEntry, ScrubberReportData scrubberReport)
scrubbedEntry
- the entry to generated plant indebtedness entries for if necessary
protected String processLiabilities(OriginEntryInformation scrubbedEntry, ScrubberReportData scrubberReport)
scrubbedEntry
- the entry to generate liability entries for if necessary
protected void plantFundAccountLookup(OriginEntryInformation scrubbedEntry, OriginEntryFull liabilityEntry)
scrubbedEntry
- basis for plant fund entryliabilityEntry
- liability entryprotected org.kuali.kfs.gl.batch.service.impl.ScrubberProcessImpl.TransactionError generateCostShareEncumbranceEntries(OriginEntryInformation scrubbedEntry, ScrubberReportData scrubberReport)
scrubbedEntry
- the entry to perhaps create a cost share encumbrance for
public void setCostShareObjectCode(OriginEntryFull costShareEntry, OriginEntryInformation originEntry)
setCostShareObjectCode
in interface ScrubberProcess
costShareEntry
- GL Entry for cost shareoriginEntry
- Scrubbed GL Entry that this is based onprotected boolean generateOffset(OriginEntryInformation scrubbedEntry, ScrubberReportData scrubberReport)
scrubbedEntry
- entry to determine if an offset is needed for
protected void createOutputEntry(OriginEntryInformation entry, PrintStream ps) throws IOException
IOException
protected void createOutputEntry(String line, PrintStream ps) throws IOException
IOException
protected void addTransactionError(String errorMessage, String errorValue, int type)
errorMessage
- Error messageerrorValue
- Value that is in errortype
- Type of error (Fatal or Warning)protected void putTransactionError(Transaction s, String errorMessage, String errorValue, int type)
s
- a transaction that caused a scrubber errorerrorMessage
- the message of what caused the errorerrorValue
- the value in errortype
- the type of errorprotected boolean shouldScrubberGenerateOffsetsForDocType(String docTypeCode)
docTypeCode
- the document type code to check if it generates scrubber offsets
public Date calculateRunDate(Date currentDate)
calculateRunDate
in interface ScrubberProcess
currentDate
- the date the scrubber should report as having run on
protected boolean checkingBypassEntry(String financialBalanceTypeCode, String desc, DemergerReportData demergerReport)
protected String checkAndSetTransactionTypeCostShare(String financialBalanceTypeCode, String desc, String currentValidLine)
protected void generateScrubberTransactionListingReport(String documentNumber, String inputFileName)
documentNumber
- the document number of the GLCP documentprotected void generateScrubberBlankBalanceTypeCodeReport(String inputFileName)
protected void generateDemergerRemovedTransactionsReport(String errorFileName)
protected void handleTransactionError(Transaction errorTransaction, Message message)
protected void handleTransactionErrors(Transaction errorTransaction, List<Message> messages)
protected void handleEndOfScrubberReport(ScrubberReportData scrubberReport)
protected void handleDemergerSaveValidEntry(String entryString)
public void setBatchFileDirectoryName(String batchFileDirectoryName)
batchFileDirectoryName
- The batchFileDirectoryName to set.public String getTransferDescription()
public void setTransferDescription(String transferDescription)
transferDescription
- The transferDescription to set.public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
dateTimeService
- The dateTimeService to set.public static void setLOG(org.apache.log4j.Logger log)
log
- The lOG to set.public void setFlexibleOffsetAccountService(FlexibleOffsetAccountService flexibleOffsetAccountService)
flexibleOffsetAccountService
- The flexibleOffsetAccountService to set.public void setConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService configurationService)
configurationService
- The configurationService to set.public void setPersistenceService(org.kuali.rice.kns.service.PersistenceService persistenceService)
persistenceService
- The persistenceService to set.public void setScrubberValidator(ScrubberValidator scrubberValidator)
scrubberValidator
- The scrubberValidator to set.public void setAccountingCycleCachingService(AccountingCycleCachingService accountingCycleCachingService)
accountingCycleCachingService
- The accountingCycleCachingService to set.public void setScrubberReportWriterService(DocumentNumberAwareReportWriterService scrubberReportWriterService)
scrubberReportWriterService
- The scrubberReportWriterService to set.public void setScrubberLedgerReportWriterService(DocumentNumberAwareReportWriterService scrubberLedgerReportWriterService)
scrubberLedgerReportWriterService
- The scrubberLedgerReportWriterService to set.public void setScrubberListingReportWriterService(DocumentNumberAwareReportWriterService scrubberListingReportWriterService)
scrubberListingReportWriterService
- The scrubberListingReportWriterService to set.public void setScrubberBadBalanceListingReportWriterService(ReportWriterService scrubberBadBalanceListingReportWriterService)
scrubberBadBalanceListingReportWriterService
- The scrubberBadBalanceListingReportWriterService to set.public void setDemergerRemovedTransactionsListingReportWriterService(ReportWriterService demergerRemovedTransactionsListingReportWriterService)
demergerRemovedTransactionsListingReportWriterService
- The demergerRemovedTransactionsListingReportWriterService to set.public void setDemergerReportWriterService(ReportWriterService demergerReportWriterService)
demergerReportWriterService
- The demergerReportWriterService to set.public void setPreScrubberService(PreScrubberService preScrubberService)
preScrubberService
- The preScrubberService to set.public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
parameterService
- The parameterService to set.public void setRunDateService(RunDateService runDateService)
runDateService
- The runDateService to set.public FlexibleOffsetAccountService getFlexibleOffsetAccountService()
public org.kuali.rice.kns.service.DateTimeService getDateTimeService()
public org.kuali.rice.kns.service.KualiConfigurationService getConfigurationService()
public org.kuali.rice.kns.service.PersistenceService getPersistenceService()
public ScrubberValidator getScrubberValidator()
public RunDateService getRunDateService()
public AccountingCycleCachingService getAccountingCycleCachingService()
public DocumentNumberAwareReportWriterService getScrubberReportWriterService()
public DocumentNumberAwareReportWriterService getScrubberLedgerReportWriterService()
public DocumentNumberAwareReportWriterService getScrubberListingReportWriterService()
public ReportWriterService getScrubberBadBalanceListingReportWriterService()
public ReportWriterService getDemergerRemovedTransactionsListingReportWriterService()
public ReportWriterService getDemergerReportWriterService()
public PreScrubberService getPreScrubberService()
public org.kuali.rice.kns.service.ParameterService getParameterService()
public void setPreScrubberReportWriterService(DocumentNumberAwareReportWriterService preScrubberReportWriterService)
preScrubberReportWriterService
- The preScrubberReportWriterService to set.public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
businessObjectService
- The businessObjectService to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |