38. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 9/24/2019 1:37:43 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.

38.1 Files compared

# Location File Last Modified
1 PCL-5_v1_build_8.zip\v1_build 8\Unredacted\spp_mha_forms-development.zip\spp_mha_forms-development\Javascript\Java\src\main\java\com\va\med\mha\vista\connection VistaConnection.java Thu Aug 1 16:20:45 2019 UTC
2 PCL-5_v1_build_8.zip\v1_build 8\Unredacted\spp_mha_forms-development.zip\spp_mha_forms-development\Javascript\Java\src\main\java\com\va\med\mha\vista\connection VistaConnection.java Mon Sep 23 14:39:55 2019 UTC

38.2 Comparison summary

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

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

38.4 Active regular expressions

No regular expressions were active.

38.5 Comparison detail

  1   package co m.va.med.m ha.vista.c onnection;
  2  
  3   import com .va.med.mh a.util.cal lback.MhaW ebCallback HandlerWra pper;
  4   import gov .va.med.ex ception.Fo undationsE xception;
  5   import gov .va.med.vi stalink.ad apter.cci. VistaLinkC onnection;
  6   import gov .va.med.vi stalink.ad apter.cci. VistaLinkC onnectionF actory;
  7   import gov .va.med.vi stalink.ad apter.spi. VistaLinkC onnectionI mpl;
  8   import gov .va.med.vi stalink.ad apter.spi. VistaLinkM anagedConn ection;
  9   import gov .va.med.vi stalink.rp c.RpcReque st;
  10   import gov .va.med.vi stalink.rp c.RpcRespo nse;
  11   import gov .va.med.vi stalink.se curity.Vis taKernelPr incipalImp l;
  12   import gov .va.med.vi stalink.se curity.Vis taLoginMod ule;
  13  
  14   import jav ax.resourc e.Resource Exception;
  15   import jav ax.securit y.auth.Sub ject;
  16   import jav ax.validat ion.constr aints.NotN ull;
  17   import jav a.util.Has hMap;
  18   import jav a.util.Has htable;
  19   import jav a.util.Map ;
  20   import jav a.util.log ging.Logge r;
  21  
  22   /** These  are the ob jects in t he VistaCo nnectionSe rvice that  are ignit ed/signed- in
  23    * on serv er start u p. There i s 1 full V istaConnec tion per d ivision th at has alr eady
  24    * been co nnected an d signed i n. See Sta rtupInit.j ava for mo re details  */
  25   public cla ss VistaCo nnection {
  26  
  27       privat e final Lo gger LOGGE R = Logger .getLogger (VistaConn ection.cla ss.getName ());
  28  
  29       privat e boolean  connected;
  30  
  31       privat e VistaLog inModule l oginModule ;
  32  
  33       privat e Subject  subject;
  34  
  35       privat e VistaKer nelPrincip alImpl use rPrincipal ;
  36  
  37       privat e String d ivisionNam e;
  38  
  39       privat e String c onnectionN ame;
  40  
  41       privat e int stat ionNumber;
  42  
  43       privat e String i pAddress;
  44  
  45       privat e String p ort;
  46  
  47       privat e String a ccessPin;
  48  
  49       privat e String v erifyPin;
  50  
  51       privat e VistaLin kConnectio n vistaLin kConnectio n;
  52  
  53       privat e boolean  signedIn;
  54  
  55       public  VistaConn ection() {
  56           co nnected =  false;
  57           lo ginModule  = new Vist aLoginModu le();
  58           su bject = ne w Subject( );
  59           si gnedIn = f alse;
  60           di visionName  = "";
  61       }
  62  
  63       privat e boolean  connect()  {
  64           Ma p<String,  String> ja asOptions  = new Hash Map<String , String>( );
  65           Ma p<String,  String> ja asSharedSt ate = new  HashMap<St ring, Stri ng>(); //  Needed for  the login Module con structor
  66  
  67           ja asOptions. put(VistaL oginModule .SERVER_AD DRESS_KEY,  this.ipAd dress);
  68           ja asOptions. put(VistaL oginModule .SERVER_PO RT_KEY, th is.port);
  69  
  70           ja asOptions. put(VistaL oginModule .SERVER_AD DRESS_KEY_ V1, this.i pAddress);
  71           ja asOptions. put(VistaL oginModule .SERVER_PO RT_KEY_V1,  this.port );
  72  
  73           Mh aWebCallba ckHandlerW rapper cal lBackHandl er = new M haWebCallb ackHandler Wrapper(ac cessPin, v erifyPin,  "");
  74  
  75  
  76           lo ginModule. initialize (subject,  callBackHa ndler.getC allBackHan dlerInstan ce(), jaas SharedStat e,
  77                    jaas Options);
  78           tr y {
  79                loginMod ule.login( );
  80                connecte d = true;
  81                loginMod ule.commit ();
  82  
  83           }  catch (Exc eption e)  {
  84                LOGGER.w arning("Fa iled to co nnect "+ t his.ipAddr ess + ":"  + this.por t +" to Vi staLink lo ginModule. login() in  VistaConn ection.jav a");
  85                System.o ut.println (e);
  86           }
  87           re turn this. connected;
  88       }
  89  
  90       /** In itiates a  connection  to VistaL ink for a  dedicated  Vista conn ection */
  91       public  boolean c onnect(Str ing ipStri ng, String  portStrin g, String  accessPin,  String ve rifyPin) {
  92           th is.ipAddre ss = ipStr ing;
  93           th is.port =  portString ;
  94           th is.accessP in = acces sPin;
  95           th is.verifyP in = verif yPin;
  96           re turn this. connect();
  97       }
  98  
  99       public  boolean s ignIn() {
  100           tr y {
  101                if (this .connected ) {
  102                    Hash table<Stri ng, String > response Data = new  Hashtable <>();
  103                      responseDa ta.put("KE Y_DOMAIN_N AME", " UR L           ");    // 0
  104                    resp onseData.p ut("KEY_LA NGUAGE", " "); // 1
  105                    resp onseData.p ut("KEY_NA ME_PREFIX" , ""); //  2
  106                    resp onseData.p ut("KEY_DI VISION_IEN ", "21789" ); // 3
  107                    resp onseData.p ut("KEY_NA ME_DISPLAY ", "Jason  Wilson");  // 4
  108                    resp onseData.p ut("KEY_DU Z", "1095" ); // 5
  109                    resp onseData.p ut("KEY_SE RVICE_SECT ION", "INF ORMATION S YSTEMS CEN TER"); //  6
  110                    resp onseData.p ut("KEY_NA ME_MIDDLE" , ""); //  7
  111                    resp onseData.p ut("KEY_NA ME_FAMILYL AST", "WIL SON"); //  8
  112                    resp onseData.p ut("KEY_NA ME_NEWPERS ON01", "WI LSON,JASON "); // 9
  113                    resp onseData.p ut("KEY_TI TLE", "");  // 10
  114                    resp onseData.p ut("KEY_DT IME", "400 0"); // 11
  115                    resp onseData.p ut("KEY_NA ME_SUFFIX" , ""); //  12
  116                    resp onseData.p ut("KEY_NA ME_DEGREE" , ""); //  13
  117                    resp onseData.p ut("KEY_DI VISION_STA TION_NUMBE R", "960") ; // 14
  118                    resp onseData.p ut("KEY_DI VISION_STA TION_NAME" , "SPPNXT  FO-SLC");  // 15
  119                    resp onseData.p ut("KEY_NA ME_GIVENFI RST", "JAS ON"); // 1 6
  120                    resp onseData.p ut("KEY_VP ID", "");  // 17
  121   //                 th is.userPri ncipal = n ew VistaKe rnelPrinci palImpl(re sponseData .getUserDe mographics Hashtable( ));
  122                    this .userPrinc ipal = Vis taKernelPr incipalImp l.getKerne lPrincipal (this.subj ect);
  123                    // s tart sessi on
  124                    this .signedIn  = true;
  125                    this .setDivisi onName();
  126                    this .setDivisi onNumber() ;
  127                    this .setConnec tionName() ;
  128                    this .setVistaL inkConnect ion();
  129                    retu rn true;
  130                }
  131           }  catch(Foun dationsExc eption fe)  {
  132                System.o ut.println (fe);
  133           }
  134           re turn  fals e;
  135       }
  136  
  137       // Log s in, sets  variables  for the V istaConnec tion objec t, then cl oses the c onnection
  138       public  boolean s etConnecti onAndClose (String ip Address, S tring port , String a ccessPin,  String ver ifyPin) {
  139           re turn this. connect(ip Address, p ort, acces sPin, veri fyPin) &&  this.signI n() && thi s.closeCon nection();
  140       }
  141  
  142       /** Ex ecute RPC  directly f rom the co nnection
  143        * Thi s is a sta te-less co nnection * */
  144       public  RpcRespon se execute RPC(RpcReq uest rpcRe quest) {
  145           Rp cResponse  response =  null;
  146           bo olean conn ected = th is.connect AndSignIn( );
  147           if (connected  && this.v istaLinkCo nnection ! = null) {
  148                try {
  149                    resp onse = thi s.vistaLin kConnectio n.executeR PC(rpcRequ est);
  150                }
  151                catch(Fo undationsE xception f e) {
  152                         LOGGER.war ning("Coul d not exec ute RCP at  : " + "\n " + fe);
  153                    }
  154           }
  155           th is.closeCo nnection() ;
  156           re turn respo nse;
  157       }
  158  
  159       privat e boolean  connectAnd SignIn() {
  160           re turn this. connect()  && this.si gnIn();
  161       }
  162  
  163       privat e void res et() {
  164           co nnected =  false;
  165           lo ginModule  = new Vist aLoginModu le();
  166           su bject = ne w Subject( );
  167           si gnedIn = f alse;
  168           us erPrincipa l = null;
  169           vi staLinkCon nection =  null;
  170       }
  171  
  172       privat e boolean  closeConne ction() {
  173           if (this.vist aLinkConne ction != n ull) {
  174                try {
  175                    this .vistaLink Connection .close();
  176                    this .signedIn  = false;
  177                    this .reset();
  178                    retu rn true;
  179                } catch  (ResourceE xception r e) {
  180                    LOGG ER.warning ("Could no t close Vi staLinkCon nection at  " + this. stationNum ber);
  181                }
  182           }
  183           re turn false ;
  184       }
  185  
  186       privat e boolean  hasRequire dInfo() {
  187           re turn this. divisionNa me != null  && this.s tationNumb er > -1;
  188       }
  189  
  190       public  String ge tDivisionN ame() {
  191           re turn divis ionName;
  192       }
  193  
  194       /**Par ses the us erPrincipa l as a str ing to get  the full  division n ame with n umber **/
  195       privat e void set DivisionNa me() {
  196           St ring divNa me = "";
  197           tr y {
  198                divName  = this.use rPrincipal .toString( ).substrin g(this.use rPrincipal .toString( ).indexOf( "Division: ") + 10);
  199                divName  = divName. substring( 0, divName .indexOf("  Timeout:" ));
  200           }  catch(Exce ption e) {
  201                LOGGER.w arning("Co uld not ex tract divi son name f rom connec tion: " +  this.userP rincipal.t oString()
  202                         + "\n" + e );
  203           }
  204           th is.divisio nName = di vName;
  205       }
  206  
  207       public  String ge tConnectio nName() {
  208           re turn conne ctionName;
  209       }
  210  
  211       /**Par ses the us erPrincipa l as a str ing to get  the full  division n ame with n umber **/
  212       privat e void set Connection Name() {
  213           St ring conne ctionName  = "";
  214           tr y {
  215                connecti onName = t his.userPr incipal.to String().s ubstring(t his.userPr incipal.to String().i ndexOf("Na me:") + 7) ;
  216                connecti onName = c onnectionN ame.substr ing(0, con nectionNam e.indexOf( " Division :"));
  217           }  catch(Exce ption e) {
  218                LOGGER.w arning("Co uld not ex tract conn ection nam e from con nection: "  + this.us erPrincipa l.toString ()
  219                         + "\n" + e );
  220           }
  221           th is.connect ionName =  connection Name;
  222       }
  223  
  224       privat e void set VistaLinkC onnection( ) {
  225           if (userPrinc ipal != nu ll) {
  226                this.vis taLinkConn ection = t his.userPr incipal.ge tAuthentic atedConnec tion();
  227           }
  228       }
  229  
  230       public  VistaLink Connection  getVistaL inkConnect ion() {
  231           re turn vista LinkConnec tion;
  232       }
  233  
  234       public  int getSt ationNumbe r() {
  235           re turn stati onNumber;
  236       }
  237  
  238       public  void setD ivisionNum ber() {
  239           th is.station Number = I nteger.par seInt(getS tationNumF romName(th is.divisio nName));
  240       }
  241  
  242       public  static St ring getSt ationNumFr omName(Str ing name)  {
  243           re turn name. replaceAll ("[\\D]",  "");
  244       }
  245  
  246       public  static bo olean stat ionStringI sValid(Str ing statio nStr) {
  247           tr y {
  248                int stat ionInt;
  249                stationI nt = Integ er.parseIn t(stationS tr);
  250                if(stati onInt >= 0  && statio nInt <= 99 9) {
  251                    retu rn true;
  252                }
  253           }  catch (Num berFormatE xception n fe) {
  254                return f alse;
  255           }
  256           re turn false ;
  257       }
  258  
  259       public  boolean i sSignedIn( ) {
  260           re turn signe dIn;
  261       }
  262  
  263       public  boolean i sConnected () {
  264           re turn conne cted;
  265       }
  266  
  267       public  VistaKern elPrincipa lImpl getU serPrincip al() {
  268           re turn  user Principal;
  269       }
  270  
  271       public  VistaLogi nModule ge tLoginModu le() {
  272           re turn login Module;
  273       }
  274  
  275       public  Subject g etSubject( ) {
  276           re turn subje ct;
  277       }
  278  
  279       public  String ge tIpAddress () {
  280           re turn ipAdd ress;
  281       }
  282  
  283       public  String ge tPort() {
  284           re turn port;
  285       }
  286  
  287       public  String ge tAccessPin () {
  288           re turn acces sPin;
  289       }
  290  
  291       public  String ge tVerifyPin () {
  292           re turn verif yPin;
  293       }
  294   }