Produced by Araxis Merge on 12/5/2017 12:06:50 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\VistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\url\vista\storage | VistaImagingStorageManager.java | Mon Dec 4 21:35:26 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\url\vista\storage | VistaImagingStorageManager.java | Mon Dec 4 22:06:44 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 380 |
| 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: Apr 22, 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.url .vista.sto rage; | |
| 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.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
| 35 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
| 36 | import gov .va.med.im aging.data source.exc eptions.In validCrede ntialsExce ption; | |
| 37 | import gov .va.med.im aging.exch ange.busin ess.Image; | |
| 38 | import gov .va.med.im aging.exch ange.busin ess.Site; | |
| 39 | import gov .va.med.im aging.prot ocol.vista .VistaImag ingTransla tor; | |
| 40 | import gov .va.med.im aging.url. vista.Vist aQuery; | |
| 41 | import gov .va.med.im aging.url. vista.exce ptions.Inv alidVistaC redentials Exception; | |
| 42 | import gov .va.med.im aging.url. vista.exce ptions.Vis taMethodEx ception; | |
| 43 | import gov .va.med.im aging.url. vista.imag e.ImagingS iteCredent ials; | |
| 44 | import gov .va.med.im aging.url. vista.imag e.ImagingS torageCred entials; | |
| 45 | import gov .va.med.im aging.url. vista.imag e.NetworkL ocation; | |
| 46 | import gov .va.med.im aging.url. vista.imag e.NetworkL ocationCac heManager; | |
| 47 | import gov .va.med.im aging.url. vista.imag e.SitePara meterCrede ntials; | |
| 48 | import gov .va.med.im aging.vist aimagingda tasource.V istaImagin gQueryFact ory; | |
| 49 | import gov .va.med.im aging.vist adatasourc e.common.V istaCommon Utilities; | |
| 50 | import gov .va.med.im aging.vist adatasourc e.session. VistaSessi on; | |
| 51 | ||
| 52 | /** | |
| 53 | * Storage manager u tility for holding o nto the ne twork loca tion cache items and for manag ing | |
| 54 | * the net work locat ions (gett ing them f rom VistA) | |
| 55 | * | |
| 56 | * @author
|
|
| 57 | * | |
| 58 | */ | |
| 59 | public cla ss VistaIm agingStora geManager | |
| 60 | { | |
| 61 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Vist aImagingSt orageManag er.class); | |
| 62 | ||
| 63 | pr ivate fina l static N etworkLoca tionCacheM anager net workLocati onCache = | |
| 64 | new NetworkLoc ationCache Manager(); | |
| 65 | ||
| 66 | pr ivate Vist aImagingSt orageManag er() | |
| 67 | { | |
| 68 | supe r(); | |
| 69 | } | |
| 70 | ||
| 71 | /* * | |
| 72 | * Passing i n the Site parameter even thou gh there i s a site n umber in t he image o bject. Th is in the event the site | |
| 73 | * number fr om the ima ge is not the VistA site numbe r, using t he Vista s ite number in all ot her cases for cachin g, this | |
| 74 | * makes it more consi stent | |
| 75 | * @param im age | |
| 76 | * @param si te | |
| 77 | * @return | |
| 78 | * / | |
| 79 | pu blic synch ronized st atic Imagi ngStorageC redentials getImagin gStorageCr edentialsF romCache(I mage image , Site sit e) | |
| 80 | { | |
| 81 | if(n etworkLoca tionCache == null) | |
| 82 | { | |
| 83 | logger .warn("net work locat ion cache is null, s houldn't h appen"); | |
| 84 | return null; | |
| 85 | } | |
| 86 | retu rn network LocationCa che.getNet workLocati ons(image, site.getS iteNumber( )); | |
| 87 | } | |
| 88 | ||
| 89 | pu blic synch ronized st atic Imagi ngStorageC redentials getImagin gStorageCr edentialsF romCache(S tring file name, Stri ng siteNum ber) | |
| 90 | { | |
| 91 | if(n etworkLoca tionCache == null) | |
| 92 | { | |
| 93 | logger .warn("net work locat ion cache is null, s houldn't h appen"); | |
| 94 | return null; | |
| 95 | } | |
| 96 | retu rn network LocationCa che.getNet workLocati on(filenam e, siteNum ber); | |
| 97 | } | |
| 98 | ||
| 99 | /* * | |
| 100 | * Returns t he network location from VistA that is a ssociated with the i mage share parameter . | |
| 101 | * This func tion also caches the network l ocations i t receives from Vist A for futu re use | |
| 102 | * | |
| 103 | * @param im ageShare T he image s hare to fi nd in the database | |
| 104 | * @return T he network location (with cred entials) a ssociated with the i mage share | |
| 105 | * @throws I OException | |
| 106 | * @throws M ethodExcep tion | |
| 107 | * @throws C onnectionE xception | |
| 108 | * / | |
| 109 | pu blic stati c ImagingS torageCred entials ge tImagingSt orageCrede ntialsFrom Vista(Vist aSession v istaSessio n, | |
| 110 | String imageShar e, Site si te) | |
| 111 | th rows IOExc eption, Me thodExcept ion, Conne ctionExcep tion | |
| 112 | { | |
| 113 | if(i mageShare == null) | |
| 114 | return null; | |
| 115 | logg er.info("G etting Sit e paramete r credenti als and ne twork loca tions from site '" + site.getS iteNumber( ) + "'."); | |
| 116 | Site ParameterC redentials siteParam eterCreden tials = ge tSiteParam eterCreden tials(vist aSession); | |
| 117 | List <NetworkLo cation> ne tworkLocat ions = get NetworkLoc ations(vis taSession, site, sit eParameter Credential s); | |
| 118 | ||
| 119 | Imag ingSiteCre dentials i magingSite Credential s = | |
| 120 | new Im agingSiteC redentials (site.getS iteNumber( ), sitePar ameterCred entials); | |
| 121 | imag ingSiteCre dentials.g etNetworkL ocations() .addAll(ne tworkLocat ions); | |
| 122 | logg er.info("P utting ima ging site credential s for site '" + imag ingSiteCre dentials.g etSiteNumb er() + "' into cache ."); | |
| 123 | logg er.info("I maging Sit e Credenti als detail s: " + ima gingSiteCr edentials. toString() ); | |
| 124 | sync hronized(n etworkLoca tionCache) | |
| 125 | { | |
| 126 | networ kLocationC ache.updat eImagingSi teCredenti als(imagin gSiteCrede ntials); | |
| 127 | } | |
| 128 | // p ut into ca che | |
| 129 | ||
| 130 | retu rn imaging SiteCreden tials.getS torageCred entials(im ageShare); | |
| 131 | } | |
| 132 | ||
| 133 | /* * | |
| 134 | * Retrieves the netwo rk locatio ns from Vi stA (all n etwork loc ations, no t just MAG ) | |
| 135 | * @return A list of n etwork loc ations fro m VistA | |
| 136 | * @throws M ethodExcep tion | |
| 137 | * @throws C onnectionE xception | |
| 138 | * @throws I OException | |
| 139 | * / | |
| 140 | pr ivate stat ic List<Ne tworkLocat ion> getNe tworkLocat ions(Vista Session vi staSession , | |
| 141 | Site s ite, SiteP arameterCr edentials siteParame terCredent ials) | |
| 142 | th rows Metho dException , Connecti onExceptio n, IOExcep tion | |
| 143 | { | |
| 144 | Vist aQuery net LocQuery = VistaImag ingQueryFa ctory.crea teGetNetwo rkLocation sVistaQuer y(); | |
| 145 | try | |
| 146 | { | |
| 147 | String rtn = vis taSession. call(netLo cQuery); | |
| 148 | if(rtn .length() <= 0) | |
| 149 | throw ne w MethodEx ception("N o network locations found for connection '" + vist aSession.g etURL().to ExternalFo rm() + "'" ); | |
| 150 | return VistaImag ingTransla tor.VistaN etworkLoca tionsToNet workLocati onsList(rt n, site, s iteParamet erCredenti als); | |
| 151 | } | |
| 152 | catc h(VistaMet hodExcepti on vmX) | |
| 153 | { | |
| 154 | logger .error("Ex ception re trieving n etwork loc ations", v mX); | |
| 155 | throw new Method Exception( vmX); | |
| 156 | } | |
| 157 | catc h(InvalidV istaCreden tialsExcep tion ivcX) | |
| 158 | { | |
| 159 | logger .error("Ex ception re trieving n etwork loc ations", i vcX); | |
| 160 | throw new Invali dCredentia lsExceptio n(ivcX); | |
| 161 | } | |
| 162 | } | |
| 163 | ||
| 164 | /* * | |
| 165 | * Retrieves the crede ntials inf ormation f rom the Im aging Site Parameter s file fro m VistA | |
| 166 | * @return T he general credentia ls for ima ge share a ccess from the Site Parameters file | |
| 167 | * @throws M ethodExcep tion | |
| 168 | * @throws C onnectionE xception | |
| 169 | * @throws I OException | |
| 170 | * / | |
| 171 | pr ivate stat ic SitePar ameterCred entials ge tSiteParam eterCreden tials(Vist aSession v istaSessio n) | |
| 172 | th rows Metho dException , Connecti onExceptio n, IOExcep tion | |
| 173 | { | |
| 174 | Vist aQuery sit eParameter Query = Vi staImaging QueryFacto ry.createG etImagingS iteParamet ersQuery(V istaCommon Utilities. getWorksta tionId()); | |
| 175 | try | |
| 176 | { | |
| 177 | String rtn = vis taSession. call(siteP arameterQu ery); | |
| 178 | return VistaImag ingTransla tor.VistaI magingSite Parameters StringToSi teCredenti als(rtn); | |
| 179 | } | |
| 180 | catc h(VistaMet hodExcepti on vmX) | |
| 181 | { | |
| 182 | logger .error("Er ror retrie ving Imagi ng Site Pa rameter cr edentials" , vmX); | |
| 183 | throw new Method Exception( vmX); | |
| 184 | } | |
| 185 | catc h(InvalidV istaCreden tialsExcep tion ivcX) | |
| 186 | { | |
| 187 | logger .error("Er ror retrie ving Imagi ng Site Pa rameter cr edentials" , ivcX); | |
| 188 | throw new Invali dCredentia lsExceptio n(ivcX); | |
| 189 | } | |
| 190 | } | |
| 191 | ||
| 192 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.