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\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchangedatasource | ExchangeDataSourceProvider.java | Mon Dec 4 21:34:44 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchangedatasource | ExchangeDataSourceProvider.java | Mon Dec 4 22:00:06 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 556 |
| 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.exc hangedatas ource; | |
| 27 | ||
| 28 | import gov .va.med.im aging.data source.*; | |
| 29 | import gov .va.med.im aging.url. exchange.c onfigurati on.Exchang eConfigura tion; | |
| 30 | import gov .va.med.im aging.url. exchange.c onfigurati on.Exchang eSiteConfi guration; | |
| 31 | import gov .va.med.im aging.url. exchange.e xceptions. ExchangeCo 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 Exchang eDataSourc eProvider | |
| 53 | extends Pr ovider | |
| 54 | { | |
| 55 | pr ivate stat ic final S tring PROV IDER_NAME = "Exchang eDataSourc e"; | |
| 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 n Exchange data stor e."; | |
| 60 | privat e static E xchangeCon figuration exchangeC onfigurati on = null; | |
| 61 | privat e static L ogger logg er = LogMa nager.getL ogger(Exch angeDataSo urceProvid er.class); | |
| 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 Excha ngeDataSou rceProvide r() | |
| 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 ex changeConf iguration | |
| 76 | * / | |
| 77 | pr ivate Exch angeDataSo urceProvid er(Exchang eConfigura tion excha ngeConfigu ration) | |
| 78 | { | |
| 79 | this (); | |
| 80 | Exch angeDataSo urceProvid er.exchang eConfigura tion = exc hangeConfi guration; | |
| 81 | } | |
| 82 | ||
| 83 | pu blic Excha ngeDataSou rceProvide r(String n ame, doubl e version, String in fo) | |
| 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 | Exchange StudyGraph DataSource Service.SU PPORTED_PR OTOCOL, | |
| 92 | 1.0F, | |
| 93 | Exchange StudyGraph DataSource Service.cl ass) | |
| 94 | ); | |
| 95 | serv ices.add( | |
| 96 | new Pr oviderServ ice( | |
| 97 | this, | |
| 98 | ImageDat aSourceSpi .class, | |
| 99 | Exchange ImageDataS ourceServi ce.SUPPORT ED_PROTOCO L, | |
| 100 | 1.0F, | |
| 101 | Exchange ImageDataS ourceServi ce.class) | |
| 102 | ); | |
| 103 | serv ices.add( | |
| 104 | new Pr oviderServ ice( | |
| 105 | this, | |
| 106 | VistaRad DataSource Spi.class, | |
| 107 | Exchange VistaRadDa taSourceSe rvice.SUPP ORTED_PROT OCOL, | |
| 108 | 1.0F, | |
| 109 | Exchange VistaRadDa taSourceSe rvice.clas s) | |
| 110 | ); | |
| 111 | serv ices.add( | |
| 112 | new Pr oviderServ ice( | |
| 113 | this, | |
| 114 | VistaRad ImageDataS ourceSpi.c lass, | |
| 115 | Exchange VistaRadIm ageDataSou rceService .SUPPORTED _PROTOCOL, | |
| 116 | 1.0F, | |
| 117 | Exchange VistaRadIm ageDataSou rceService .class) | |
| 118 | ); | |
| 119 | serv ices.add( | |
| 120 | new Pr oviderServ ice( | |
| 121 | this, | |
| 122 | StudyGra phDataSour ceSpi.clas s, | |
| 123 | Exchange StudyGraph DataSource ServiceV2. SUPPORTED_ PROTOCOL, | |
| 124 | 2.0F, | |
| 125 | Exchange StudyGraph DataSource ServiceV2. class) | |
| 126 | ); | |
| 127 | serv ices.add( | |
| 128 | new Pr oviderServ ice( | |
| 129 | this, | |
| 130 | ImageDat aSourceSpi .class, | |
| 131 | Exchange ImageDataS ourceServi ceV2.SUPPO RTED_PROTO COL, | |
| 132 | 2.0F, | |
| 133 | Exchange ImageDataS ourceServi ceV2.class ) | |
| 134 | ); | |
| 135 | serv ices.add( | |
| 136 | new Pr oviderServ ice( | |
| 137 | this, | |
| 138 | VistaRad DataSource Spi.class, | |
| 139 | Exchange VistaRadDa taSourceSe rviceV2.SU PPORTED_PR OTOCOL, | |
| 140 | 2.0F, | |
| 141 | Exchange VistaRadDa taSourceSe rviceV2.cl ass) | |
| 142 | ); | |
| 143 | serv ices.add( | |
| 144 | new Pr oviderServ ice( | |
| 145 | this, | |
| 146 | VistaRad ImageDataS ourceSpi.c lass, | |
| 147 | Exchange VistaRadIm ageDataSou rceService V2.SUPPORT ED_PROTOCO L, | |
| 148 | 2.0F, | |
| 149 | Exchange VistaRadIm ageDataSou rceService V2.class) | |
| 150 | ); | |
| 151 | ||
| 152 | // l oad the Ex changeConf iguration if it exis ts | |
| 153 | sync hronized(E xchangeDat aSourcePro vider.clas s) | |
| 154 | { | |
| 155 | try | |
| 156 | { | |
| 157 | if(excha ngeConfigu ration == null) | |
| 158 | exchangeCo nfiguratio n = (Excha ngeConfigu 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 (getExchan geConfigur ation()); | |
| 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 | st atic Excha ngeConfigu ration get ExchangeCo nfiguratio n() | |
| 183 | { | |
| 184 | if(e xchangeCon figuration == null) | |
| 185 | logger .error("Ex changeConf iguration is null, p ossibly ca lled befor e Exchange DataSource Provider w as instant iated."); | |
| 186 | ||
| 187 | retu rn exchang eConfigura tion; | |
| 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 exc hange data source co nfiguratio n file for one DOD s ite. | |
| 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. | |
| 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 exchang e datasour ce configu ration fil e"); | |
| 217 | String biaUserna me = null; | |
| 218 | String biaPasswo rd = null; | |
| 219 | ||
| 220 | String [] vaSites = new Str ing[argv.l ength]; | |
| 221 | List<E xchangeSit eConfigura tion> alie nSites = n ew ArrayLi st<Exchang eSiteConfi guration>( ); | |
| 222 | List<S tring> emp tyStudyMod alities = new ArrayL ist<String >(); | |
| 223 | int va SiteIndex = 0; | |
| 224 | ||
| 225 | for(in t i = 0; i < argv.le ngth; i++) | |
| 226 | { | |
| 227 | if("-bia Username". equals(arg v[i])) | |
| 228 | { | |
| 229 | biaUsernam e = argv[+ +i]; | |
| 230 | } | |
| 231 | else if( "-biaPassw ord".equal s(argv[i]) ) | |
| 232 | { | |
| 233 | biaPasswor d = argv[+ +i]; | |
| 234 | } | |
| 235 | else if( "-alienSit e".equals( argv[i])) | |
| 236 | { | |
| 237 | String sit eNumber = argv[++i]; | |
| 238 | String hos t = argv[+ +i]; | |
| 239 | int port = Integer.p arseInt(ar gv[++i]); | |
| 240 | String use rname = ar gv[++i]; | |
| 241 | String pas sword = ar gv[++i]; | |
| 242 | alienSites .add(new E xchangeSit eConfigura tion(siteN umber, use rname, pas sword, "", "", "", | |
| 243 | fals e, host, p ort)); | |
| 244 | } | |
| 245 | else if( "-emptyMod ality".equ als(argv[i ])) | |
| 246 | { | |
| 247 | String emp tyStudyMod ality = ar gv[++i]; | |
| 248 | emptyStudy Modalities .add(empty StudyModal ity); | |
| 249 | } | |
| 250 | else | |
| 251 | { | |
| 252 | try | |
| 253 | { | |
| 254 | In teger.pars eInt(argv[ i]); | |
| 255 | va Sites[vaSi teIndex++] = argv[i] ; | |
| 256 | } | |
| 257 | catch(Numb erFormatEx ception nf X) | |
| 258 | { | |
| 259 | Sy stem.out.p rintln("Er ror conver ting " + a rgv[i] + " to numeri c site num ber, ignor ing ..."); | |
| 260 | } | |
| 261 | } | |
| 262 | } | |
| 263 | // nul l the rema inder of t he array p ositions | |
| 264 | for(; vaSiteInde x < vaSite s.length; ++vaSiteIn dex) | |
| 265 | vaSites[ vaSiteInde x] = null; | |
| 266 | ||
| 267 | Exchan geConfigur ation xcha ngeConfigu ration = | |
| 268 | Exchange Configurat ion.create DefaultExc hangeConfi guration(v aSites, bi aUsername, biaPasswo rd, | |
| 269 | al ienSites, emptyStudy Modalities , Exchange Configurat ion.defaul tMetadataT imeout); | |
| 270 | ||
| 271 | Exchan geDataSour ceProvider provider = new Exch angeDataSo urceProvid er(xchange Configurat ion); | |
| 272 | provid er.storeCo nfiguratio n(); | |
| 273 | System .out.print ln("Config uration fi le saved t o '" + pro vider.getC onfigurati onFileName () + "'.") ; | |
| 274 | } | |
| 275 | catc h(Exchange Configurat ionExcepti on ecX) | |
| 276 | { | |
| 277 | ecX.pr intStackTr ace(); | |
| 278 | } | |
| 279 | } | |
| 280 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.