Produced by Araxis Merge on 12/5/2017 12:06:48 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\ROICommon\main\src\java\gov\va\med\imaging\roi\queue | AbstractExportQueueURN.java | Mon Dec 4 21:34:54 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ROICommon\main\src\java\gov\va\med\imaging\roi\queue | AbstractExportQueueURN.java | Mon Dec 4 22:05:25 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 630 |
| 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 17, 2012 | |
| 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.roi .queue; | |
| 27 | ||
| 28 | import gov .va.med.Gl obalArtifa ctIdentifi er; | |
| 29 | import gov .va.med.Gl obalArtifa ctIdentifi erImpl; | |
| 30 | import gov .va.med.Na mespaceIde ntifier; | |
| 31 | import gov .va.med.Ro utingToken ; | |
| 32 | import gov .va.med.Ro utingToken Impl; | |
| 33 | import gov .va.med.SE RIALIZATIO N_FORMAT; | |
| 34 | import gov .va.med.UR N; | |
| 35 | import gov .va.med.UR NComponent s; | |
| 36 | import gov .va.med.UR NType; | |
| 37 | import gov .va.med.We llKnownOID ; | |
| 38 | import gov .va.med.im aging.exce ptions.Ima geURNForma tException ; | |
| 39 | import gov .va.med.im aging.exce ptions.URN FormatExce ption; | |
| 40 | ||
| 41 | import jav a.io.Seria lizable; | |
| 42 | import jav a.util.reg ex.Matcher ; | |
| 43 | import jav a.util.reg ex.Pattern ; | |
| 44 | ||
| 45 | import org .apache.lo gging.log4 j.LogManag er; | |
| 46 | import org .apache.lo gging.log4 j.Logger; | |
| 47 | ||
| 48 | /** | |
| 49 | * @author
|
|
| 50 | * | |
| 51 | */ | |
| 52 | @URNType(n amespace=" exportqueu e") | |
| 53 | public abs tract clas s Abstract ExportQueu eURN | |
| 54 | extends UR N | |
| 55 | implements Serializa ble, Globa lArtifactI dentifier | |
| 56 | { | |
| 57 | ||
| 58 | pr ivate stat ic final l ong serial VersionUID = 1L; | |
| 59 | ||
| 60 | pr otected St ring queue Id; | |
| 61 | pr otected St ring origi natingSite Id; | |
| 62 | ||
| 63 | // private st atic final String na mespace = "exportque ue"; | |
| 64 | pu blic stati c final We llKnownOID DEFAULT_H OME_COMMUN ITY_ID = W ellKnownOI D.VA_RADIO LOGY_IMAGE ; | |
| 65 | ||
| 66 | pr ivate stat ic final S tring name spaceSpeci ficStringR egex = | |
| 67 | "([^ -]+)" + // the site ID | |
| 68 | URN. namespaceS pecificStr ingDelimit er + | |
| 69 | "([^ -]+)"; // t he queue I D | |
| 70 | pr ivate stat ic final P attern nam espaceSpec ificString Pattern = Pattern.co mpile(name spaceSpeci ficStringR egex); | |
| 71 | pr ivate stat ic final i nt SITE_ID _GROUP = 1 ; | |
| 72 | pr ivate stat ic final i nt QUEUE_I D_GROUP = 2; | |
| 73 | ||
| 74 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Abst ractExport QueueURN.c lass); | |
| 75 | ||
| 76 | /* | |
| 77 | pr ivate stat ic Namespa ceIdentifi er namespa ceIdentifi er = new N amespaceId entifier(n amespace); | |
| 78 | pu blic stati c synchron ized Names paceIdenti fier getMa nagedNames pace() | |
| 79 | { | |
| 80 | retu rn namespa ceIdentifi er; | |
| 81 | }* / | |
| 82 | ||
| 83 | /* * | |
| 84 | * Used dire ctly and a pass thro ugh for de rived clas ses. | |
| 85 | * The const ructor cal led by the URN class when a UR N derived class | |
| 86 | * is being created fr om a Strin g represen tation. | |
| 87 | * | |
| 88 | * @param co mponents | |
| 89 | * @throws U RNFormatEx ception | |
| 90 | * / | |
| 91 | pr otected Ab stractExpo rtQueueURN (URNCompon ents urnCo mponents, SERIALIZAT ION_FORMAT serializa tionFormat ) | |
| 92 | th rows URNFo rmatExcept ion | |
| 93 | { | |
| 94 | supe r(urnCompo nents, ser ialization Format); | |
| 95 | } | |
| 96 | ||
| 97 | pr otected Ab stractExpo rtQueueURN (Namespace Identifier namespace Identifier , | |
| 98 | String originati ngSiteId, | |
| 99 | String queueId) | |
| 100 | th rows URNFo rmatExcept ion | |
| 101 | { | |
| 102 | supe r(namespac eIdentifie r); | |
| 103 | setO riginating SiteId(ori ginatingSi teId); | |
| 104 | setQ ueueId(que ueId); | |
| 105 | } | |
| 106 | ||
| 107 | @O verride | |
| 108 | pu blic Strin g getHomeC ommunityId () | |
| 109 | { | |
| 110 | // I mages are always in the VA com munity | |
| 111 | retu rn WellKno wnOID.VA_R ADIOLOGY_I MAGE.getCa nonicalVal ue().toStr ing(); | |
| 112 | } | |
| 113 | ||
| 114 | @O verride | |
| 115 | pu blic Strin g getRepos itoryUniqu eId() | |
| 116 | { | |
| 117 | retu rn origina tingSiteId ; | |
| 118 | } | |
| 119 | ||
| 120 | @O verride | |
| 121 | pu blic boole an isEquiv alent(Rout ingToken t hat) | |
| 122 | { | |
| 123 | retu rn Routing TokenImpl. isEquivale nt(this, t hat); | |
| 124 | } | |
| 125 | ||
| 126 | @O verride | |
| 127 | pu blic boole an isInclu ding(Routi ngToken th at) | |
| 128 | { | |
| 129 | retu rn Routing TokenImpl. isIncludin g(this, th at); | |
| 130 | } | |
| 131 | ||
| 132 | @O verride | |
| 133 | pu blic Strin g toRoutin gTokenStri ng() | |
| 134 | { | |
| 135 | retu rn getHome CommunityI d() + "," + getRepos itoryUniqu eId(); | |
| 136 | } | |
| 137 | ||
| 138 | @O verride | |
| 139 | pu blic int c ompareTo(G lobalArtif actIdentif ier o) | |
| 140 | { | |
| 141 | retu rn GlobalA rtifactIde ntifierImp l.compareT o(this, o) ; | |
| 142 | } | |
| 143 | ||
| 144 | @O verride | |
| 145 | pu blic Strin g getDocum entUniqueI d() | |
| 146 | { | |
| 147 | retu rn formatD ocumentUni queId( get QueueId() ); | |
| 148 | } | |
| 149 | ||
| 150 | @O verride | |
| 151 | pu blic boole an equalsG lobalArtif actIdentif ier(Global ArtifactId entifier t hat) | |
| 152 | { | |
| 153 | retu rn GlobalA rtifactIde ntifierImp l.equalsGl obalArtifa ctIdentifi er(this, t hat); | |
| 154 | } | |
| 155 | ||
| 156 | @O verride | |
| 157 | pu blic Globa lArtifactI dentifier clone() | |
| 158 | th rows Clone NotSupport edExceptio n | |
| 159 | { | |
| 160 | thro w new Clon eNotSuppor tedExcepti on("Clone not suppor ted in Exp ortQueueUR N"); | |
| 161 | } | |
| 162 | ||
| 163 | pu blic Strin g getQueue Id() | |
| 164 | { | |
| 165 | retu rn queueId ; | |
| 166 | } | |
| 167 | ||
| 168 | pu blic void setQueueId (String qu eueId) | |
| 169 | { | |
| 170 | this .queueId = queueId; | |
| 171 | } | |
| 172 | ||
| 173 | pu blic Strin g getOrigi natingSite Id() | |
| 174 | { | |
| 175 | retu rn origina tingSiteId ; | |
| 176 | } | |
| 177 | ||
| 178 | pu blic void setOrigina tingSiteId (String or iginatingS iteId) | |
| 179 | { | |
| 180 | this .originati ngSiteId = originati ngSiteId; | |
| 181 | } | |
| 182 | ||
| 183 | pr otected st atic Strin g formatDo cumentUniq ueId(Strin g queueId) | |
| 184 | { | |
| 185 | Stri ngBuilder sb = new S tringBuild er(); | |
| 186 | ||
| 187 | sb.a ppend(queu eId); | |
| 188 | ||
| 189 | retu rn sb.toSt ring(); | |
| 190 | } | |
| 191 | ||
| 192 | /* (non-Java doc) | |
| 193 | * @see gov. va.med.URN #toString( ) | |
| 194 | * / | |
| 195 | @O verride | |
| 196 | pu blic Strin g toString () | |
| 197 | { | |
| 198 | Stri ngBuilder ahnold = n ew StringB uilder(); | |
| 199 | ||
| 200 | // b uild the s cheme iden tifier | |
| 201 | ahno ld.append( urnSchemaI dentifier) ; | |
| 202 | ahno ld.append( urnCompone ntDelimite r); | |
| 203 | ||
| 204 | // b uild the n amespace i dentifier | |
| 205 | ahno ld.append( this.getNa mespaceIde ntifier()) ; | |
| 206 | ahno ld.append( urnCompone ntDelimite r); | |
| 207 | ||
| 208 | ahno ld.append( this.getNa mespaceSpe cificStrin g()); | |
| 209 | ||
| 210 | retu rn ahnold. toString() ; | |
| 211 | } | |
| 212 | ||
| 213 | /* (non-Java doc) | |
| 214 | * @see gov. va.med.URN #toStringA sNative() | |
| 215 | * / | |
| 216 | @O verride | |
| 217 | pr otected St ring toStr ingNative( ) | |
| 218 | { | |
| 219 | Stri ngBuilder ahnold = n ew StringB uilder(); | |
| 220 | ||
| 221 | // b uild the s cheme iden tifier | |
| 222 | ahno ld.append( urnSchemaI dentifier) ; | |
| 223 | ahno ld.append( urnCompone ntDelimite r); | |
| 224 | ||
| 225 | // b uild the n amespace i dentifier | |
| 226 | ahno ld.append( this.getNa mespaceIde ntifier()) ; | |
| 227 | ahno ld.append( urnCompone ntDelimite r); | |
| 228 | ||
| 229 | // r estore any RFC2141 i llegal cha racters | |
| 230 | ahno ld.append( RFC2141_E SCAPING.un escapeIlle galCharact ers(this.g etNamespac eSpecificS tring()) ) ; | |
| 231 | ||
| 232 | retu rn ahnold. toString() ; | |
| 233 | } | |
| 234 | ||
| 235 | /* (non-Java doc) | |
| 236 | * @see gov. va.med.URN #toStringA sVAInterna l() | |
| 237 | * / | |
| 238 | @O verride | |
| 239 | pu blic Strin g toString CDTP() | |
| 240 | { | |
| 241 | Stri ngBuilder ahnold = n ew StringB uilder(); | |
| 242 | ||
| 243 | // b uild the s cheme iden tifier | |
| 244 | ahno ld.append( urnSchemaI dentifier) ; | |
| 245 | ahno ld.append( urnCompone ntDelimite r); | |
| 246 | ||
| 247 | // b uild the n amespace i dentifier | |
| 248 | ahno ld.append( this.getNa mespaceIde ntifier()) ; | |
| 249 | ahno ld.append( urnCompone ntDelimite r); | |
| 250 | ||
| 251 | Stri ng nss = t his.getNam espaceSpec ificString (); | |
| 252 | // e scape any filename i llegal cha racters | |
| 253 | nss = FILENAME _ESCAPING. escapeIlle galCharact ers(nss); | |
| 254 | ahno ld.append( nss); | |
| 255 | ||
| 256 | Stri ng additio nalIdentif iers = thi s.getAddit ionalIdent ifiersStri ng(); | |
| 257 | // e scape any filename i llegal cha racters | |
| 258 | addi tionalIden tifiers = FILENAME_E SCAPING.es capeIllega lCharacter s(addition alIdentifi ers); | |
| 259 | ahno ld.append( additional Identifier s); | |
| 260 | ||
| 261 | retu rn ahnold. toString() ; | |
| 262 | } | |
| 263 | ||
| 264 | /* * | |
| 265 | * | |
| 266 | * / | |
| 267 | @O verride | |
| 268 | pu blic Strin g getNames paceSpecif icString(S ERIALIZATI ON_FORMAT serializat ionFormat) | |
| 269 | { | |
| 270 | Stri ngBuilder ahnold = n ew StringB uilder(); | |
| 271 | ||
| 272 | // b uild the n amespace s pecific st ring | |
| 273 | ahno ld.append( this.origi natingSite Id); | |
| 274 | ahno ld.append( URN.namesp aceSpecifi cStringDel imiter); | |
| 275 | ahno ld.append( this.queue Id); | |
| 276 | ||
| 277 | retu rn ahnold. toString() ; | |
| 278 | } | |
| 279 | ||
| 280 | @O verride | |
| 281 | pu blic void parseNames paceSpecif icString(N amespaceId entifier n amespace, | |
| 282 | String namespace SpecificSt ring, | |
| 283 | SERIAL IZATION_FO RMAT seria lizationFo rmat) | |
| 284 | th rows URNFo rmatExcept ion | |
| 285 | { | |
| 286 | if(n amespaceSp ecificStri ng == null ) | |
| 287 | throw new URNFor matExcepti on("The na mespace sp ecific str ing for a( n) " + thi s.getClass ().getSimp leName() + " cannot be null.") ; | |
| 288 | ||
| 289 | Matc her nssMat cher = nam espaceSpec ificString Pattern.ma tcher(name spaceSpeci ficString) ; | |
| 290 | ||
| 291 | if(! nssMatche r.matches( )) | |
| 292 | { | |
| 293 | String msg = "Na mespace sp ecific str ing '" + n amespaceSp ecificStri ng + "' is not valid ."; | |
| 294 | logger .warn(msg) ; | |
| 295 | throw new ImageU RNFormatEx ception(ms g); | |
| 296 | } | |
| 297 | ||
| 298 | setO riginating SiteId( ns sMatcher.g roup(SITE_ ID_GROUP). trim() ); | |
| 299 | setQ ueueId( ns sMatcher.g roup(Abstr actExportQ ueueURN.QU EUE_ID_GRO UP).trim() ); | |
| 300 | /* | |
| 301 | swit ch(seriali zationForm at) | |
| 302 | { | |
| 303 | case PATCH83_V FTP: | |
| 304 | case RFC2141: | |
| 305 | case VFTP: | |
| 306 | case NATIVE: | |
| 307 | case RAW: | |
| 308 | setQue ueId(tmpAn notationId ); | |
| 309 | setIma geId(tmpIm ageId); | |
| 310 | break; | |
| 311 | case CDTP: | |
| 312 | this.a nnotationI d = URN.FI LENAME_TO_ RFC2141_ES CAPING.esc apeIllegal Characters (tmpAnnota tionId); | |
| 313 | this.i mageId = U RN.FILENAM E_TO_RFC21 41_ESCAPIN G.escapeIl legalChara cters(tmpI mageId); | |
| 314 | break; | |
| 315 | }*/ | |
| 316 | } | |
| 317 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.