Produced by Araxis Merge on 12/5/2017 12:06:47 PM Central Standard 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\MIXCommonDataSource\main\src\java\gov\va\med\imaging\url\mix\configuration | MIXConfiguration.java | Mon Dec 4 21:35:24 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\MIXCommonDataSource\main\src\java\gov\va\med\imaging\url\mix\configuration | MIXConfiguration.java | Tue Dec 5 13:26:12 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 640 |
| Changed | 3 | 8 |
| 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 DNS TITTOC | |
| 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 = " vixuser"; | |
| 23 | pr ivate stat ic final S tring DEFA ULT_DAS_PA SSWORD = " vixvix1."; | |
| 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 = " SERVER "; | |
| 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 | ||
| 52 | pr ivate Stri ng keystor eUrl; | |
| 53 | pr ivate Stri ng keystor ePassword; | |
| 54 | pr ivate Stri ng trustst oreUrl; | |
| 55 | pr ivate Stri ng trustst orePasswor d; | |
| 56 | ||
| 57 | pu blic final static in t defaultM etadataTim eout = 450 00; | |
| 58 | ||
| 59 | ||
| 60 | /* * | |
| 61 | * | |
| 62 | * / | |
| 63 | pu blic MIXCo nfiguratio n() | |
| 64 | { | |
| 65 | supe r(); | |
| 66 | conf igurations = new Arr ayList<MIX SiteConfig uration>() ; | |
| 67 | empt yStudyModa lities = n ew ArrayLi st<String> (); | |
| 68 | meta dataTimeou t = defaul tMetadataT imeout; // 45 sec | |
| 69 | } | |
| 70 | ||
| 71 | pu blic stati c MIXConfi guration c reateDefau ltMixConfi guration( | |
| 72 | List<S tring> emp tyStudyMod alities, | |
| 73 | int me tadataTime out, | |
| 74 | String imageHost , int imag ePort, | |
| 75 | String cvixCertP wd, | |
| 76 | String dasCertPw d | |
| 77 | ) | |
| 78 | th rows MIXCo nfiguratio nException | |
| 79 | { | |
| 80 | MIXC onfigurati on mixConf iguration = new MIXC onfigurati on(); | |
| 81 | mixC onfigurati on.createD ODSite(nul l, null, imageHost, imagePort ); | |
| 82 | mixC onfigurati on.emptySt udyModalit ies.addAll (emptyStud yModalitie s); | |
| 83 | mixC onfigurati on.metadat aTimeout = metadataT imeout; | |
| 84 | mixC onfigurati on.keystor eUrl = def aultKeysto reUrl; | |
| 85 | mixC onfigurati on.trustst oreUrl = d efaultTrus tstoreUrl; | |
| 86 | mixC onfigurati on.keystor ePassword = cvixCert Pwd; | |
| 87 | mixC onfigurati on.trustst orePasswor d = dasCer tPwd; | |
| 88 | ||
| 89 | retu rn mixConf iguration; | |
| 90 | } | |
| 91 | ||
| 92 | /* * | |
| 93 | * Create an MIXConfig uration in stance wit h a DOD an d multiple VA site | |
| 94 | * entries. | |
| 95 | * | |
| 96 | * @param va Sites | |
| 97 | * @return | |
| 98 | * @throws M IXConfigur ationExcep tion | |
| 99 | * / | |
| 100 | pu blic stati c MIXConfi guration c reateDefau ltMixConfi guration(S tring[] va Sites) | |
| 101 | th rows MIXCo nfiguratio nException | |
| 102 | { | |
| 103 | MIXC onfigurati on mixConf iguration = new MIXC onfigurati on(); | |
| 104 | /* | |
| 105 | xcha ngeConfigu ration.set DasPasswor d(DEFAULT_ DAS_PASSWO RD); | |
| 106 | xcha ngeConfigu ration.set DasUsernam e(DEFAULT_ DAS_USERNA ME); | |
| 107 | */ | |
| 108 | ||
| 109 | if(v aSites != null) | |
| 110 | { | |
| 111 | for(St ring vaSit e : vaSite s) | |
| 112 | { | |
| 113 | System.o ut.println ("Adding V A template for site [" + vaSit e + "]"); | |
| 114 | if(vaSit e != null) | |
| 115 | { | |
| 116 | MIXSiteCon figuration site = | |
| 117 | ne w MIXSiteC onfigurati on( | |
| 118 | vaSi te, "", "" , | |
| 119 | defa ultImageXC hangeAppli cation, | |
| 120 | defa ultImageMe tadataXCha ngePath1, | |
| 121 | defa ultImageMe tadataXCha ngePath2, | |
| 122 | defa ultImageXC hangePath1 , | |
| 123 | defa ultImageXC hangePath2 , | |
| 124 | true , | |
| 125 | defa ultImageHo st, | |
| 126 | defa ultImagePo rt); | |
| 127 | ||
| 128 | mixConfigu ration.add SiteConfig uration(si te); | |
| 129 | } | |
| 130 | } | |
| 131 | } | |
| 132 | ||
| 133 | mixC onfigurati on.createD ODSite(); | |
| 134 | retu rn mixConf iguration; | |
| 135 | } | |
| 136 | ||
| 137 | pr ivate void createDOD Site() | |
| 138 | { | |
| 139 | MIXS iteConfigu ration sit e = new MI XSiteConfi guration(D EFAULT_DAS _SITE, | |
| 140 | DEFAULT_ DAS_USERNA ME, DEFAUL T_DAS_PASS WORD, defa ultDODXCha ngeApplica tion, | |
| 141 | defaultD ODMetadata XChangePat h1, defaul tDODMetada taXChangeP ath2, | |
| 142 | defaultD ODImageXCh angePath1, defaultDO DImageXCha ngePath1, false, | |
| 143 | defaultD ODImageHos t, default DODImagePo rt); | |
| 144 | addS iteConfigu ration(sit e); | |
| 145 | } | |
| 146 | ||
| 147 | pr ivate void createDOD Site(Strin g dasUsern ame, Strin g dasPassw ord, Strin g imageHos t, int ima gePort) | |
| 148 | { | |
| 149 | MIXS iteConfigu ration sit e = new MI XSiteConfi guration(D EFAULT_DAS _SITE, | |
| 150 | DEFAULT_ DAS_USERNA ME, DEFAUL T_DAS_PASS WORD, defa ultDODXCha ngeApplica tion, | |
| 151 | defaultD ODMetadata XChangePat h1, defaul tDODMetada taXChangeP ath2, | |
| 152 | defaultD ODImageXCh angePath1, defaultDO DImageXCha ngePath1, false, | |
| 153 | imageHos t, imagePo rt); | |
| 154 | addS iteConfigu ration(sit e); | |
| 155 | } | |
| 156 | ||
| 157 | pr ivate void createDOD Site(Strin g dasUsern ame, Strin g dasPassw ord) | |
| 158 | { | |
| 159 | Stri ng usernam e = DEFAUL T_DAS_USER NAME; | |
| 160 | Stri ng passwor d = DEFAUL T_DAS_PASS WORD; | |
| 161 | if(d asUsername != null) | |
| 162 | userna me = dasUs ername; | |
| 163 | if(d asPassword != null) | |
| 164 | passwo rd = dasPa ssword; | |
| 165 | Syst em.out.pri ntln("Addi ng DOD Sit e with use rname [" + username + "] and p assword [" + passwor d + "]"); | |
| 166 | MIXS iteConfigu ration sit e = new MI XSiteConfi guration(D EFAULT_DAS _SITE, | |
| 167 | username , password , defaultD ODXChangeA pplication , | |
| 168 | defaultD ODMetadata XChangePat h1, defaul tDODMetada taXChangeP ath2, | |
| 169 | defaultD ODImageXCh angePath1, defaultDO DImageXCha ngePath1, false, | |
| 170 | defaultD ODImageHos t, default DODImagePo rt); | |
| 171 | addS iteConfigu ration(sit e); | |
| 172 | } | |
| 173 | ||
| 174 | pr ivate void addSiteCo nfiguratio n(MIXSiteC onfigurati on site) | |
| 175 | { | |
| 176 | this .configura tions.add( site); | |
| 177 | } | |
| 178 | ||
| 179 | pu blic MIXSi teConfigur ation getS iteConfigu ration(Str ing prefer redSiteNum ber, Strin g alternat eSiteNumbe r) | |
| 180 | th rows MIXCo nfiguratio nException | |
| 181 | { | |
| 182 | logg er.debug(" Searching for MIX da ta source site confi guration [ " + prefer redSiteNum ber + "]") ; | |
| 183 | for( int i = 0; i < confi gurations. size(); i+ +) | |
| 184 | { | |
| 185 | MIXSit eConfigura tion site = configur ations.get (i); | |
| 186 | if((si te != null ) && (site .equals(pr eferredSit eNumber))) | |
| 187 | { | |
| 188 | logger.d ebug("Foun d MIX data source si te configu ration [" + preferre dSiteNumbe r + "]"); | |
| 189 | return s ite; | |
| 190 | } | |
| 191 | } | |
| 192 | logg er.warn("U nable to f ind prefer red site [ " + prefer redSiteNum ber + "] i n MIX conf iguration" ); | |
| 193 | if(( alternateS iteNumber != null) & & (alterna teSiteNumb er.length( ) > 0)) | |
| 194 | { | |
| 195 | logger .debug("Se arching fo r MIX data source si te configu ration wit h alternat ive site [ " + altern ateSiteNum ber + "]") ; | |
| 196 | for(in t i = 0; i < configu rations.si ze(); i++) | |
| 197 | { | |
| 198 | MIXSiteC onfigurati on site = configurat ions.get(i ); | |
| 199 | if((site != null) && (site.e quals(alte rnateSiteN umber))) | |
| 200 | { | |
| 201 | logger.deb ug("Found MIX data s ource site configura tion for a lternate s ite [" + a lternateSi teNumber + "]"); | |
| 202 | return sit e; | |
| 203 | } | |
| 204 | } | |
| 205 | } | |
| 206 | Stri ng msg = " Unable to find prefe rred site [" + prefe rredSiteNu mber + "]" ; | |
| 207 | if(( alternateS iteNumber != null) & & (alterna teSiteNumb er.length( ) > 0)) | |
| 208 | msg += " or alte rnate site number [" + alterna teSiteNumb er + "]"; | |
| 209 | msg += " in MI X configur ation"; | |
| 210 | thro w new MIXC onfigurati onExceptio n(msg); | |
| 211 | } | |
| 212 | ||
| 213 | /* * | |
| 214 | * return an unmodifia ble List o f configur ations | |
| 215 | * @return | |
| 216 | * / | |
| 217 | pu blic List< MIXSiteCon figuration > getConfi gurations( ) | |
| 218 | { | |
| 219 | retu rn configu rations; | |
| 220 | } | |
| 221 | ||
| 222 | pu blic void setConfigu rations(Li st<MIXSite Configurat ion> confi gurations) | |
| 223 | { | |
| 224 | this .configura tions = co nfiguratio ns; | |
| 225 | } | |
| 226 | ||
| 227 | pu blic List< String> ge tEmptyStud yModalitie s() | |
| 228 | { | |
| 229 | retu rn emptySt udyModalit ies; | |
| 230 | } | |
| 231 | ||
| 232 | pu blic void setEmptySt udyModalit ies(List<S tring> emp tyStudyMod alities) | |
| 233 | { | |
| 234 | this .emptyStud yModalitie s = emptyS tudyModali ties; | |
| 235 | } | |
| 236 | ||
| 237 | pu blic int g etMetadata Timeout() | |
| 238 | { | |
| 239 | retu rn metadat aTimeout; | |
| 240 | } | |
| 241 | ||
| 242 | pu blic void setMetadat aTimeout(i nt metadat aTimeout) | |
| 243 | { | |
| 244 | this .metadataT imeout = m etadataTim eout; | |
| 245 | } | |
| 246 | ||
| 247 | /* * | |
| 248 | * @return t he trustst oreUrl | |
| 249 | * / | |
| 250 | pu blic Strin g getTrust storeUrl() | |
| 251 | { | |
| 252 | //re turn getTl sConfigura tion().get Truststore Url().toSt ring(); | |
| 253 | retu rn trustst oreUrl; | |
| 254 | } | |
| 255 | ||
| 256 | /* * | |
| 257 | * @param tr uststoreUr l the trus tstoreUrl to set | |
| 258 | * @throws M alformedUR LException | |
| 259 | * / | |
| 260 | pu blic void setTrustst oreUrl(Str ing trusts toreUrl) | |
| 261 | // throws Mal formedURLE xception | |
| 262 | { | |
| 263 | //ge tTlsConfig uration(). setTrustst oreUrl(new URL(trust storeUrl)) ; | |
| 264 | this .truststor eUrl = tru ststoreUrl ; | |
| 265 | } | |
| 266 | ||
| 267 | /* * | |
| 268 | * @return t he trustst orePasswor d | |
| 269 | * / | |
| 270 | pu blic Strin g getTrust storePassw ord() | |
| 271 | { | |
| 272 | //re turn getTl sConfigura tion().get Truststore Password() ; | |
| 273 | retu rn trustst orePasswor d; | |
| 274 | } | |
| 275 | ||
| 276 | /* * | |
| 277 | * @param tr uststorePa ssword the truststor ePassword to set | |
| 278 | * / | |
| 279 | pu blic void setTrustst orePasswor d(String t ruststoreP assword) | |
| 280 | { | |
| 281 | //ge tTlsConfig uration(). setTrustst orePasswor d(truststo rePassword ); | |
| 282 | this .truststor ePassword = truststo rePassword ; | |
| 283 | } | |
| 284 | ||
| 285 | /* * | |
| 286 | * @return t he keystor eUrl | |
| 287 | * / | |
| 288 | pu blic Strin g getKeyst oreUrl() | |
| 289 | { | |
| 290 | //re turn getTl sConfigura tion().get KeystoreUr l().toStri ng(); | |
| 291 | retu rn keystor eUrl; | |
| 292 | } | |
| 293 | ||
| 294 | /* * | |
| 295 | * @param ke ystoreUrl the keysto reUrl to s et | |
| 296 | * @throws M alformedUR LException | |
| 297 | * / | |
| 298 | pu blic void setKeystor eUrl(Strin g keystore Url) | |
| 299 | // throws Mal formedURLE xception | |
| 300 | { | |
| 301 | //ge tTlsConfig uration(). setKeystor eUrl(new U RL(keystor eUrl)); | |
| 302 | this .keystoreU rl = keyst oreUrl; | |
| 303 | } | |
| 304 | ||
| 305 | /* * | |
| 306 | * @return t he keystor ePassword | |
| 307 | * / | |
| 308 | pu blic Strin g getKeyst orePasswor d() | |
| 309 | { | |
| 310 | //re turn getTl sConfigura tion().get KeystorePa ssword(); | |
| 311 | retu rn keystor ePassword; | |
| 312 | } | |
| 313 | ||
| 314 | /* * | |
| 315 | * @param ke ystorePass word the k eystorePas sword to s et | |
| 316 | * / | |
| 317 | pu blic void setKeystor ePassword( String key storePassw ord) | |
| 318 | { | |
| 319 | //ge tTlsConfig uration(). setKeystor ePassword( keystorePa ssword); | |
| 320 | this .keystoreP assword = keystorePa ssword; | |
| 321 | } | |
| 322 | ||
| 323 | ||
| 324 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.