Produced by Araxis Merge on 12/5/2017 12:06:36 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\CacheImplJCIFS\main\src\java\gov\va\med\imaging\storage\cache\impl\jcifs | JcifsInstanceSet.java | Mon Dec 4 21:35:30 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\CacheImplJCIFS\main\src\java\gov\va\med\imaging\storage\cache\impl\jcifs | JcifsInstanceSet.java | Mon Dec 4 21:57:47 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 298 |
| Changed | 1 | 2 |
| 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 | package go v.va.med.i maging.sto rage.cache .impl.jcif s; | |
| 2 | ||
| 3 | import gov .va.med.im aging.stor age.cache. Instance; | |
| 4 | import gov .va.med.im aging.stor age.cache. InstanceBy teChannelF actory; | |
| 5 | import gov .va.med.im aging.stor age.cache. exceptions .CacheExce ption; | |
| 6 | import gov .va.med.im aging.stor age.cache. exceptions .CacheInte rnalExcept ion; | |
| 7 | import gov .va.med.im aging.stor age.cache. exceptions .Persisten ceIOExcept ion; | |
| 8 | import gov .va.med.im aging.stor age.cache. impl.Persi stentInsta nceSet; | |
| 9 | ||
| 10 | import jav a.lang.ref .SoftRefer ence; | |
| 11 | import jav a.net.Malf ormedURLEx ception; | |
| 12 | import jav a.net.Unkn ownHostExc eption; | |
| 13 | import jav a.util.Ite rator; | |
| 14 | ||
| 15 | import jci fs.smb.Smb Exception; | |
| 16 | import jci fs.smb.Smb File; | |
| 17 | import jci fs.smb.Smb FileFilter ; | |
| 18 | ||
| 19 | import org .apache.lo gging.log4 j.LogManag er; | |
| 20 | import org .apache.lo gging.log4 j.Logger; | |
| 21 | ||
| 22 | /** | |
| 23 | * This cl ass encaps ulates the collectio n of child instances in a Jcif sCacheGrou p. | |
| 24 | * It is t he respons ibility of this clas s to ensur e that the persisten t (filesys tem) | |
| 25 | * and the transient (memory) views of t he Instanc es in a gr oup are co nsistent. | |
| 26 | * It is a requireme nt that th is class N OT keep re ferences t o child in stances th at | |
| 27 | * would p revent gar bage colle ction of i nstances t hat are no longer re ferenced o utside | |
| 28 | * the cac he (i.e. i f the appl ication do es not hav e a refere nce then t he cache s hould not | |
| 29 | * prevent garbage c ollection) . | |
| 30 | * This cl ass should be the so le modifie r of the i nstances r eferenced within. | |
| 31 | * | |
| 32 | * @author
|
|
| 33 | * | |
| 34 | */ | |
| 35 | class Jcif sInstanceS et | |
| 36 | extends Pe rsistentIn stanceSet | |
| 37 | { | |
| 38 | pr ivate Logg er logger = LogManag er.getLogg er(this.ge tClass()); | |
| 39 | pr ivate stat ic final l ong serial VersionUID = -346790 2332881831 29L; | |
| 40 | pr ivate SmbF ile rootDi rectory = null; // the directory in which all of our instances reside in persisten t storage | |
| 41 | pr ivate SmbU tilities s mbUtilitie s = new Sm bUtilities (); | |
| 42 | ||
| 43 | /* * | |
| 44 | * | |
| 45 | * @param ro otDirector y | |
| 46 | * @param by teChannelF actory | |
| 47 | * @param se condsReadW aitsForWri teCompleti on | |
| 48 | * @param se tModificat ionTimeOnR ead | |
| 49 | * / | |
| 50 | Jc ifsInstanc eSet( | |
| 51 | SmbF ile rootDi rectory, | |
| 52 | Inst anceByteCh annelFacto ry byteCha nnelFactor y, | |
| 53 | int secondsRea dWaitsForW riteComple tion, | |
| 54 | bool ean setMod ificationT imeOnRead | |
| 55 | ) | |
| 56 | { | |
| 57 | supe r(byteChan nelFactory , secondsR eadWaitsFo rWriteComp letion, se tModificat ionTimeOnR ead); | |
| 58 | this .rootDirec tory = roo tDirectory ; | |
| 59 | } | |
| 60 | ||
| 61 | /* * | |
| 62 | * | |
| 63 | * @return | |
| 64 | * / | |
| 65 | pu blic SmbFi le getRoot Directory( ) | |
| 66 | { | |
| 67 | retu rn rootDir ectory; | |
| 68 | } | |
| 69 | ||
| 70 | /* * | |
| 71 | * | |
| 72 | * / | |
| 73 | @O verride | |
| 74 | pr otected In stance get OrCreate(S tring name , boolean create) | |
| 75 | th rows Cache Exception | |
| 76 | { | |
| 77 | SmbF ile childI nstanceFil e; | |
| 78 | try | |
| 79 | { | |
| 80 | childI nstanceFil e = new Sm bFile(getR ootDirecto ry().getCa nonicalPat h() + "/" + name); | |
| 81 | ||
| 82 | Instan ce child = create ? | |
| 83 | JcifsInsta nce.getOrC reateInsta nce(childI nstanceFil e, getByte ChannelFac tory(), ge tSecondsRe adWaitsFor WriteCompl etion(), i sSetModifi cationTime OnRead()) : | |
| 84 | JcifsInsta nce.getIns tance(chil dInstanceF ile, getBy teChannelF actory(), getSeconds ReadWaitsF orWriteCom pletion(), isSetModi ficationTi meOnRead() ); | |
| 85 | ||
| 86 | return child; | |
| 87 | } | |
| 88 | catc h (Malform edURLExcep tion x) | |
| 89 | { | |
| 90 | throw new CacheI nternalExc eption( | |
| 91 | "The SMB URL built from dire ctory '" + getRootDi rectory(). getPath() + "' and f ile name ' " + name + "' is inv alid.", | |
| 92 | x); | |
| 93 | } | |
| 94 | //ca tch (Unkno wnHostExce ption x) | |
| 95 | //{ | |
| 96 | // throw new Persis tenceIOExc eption("Th e SMB host computer (file serv er) is ina ccesible." , x); | |
| 97 | //} | |
| 98 | ||
| 99 | } | |
| 100 | ||
| 101 | /* * | |
| 102 | * Assure th at the int ernal repr esenation of child i nstances m atches | |
| 103 | * what is i n the file system. | |
| 104 | * / | |
| 105 | @O verride | |
| 106 | pr otected vo id interna lSynchroni zeChildren () | |
| 107 | th rows Cache Exception | |
| 108 | { | |
| 109 | Stri ng instanc eName = nu ll; // d eclared ou t here so tha the er ror logs c an report it | |
| 110 | ||
| 111 | try | |
| 112 | { | |
| 113 | // pru ne unused references | |
| 114 | for( I terator<So ftReferenc e<? extend s Instance >> iter=it erator(); | |
| 115 | iter.has Next(); ) | |
| 116 | { | |
| 117 | SoftRefe rence<? ex tends Inst ance> inst anceRef = iter.next( ); | |
| 118 | if( inst anceRef.ge t() == nul l ) | |
| 119 | iter.remov e(); | |
| 120 | } | |
| 121 | ||
| 122 | // get a list of all the c hild files | |
| 123 | for( S mbFile chi ldFile : s mbUtilitie s.getPersi stentChild ren(getRoo tDirectory (), false, true) ) | |
| 124 | { | |
| 125 | instance Name = chi ldFile.get Name(); // the fil e name and the Insta nce name a re the sam e | |
| 126 | Instance childInst ance = get Transient( instanceNa me); // g et an exis ting refer ence by na me | |
| 127 | if(child Instance = = null) | |
| 128 | { | |
| 129 | childInsta nce = getC hild(insta nceName, f alse); | |
| 130 | SmbFile in stanceFile = new Smb File(this. getRootDir ectory(), instanceNa me); | |
| 131 | childInsta nce = Jci fsInstance .getInstan ce(instanc eFile, get ByteChanne lFactory() , getSecon dsReadWait sForWriteC ompletion( ), isSetMo dification TimeOnRead ()); | |
| 132 | SoftRefere nce<JcifsI nstance> i nstanceRef = new Sof tReference <JcifsInst ance>( (Jc ifsInstanc e)childIns tance); | |
| 133 | add( insta nceRef ); | |
| 134 | } | |
| 135 | } | |
| 136 | } | |
| 137 | catc h (Malform edURLExcep tion x) | |
| 138 | { | |
| 139 | throw new CacheI nternalExc eption( | |
| 140 | "The SMB U RL built f rom direct ory '" + g etRootDire ctory().ge tPath() + "' and fil e name '" + instance Name + "' is invalid .", | |
| 141 | x); | |
| 142 | } | |
| 143 | catc h (Unknown HostExcept ion x) | |
| 144 | { | |
| 145 | throw new Persis tenceIOExc eption( | |
| 146 | "The host specified in the SMB URL '" + getRootDir ectory().g etPath() + "' cannot be contac ted.", | |
| 147 | x); | |
| 148 | } | |
| 149 | } | |
| 150 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.