Produced by Araxis Merge on 7/10/2017 1:01:46 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\IV-ehmp_cif\MIXDataSource\main\src\java\gov\va\med\imaging\mixdatasource | MixDataSourceProvider.java | Thu Jun 29 17:23:07 2017 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\MIXDataSource\main\src\java\gov\va\med\imaging\mixdatasource | MixDataSourceProvider.java | Thu Jul 6 15:04:33 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 554 |
| Changed | 2 | 4 |
| 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 | /** | |
| 2 | * | |
| 3 | Package: MAG - Vis tA Imaging | |
| 4 | WARNING: Per VHA D irective 2 004-038, t his routin e should n ot be modi fied. | |
| 5 | Date Cre ated: Jan 8, 2008 | |
| 6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
| 7 | Developer:
|
|
| 8 | Descript ion: | |
| 9 | ||
| 10 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 11 | ;; Property of the US Government . | |
| 12 | ;; No permis sion to co py or redi stribute t his softwa re is give n. | |
| 13 | ;; Use of un released v ersions of this soft ware requi res the us er | |
| 14 | ;; to execu te a writt en test ag reement wi th the Vis tA Imaging | |
| 15 | ;; Developm ent Office of the De partment o f Veterans Affairs, | |
| 16 | ;; telephon e (301) 73 4-0100. | |
| 17 | ;; | |
| 18 | ;; The Food and Drug A dministrat ion classi fies this software a s | |
| 19 | ;; a Class I I medical device. A s such, it may not b e changed | |
| 20 | ;; in any wa y. Modifi cations to this soft ware may r esult in a n | |
| 21 | ;; adulterat ed medical device un der 21CFR8 20, the us e of which | |
| 22 | ;; is consid ered to be a violati on of US F ederal Sta tutes. | |
| 23 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 24 | ||
| 25 | */ | |
| 26 | package go v.va.med.i maging.mix datasource ; | |
| 27 | ||
| 28 | import gov .va.med.im aging.data source.*; | |
| 29 | import gov .va.med.im aging.url. mix.config uration.MI XConfigura tion; | |
| 30 | import gov .va.med.im aging.url. mix.config uration.MI XSiteConfi guration; | |
| 31 | import gov .va.med.im aging.url. mix.except ions.MIXCo nfiguratio nException ; | |
| 32 | import jav a.util.*; | |
| 33 | import org .apache.lo g4j.Logger ; | |
| 34 | ||
| 35 | /** | |
| 36 | * @author
|
|
| 37 | * | |
| 38 | * A note about the configurat ion file: | |
| 39 | * The con figuration file load ing is rat her odd as it depend s on an | |
| 40 | * instanc e of this class to l oad the fi le and mak e the conf iguration | |
| 41 | * availab le in a st atic refer ence. | |
| 42 | * The rea son for th is is that the SPI's do not ha ve a refer ence to th eir | |
| 43 | * Provide r (this) a nd this do es not ins tantiate t he SPI's. | |
| 44 | * The con figuration is an ins tance refe rence and must stay that way b ecause it | |
| 45 | * uses th e name and version t o build th e file nam e. | |
| 46 | * Nonethe less, this will be l oaded by t he Service Loader bef ore an SPI can | |
| 47 | * be crea ted, so th ere is not a danger of an SPI being crea ted withou t | |
| 48 | * the con figuration being ini tialized. Nonethele ss there i s an error log | |
| 49 | * if the configurat ion is nul l when it is asked f or. | |
| 50 | */ | |
| 51 | public cla ss MixData SourceProv ider | |
| 52 | extends Pr ovider | |
| 53 | { | |
| 54 | pr ivate stat ic final S tring PROV IDER_NAME = "MIXData Source"; | |
| 55 | privat e static f inal doubl e PROVIDER _VERSION = 1.0d; | |
| 56 | privat e static f inal Strin g PROVIDER _INFO = | |
| 57 | "I mplements: \nStudyGr aphDataSou rce \nImag eDataSourc e SPI \n" + | |
| 58 | "b acked by a MIX data store."; | |
| 59 | privat e static M IXConfigur ation mixC onfigurati on = null; | |
| 60 | privat e static L ogger logg er = Logge r.getLogge r(MixDataS ourceProvi der.class) ; | |
| 61 | ||
| 62 | privat e static f inal long serialVers ionUID = 1 L; | |
| 63 | privat e final So rtedSet<Pr oviderServ ice> servi ces; | |
| 64 | ||
| 65 | pu blic MixDa taSourcePr ovider() | |
| 66 | { | |
| 67 | this (PROVIDER_ NAME, PROV IDER_VERSI ON, PROVID ER_INFO); | |
| 68 | } | |
| 69 | ||
| 70 | /* * | |
| 71 | * A special construct or that is only used for creat ing a conf iguration | |
| 72 | * file. | |
| 73 | * | |
| 74 | * @param MI XConfigura tion | |
| 75 | * / | |
| 76 | pr ivate MixD ataSourceP rovider(MI XConfigura tion mixCo nfiguratio n) | |
| 77 | { | |
| 78 | this (); | |
| 79 | MixD ataSourceP rovider.mi xConfigura tion = mix Configurat ion; | |
| 80 | } | |
| 81 | ||
| 82 | pu blic MixDa taSourcePr ovider(Str ing name, double ver sion, Stri ng info) | |
| 83 | { | |
| 84 | supe r(name, ve rsion, inf o); | |
| 85 | serv ices = new TreeSet<P roviderSer vice>(); | |
| 86 | // serv ices.add( | |
| 87 | // new Pr oviderServ ice( | |
| 88 | // this, | |
| 89 | // StudyGra phDataSour ceSpi.clas s, | |
| 90 | // MixStudy GraphDataS ourceServi ce.SUPPORT ED_PROTOCO L, | |
| 91 | // 1.0F, | |
| 92 | // MixStudy GraphDataS ourceServi ce.class) | |
| 93 | // ); | |
| 94 | // serv ices.add( | |
| 95 | // new Pr oviderServ ice( | |
| 96 | // this, | |
| 97 | // ImageDat aSourceSpi .class, | |
| 98 | // MixImage DataSource Service.SU PPORTED_PR OTOCOL, | |
| 99 | // 1.0F, | |
| 100 | // MixImage DataSource Service.cl ass) | |
| 101 | // ); | |
| 102 | // serv ices.add( | |
| 103 | // new Pr oviderServ ice( | |
| 104 | // this, | |
| 105 | // VistaRad DataSource Spi.class, | |
| 106 | // MixVista RadDataSou rceService .SUPPORTED _PROTOCOL, | |
| 107 | // 1.0F, | |
| 108 | // MixVista RadDataSou rceService .class) | |
| 109 | // ); | |
| 110 | // serv ices.add( | |
| 111 | // new Pr oviderServ ice( | |
| 112 | // this, | |
| 113 | // VistaRad ImageDataS ourceSpi.c lass, | |
| 114 | // MixVista RadImageDa taSourceSe rvice.SUPP ORTED_PROT OCOL, | |
| 115 | // 1.0F, | |
| 116 | // MixVista RadImageDa taSourceSe rvice.clas s) | |
| 117 | // ); | |
| 118 | serv ices.add( | |
| 119 | new Pr oviderServ ice( | |
| 120 | this, | |
| 121 | StudyGra phDataSour ceSpi.clas s, | |
| 122 | MixStudy GraphDataS ourceServi ceV1.SUPPO RTED_PROTO COL, | |
| 123 | 1.0F, | |
| 124 | MixStudy GraphDataS ourceServi ceV1.class ) | |
| 125 | ); | |
| 126 | serv ices.add( | |
| 127 | new Pr oviderServ ice( | |
| 128 | this, | |
| 129 | ImageDat aSourceSpi .class, | |
| 130 | MixImage DataSource ServiceV1. SUPPORTED_ PROTOCOL, | |
| 131 | 1.0F, | |
| 132 | MixImage DataSource ServiceV1. class) | |
| 133 | ); | |
| 134 | serv ices.add( | |
| 135 | new Pr oviderServ ice( | |
| 136 | this, | |
| 137 | VistaRad DataSource Spi.class, | |
| 138 | MixVista RadDataSou rceService V1.SUPPORT ED_PROTOCO L, | |
| 139 | 1.0F, | |
| 140 | MixVista RadDataSou rceService V1.class) | |
| 141 | ); | |
| 142 | serv ices.add( | |
| 143 | new Pr oviderServ ice( | |
| 144 | this, | |
| 145 | VistaRad ImageDataS ourceSpi.c lass, | |
| 146 | MixVista RadImageDa taSourceSe rviceV1.SU PPORTED_PR OTOCOL, | |
| 147 | 1.0F, | |
| 148 | MixVista RadImageDa taSourceSe rviceV1.cl ass) | |
| 149 | ); | |
| 150 | ||
| 151 | // l oad the MI XConfigura tion if it exists | |
| 152 | sync hronized(M ixDataSour ceProvider .class) | |
| 153 | { | |
| 154 | try | |
| 155 | { | |
| 156 | if(mixCo nfiguratio n == null) | |
| 157 | mixConfigu ration = ( MIXConfigu ration)loa dConfigura tion(); | |
| 158 | } | |
| 159 | catch( ClassCastE xception c cX) | |
| 160 | { | |
| 161 | logger.e rror("Unab le to load configura tion becau se the con figuration file is i nvalid.", ccX); | |
| 162 | } | |
| 163 | } | |
| 164 | } | |
| 165 | ||
| 166 | /* * | |
| 167 | * | |
| 168 | * / | |
| 169 | @O verride | |
| 170 | pu blic void storeConfi guration() | |
| 171 | { | |
| 172 | storeCon figuration (getMixCon figuration ()); | |
| 173 | } | |
| 174 | ||
| 175 | /* * | |
| 176 | * A package level met hod for SP I implemen tation to get the | |
| 177 | * Configura tion. | |
| 178 | * | |
| 179 | * @return | |
| 180 | * / | |
| 181 | pu blic stati c MIXConfi guration g etMixConfi guration() | |
| 182 | { | |
| 183 | if(m ixConfigur ation == n ull) | |
| 184 | logger .error("MI XConfigura tion is nu ll, possib ly called before Mix DataSource Provider w as instant iated."); | |
| 185 | ||
| 186 | retu rn mixConf iguration; | |
| 187 | } | |
| 188 | ||
| 189 | /* (non-Java doc) | |
| 190 | * @see gov. va.med.ima ging.datas ource.Prov ider#getSe rvices() | |
| 191 | * / | |
| 192 | @O verride | |
| 193 | pu blic Sorte dSet<Provi derService > getServi ces() { | |
| 194 | retu rn Collect ions.unmod ifiableSor tedSet(ser vices); | |
| 195 | } | |
| 196 | ||
| 197 | /* * | |
| 198 | * This crea tes by def ault a MIX data sour ce configu ration fil e for one DOD site. | |
| 199 | * To specif y the user name and p assword fo r communic ating with the DOD u se | |
| 200 | * the -biaP assword <P assword> a nd -biaUse rname <use rname> par ameters (f or now, un til instal l GUI chan ges). | |
| 201 | * You can a lso specif y VA site numbers to be create d with def ault value s separate d | |
| 202 | * by a spac e. This wi ll create | |
| 203 | * template output for VA sites - you will have to f ill in the correct u sername/pa ssword and | |
| 204 | * change an y other fi elds if ne cessary. | |
| 205 | * | |
| 206 | * You can a lso specif y alien si tes with t he -alienS ite paramt er followe d by the f ollowing a rguments: | |
| 207 | * <Alien Si te number> <host> <p ort> <user name> <pas sword> | |
| 208 | * | |
| 209 | * @param ar gs VA site numbers s eparated b y a space | |
| 210 | * / | |
| 211 | pu blic stati c void mai n(String[] argv) | |
| 212 | { | |
| 213 | try | |
| 214 | { | |
| 215 | System .out.print ln("Creati ng MIX dat asource co nfiguratio n file"); | |
| 216 | String biaUserna me = null; | |
| 217 | String biaPasswo rd = null; | |
| 218 | ||
| 219 | String [] vaSites = new Str ing[argv.l ength]; | |
| 220 | List<M IXSiteConf iguration> alienSite s = new Ar rayList<MI XSiteConfi guration>( ); | |
| 221 | List<S tring> emp tyStudyMod alities = new ArrayL ist<String >(); | |
| 222 | int va SiteIndex = 0; | |
| 223 | ||
| 224 | for(in t i = 0; i < argv.le ngth; i++) | |
| 225 | { | |
| 226 | if("-bia Username". equals(arg v[i])) | |
| 227 | { | |
| 228 | biaUsernam e = argv[+ +i]; | |
| 229 | } | |
| 230 | else if( "-biaPassw ord".equal s(argv[i]) ) | |
| 231 | { | |
| 232 | biaPasswor d = argv[+ +i]; | |
| 233 | } | |
| 234 | else if( "-alienSit e".equals( argv[i])) | |
| 235 | { | |
| 236 | String sit eNumber = argv[++i]; | |
| 237 | String hos t = argv[+ +i]; | |
| 238 | int port = Integer.p arseInt(ar gv[++i]); | |
| 239 | String use rname = ar gv[++i]; | |
| 240 | String pas sword = ar gv[++i]; | |
| 241 | alienSites .add(new M IXSiteConf iguration( siteNumber , username , password , "", "", "", "", "" , | |
| 242 | fals e, host, p ort)); | |
| 243 | } | |
| 244 | else if( "-emptyMod ality".equ als(argv[i ])) | |
| 245 | { | |
| 246 | String emp tyStudyMod ality = ar gv[++i]; | |
| 247 | emptyStudy Modalities .add(empty StudyModal ity); | |
| 248 | } | |
| 249 | else | |
| 250 | { | |
| 251 | try | |
| 252 | { | |
| 253 | In teger.pars eInt(argv[ i]); | |
| 254 | va Sites[vaSi teIndex++] = argv[i] ; | |
| 255 | } | |
| 256 | catch(Numb erFormatEx ception nf X) | |
| 257 | { | |
| 258 | Sy stem.out.p rintln("Er ror conver ting " + a rgv[i] + " to numeri c site num ber, ignor ing ..."); | |
| 259 | } | |
| 260 | } | |
| 261 | } | |
| 262 | // nul l the rema inder of t he array p ositions | |
| 263 | for(; vaSiteInde x < vaSite s.length; ++vaSiteIn dex) | |
| 264 | vaSites[ vaSiteInde x] = null; | |
| 265 | ||
| 266 | MIXCon figuration miXConfig uration = | |
| 267 | MIXConfi guration.c reateDefau ltMixConfi guration(v aSites, bi aUsername, biaPasswo rd, | |
| 268 | al ienSites, emptyStudy Modalities , MIXConfi guration.d efaultMeta dataTimeou t); | |
| 269 | ||
| 270 | MixDat aSourcePro vider prov ider = new MixDataSo urceProvid er(miXConf iguration) ; | |
| 271 | provid er.storeCo nfiguratio n(); | |
| 272 | System .out.print ln("Config uration fi le saved t o '" + pro vider.getC onfigurati onFileName () + "'.") ; | |
| 273 | } | |
| 274 | catc h(MIXConfi gurationEx ception ec X) | |
| 275 | { | |
| 276 | ecX.pr intStackTr ace(); | |
| 277 | } | |
| 278 | } | |
| 279 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.