Produced by Araxis Merge on 12/5/2017 12:06:40 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\ExchangeCommonDataSource\main\src\java\gov\va\med\imaging\url\exchange\configuration | ExchangeConfiguration.java | Mon Dec 4 21:35:18 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ExchangeCommonDataSource\main\src\java\gov\va\med\imaging\url\exchange\configuration | ExchangeConfiguration.java | Tue Dec 5 12:46:54 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 476 |
| Changed | 3 | 6 |
| 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 .exchange. configurat ion; | |
| 2 | ||
| 3 | import gov .va.med.im aging.url. exchange.e xceptions. ExchangeCo 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
|
|
| 15 | * | |
| 16 | */ | |
| 17 | public cla ss Exchang eConfigura tion | |
| 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_BIA_US ERNAME = " vixuser"; | |
| 23 | pr ivate stat ic final S tring DEFA ULT_BIA_PA SSWORD = " vixvix1."; | |
| 24 | pu blic stati c final St ring DEFAU LT_BIA_SIT E = "200"; | |
| 25 | ||
| 26 | pu blic final static St ring defau ltDODXChan geApplicat ion = "VaI magingExch ange"; | |
| 27 | pu blic final static St ring defau ltDODImage XChangePat h = "/Retr ieveImage. ashx"; | |
| 28 | pu blic final static St ring defau ltDODMetad ataXChange Path = "/I mageMetada taService. asmx"; | |
| 29 | pu blic final static St ring defau ltDODImage Host = ""; | |
| 30 | pu blic final static in t defaultD ODImagePor t = PORT ; | |
| 31 | ||
| 32 | pu blic final static St ring defau ltImageXCh angeApplic ation = "E xchangeWeb App";//"Im agingExcha ngeWebApp" ; | |
| 33 | pu blic final static St ring defau ltImageMet adataXChan gePath = " /xchange-w s/ImageMet adata.V1"; | |
| 34 | pu blic final static St ring defau ltImageXCh angePath = "/xchange /xchange"; | |
| 35 | pu blic final static St ring defau ltImageHos t = ""; | |
| 36 | pu blic final static in t defaultI magePort = PORT ; | |
| 37 | ||
| 38 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Exch angeConfig uration.cl ass); | |
| 39 | ||
| 40 | pr ivate List <ExchangeS iteConfigu ration> co nfiguratio ns; | |
| 41 | pr ivate List <String> e mptyStudyM odalities; | |
| 42 | pr ivate int metadataTi meout; | |
| 43 | ||
| 44 | pu blic final static in t defaultM etadataTim eout = 450 00; | |
| 45 | ||
| 46 | /* * | |
| 47 | * | |
| 48 | * / | |
| 49 | pu blic Excha ngeConfigu ration() | |
| 50 | { | |
| 51 | supe r(); | |
| 52 | conf igurations = new Arr ayList<Exc hangeSiteC onfigurati on>(); | |
| 53 | empt yStudyModa lities = n ew ArrayLi st<String> (); | |
| 54 | meta dataTimeou t = defaul tMetadataT imeout; | |
| 55 | } | |
| 56 | ||
| 57 | pu blic stati c Exchange Configurat ion create DefaultExc hangeConfi guration(S tring [] v aSites, | |
| 58 | String biaUserna me, String biaPasswo rd, List<E xchangeSit eConfigura tion> alie nSites, | |
| 59 | List<S tring> emp tyStudyMod alities, i nt metadat aTimeout) | |
| 60 | th rows Excha ngeConfigu rationExce ption | |
| 61 | { | |
| 62 | Exch angeConfig uration xc hangeConfi guration = new Excha ngeConfigu ration(); | |
| 63 | if(v aSites != null) | |
| 64 | { | |
| 65 | for(St ring vaSit e : vaSite s) | |
| 66 | { | |
| 67 | if(vaSit e != null) | |
| 68 | { | |
| 69 | System.out .println(" Adding VA template f or site [" + vaSite + "]"); | |
| 70 | ExchangeSi teConfigur ation site = | |
| 71 | ne w Exchange SiteConfig uration( | |
| 72 | vaSi te, "", "" , | |
| 73 | defa ultImageXC hangeAppli cation, | |
| 74 | defa ultImageMe tadataXCha ngePath, | |
| 75 | defa ultImageXC hangePath, | |
| 76 | true , | |
| 77 | defa ultImageHo st, | |
| 78 | defa ultImagePo rt); | |
| 79 | ||
| 80 | xchangeCon figuration .addSiteCo nfiguratio n(site); | |
| 81 | } | |
| 82 | } | |
| 83 | } | |
| 84 | xcha ngeConfigu ration.cre ateDODSite (biaUserna me, biaPas sword); | |
| 85 | if(a lienSites != null) | |
| 86 | { | |
| 87 | for(Ex changeSite Configurat ion alienS iteConfig : alienSit es) | |
| 88 | { | |
| 89 | alienSit eConfig.se tImagePath (defaultDO DImageXCha ngePath); | |
| 90 | alienSit eConfig.se tMetadataP ath(defaul tDODMetada taXChangeP ath); | |
| 91 | alienSit eConfig.se tXChangeAp plication( defaultDOD XChangeApp lication); | |
| 92 | xchangeC onfigurati on.addSite Configurat ion(alienS iteConfig) ; | |
| 93 | } | |
| 94 | } | |
| 95 | //xc hangeConfi guration.e mptyStudyM odalities. add("PR"); // we kno w PR studi es from th e DoD have 0 images | |
| 96 | xcha ngeConfigu ration.emp tyStudyMod alities.ad dAll(empty StudyModal ities); | |
| 97 | xcha ngeConfigu ration.met adataTimeo ut = metad ataTimeout ; | |
| 98 | retu rn xchange Configurat ion; | |
| 99 | } | |
| 100 | ||
| 101 | /* * | |
| 102 | * Create an ExchangeC onfigurati on instanc e with a D OD and mul tiple VA s ite | |
| 103 | * entries. | |
| 104 | * | |
| 105 | * @param va Sites | |
| 106 | * @return | |
| 107 | * @throws E xchangeCon figuration Exception | |
| 108 | * / | |
| 109 | pu blic stati c Exchange Configurat ion create DefaultExc hangeConfi guration(S tring[] va Sites) | |
| 110 | th rows Excha ngeConfigu rationExce ption | |
| 111 | { | |
| 112 | Exch angeConfig uration xc hangeConfi guration = new Excha ngeConfigu ration(); | |
| 113 | /* | |
| 114 | xcha ngeConfigu ration.set BiaPasswor d(DEFAULT_ BIA_PASSWO RD); | |
| 115 | xcha ngeConfigu ration.set BiaUsernam e(DEFAULT_ BIA_USERNA ME); | |
| 116 | */ | |
| 117 | ||
| 118 | if(v aSites != null) | |
| 119 | { | |
| 120 | for(St ring vaSit e : vaSite s) | |
| 121 | { | |
| 122 | System.o ut.println ("Adding V A template for site [" + vaSit e + "]"); | |
| 123 | if(vaSit e != null) | |
| 124 | { | |
| 125 | ExchangeSi teConfigur ation site = | |
| 126 | ne w Exchange SiteConfig uration( | |
| 127 | vaSi te, "", "" , | |
| 128 | defa ultImageXC hangeAppli cation, | |
| 129 | defa ultImageMe tadataXCha ngePath, | |
| 130 | defa ultImageXC hangePath, | |
| 131 | true , | |
| 132 | defa ultImageHo st, | |
| 133 | defa ultImagePo rt); | |
| 134 | ||
| 135 | xchangeCon figuration .addSiteCo nfiguratio n(site); | |
| 136 | } | |
| 137 | } | |
| 138 | } | |
| 139 | ||
| 140 | xcha ngeConfigu ration.cre ateDODSite (); | |
| 141 | retu rn xchange Configurat ion; | |
| 142 | } | |
| 143 | ||
| 144 | pr ivate void createDOD Site() | |
| 145 | { | |
| 146 | Exch angeSiteCo nfiguratio n site = n ew Exchang eSiteConfi guration(D EFAULT_BIA _SITE, | |
| 147 | DEFAULT_ BIA_USERNA ME, DEFAUL T_BIA_PASS WORD, defa ultDODXCha ngeApplica tion, | |
| 148 | defaultD ODMetadata XChangePat h, default DODImageXC hangePath, false, | |
| 149 | defaultD ODImageHos t, default DODImagePo rt); | |
| 150 | addS iteConfigu ration(sit e); | |
| 151 | } | |
| 152 | ||
| 153 | pr ivate void createDOD Site(Strin g biaUsern ame, Strin g biaPassw ord) | |
| 154 | { | |
| 155 | Stri ng usernam e = DEFAUL T_BIA_USER NAME; | |
| 156 | Stri ng passwor d = DEFAUL T_BIA_PASS WORD; | |
| 157 | if(b iaUsername != null) | |
| 158 | userna me = biaUs ername; | |
| 159 | if(b iaPassword != null) | |
| 160 | passwo rd = biaPa ssword; | |
| 161 | Syst em.out.pri ntln("Addi ng DOD Sit e with use rname [" + username + "] and p assword [" + passwor d + "]"); | |
| 162 | Exch angeSiteCo nfiguratio n site = n ew Exchang eSiteConfi guration(D EFAULT_BIA _SITE, | |
| 163 | username , password , defaultD ODXChangeA pplication , | |
| 164 | defaultD ODMetadata XChangePat h, default DODImageXC hangePath, false, | |
| 165 | defaultD ODImageHos t, default DODImagePo rt); | |
| 166 | addS iteConfigu ration(sit e); | |
| 167 | } | |
| 168 | ||
| 169 | pr ivate void addSiteCo nfiguratio n(Exchange SiteConfig uration si te) | |
| 170 | { | |
| 171 | this .configura tions.add( site); | |
| 172 | } | |
| 173 | ||
| 174 | pu blic Excha ngeSiteCon figuration getSiteCo nfiguratio n(String p referredSi teNumber, String alt ernateSite Number) | |
| 175 | th rows Excha ngeConfigu rationExce ption | |
| 176 | { | |
| 177 | logg er.debug(" Searching for Exchan ge data so urce site configurat ion [" + p referredSi teNumber + "]"); | |
| 178 | for( int i = 0; i < confi gurations. size(); i+ +) | |
| 179 | { | |
| 180 | Exchan geSiteConf iguration site = con figuration s.get(i); | |
| 181 | if((si te != null ) && (site .equals(pr eferredSit eNumber))) | |
| 182 | { | |
| 183 | logger.d ebug("Foun d Exchange data sour ce site co nfiguratio n [" + pre ferredSite Number + " ]"); | |
| 184 | return s ite; | |
| 185 | } | |
| 186 | } | |
| 187 | logg er.warn("U nable to f ind prefer red site [ " + prefer redSiteNum ber + "] i n exchange configura tion"); | |
| 188 | if(( alternateS iteNumber != null) & & (alterna teSiteNumb er.length( ) > 0)) | |
| 189 | { | |
| 190 | logger .debug("Se arching fo r Exchange data sour ce site co nfiguratio n with alt ernative s ite [" + a lternateSi teNumber + "]"); | |
| 191 | for(in t i = 0; i < configu rations.si ze(); i++) | |
| 192 | { | |
| 193 | Exchange SiteConfig uration si te = confi gurations. get(i); | |
| 194 | if((site != null) && (site.e quals(alte rnateSiteN umber))) | |
| 195 | { | |
| 196 | logger.deb ug("Found Exchange d ata source site conf iguration for altern ate site [ " + altern ateSiteNum ber + "]") ; | |
| 197 | return sit e; | |
| 198 | } | |
| 199 | } | |
| 200 | } | |
| 201 | Stri ng msg = " Unable to find prefe rred site [" + prefe rredSiteNu mber + "]" ; | |
| 202 | if(( alternateS iteNumber != null) & & (alterna teSiteNumb er.length( ) > 0)) | |
| 203 | msg += " or alte rnate site number [" + alterna teSiteNumb er + "]"; | |
| 204 | msg += " in ex change con figuration "; | |
| 205 | thro w new Exch angeConfig urationExc eption(msg ); | |
| 206 | } | |
| 207 | ||
| 208 | /* * | |
| 209 | * return an unmodifia ble List o f configur ations | |
| 210 | * @return | |
| 211 | * / | |
| 212 | pu blic List< ExchangeSi teConfigur ation> get Configurat ions() | |
| 213 | { | |
| 214 | retu rn configu rations; | |
| 215 | } | |
| 216 | ||
| 217 | pu blic void setConfigu rations(Li st<Exchang eSiteConfi guration> configurat ions) | |
| 218 | { | |
| 219 | this .configura tions = co nfiguratio ns; | |
| 220 | } | |
| 221 | ||
| 222 | pu blic List< String> ge tEmptyStud yModalitie s() | |
| 223 | { | |
| 224 | retu rn emptySt udyModalit ies; | |
| 225 | } | |
| 226 | ||
| 227 | pu blic void setEmptySt udyModalit ies(List<S tring> emp tyStudyMod alities) | |
| 228 | { | |
| 229 | this .emptyStud yModalitie s = emptyS tudyModali ties; | |
| 230 | } | |
| 231 | ||
| 232 | pu blic int g etMetadata Timeout() | |
| 233 | { | |
| 234 | retu rn metadat aTimeout; | |
| 235 | } | |
| 236 | ||
| 237 | pu blic void setMetadat aTimeout(i nt metadat aTimeout) | |
| 238 | { | |
| 239 | this .metadataT imeout = m etadataTim eout; | |
| 240 | } | |
| 241 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.