Produced by Araxis Merge on 6/5/2018 10:24:12 AM 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 | patch_205_build_9.zip\Java\MIXCommonDataSource\main\src\java\gov\va\med\imaging\url\mix\configuration | MIXConfiguration.java | Wed May 30 14:35:27 2018 UTC |
2 | patch_205_build_9.zip\Java\MIXCommonDataSource\main\src\java\gov\va\med\imaging\url\mix\configuration | MIXConfiguration.java | Mon Jun 4 18:18:23 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 7 | 674 |
Changed | 6 | 16 |
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 go v.va.med.i maging.url .mix.confi guration; | |
2 | ||
3 | import gov .va.med.im aging.url. mix.except ions.MIXCo nfiguratio nException ; | |
4 | ||
5 | import jav a.io.Seria lizable; | |
6 | import jav a.util.Arr ayList; | |
7 | import jav a.util.Lis t; | |
8 | ||
9 | import org .apache.lo gging.log4 j.LogManag er; | |
10 | import org .apache.lo gging.log4 j.Logger; | |
11 | ||
12 | /** | |
13 | * | |
14 | * @author PI I
|
|
15 | * | |
16 | */ | |
17 | public cla ss MIXConf iguration | |
18 | implements Serializa ble | |
19 | { | |
20 | pr ivate fina l static l ong serial VersionUID = 1L; | |
21 | ||
22 | pr ivate stat ic final S tring DEFA ULT_DAS_US ERNAME = " AI "; | |
23 | pr ivate stat ic final S tring DEFA ULT_DAS_PA SSWORD = " AI "; | |
24 | pu blic stati c final St ring DEFAU LT_DAS_SIT E = "200"; | |
25 | pu blic stati c final St ring DEFAU LT_DAS_PRO TOCOL = "m ixs"; | |
26 | ||
27 | pu blic final static St ring defau ltMIXProto col = "htt ps"; | |
28 | pu blic final static St ring defau ltDODXChan geApplicat ion = "hai ms"; // DA S is proxy only... | |
29 | pu blic final static St ring defau ltDODMetad ataXChange Path1 = "/ mix/v1/Dia gnosticRep ort/subjec t"; // "/m ix/Diagnos ticReport/ subject" ( FHIR) -- p ass 1 leve l 1 | |
30 | pu blic final static St ring defau ltDODMetad ataXChange Path2 = "/ mix/v1/Ima gingStudy" ; // "/mix /ImagingSt udy" (FHIR ) -- pass 1 level 2 | |
31 | pu blic final static St ring defau ltDODImage XChangePat h1 = "/mix /v1/Retrie veThumbnai l"; // "/m ix/Retriev eThumbnail " (WADO-UR I) -- pass 2 (TN) | |
32 | pu blic final static St ring defau ltDODImage XChangePat h2 = "/mix /v1/Retrie veInstance "; // "/mi x/Retrieve Instance" (WADO-RS) -- pass 2 (Ref/Diag) | |
33 | pu blic final static St ring defau ltDODImage Host = " DNS "; | |
34 | pu blic final static in t defaultD ODImagePor t = PORT ; | |
35 | ||
36 | pu blic final static St ring defau ltImageXCh angeApplic ation = "M IXWebApp"; // was "Im agingExcha ngeWebApp" ; | |
37 | pu blic final static St ring defau ltImageMet adataXChan gePath1 = "/restserv ices/mix/D iagnosticR eport/subj ect"; // ( FHIR) -- p ass 1 leve l 1 | |
38 | pu blic final static St ring defau ltImageMet adataXChan gePath2 = "/restserv ices/mix/I magingStud y"; // (FH IR) -- pas s 1 level 2 | |
39 | pu blic final static St ring defau ltImageXCh angePath1 = "/mix/re trieveThum bnail"; // (WADO-URI ) -- pass 2 (TN) | |
40 | pu blic final static St ring defau ltImageXCh angePath2 = "/mix/re trieveInst ance"; // (WADO-URI ) -- pass 2 (Ref/Dia g); later WADO-RS | |
41 | pu blic final static St ring defau ltImageHos t = "local host"; | |
42 | pu blic final static in t defaultI magePort = PORT ; | |
43 | pu blic final static St ring defau ltKeystore Url = "fil e:///c:/Vi xCertStore /cvix.jks" ; | |
44 | pu blic final static St ring defau ltTruststo reUrl = "f ile:///c:/ VixCertSto re/das.tru ststore"; | |
45 | ||
46 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(MIXC onfigurati on.class); | |
47 | ||
48 | pr ivate List <MIXSiteCo nfiguratio n> configu rations; | |
49 | pr ivate List <String> e mptyStudyM odalities; | |
50 | pr ivate int metadataTi meout; | |
51 | pr ivate int metadataCo ncurentQue ryTimeout; | |
52 | pr ivate int maxConcure ntThreads; | |
53 | pr ivate Stri ng keystor eUrl; | |
54 | pr ivate Stri ng keystor ePassword; | |
55 | pr ivate Stri ng trustst oreUrl; | |
56 | pr ivate Stri ng trustst orePasswor d; | |
57 | ||
58 | pu blic final static in t defaultM etadataTim eout = 450 00; | |
59 | pu blic final static in t defaultM etadataCon currentQue ryTimeoutT imeout = 7 000; // se t to a saf e value fo r 171 CVIX installer (3/8/18 c pt) | |
60 | pu blic final static in t defaultm axConcuren tThreads = 10; // HA IMS team d id not wan t this to be too hig h! | |
61 | ||
62 | /* * | |
63 | * | |
64 | * / | |
65 | pu blic MIXCo nfiguratio n() | |
66 | { | |
67 | supe r(); | |
68 | conf igurations = new Arr ayList<MIX SiteConfig uration>() ; | |
69 | empt yStudyModa lities = n ew ArrayLi st<String> (); | |
70 | meta dataTimeou t = defaul tMetadataT imeout; // 45 sec | |
71 | meta dataConcur entQueryTi meout = de faultMetad ataConcurr entQueryTi meoutTimeo ut; // 4+ sec | |
72 | maxC oncurentTh reads = de faultmaxCo ncurentThr eads; // 1 0 | |
73 | } | |
74 | ||
75 | pu blic stati c MIXConfi guration c reateDefau ltMixConfi guration( | |
76 | List<S tring> emp tyStudyMod alities, | |
77 | int me tadataTime out, | |
78 | String imageHost , int imag ePort, | |
79 | String cvixCertP wd, | |
80 | String dasCertPw d | |
81 | ) | |
82 | th rows MIXCo nfiguratio nException | |
83 | { | |
84 | MIXC onfigurati on mixConf iguration = new MIXC onfigurati on(); | |
85 | mixC onfigurati on.createD ODSite(nul l, null, imageHost, imagePort ); | |
86 | mixC onfigurati on.emptySt udyModalit ies.addAll (emptyStud yModalitie s); | |
87 | mixC onfigurati on.metadat aTimeout = metadataT imeout; | |
88 | mixC onfigurati on.keystor eUrl = def aultKeysto reUrl; | |
89 | mixC onfigurati on.trustst oreUrl = d efaultTrus tstoreUrl; | |
90 | mixC onfigurati on.keystor ePassword = cvixCert Pwd; | |
91 | mixC onfigurati on.trustst orePasswor d = dasCer tPwd; | |
92 | ||
93 | retu rn mixConf iguration; | |
94 | } | |
95 | ||
96 | /* * | |
97 | * Create an MIXConfig uration in stance wit h a DOD an d multiple VA site | |
98 | * entries. | |
99 | * | |
100 | * @param va Sites | |
101 | * @return | |
102 | * @throws M IXConfigur ationExcep tion | |
103 | * / | |
104 | pu blic stati c MIXConfi guration c reateDefau ltMixConfi guration2( String[] v aSites) | |
105 | th rows MIXCo nfiguratio nException | |
106 | { | |
107 | MIXC onfigurati on mixConf iguration = new MIXC onfigurati on(); | |
108 | /* | |
109 | xcha ngeConfigu ration.set DasPasswor d(DEFAULT_ DAS_PASSWO RD); | |
110 | xcha ngeConfigu ration.set DasUsernam e(DEFAULT_ DAS_USERNA ME); | |
111 | */ | |
112 | ||
113 | if(v aSites != null) | |
114 | { | |
115 | for(St ring vaSit e : vaSite s) | |
116 | { | |
117 | System.o ut.println ("Adding V A template for site [" + vaSit e + "]"); | |
118 | if(vaSit e != null) | |
119 | { | |
120 | MIXSiteCon figuration site = | |
121 | ne w MIXSiteC onfigurati on( | |
122 | vaSi te, "", "" , | |
123 | defa ultImageXC hangeAppli cation, | |
124 | defa ultImageMe tadataXCha ngePath1, | |
125 | defa ultImageMe tadataXCha ngePath2, | |
126 | defa ultImageXC hangePath1 , | |
127 | defa ultImageXC hangePath2 , | |
128 | true , | |
129 | defa ultImageHo st, | |
130 | defa ultImagePo rt); | |
131 | ||
132 | mixConfigu ration.add SiteConfig uration(si te); | |
133 | } | |
134 | } | |
135 | } | |
136 | ||
137 | mixC onfigurati on.createD ODSite(); | |
138 | retu rn mixConf iguration; | |
139 | } | |
140 | ||
141 | pr ivate void createDOD Site() | |
142 | { | |
143 | MIXS iteConfigu ration sit e = new MI XSiteConfi guration(D EFAULT_DAS _SITE, | |
144 | DEFAULT_ DAS_USERNA ME, DEFAUL T_DAS_PASS WORD, defa ultDODXCha ngeApplica tion, | |
145 | defaultD ODMetadata XChangePat h1, defaul tDODMetada taXChangeP ath2, | |
146 | defaultD ODImageXCh angePath1, defaultDO DImageXCha ngePath1, false, | |
147 | defaultD ODImageHos t, default DODImagePo rt); | |
148 | addS iteConfigu ration(sit e); | |
149 | } | |
150 | ||
151 | pr ivate void createDOD Site(Strin g dasUsern ame, Strin g dasPassw ord, Strin g imageHos t, int ima gePort) | |
152 | { | |
153 | MIXS iteConfigu ration sit e = new MI XSiteConfi guration(D EFAULT_DAS _SITE, | |
154 | DEFAULT_ DAS_USERNA ME, DEFAUL T_DAS_PASS WORD, defa ultDODXCha ngeApplica tion, | |
155 | defaultD ODMetadata XChangePat h1, defaul tDODMetada taXChangeP ath2, | |
156 | defaultD ODImageXCh angePath1, defaultDO DImageXCha ngePath1, false, | |
157 | imageHos t, imagePo rt); | |
158 | addS iteConfigu ration(sit e); | |
159 | } | |
160 | ||
161 | pr ivate void createDOD Site(Strin g dasUsern ame, Strin g dasPassw ord) | |
162 | { | |
163 | Stri ng usernam e = DEFAUL T_DAS_USER NAME; | |
164 | Stri ng passwor d = DEFAUL T_DAS_PASS WORD; | |
165 | if(d asUsername != null) | |
166 | username = AI ; | |
167 | if(d asPassword != null) | |
168 | password = AI ; | |
169 | Syst em.out.pri ntln("Addi ng DOD Sit e with use rname [" + username + "] and p assword [" + passwor d + "]"); | |
170 | MIXS iteConfigu ration sit e = new MI XSiteConfi guration(D EFAULT_DAS _SITE, | |
171 | username , password , defaultD ODXChangeA pplication , | |
172 | defaultD ODMetadata XChangePat h1, defaul tDODMetada taXChangeP ath2, | |
173 | defaultD ODImageXCh angePath1, defaultDO DImageXCha ngePath1, false, | |
174 | defaultD ODImageHos t, default DODImagePo rt); | |
175 | addS iteConfigu ration(sit e); | |
176 | } | |
177 | ||
178 | pr ivate void addSiteCo nfiguratio n(MIXSiteC onfigurati on site) | |
179 | { | |
180 | this .configura tions.add( site); | |
181 | } | |
182 | ||
183 | pu blic MIXSi teConfigur ation getS iteConfigu ration(Str ing prefer redSiteNum ber, Strin g alternat eSiteNumbe r) | |
184 | th rows MIXCo nfiguratio nException | |
185 | { | |
186 | logg er.debug(" Searching for MIX da ta source site confi guration [ " + prefer redSiteNum ber + "]") ; | |
187 | for( int i = 0; i < confi gurations. size(); i+ +) | |
188 | { | |
189 | MIXSit eConfigura tion site = configur ations.get (i); | |
190 | if((si te != null ) && (site .equals(pr eferredSit eNumber))) | |
191 | { | |
192 | logger.d ebug("Foun d MIX data source si te configu ration [" + preferre dSiteNumbe r + "]"); | |
193 | return s ite; | |
194 | } | |
195 | } | |
196 | logg er.warn("U nable to f ind prefer red site [ " + prefer redSiteNum ber + "] i n MIX conf iguration" ); | |
197 | if(( alternateS iteNumber != null) & & (alterna teSiteNumb er.length( ) > 0)) | |
198 | { | |
199 | logger .debug("Se arching fo r MIX data source si te configu ration wit h alternat ive site [ " + altern ateSiteNum ber + "]") ; | |
200 | for(in t i = 0; i < configu rations.si ze(); i++) | |
201 | { | |
202 | MIXSiteC onfigurati on site = configurat ions.get(i ); | |
203 | if((site != null) && (site.e quals(alte rnateSiteN umber))) | |
204 | { | |
205 | logger.deb ug("Found MIX data s ource site configura tion for a lternate s ite [" + a lternateSi teNumber + "]"); | |
206 | return sit e; | |
207 | } | |
208 | } | |
209 | } | |
210 | Stri ng msg = " Unable to find prefe rred site [" + prefe rredSiteNu mber + "]" ; | |
211 | if(( alternateS iteNumber != null) & & (alterna teSiteNumb er.length( ) > 0)) | |
212 | msg += " or alte rnate site number [" + alterna teSiteNumb er + "]"; | |
213 | msg += " in MI X configur ation"; | |
214 | thro w new MIXC onfigurati onExceptio n(msg); | |
215 | } | |
216 | ||
217 | /* * | |
218 | * return an unmodifia ble List o f configur ations | |
219 | * @return | |
220 | * / | |
221 | pu blic List< MIXSiteCon figuration > getConfi gurations( ) | |
222 | { | |
223 | retu rn configu rations; | |
224 | } | |
225 | ||
226 | pu blic void setConfigu rations(Li st<MIXSite Configurat ion> confi gurations) | |
227 | { | |
228 | this .configura tions = co nfiguratio ns; | |
229 | } | |
230 | ||
231 | pu blic List< String> ge tEmptyStud yModalitie s() | |
232 | { | |
233 | retu rn emptySt udyModalit ies; | |
234 | } | |
235 | ||
236 | pu blic void setEmptySt udyModalit ies(List<S tring> emp tyStudyMod alities) | |
237 | { | |
238 | this .emptyStud yModalitie s = emptyS tudyModali ties; | |
239 | } | |
240 | ||
241 | ||
242 | pu blic int g etMetadata Timeout() { | |
243 | retu rn metadat aTimeout; | |
244 | } | |
245 | ||
246 | pu blic void setMetadat aTimeout(i nt metadat aTimeout) { | |
247 | this .metadataT imeout = m etadataTim eout; | |
248 | } | |
249 | ||
250 | pu blic int g etMetadata ConcurentQ ueryTimeou t() | |
251 | { | |
252 | retu rn metadat aConcurent QueryTimeo ut; | |
253 | } | |
254 | ||
255 | pu blic void setMetadat aConcurent QueryTimeo ut(int met adataCQTim eout) | |
256 | { | |
257 | this .metadataC oncurentQu eryTimeout = metadat aCQTimeout ; | |
258 | } | |
259 | ||
260 | pu blic int g etMaxConcu rentThread s() { | |
261 | retu rn maxConc urentThrea ds; | |
262 | } | |
263 | ||
264 | pu blic void setMaxConc urentThrea ds(int max ConcurentT hreads) { | |
265 | this .maxConcur entThreads = maxConc urentThrea ds; | |
266 | } | |
267 | ||
268 | /* * | |
269 | * @return t he trustst oreUrl | |
270 | * / | |
271 | pu blic Strin g getTrust storeUrl() | |
272 | { | |
273 | //re turn getTl sConfigura tion().get Truststore Url().toSt ring(); | |
274 | retu rn trustst oreUrl; | |
275 | } | |
276 | ||
277 | /* * | |
278 | * @param tr uststoreUr l the trus tstoreUrl to set | |
279 | * @throws M alformedUR LException | |
280 | * / | |
281 | pu blic void setTrustst oreUrl(Str ing trusts toreUrl) | |
282 | // throws Mal formedURLE xception | |
283 | { | |
284 | //ge tTlsConfig uration(). setTrustst oreUrl(new URL(trust storeUrl)) ; | |
285 | this .truststor eUrl = tru ststoreUrl ; | |
286 | } | |
287 | ||
288 | /* * | |
289 | * @return t he trustst orePasswor d | |
290 | * / | |
291 | pu blic Strin g getTrust storePassw ord() | |
292 | { | |
293 | //re turn getTl sConfigura tion().get Truststore Password() ; | |
294 | retu rn trustst orePasswor d; | |
295 | } | |
296 | ||
297 | /* * | |
298 | * @param tr uststorePa ssword the truststor ePassword to set | |
299 | * / | |
300 | pu blic void setTrustst orePasswor d(String t ruststoreP assword) | |
301 | { | |
302 | //ge tTlsConfig uration(). setTrustst orePasswor d(truststo rePassword ); | |
303 | this .truststor ePassword = truststo rePassword ; | |
304 | } | |
305 | ||
306 | /* * | |
307 | * @return t he keystor eUrl | |
308 | * / | |
309 | pu blic Strin g getKeyst oreUrl() | |
310 | { | |
311 | //re turn getTl sConfigura tion().get KeystoreUr l().toStri ng(); | |
312 | retu rn keystor eUrl; | |
313 | } | |
314 | ||
315 | /* * | |
316 | * @param ke ystoreUrl the keysto reUrl to s et | |
317 | * @throws M alformedUR LException | |
318 | * / | |
319 | pu blic void setKeystor eUrl(Strin g keystore Url) | |
320 | // throws Mal formedURLE xception | |
321 | { | |
322 | //ge tTlsConfig uration(). setKeystor eUrl(new U RL(keystor eUrl)); | |
323 | this .keystoreU rl = keyst oreUrl; | |
324 | } | |
325 | ||
326 | /* * | |
327 | * @return t he keystor ePassword | |
328 | * / | |
329 | pu blic Strin g getKeyst orePasswor d() | |
330 | { | |
331 | //re turn getTl sConfigura tion().get KeystorePa ssword(); | |
332 | retu rn keystor ePassword; | |
333 | } | |
334 | ||
335 | /* * | |
336 | * @param ke ystorePass word the k eystorePas sword to s et | |
337 | * / | |
338 | pu blic void setKeystor ePassword( String key storePassw ord) | |
339 | { | |
340 | //ge tTlsConfig uration(). setKeystor ePassword( keystorePa ssword); | |
341 | this .keystoreP assword = keystorePa ssword; | |
342 | } | |
343 | ||
344 | ||
345 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.