Produced by Araxis Merge on 12/5/2017 12:06:41 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\FederationDataSourceProvider\main\src\java\gov\va\med\imaging\federationdatasource\v5 | FederationUserDataSourceServiceV5.java | Mon Dec 4 21:35:06 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\FederationDataSourceProvider\main\src\java\gov\va\med\imaging\federationdatasource\v5 | FederationUserDataSourceServiceV5.java | Mon Dec 4 22:00:37 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 498 |
| 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: Jun 21, 2011 | |
| 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.fed erationdat asource.v5 ; | |
| 27 | ||
| 28 | import jav a.io.IOExc eption; | |
| 29 | import jav a.util.Lis t; | |
| 30 | ||
| 31 | import org .apache.lo gging.log4 j.LogManag er; | |
| 32 | import org .apache.lo gging.log4 j.Logger; | |
| 33 | ||
| 34 | import gov .va.med.Ro utingToken ; | |
| 35 | import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce; | |
| 36 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
| 37 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
| 38 | import gov .va.med.im aging.core .interface s.exceptio ns.Securit yException ; | |
| 39 | import gov .va.med.im aging.data source.Use rDataSourc eSpi; | |
| 40 | import gov .va.med.im aging.data source.exc eptions.Un supportedP rotocolExc eption; | |
| 41 | import gov .va.med.im aging.data source.exc eptions.Un supportedS erviceMeth odExceptio n; | |
| 42 | import gov .va.med.im aging.exch ange.busin ess.Applic ationTimeo utParamete rs; | |
| 43 | import gov .va.med.im aging.exch ange.busin ess.Divisi on; | |
| 44 | import gov .va.med.im aging.exch ange.busin ess.Electr onicSignat ureResult; | |
| 45 | import gov .va.med.im aging.exch ange.busin ess.Resolv edSite; | |
| 46 | import gov .va.med.im aging.exch ange.busin ess.Site; | |
| 47 | import gov .va.med.im aging.exch ange.busin ess.UserIn formation; | |
| 48 | import gov .va.med.im aging.fede ration.pro xy.Federat ionProxyUt ilities; | |
| 49 | import gov .va.med.im aging.fede ration.pro xy.v5.Fede rationRest UserProxyV 5; | |
| 50 | import gov .va.med.im aging.fede rationdata source.Abs tractFeder ationDataS ourceServi ce; | |
| 51 | import gov .va.med.im aging.prox y.services .ProxyServ iceType; | |
| 52 | import gov .va.med.im aging.prox y.services .ProxyServ ices; | |
| 53 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 54 | import gov .va.med.im aging.url. federation .exception s.Federati onConnecti onExceptio n; | |
| 55 | import gov .va.med.im aging.url. vftp.VftpC onnection; | |
| 56 | ||
| 57 | /** | |
| 58 | * @author
|
|
| 59 | * | |
| 60 | */ | |
| 61 | public cla ss Federat ionUserDat aSourceSer viceV5 | |
| 62 | extends Ab stractFede rationData SourceServ ice | |
| 63 | implements UserDataS ourceSpi | |
| 64 | { | |
| 65 | pr otected fi nal VftpCo nnection f ederationC onnection; | |
| 66 | pr ivate Prox yServices federation ProxyServi ces = null ; | |
| 67 | ||
| 68 | pr ivate fina l static S tring DATA SOURCE_VER SION = "5" ; | |
| 69 | pr ivate Fede rationRest UserProxyV 5 proxy = null; | |
| 70 | pu blic final static St ring SUPPO RTED_PROTO COL = "vft p"; | |
| 71 | pr ivate fina l static S tring FEDE RATION_PRO XY_SERVICE _NAME = "F ederation" ; | |
| 72 | ||
| 73 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Fede rationUser DataSource ServiceV5. class); | |
| 74 | ||
| 75 | pu blic Feder ationUserD ataSourceS erviceV5(R esolvedArt ifactSourc e resolved ArtifactSo urce, Stri ng protoco l) | |
| 76 | th rows Unsup portedOper ationExcep tion | |
| 77 | { | |
| 78 | supe r(resolved ArtifactSo urce, prot ocol); | |
| 79 | fede rationConn ection = n ew VftpCon nection(ge tMetadataU rl()); | |
| 80 | ||
| 81 | if(! (resolved ArtifactSo urce insta nceof Reso lvedSite) ) | |
| 82 | throw new Unsupp ortedOpera tionExcept ion("The a rtifact so urce must be an inst ance of Re solvedSite and it is a '" + re solvedArti factSource .getClass( ).getSimpl eName() + "'."); | |
| 83 | } | |
| 84 | ||
| 85 | pu blic stati c Federati onUserData SourceServ iceV5 crea te(Resolve dArtifactS ource reso lvedArtifa ctSource, String pro tocol) | |
| 86 | th rows Conne ctionExcep tion, Unsu pportedPro tocolExcep tion | |
| 87 | { | |
| 88 | retu rn new Fed erationUse rDataSourc eServiceV5 (resolvedA rtifactSou rce, proto col); | |
| 89 | } | |
| 90 | ||
| 91 | pr otected Lo gger getLo gger() | |
| 92 | { | |
| 93 | retu rn logger; | |
| 94 | } | |
| 95 | ||
| 96 | pr otected Pr oxyService Type getPr oxyService Type() | |
| 97 | { | |
| 98 | retu rn ProxySe rviceType. metadata; | |
| 99 | } | |
| 100 | ||
| 101 | @O verride | |
| 102 | pu blic List< String> ge tUserKeys( RoutingTok en globalR outingToke n) | |
| 103 | th rows Metho dException , Connecti onExceptio n | |
| 104 | { | |
| 105 | getL ogger().in fo("getUse rKeys Tran sactionCon text (" + | |
| 106 | Transact ionContext Factory.ge t().getDis playIdenti ty() + "). "); | |
| 107 | try | |
| 108 | { | |
| 109 | federa tionConnec tion.conne ct(); | |
| 110 | } | |
| 111 | catc h(IOExcept ion ioX) | |
| 112 | { | |
| 113 | getLog ger().erro r("Error g etting use r keys", i oX); | |
| 114 | throw new Federa tionConnec tionExcept ion(ioX); | |
| 115 | } | |
| 116 | List <String> r esult = ge tProxy().g etUserKeys (globalRou tingToken) ; | |
| 117 | getL ogger().in fo("getUse rKeys got [" + (resu lt == null ? "null" : result.s ize()) + " ] user key s from sit e [" + get Site().get SiteNumber () + "]"); | |
| 118 | retu rn result; | |
| 119 | } | |
| 120 | ||
| 121 | @O verride | |
| 122 | pu blic List< Division> getDivisio nList(Stri ng accessC ode, | |
| 123 | Routin gToken glo balRouting Token) | |
| 124 | th rows Metho dException , Connecti onExceptio n | |
| 125 | { | |
| 126 | getL ogger().in fo("getDiv isionList Transactio nContext ( " + | |
| 127 | Transact ionContext Factory.ge t().getDis playIdenti ty() + "). "); | |
| 128 | try | |
| 129 | { | |
| 130 | federa tionConnec tion.conne ct(); | |
| 131 | } | |
| 132 | catc h(IOExcept ion ioX) | |
| 133 | { | |
| 134 | getLog ger().erro r("Error g etting div ision list ", ioX); | |
| 135 | throw new Federa tionConnec tionExcept ion(ioX); | |
| 136 | } | |
| 137 | List <Division> result = getProxy() .getDivisi onList(acc essCode, g lobalRouti ngToken); | |
| 138 | getL ogger().in fo("getDiv isionList got [" + ( result == null ? "nu ll" : resu lt.size()) + "] divi sions from site [" + getSite() .getSiteNu mber() + " ]"); | |
| 139 | retu rn result; | |
| 140 | } | |
| 141 | ||
| 142 | @O verride | |
| 143 | pu blic UserI nformation getUserIn formation( RoutingTok en globalR outingToke n) | |
| 144 | th rows Metho dException , Connecti onExceptio n | |
| 145 | { | |
| 146 | getL ogger().in fo("getUse rInformati on Transac tionContex t (" + | |
| 147 | Transact ionContext Factory.ge t().getDis playIdenti ty() + "). "); | |
| 148 | try | |
| 149 | { | |
| 150 | federa tionConnec tion.conne ct(); | |
| 151 | } | |
| 152 | catc h(IOExcept ion ioX) | |
| 153 | { | |
| 154 | getLog ger().erro r("Error g etting use r informat ion", ioX) ; | |
| 155 | throw new Federa tionConnec tionExcept ion(ioX); | |
| 156 | } | |
| 157 | User Informatio n result = getProxy( ).getUserI nformation (globalRou tingToken) ; | |
| 158 | getL ogger().in fo("getUse rInformati on got [" + (result == null ? "null" : " not null") + "] user informati on from si te [" + ge tSite().ge tSiteNumbe r() + "]") ; | |
| 159 | retu rn result; | |
| 160 | } | |
| 161 | ||
| 162 | @O verride | |
| 163 | pu blic boole an isVersi onCompatib le() | |
| 164 | th rows Secur ityExcepti on | |
| 165 | { | |
| 166 | if(g etFederati onProxySer vices() == null) | |
| 167 | return false; | |
| 168 | try | |
| 169 | { | |
| 170 | getLog ger().debu g("Found F ederationP roxyServic es, lookin g for '" + getProxyS erviceType () + "' se rvice type at site [ " + getSit e().getSit eNumber() + "]."); | |
| 171 | getFed erationPro xyServices ().getProx yService(g etProxySer viceType() ); | |
| 172 | getLog ger().debu g("Found s ervice typ e '" + get ProxyServi ceType() + "' at sit e [" + get Site().get SiteNumber () + "], r eturning t rue for ve rsion comp atible."); | |
| 173 | return true; | |
| 174 | } | |
| 175 | catc h(gov.va.m ed.imaging .proxy.exc eptions.Pr oxyService NotFoundEx ception ps nfX) | |
| 176 | { | |
| 177 | getLog ger().warn ("Cannot f ind proxy service ty pe '" + ge tProxyServ iceType() + "' at si te [" + ge tSite().ge tSiteNumbe r() + "]") ; | |
| 178 | return false; | |
| 179 | } | |
| 180 | } | |
| 181 | ||
| 182 | pr otected Pr oxyService s getFeder ationProxy Services() | |
| 183 | { | |
| 184 | if(f ederationP roxyServic es == null ) | |
| 185 | { | |
| 186 | federa tionProxyS ervices = | |
| 187 | Federati onProxyUti lities.get Federation ProxyServi ces(getSit e(), | |
| 188 | ge tFederatio nProxyName (), getDat aSourceVer sion()); | |
| 189 | } | |
| 190 | retu rn federat ionProxySe rvices; | |
| 191 | } | |
| 192 | ||
| 193 | pr otected St ring getFe derationPr oxyName() | |
| 194 | { | |
| 195 | retu rn FEDERAT ION_PROXY_ SERVICE_NA ME; | |
| 196 | } | |
| 197 | ||
| 198 | pu blic Strin g getDataS ourceVersi on() | |
| 199 | { | |
| 200 | retu rn DATASOU RCE_VERSIO N; | |
| 201 | } | |
| 202 | ||
| 203 | /* * | |
| 204 | * The artif act source must be c hecked in the constr uctor to a ssure that it is an instance | |
| 205 | * of Resolv edSite. | |
| 206 | * | |
| 207 | * @return | |
| 208 | * / | |
| 209 | pr otected Re solvedSite getResolv edSite() | |
| 210 | { | |
| 211 | retu rn (Resolv edSite)get ResolvedAr tifactSour ce(); | |
| 212 | } | |
| 213 | ||
| 214 | pr otected Si te getSite () | |
| 215 | { | |
| 216 | retu rn getReso lvedSite() .getSite() ; | |
| 217 | } | |
| 218 | ||
| 219 | pr otected Fe derationRe stUserProx yV5 getPro xy() | |
| 220 | th rows Conne ctionExcep tion | |
| 221 | { | |
| 222 | if(p roxy == nu ll) | |
| 223 | { | |
| 224 | ProxyS ervices pr oxyService s = getFed erationPro xyServices (); | |
| 225 | if(pro xyServices == null) | |
| 226 | throw ne w Connecti onExceptio n("Did not receive a ny applica ble servic es from ID S service for site [ " + getSit e().getSit eNumber() + "]"); | |
| 227 | proxy = new Fede rationRest UserProxyV 5(proxySer vices, | |
| 228 | getFederat ionConfigu ration()); | |
| 229 | } | |
| 230 | retu rn proxy; | |
| 231 | } | |
| 232 | ||
| 233 | /* (non-Java doc) | |
| 234 | * @see gov. va.med.ima ging.datas ource.User DataSource Spi#verify Electronic Signature( gov.va.med .RoutingTo ken, java. lang.Strin g) | |
| 235 | * / | |
| 236 | @O verride | |
| 237 | pu blic Elect ronicSigna tureResult verifyEle ctronicSig nature( | |
| 238 | Routin gToken glo balRouting Token, Str ing electr onicSignat ure) | |
| 239 | th rows Metho dException , Connecti onExceptio n | |
| 240 | { | |
| 241 | thro w new Unsu pportedSer viceMethod Exception( UserDataSo urceSpi.cl ass, "veri fyElectron icSignatur e"); | |
| 242 | } | |
| 243 | ||
| 244 | @O verride | |
| 245 | pu blic Appli cationTime outParamet ers getApp licationTi meoutParam eters(Stri ng siteId, String ap plicationN ame) | |
| 246 | th rows Metho dException , Connecti onExceptio n | |
| 247 | { | |
| 248 | thro w new Unsu pportedSer viceMethod Exception( UserDataSo urceSpi.cl ass, "getA pplication TimeoutPar ameters"); | |
| 249 | } | |
| 250 | ||
| 251 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.