4253. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/9/2017 3:51:24 PM 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.

4253.1 Files compared

# Location File Last Modified
1 Fri Jun 9 19:51:24 2017 UTC
2 eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-web\src\main\java\gov\va\nvap\web\admin\reports ServiceAuditReport.java Fri Apr 21 20:03:30 2017 UTC

4253.2 Comparison summary

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

4253.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

4253.4 Active regular expressions

No regular expressions were active.

4253.5 Comparison detail

        1   /*
        2    * To chan ge this li cense head er, choose  License H eaders in  Project Pr operties.
        3    * To chan ge this te mplate fil e, choose  Tools | Te mplates
        4    * and ope n the temp late in th e editor.
        5    */
        6   package go v.va.nvap. web.admin. reports;
        7  
        8   import gov .va.nvap.s ervice.aut h.ServiceA udit;
        9   import gov .va.nvap.s ervice.aut h.ServiceA uditDAO;
        10   import jav a.io.IOExc eption;
        11   import jav a.io.Strin gWriter;
        12   import jav a.text.Par seExceptio n;
        13   import jav a.text.Sim pleDateFor mat;
        14   import jav a.util.Arr ayList;
        15   import jav a.util.Dat e;
        16   import jav a.util.Has hMap;
        17   import jav a.util.Lis t;
        18   import jav a.util.log ging.Level ;
        19   import jav a.util.log ging.Logge r;
        20   import jav ax.servlet .ServletEx ception;
        21   import jav ax.servlet .http.Http ServletReq uest;
        22   import jav ax.servlet .http.Http ServletRes ponse;
        23   import jav ax.servlet .http.Http Session;
        24   import org .json.JSON Exception;
        25   import org .json.JSON Object;
        26  
        27   /**
        28    *
        29    * @author  Johann So nnenberg
        30    */
        31   public cla ss Service AuditRepor t extends  gov.va.nva p.web.app. ResponseDi spatcherHt tpServlet
        32   {
        33       
        34       //@EJB (beanInter face = Ser viceAuditD AO.class,  mappedName  = "Servic eAuditDAO" )
        35       //Serv iceAuditDA O serviceA uditDAO;
        36       
        37       public  ServiceAu ditDAO get ServiceAud itDAO()
        38       {
        39           re turn this. getBean("S erviceAudi tDAO", Ser viceAuditD AO.class);
        40       }
        41       
        42       public  void getC allsByWebS ervice(Htt pServletRe quest requ est, HttpS ervletResp onse respo nse) throw s ServletE xception,  IOExceptio
        43       {
        44           //  call done  via ajax  to get the  distinct  calls (met hods) by a  web servi ce. 
        45           
        46           fi nal HttpSe ssion sess ion = requ est.getSes sion(false );
        47           
        48           fi nal String  webservic e = reques t.getParam eter("webs ervice");
        49           
        50           Li st<String>  calls = t his.getSer viceAuditD AO().findD istinctCal lsByWebSer vice(webse rvice);
        51           
        52           se ssion.setA ttribute(" calls", ca lls);
        53           
        54           th is.forward (request,  response,  "getCallsB yWebServic e");
        55       }
        56       
        57       public  void doSe arch(HttpS ervletRequ est reques t, HttpSer vletRespon se respons e) throws  ServletExc eption, IO Exception,  ParseExce ption 
        58       {
        59           fi nal HttpSe ssion sess ion = requ est.getSes sion(false );
        60           
        61           // get parame ters from  the url
        62           fi nal String  webservic e = reques t.getParam eter("webs ervice");
        63           fi nal String  method =  request.ge tParameter ("method") ;
        64           fi nal String  authorize d = reques t.getParam eter("auth orized");
        65           fi nal String  success =  request.g etParamete r("success ");
        66           fi nal String  duration  = request. getParamet er("durati on");
        67           fi nal String  startDate  = request .getParame ter("start Date");
        68           fi nal String  endDate =  request.g etParamete r("endDate ");
        69           fi nal String  maxRows =  request.g etParamete r("length" );
        70           fi nal String  startRow  = request. getParamet er("start" );
        71           fi nal String  useJSON =  request.g etParamete r("useJSON ");
        72           fi nal String  draw = re quest.getP arameter(" draw");
        73           fi nal String  sortBy =  request.ge tParameter ("order[0] [column]") ;
        74           fi nal String  sortOrder  = request .getParame ter("order [0][dir]") ;
        75           
        76           // do the act ual search
        77           Ha shMap hm =  this.getS erviceAudi tDAO().get ServiceAud itByWebSer viceAndCal l(webservi ce, method , authoriz ed, succes s, duratio n, startDa te, endDat e, Integer .parseInt( maxRows),  Integer.pa rseInt(sta rtRow), so rtBy, sort Order);
        78           hm .put("draw ", draw);
        79           
        80           se ssion.setA ttribute(" webservice ", webserv ice);
        81           se ssion.setA ttribute(" method", m ethod);
        82           
        83           // create JSO N here...
        84           se ssion.setA ttribute(" results",  encodeServ iceAuditIn toJSON(hm) );
        85           th is.forward (request,  response,  "searchRes ultsJSON") ;
        86       }
        87       
        88       @Overr ide
        89       protec ted void u nspecified (HttpServl etRequest  request, H ttpServlet Response r esponse) t hrows Serv letExcepti on, IOExce ption 
        90       {
        91           // this is th e search f orm
        92           
        93           // get inform ation for  dropdowns
        94           Li st<String>  webservic es = this. getService AuditDAO() .findDisti nctWebServ ices();
        95           
        96           fi nal HttpSe ssion sess ion = requ est.getSes sion(false );
        97                    sess ion.setAtt ribute("we bservices" , webservi ces);
        98           
        99           th is.forward (request,  response,  "searchFor m");
        100       }   
        101       
        102       privat e String e ncodeServi ceAuditInt oJSON(Hash Map result s) throws  ParseExcep tion 
        103       {
        104           tr y {
        105                StringWr iter json  = new Stri ngWriter() ;
        106                JSONObje ct obj = n ew JSONObj ect();
        107                Long cou nt = (Long ) results. get("count ");
        108                List<Ser viceAudit>  serviceAu dits = (Li st<Service Audit>) re sults.get( "results") ;
        109                Integer  draw = Int eger.parse Int( (Stri ng) result s.get("dra w"));
        110                
        111                obj.put( "draw", dr aw);
        112                obj.put( "recordsTo tal", coun t);
        113                obj.put( "recordsFi ltered", c ount);
        114                
        115                List<Lis t> data =  new ArrayL ist<List>( ); //overa rching "da ta"
        116                
        117                for (Ser viceAudit  sa : servi ceAudits)  {
        118                    List <String> d ataItem =  new ArrayL ist<String >(); //eac h "row"
        119                    data Item.add(s a.getWebSe rvice());
        120                    data Item.add(s a.getCall( ));
        121                    
        122                    Simp leDateForm at dt = ne w SimpleDa teFormat(" yyyy-MM-dd  kk:mm:ss. S");
        123                    Date  date = dt .parse(sa. getEventDa te().toStr ing());
        124                    Simp leDateForm at finalDa te = new S impleDateF ormat("MM/ dd/yyyy hh :mm:ss a") ;
        125                    
        126                    data Item.add(f inalDate.f ormat(date ));
        127                    data Item.add(s a.getIp()) ;
        128                    data Item.add(s a.getCN()) ;
        129                    data Item.add(s a.getAutho rized() ?  "Yes" : "N o");
        130                    data Item.add(s a.getSucce ss() == nu ll ? "Not  Audited" :  sa.getSuc cess() ==  1 ? "Yes"  : "No");
        131                    data Item.add(s a.getDurat ion() == n ull ? "Not  Audited"  : sa.getDu ration().t oString()) ;
        132                    
        133                    data .add(dataI tem);
        134                }
        135                
        136                obj.put( "data", da ta);
        137                
        138                obj.writ e(json);
        139                
        140                return j son.toStri ng();
        141           }  catch (JSO NException  ex) {
        142                Logger.g etLogger(S erviceAudi tReport.cl ass.getNam e()).log(L evel.SEVER E, null, e x);
        143           }
        144           
        145           re turn "";
        146       }
        147   }