98. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/11/2019 10:54:11 AM Eastern Daylight 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.

98.1 Files compared

# Location File Last Modified
1 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\batchprocess AbstractDataProcessWorker.java Wed May 29 15:26:02 2019 UTC
2 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\batchprocess AbstractDataProcessWorker.java Mon Jun 10 19:30:04 2019 UTC

98.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 252
Changed 1 2
Inserted 0 0
Removed 0 0

98.3 Comparison options

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

98.4 Active regular expressions

No regular expressions were active.

98.5 Comparison detail

  1   /********* ********** ********** ********** ********** ********** *********
  2    * Copyrii ght 2006 V HA. All ri ghts reser ved
  3    ********* ********** ********** ********** ********** ********** *********/
  4  
  5   package go v.va.med.f w.batchpro cess;
  6  
  7   import org .apache.co mmons.lang .StringUti ls;
  8   import org .apache.co mmons.lang .Validate;
  9  
  10   import gov .va.med.cc ht.util.ES APIValidat ionType;
  11   import gov .va.med.cc ht.util.ES APIValidat or;
  12   import gov .va.med.fw .model.Ent ityKey;
  13   import gov .va.med.fw .model.Ent ityKeyFact ory;
  14   import gov .va.med.fw .model.bat chprocess. JobConfig;
  15   import gov .va.med.fw .model.bat chprocess. JobResult;
  16   import gov .va.med.fw .model.bat chprocess. JobStatus;
  17   import gov .va.med.fw .service.A bstractCom ponent;
  18  
  19   /**
  20    * Worker  implementa tion for A bstractDat aProcess i nstances t hat need p arallelism
  21    * (eg, pr ocessing J MS message s across a  cluster).
  22    * 
  23    * Created  Sep 21, 2 006 3:13:1 2 PM
  24    * 
  25    * @author   DNS     DN S
  26    */
  27   public abs tract clas s Abstract DataProces sWorker ex tends Abst ractCompon ent {
  28           pr ivate Proc essStatist icsHandler  processSt atisticsHa ndler;
  29           pr ivate Batc hProcessSe rvice batc hProcessSe rvice;
  30  
  31           pu blic final  void proc ess(DataPr ocessWorke rInput in)  {
  32                    if ( logger.isI nfoEnabled ())
  33                             logger .info("Pro cessing da ta for pro cess: " +  in.getProc essName()
  34                                               + " with a  payload c ount of: "  + in.getP ayloadCoun t()
  35                                               + " and a  total coun t of: " +  in.getTota lCount());
  36                    try  {
  37                             Entity Key jobRes ultKey = n ull;
  38                             if (in .getId() ! = null)
  39                                      jobResul tKey = Ent ityKeyFact ory.create EntityKey( in.getId() .toString( ),
  40                                                       Jo bResult.cl ass);
  41                             // 1)  verify if  should sti ll process  data
  42                             JobRes ult jobRes ult = batc hProcessSe rvice.getJ obResult(L ong.parseL ong(in.get Id().toStr ing()));
  43                             if (sh ouldProces sData(in,  jobResult) ) {
  44                                      // 2) pr ocess data
  45                                      ProcessS tatistics  workerStat s = proces sData(in.g etPayload( ));
  46                                      workerSt ats.setPro cessName(i n.getProce ssName());
  47                                      long job Id = Long. parseLong( in.getId() .toString( ));
  48                                      JobResul tData data  = batchPr ocessServi ce.saveAnd OverlayJob Result(job Id,
  49                                                       wo rkerStats,  in.getTot alCount()) ;
  50                                      processS tatistics( data);
  51                             }
  52                    } ca tch (Excep tion e) {
  53                             if (lo gger.isErr orEnabled( ))
  54                                      logger.e rror("Fail ed process ing data",  e);
  55                    }
  56           }
  57  
  58           pr otected fi nal void p rocessStat istics(Job ResultData  data) thr ows Except ion {
  59                    Proc essStatist ics jobSta ts = data. getProcess Statistics ();
  60                    JobR esult jobR esult = da ta.getJobR esult();
  61  
  62                    if ( JobStatus. CANCELLED. equals(job Result.get Status()))
  63                             jobSta ts.setWasI nterrupted (true);
  64  
  65                    if ( !JobStatus .IN_PROCES S.equals(j obResult.g etStatus() )) {
  66                             if (lo gger.isInf oEnabled() ) {
  67                                //F ix Fortify  Issues
  68                                      ESAPIVal idator.val idateStrin gInput(job Stats.toFo rmattedStr ing(), ESA PIValidati onType.Sch eduledJob_ Whitelist) ;
  69                                      
  70                                      logger.i nfo("Proce ssStatisti cs [" + jo bStats + " ]");
  71                             }        
  72                             if (pr ocessStati sticsHandl er != null ) { 
  73                                      JobConfi g config =  this.batc hProcessSe rvice.getJ obConfig(j obResult.g etName(),
  74                                                       jo bResult.ge tGroup());
  75                                      if (conf ig != null  && String Utils.isNo tBlank(con fig.getEma ilDistribu tionList() )) {
  76                                               processSta tisticsHan dler.proce ssStatisti csWithDyna micRecipie nts(jobSta ts,
  77                                                                conf ig.getEmai lsAsList() );
  78                                      } else {
  79                                               processSta tisticsHan dler.proce ssStatisti cs(jobStat s);
  80                                      }
  81                             }
  82  
  83                    }
  84           }
  85  
  86           pr otected bo olean shou ldProcessD ata(DataPr ocessWorke rInput in,  JobResult  currentJo bResult) {
  87                    retu rn JobStat us.IN_PROC ESS.getCod e().equals (currentJo bResult.ge tStatus(). getCode()) ;
  88           }
  89  
  90           //  TODO: cha nge this t o be prote cted
  91           //  for now,  keeping th is public  allows for  easy test ing of wor ker
  92           pu blic abstr act Proces sStatistic s processD ata(Object  o) throws  Exception ;
  93  
  94           /* *
  95            *  @return R eturns the  processSt atisticsHa ndler.
  96            * /
  97           pu blic Proce ssStatisti csHandler  getProcess Statistics Handler()  {
  98                    retu rn process Statistics Handler;
  99           }
  100  
  101           /* *
  102            *  @param pr ocessStati sticsHandl er
  103            *              The proc essStatist icsHandler  to set.
  104            * /
  105           pu blic void  setProcess Statistics Handler(Pr ocessStati sticsHandl er process Statistics Handler) {
  106                    this .processSt atisticsHa ndler = pr ocessStati sticsHandl er;
  107           }
  108  
  109           /* *
  110            *  @return R eturns the  batchProc essService .
  111            * /
  112           pu blic Batch ProcessSer vice getBa tchProcess Service()  {
  113                    retu rn batchPr ocessServi ce;
  114           }
  115  
  116           /* *
  117            *  @param ba tchProcess Service
  118            *              The batc hProcessSe rvice to s et.
  119            * /
  120           pu blic void  setBatchPr ocessServi ce(BatchPr ocessServi ce batchPr ocessServi ce) {
  121                    this .batchProc essService  = batchPr ocessServi ce;
  122           }
  123  
  124           pu blic void  afterPrope rtiesSet()  {
  125                    Vali date.notNu ll(this.ba tchProcess Service, " batchProce ssService  is require d");
  126           }
  127   }