84. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/10/2017 1:01:45 PM Central 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.

84.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\ImagingVistaRealm\main\src\java\gov\va\med\imaging\tomcat\vistarealm SpecificRealmAuthentication.java Thu Jun 29 17:23:03 2017 UTC
2 C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\ImagingVistaRealm\main\src\java\gov\va\med\imaging\tomcat\vistarealm SpecificRealmAuthentication.java Thu Jul 6 15:03:44 2017 UTC

84.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 276
Changed 2 4
Inserted 0 0
Removed 0 0

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

84.4 Active regular expressions

No regular expressions were active.

84.5 Comparison detail

  1   /**
  2    * 
  3     Package:  MAG - Vis tA Imaging
  4     WARNING:  Per VHA D irective 2 004-038, t his routin e should n ot be modi fied.
  5     Date Cre ated: Feb  15, 2012
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:          
WERFEJ
  8     Descript ion: 
  9  
  10           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  11           ;;  Property  of the US  Government .
  12           ;;  No permis sion to co py or redi stribute t his softwa re is give n.
  13           ;;  Use of un released v ersions of  this soft ware requi res the us er
  14           ;;   to execu te a writt en test ag reement wi th the Vis tA Imaging
  15           ;;   Developm ent Office  of the De partment o f Veterans  Affairs,
  16           ;;   telephon e (301) 73 4-0100.
  17           ;;
  18           ;;  The Food  and Drug A dministrat ion classi fies this  software a s
  19           ;;  a Class I I medical  device.  A s such, it  may not b e changed
  20           ;;  in any wa y.  Modifi cations to  this soft ware may r esult in a n
  21           ;;  adulterat ed medical  device un der 21CFR8 20, the us e of which
  22           ;;  is consid ered to be  a violati on of US F ederal Sta tutes.
  23           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  24  
  25    */
  26   package go v.va.med.i maging.tom cat.vistar ealm;
  27  
  28   import jav a.security .Principal ;
  29   import jav a.util.Arr ayList;
  30   import jav a.util.Has hMap;
  31   import jav a.util.Lis t;
  32   import jav ax.managem ent.*;
  33  
  34   import org .apache.ca talina.Con tainer;
  35   import org .apache.ca talina.Rea lm;
  36   import org .apache.ca talina.Ser ver;
  37   import org .apache.ca talina.Ser vice;
  38   import org .apache.ca talina.cor e.Standard Server;
  39   import org .apache.lo g4j.Logger ;
  40  
  41   /**
  42    * @author         
WERFEJ
  43    *
  44    */
  45   public cla ss Specifi cRealmAuth entication
  46   {
  47           pr ivate fina l static L ogger logg er = Logge r.getLogge r(Specific RealmAuthe ntication. class);
  48           pr ivate stat ic List<Re alm> realm s = null;
  49           
  50           pr ivate sync hronized s tatic List <Realm> ge tRealms()
  51           {
  52                    if(r ealms == n ull)
  53                    {
  54                             realms  = new Arr ayList<Rea lm>();
  55                    
  56                             //Stan dardServer  server =  (StandardS erver)Serv erFactory. getServer( );
  57                             Standa rdServer s erver = ge tServer();
  58                             if (se rver != nu ll)
  59                             {
  60                             for (S ervice ser vice : ser ver.findSe rvices())
  61                             {
  62                                      addVista RealmsToLi st(service );
  63                             }
  64                             }
  65                    }
  66                    retu rn realms;
  67           }
  68           
  69  
  70           pu blic stati c Standard Server get Server()
  71           {
  72                    try
  73                    {
  74                             MBeanS erver mBea nServer =  MBeanServe rFactory.f indMBeanSe rver(null) .get(0);
  75                             Object Name name  = new Obje ctName("Ca talina","t ype","Serv er");
  76                             return  (Standard Server) mB eanServer. getAttribu te(name, " managedRes ource");
  77                    }
  78                    catc h (Malform edObjectNa meExceptio n e)
  79                    {
  80                             return  null;
  81                    }
  82                    catc h (MBeanEx ception e)
  83                    {
  84                             return  null;
  85                    }
  86                    catc h (Attribu teNotFound Exception  e)
  87                    {
  88                             return  null;
  89                    }
  90                    catc h (Instanc eNotFoundE xception e )
  91                    {
  92                             return  null;
  93                    }
  94                    catc h (Reflect ionExcepti on e)
  95                    {
  96                             return  null;
  97                    }
  98           
  99           }
  100           
  101           pu blic stati c Principa l authenti cate(Class <? extends  Realm> se archRealm,  String ac cessCode,  String ver ifyCode)
  102           {
  103                    for( Realm r :  getRealms( ))
  104                    {
  105                             if(r.g etClass()  == searchR ealm)
  106                             {
  107                                      return r .authentic ate(access Code, veri fyCode);
  108                             }
  109                    }
  110                    retu rn null;
  111           }
  112           
  113           pr ivate stat ic void ad dVistaReal msToList(S ervice ser vice)
  114           {
  115                    recu rseContain ers(servic e.getConta iner());
  116           }
  117  
  118           pr ivate stat ic void re curseConta iners(Cont ainer cont ainer)
  119           {
  120                    try
  121                    {
  122                             for (C ontainer c hildContai ner : cont ainer.find Children() )
  123                             {
  124                                      recurseC ontainers( childConta iner);
  125                             }
  126           
  127                             if (co ntainer in stanceof o rg.apache. catalina.c ore.Standa rdHost ||
  128                                      containe r instance of org.apa che.catali na.core.St andardEngi ne ||
  129                                      containe r instance of org.apa che.catali na.core.St andardServ ice)
  130                                      return;
  131                             
  132                             if(con tainer.get Realm() !=  null)
  133                                      realms.a dd(contain er.getReal m());
  134                    }
  135                    catc h (Throwab le t)
  136                    {
  137                             logger .error(t.g etMessage( ), t);
  138                    }
  139           }
  140   }