Produced by Araxis Merge on 11/14/2017 6:57:20 AM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | cbs.zip\cbs\cbs\src\main\java\gov\va\cpss\job\loadbill | LoadBillJobExecutionListener.java | Thu Nov 9 14:19:52 2017 UTC |
| 2 | cbs.zip\cbs\cbs\src\main\java\gov\va\cpss\job\loadbill | LoadBillJobExecutionListener.java | Tue Nov 14 12:26:23 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 144 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.cpss. job.loadbi ll; | |
| 2 | ||
| 3 | import sta tic gov.va .cpss.job. CbssJobPro cessingCon stants.JOB _FAILURE_K EY; | |
| 4 | import sta tic gov.va .cpss.job. CbssJobPro cessingCon stants.JOB _FAILURE_M ESSAGE_KEY ; | |
| 5 | import sta tic gov.va .cpss.job. CbssJobPro cessingCon stants.REA D_FAILURE_ STATUS; | |
| 6 | import sta tic gov.va .cpss.job. loadbill.L oadBillPro cessingCon stants.PU_ HEADER_COM PLETE_KEY; | |
| 7 | ||
| 8 | import org .apache.lo g4j.Logger ; | |
| 9 | import org .springfra mework.bat ch.core.Ex itStatus; | |
| 10 | import org .springfra mework.bat ch.core.Jo bExecution ; | |
| 11 | import org .springfra mework.bat ch.core.Jo bExecution Listener; | |
| 12 | ||
| 13 | /** | |
| 14 | * Custom JobExecuti onListener used to p rocess cus tom exit s tatus to h andle | |
| 15 | * errors during Loa d Bill bat ch job exe cution. | |
| 16 | * | |
| 17 | * @author DN S BROWNL | |
| 18 | */ | |
| 19 | public cla ss LoadBil lJobExecut ionListene r implemen ts JobExec utionListe ner { | |
| 20 | ||
| 21 | pr ivate fina l Logger l istenerLog ger = Logg er.getLogg er(LoadBil lJobExecut ionListene r.class.ge tCanonical Name()); | |
| 22 | ||
| 23 | @O verride | |
| 24 | pu blic void beforeJob( JobExecuti on jobExec ution) { | |
| 25 | list enerLogger .info("Beg inning Job Execution "); | |
| 26 | } | |
| 27 | ||
| 28 | @O verride | |
| 29 | pu blic void afterJob(J obExecutio n jobExecu tion) { | |
| 30 | ||
| 31 | list enerLogger .info("Aft er Job"); | |
| 32 | ||
| 33 | // S ystem fail ure takes precedence over data error. | |
| 34 | if ( jobExecuti on.getExec utionConte xt().conta insKey(JOB _FAILURE_K EY)) { | |
| 35 | ||
| 36 | final String exi tStatus = jobExecuti on.getExec utionConte xt().getSt ring(JOB_F AILURE_KEY ); | |
| 37 | ||
| 38 | if (jo bExecution .getExecut ionContext ().contain sKey(JOB_F AILURE_MES SAGE_KEY)) { | |
| 39 | ||
| 40 | final St ring exitM essage = j obExecutio n.getExecu tionContex t().getStr ing(JOB_FA ILURE_MESS AGE_KEY); | |
| 41 | ||
| 42 | listener Logger.err or("JobFai lure detec ted, setti ng exit st atus (" + exitStatus + "): " + exitMessa ge); | |
| 43 | ||
| 44 | jobExecu tion.setEx itStatus(n ew ExitSta tus(exitSt atus, exit Message)); | |
| 45 | } else { | |
| 46 | ||
| 47 | listener Logger.err or("JobFai lure detec ted, setti ng exit st atus (" + exitStatus + ")"); | |
| 48 | ||
| 49 | jobExecu tion.setEx itStatus(n ew ExitSta tus(exitSt atus)); | |
| 50 | } | |
| 51 | ||
| 52 | } el se if (job Execution. getExecuti onContext( ).contains Key(PU_HEA DER_COMPLE TE_KEY)) { | |
| 53 | ||
| 54 | final String com pleteHeade r = jobExe cution.get ExecutionC ontext().g etString(P U_HEADER_C OMPLETE_KE Y); | |
| 55 | ||
| 56 | if (!B oolean.val ueOf(compl eteHeader) ) { | |
| 57 | ||
| 58 | final St ring exitS tatus = RE AD_FAILURE _STATUS; | |
| 59 | ||
| 60 | final St ring exitM essage = " Incomplete header fo und"; | |
| 61 | ||
| 62 | listener Logger.err or("JobFai lure detec ted, setti ng exit st atus (" + exitStatus + "): " + exitMessa ge); | |
| 63 | ||
| 64 | jobExecu tion.setEx itStatus(n ew ExitSta tus(exitSt atus, exit Message)); | |
| 65 | } else { | |
| 66 | jobExecu tion.setEx itStatus(E xitStatus. COMPLETED) ; | |
| 67 | } | |
| 68 | } | |
| 69 | ||
| 70 | list enerLogger .info("End ing Job Ex ecution"); | |
| 71 | } | |
| 72 | ||
| 73 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.