Produced by Araxis Merge on 5/1/2018 12:02:00 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.
# | Location | File | Last Modified |
---|---|---|---|
1 | C:\AraxisMergeCompare\Pri_un\ZIP\JLV_2.6.2.0.3_src\JLV\grails-app\services\jlv | VixService.groovy | Thu Mar 29 22:08:31 2018 UTC |
2 | C:\AraxisMergeCompare\Pri_re\ZIP\JLV_2.6.2.0.3_src\JLV\grails-app\services\jlv | VixService.groovy | Tue May 1 14:47:24 2018 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/vix/vi ewer/loade r?ContextI d=RPT%5eCP RS%5e71789 10%5eRA%5e 6828886.82 61-1%5e49% 5eDNS260%5 e%5e%5e%5e %5e%5e1&Si teNumber=R EDACTED&Pa tientICN=R EDACTED&Se curityToke n=REDACTED &AuthSiteN umber=REDA CTED&Flags =PSTATE^ES IGNATURE" | |
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.