Produced by Araxis Merge on 4/2/2019 9:48:11 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.
# | Location | File | Last Modified |
---|---|---|---|
1 | JLV_JLV 2_7_2_0_0.zip\JLV_Src\JLV\grails-app\services\jlv | VixService.groovy | Wed Mar 20 21:44:06 2019 UTC |
2 | JLV_JLV 2_7_2_0_0.zip\JLV_Src\JLV\grails-app\services\jlv | VixService.groovy | Tue Apr 2 00:51:33 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 172 |
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 jl v | |
2 | ||
3 | import gov .va.med.co mmon.VixSe rviceExcep tion | |
4 | import gro ovyx.net.h ttp.Conten tType | |
5 | import gro ovyx.net.h ttp.HTTPBu ilder | |
6 | import gro ovyx.net.h ttp.Method | |
7 | import org .apache.co mmons.coll ections4.C ollectionU tils | |
8 | import org .apache.co mmons.lang 3.StringUt ils | |
9 | ||
10 | import jav a.util.con current.Co ncurrentHa shMap | |
11 | ||
12 | class VixS ervice { | |
13 | ||
14 | def ap pConfig | |
15 | ||
16 | privat e static C oncurrentH ashMap<Str ing, Strin g> vixEndp ointCache = new Conc urrentHash Map<>(); | |
17 | ||
18 | def is Valid(Stri ng endpoin t){ | |
19 | ||
20 | if (appConfig .isVixVali dationBypa ss()){ | |
21 | return t rue | |
22 | } | |
23 | // endpoint = "https:// 52.1.53.59 /blah/blah /blah"; | |
24 | //endpoint = "https: / DNS . URL /vix/viewe r/loader?C ontextId=R PT%5eCPRS% 5e7178910% 5eRA%5e682 8886.8261- 1%5e49%5eC HYSQA260%5 e%5e%5e%5e %5e%5e1&Si teNumber=9 94&Patient ICN=100868 9559V85913 4&Security Token=MjAx Ny0xMi0wOF QwNjowMDow MC4wMDAwMD AwWnx6V3JL dmJCSGo1OX pDVHhoNWY3 aEh2aW9rUm dLSnFNMEZs QWtXQXRtUW N6blZZSllP VWxiMGxLdF hmTEhtX0Vu Q2RQcjItV1 hsY0xDbTY1 UmdkbWN6dX JGbVdlU29j Z1FBQkRlSm xjTG9MSnBG N3NfX1ROSn EzdWlLcDU0 NVhJMGl3b1 lULXk0cjl0 VW1qRmlSZn g5ZkE9PXw1 MjA3MzY1Mz N8MzhmOTk4 NDYtMDJkOS 00ZWE5LWE0 OWMtYjZjMm I1ZGRkYWI0 fFkwVGtVOC 8xOWVieXhO UXd4TklqcG JVZHY2cG5L S1hMNm9XS2 82UmJzR1lv VlZFbXp2M3 JFL0p4Q0gv Y2VXUXUrak Zkb01CNHp6 c0I0MW9oQV FMRkpqNW5Q UWNOYktTST BaaHZMRVJs SVpjPQ%3d% 3d&AuthSit eNumber=99 4&Flags=PS TATE^ESIGN ATURE" | |
25 | ||
26 | tr y { | |
27 | ||
28 | endpoint = endpoin t.replace( "^","%5E") | |
29 | endpoint = endpoin t.replace( " ","%20") | |
30 | ||
31 | URI uri = new URI( endpoint) | |
32 | String d omain = "" | |
33 | ||
34 | if(uri ! = null){ | |
35 | doma in = uri.g etHost() | |
36 | } | |
37 | ||
38 | if(Strin gUtils.isN otEmpty(do main)){ | |
39 | if(v ixEndpoint Cache.cont ainsKey(do main)){ | |
40 | return tru e | |
41 | } el se { | |
42 | populateVi xEndpointC ache() | |
43 | return vix EndpointCa che.contai nsKey(doma in) | |
44 | } | |
45 | } else { | |
46 | //no domain in cluded...s o this is a relative link | |
47 | retu rn true | |
48 | } | |
49 | } catch (URI SyntaxExce ption e) { | |
50 | log.erro r("Invalid URL detec ted. ", e) | |
51 | return f alse | |
52 | } catch (Con nectExcept ion e){ | |
53 | log.erro r("Error c onnecting to VIX val idation en dpoint. ", e) | |
54 | return t rue | |
55 | } catch (Exc eption e){ | |
56 | log.erro r("Error c onnecting to VIX val idation en dpoint. ", e) | |
57 | return t rue | |
58 | } | |
59 | ||
60 | ||
61 | ||
62 | } | |
63 | ||
64 | def po pulateVixE ndpointCac he() { | |
65 | de f http = n ew HTTPBui lder(appCo nfig.getVi xEndpoint( )) | |
66 | de f servers | |
67 | ||
68 | ht tp.request (Method.GE T, Content Type.XML) { req -> | |
69 | response .'200' = { resp, rea der -> | |
70 | serv ers = read er.'**'.fi ndAll{it.n ame() == ' server' }* .text() | |
71 | ||
72 | if(s ervers != null && Co llectionUt ils.isNotE mpty(serve rs)) { | |
73 | for (Strin g server : servers) { | |
74 | vixEnd pointCache .putIfAbse nt(server, server) | |
75 | } | |
76 | } | |
77 | } | |
78 | ||
79 | response .failure = { resp -> | |
80 | thro w new VixS erviceExce ption("The re was an error retr ieving Vix endpoints ") | |
81 | } | |
82 | } | |
83 | ||
84 | ht tp.shutdow n() | |
85 | ||
86 | } | |
87 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.