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\MIXDataSource\main\src\java\gov\va\med\imaging\mixdatasource | MixDataSourceProvider.java | Mon Dec 4 21:34:38 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\MIXDataSource\main\src\java\gov\va\med\imaging\mixdatasource | MixDataSourceProvider.java | Mon Dec 4 22:04:12 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 580 |
| 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 gging.log4 j.LogManag er; | |
| 34 | import org .apache.lo gging.log4 j.Logger; | |
| 35 | ||
| 36 | /** | |
| 37 | * @author
|
|
| 38 | * | |
| 39 | * A note about the configurat ion file: | |
| 40 | * The con figuration file load ing is rat her odd as it depend s on an | |
| 41 | * instanc e of this class to l oad the fi le and mak e the conf iguration | |
| 42 | * availab le in a st atic refer ence. | |
| 43 | * The rea son for th is is that the SPI's do not ha ve a refer ence to th eir | |
| 44 | * Provide r (this) a nd this do es not ins tantiate t he SPI's. | |
| 45 | * The con figuration is an ins tance refe rence and must stay that way b ecause it | |
| 46 | * uses th e name and version t o build th e file nam e. | |
| 47 | * Nonethe less, this will be l oaded by t he Service Loader bef ore an SPI can | |
| 48 | * be crea ted, so th ere is not a danger of an SPI being crea ted withou t | |
| 49 | * the con figuration being ini tialized. Nonethele ss there i s an error log | |
| 50 | * if the configurat ion is nul l when it is asked f or. | |
| 51 | */ | |
| 52 | public cla ss MixData SourceProv ider | |
| 53 | extends Pr ovider | |
| 54 | { | |
| 55 | pr ivate stat ic final S tring PROV IDER_NAME = "MIXData Source"; | |
| 56 | privat e static f inal doubl e PROVIDER _VERSION = 1.0d; | |
| 57 | privat e static f inal Strin g PROVIDER _INFO = | |
| 58 | "I mplements: \nStudyGr aphDataSou rce \nImag eDataSourc e SPI \n" + | |
| 59 | "b acked by a MIX data store."; | |
| 60 | privat e static M IXConfigur ation mixC onfigurati on = null; | |
| 61 | privat e static L ogger logg er = LogMa nager.getL ogger(MixD ataSourceP rovider.cl ass); | |
| 62 | ||
| 63 | privat e static f inal long serialVers ionUID = 1 L; | |
| 64 | privat e final So rtedSet<Pr oviderServ ice> servi ces; | |
| 65 | ||
| 66 | pu blic MixDa taSourcePr ovider() | |
| 67 | { | |
| 68 | this (PROVIDER_ NAME, PROV IDER_VERSI ON, PROVID ER_INFO); | |
| 69 | } | |
| 70 | ||
| 71 | /* * | |
| 72 | * A special construct or that is only used for creat ing a conf iguration | |
| 73 | * file. | |
| 74 | * | |
| 75 | * @param MI XConfigura tion | |
| 76 | * / | |
| 77 | pr ivate MixD ataSourceP rovider(MI XConfigura tion mixCo nfiguratio n) | |
| 78 | { | |
| 79 | this (); | |
| 80 | MixD ataSourceP rovider.mi xConfigura tion = mix Configurat ion; | |
| 81 | } | |
| 82 | ||
| 83 | pu blic MixDa taSourcePr ovider(Str ing name, double ver sion, Stri ng info) | |
| 84 | { | |
| 85 | supe r(name, ve rsion, inf o); | |
| 86 | serv ices = new TreeSet<P roviderSer vice>(); | |
| 87 | // serv ices.add( | |
| 88 | // new Pr oviderServ ice( | |
| 89 | // this, | |
| 90 | // StudyGra phDataSour ceSpi.clas s, | |
| 91 | // MixStudy GraphDataS ourceServi ce.SUPPORT ED_PROTOCO L, | |
| 92 | // 1.0F, | |
| 93 | // MixStudy GraphDataS ourceServi ce.class) | |
| 94 | // ); | |
| 95 | // serv ices.add( | |
| 96 | // new Pr oviderServ ice( | |
| 97 | // this, | |
| 98 | // ImageDat aSourceSpi .class, | |
| 99 | // MixImage DataSource Service.SU PPORTED_PR OTOCOL, | |
| 100 | // 1.0F, | |
| 101 | // MixImage DataSource Service.cl ass) | |
| 102 | // ); | |
| 103 | // serv ices.add( | |
| 104 | // new Pr oviderServ ice( | |
| 105 | // this, | |
| 106 | // VistaRad DataSource Spi.class, | |
| 107 | // MixVista RadDataSou rceService .SUPPORTED _PROTOCOL, | |
| 108 | // 1.0F, | |
| 109 | // MixVista RadDataSou rceService .class) | |
| 110 | // ); | |
| 111 | // serv ices.add( | |
| 112 | // new Pr oviderServ ice( | |
| 113 | // this, | |
| 114 | // VistaRad ImageDataS ourceSpi.c lass, | |
| 115 | // MixVista RadImageDa taSourceSe rvice.SUPP ORTED_PROT OCOL, | |
| 116 | // 1.0F, | |
| 117 | // MixVista RadImageDa taSourceSe rvice.clas s) | |
| 118 | // ); | |
| 119 | serv ices.add( | |
| 120 | new Pr oviderServ ice( | |
| 121 | this, | |
| 122 | StudyGra phDataSour ceSpi.clas s, | |
| 123 | MixStudy GraphDataS ourceServi ceV1.SUPPO RTED_PROTO COL, | |
| 124 | 1.0F, | |
| 125 | MixStudy GraphDataS ourceServi ceV1.class ) | |
| 126 | ); | |
| 127 | serv ices.add( | |
| 128 | new Pr oviderServ ice( | |
| 129 | this, | |
| 130 | ImageDat aSourceSpi .class, | |
| 131 | MixImage DataSource ServiceV1. SUPPORTED_ PROTOCOL, | |
| 132 | 1.0F, | |
| 133 | MixImage DataSource ServiceV1. class) | |
| 134 | ); | |
| 135 | serv ices.add( | |
| 136 | new Pr oviderServ ice( | |
| 137 | this, | |
| 138 | VistaRad DataSource Spi.class, | |
| 139 | MixVista RadDataSou rceService V1.SUPPORT ED_PROTOCO L, | |
| 140 | 1.0F, | |
| 141 | MixVista RadDataSou rceService V1.class) | |
| 142 | ); | |
| 143 | serv ices.add( | |
| 144 | new Pr oviderServ ice( | |
| 145 | this, | |
| 146 | VistaRad ImageDataS ourceSpi.c lass, | |
| 147 | MixVista RadImageDa taSourceSe rviceV1.SU PPORTED_PR OTOCOL, | |
| 148 | 1.0F, | |
| 149 | MixVista RadImageDa taSourceSe rviceV1.cl ass) | |
| 150 | ); | |
| 151 | ||
| 152 | // l oad the MI XConfigura tion if it exists | |
| 153 | sync hronized(M ixDataSour ceProvider .class) | |
| 154 | { | |
| 155 | try | |
| 156 | { | |
| 157 | if(mixCo nfiguratio n == null) | |
| 158 | mixConfigu ration = ( MIXConfigu ration)loa dConfigura tion(); | |
| 159 | } | |
| 160 | catch( ClassCastE xception c cX) | |
| 161 | { | |
| 162 | logger.e rror("Unab le to load configura tion becau se the con figuration file is i nvalid.", ccX); | |
| 163 | } | |
| 164 | } | |
| 165 | } | |
| 166 | ||
| 167 | /* * | |
| 168 | * | |
| 169 | * / | |
| 170 | @O verride | |
| 171 | pu blic void storeConfi guration() | |
| 172 | { | |
| 173 | storeCon figuration (getMixCon figuration ()); | |
| 174 | } | |
| 175 | ||
| 176 | /* * | |
| 177 | * A package level met hod for SP I implemen tation to get the | |
| 178 | * Configura tion. | |
| 179 | * | |
| 180 | * @return | |
| 181 | * / | |
| 182 | pu blic stati c MIXConfi guration g etMixConfi guration() | |
| 183 | { | |
| 184 | if(m ixConfigur ation == n ull) | |
| 185 | logger .error("MI XConfigura tion is nu ll, possib ly called before Mix DataSource Provider w as instant iated."); | |
| 186 | ||
| 187 | retu rn mixConf iguration; | |
| 188 | } | |
| 189 | ||
| 190 | /* (non-Java doc) | |
| 191 | * @see gov. va.med.ima ging.datas ource.Prov ider#getSe rvices() | |
| 192 | * / | |
| 193 | @O verride | |
| 194 | pu blic Sorte dSet<Provi derService > getServi ces() { | |
| 195 | retu rn Collect ions.unmod ifiableSor tedSet(ser vices); | |
| 196 | } | |
| 197 | ||
| 198 | /* * | |
| 199 | * This crea tes by def ault a MIX data sour ce configu ration fil e for one DOD site. | |
| 200 | * To specif y the user name and p assword fo r communic ating with the DOD u se | |
| 201 | * the -biaP assword <P assword> a nd -biaUse rname <use rname> par ameters (f or now, un til instal l GUI chan ges). | |
| 202 | * You can a lso specif y VA site numbers to be create d with def ault value s separate d | |
| 203 | * by a spac e. This wi ll create | |
| 204 | * template output for VA sites - you will have to f ill in the correct u sername/pa ssword and | |
| 205 | * change an y other fi elds if ne cessary. | |
| 206 | * | |
| 207 | * You can a lso specif y alien si tes with t he -alienS ite paramt er followe d by the f ollowing a rguments: | |
| 208 | * <Alien Si te number> <host> <p ort> <user name> <pas sword> | |
| 209 | * | |
| 210 | * @param ar gs VA site numbers s eparated b y a space | |
| 211 | * / | |
| 212 | pu blic stati c void mai n(String[] argv) | |
| 213 | { | |
| 214 | try | |
| 215 | { | |
| 216 | System .out.print ln("Creati ng MIX dat asource co nfiguratio n file"); | |
| 217 | String biaUserna me = null; | |
| 218 | String biaPasswo rd = null; | |
| 219 | String dodConnec torHost = null; | |
| 220 | String dodConnec torPort = "0"; | |
| 221 | String cvixCertP wd = null; | |
| 222 | String dasCertPw d = null; | |
| 223 | ||
| 224 | List<M IXSiteConf iguration> alienSite s = new Ar rayList<MI XSiteConfi guration>( ); | |
| 225 | List<S tring> emp tyStudyMod alities = new ArrayL ist<String >(); | |
| 226 | ||
| 227 | for(in t i = 0; i < argv.le ngth; i++) | |
| 228 | { | |
| 229 | System.o ut.println ("arg[" + i + "] = " + argv[i] + " " + a rgv[i+1]); | |
| 230 | ||
| 231 | //if("-b iaUsername ".equals(a rgv[i])) | |
| 232 | //{ | |
| 233 | // biaUsernam e = argv[+ +i]; | |
| 234 | //} | |
| 235 | //else i f("-biaPas sword".equ als(argv[i ])) | |
| 236 | //{ | |
| 237 | // biaPasswor d = argv[+ +i]; | |
| 238 | //} | |
| 239 | //else i f("-alienS ite".equal s(argv[i]) ) | |
| 240 | //{ | |
| 241 | // String sit eNumber = argv[++i]; | |
| 242 | // String hos t = argv[+ +i]; | |
| 243 | // int port = Integer.p arseInt(ar gv[++i]); | |
| 244 | // String use rname = ar gv[++i]; | |
| 245 | // String pas sword = ar gv[++i]; | |
| 246 | // alienSites .add(new M IXSiteConf iguration( siteNumber , username , password , "", "", "", "", "" , | |
| 247 | // fals e, host, p ort)); | |
| 248 | //} | |
| 249 | ||
| 250 | if("-hos t".equals( argv[i])) | |
| 251 | { | |
| 252 | dodConnect orHost = a rgv[++i]; | |
| 253 | } | |
| 254 | else if( "-port".eq uals(argv[ i])) | |
| 255 | { | |
| 256 | dodConnect orPort = a rgv[++i]; | |
| 257 | } | |
| 258 | else if( "-cvixCert Pwd".equal s(argv[i]) ) | |
| 259 | { | |
| 260 | cvixCertPw d = argv[+ +i]; | |
| 261 | } | |
| 262 | else if( "-dasCertP wd".equals (argv[i])) | |
| 263 | { | |
| 264 | dasCertPwd = argv[++ i]; | |
| 265 | } | |
| 266 | ||
| 267 | else if( "-emptyMod ality".equ als(argv[i ])) | |
| 268 | { | |
| 269 | String emp tyStudyMod ality = ar gv[++i]; | |
| 270 | emptyStudy Modalities .add(empty StudyModal ity); | |
| 271 | } | |
| 272 | } | |
| 273 | ||
| 274 | MIXCon figuration miXConfig uration = | |
| 275 | MIXConfi guration.c reateDefau ltMixConfi guration( | |
| 276 | em ptyStudyMo dalities, | |
| 277 | MI XConfigura tion.defau ltMetadata Timeout, | |
| 278 | do dConnector Host, | |
| 279 | In teger.pars eInt(dodCo nnectorPor t), | |
| 280 | cv ixCertPwd, | |
| 281 | da sCertPwd); | |
| 282 | ||
| 283 | MixDat aSourcePro vider prov ider = new MixDataSo urceProvid er(miXConf iguration) ; | |
| 284 | provid er.storeCo nfiguratio n(); | |
| 285 | System .out.print ln("Config uration fi le saved t o '" + pro vider.getC onfigurati onFileName () + "'.") ; | |
| 286 | } | |
| 287 | catc h(MIXConfi gurationEx ception ec X) | |
| 288 | { | |
| 289 | ecX.pr intStackTr ace(); | |
| 290 | } | |
| 291 | } | |
| 292 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.